/* =====================================================================
   FLAME · style.css
   Replica del diseño de referencia. Mobile-first + breakpoints.
   Bootstrap 5 maneja la grilla/utilidades; aquí va la identidad visual.
   ===================================================================== */

:root {
  /* Paleta de marca */
  --flame-pink:      #ff2d6f;
  --flame-pink-2:    #ff6b9d;
  --flame-coral:     #ff4d7d;
  --flame-grad:      linear-gradient(135deg, #ff2d6f 0%, #ff6b9d 100%);
  --flame-grad-soft: linear-gradient(135deg, #ffe3ee 0%, #ffd6e6 100%);

  --ink:        #15151f;
  --ink-2:      #1a1a2e;
  --text:       #2b2b38;
  --muted:      #8a8a9a;
  --line:       #ececed;

  --bg:         #f6f7f9;
  --surface:    #ffffff;

  --purple:     #8b5cf6;
  --amber:      #f5a623;
  --green:      #22c55e;

  --radius-lg:  28px;
  --radius-md:  18px;
  --radius-sm:  12px;
  --shadow-sm:  0 2px 10px rgba(20, 20, 40, .05);
  --shadow-md:  0 10px 30px rgba(20, 20, 40, .08);
  --shadow-lg:  0 18px 50px rgba(20, 20, 40, .12);

  --sidebar-w:  260px;
  --rail-w:     340px;
}

/* ---------- Tema oscuro ---------- */
[data-theme="dark"] {
  --ink:        #f4f4f9;
  --ink-2:      #20202e;
  --text:       #d6d6e1;
  --muted:      #9090a3;
  --line:       #2a2a38;

  --bg:         #0e0e16;
  --surface:    #1a1a26;

  --flame-grad-soft: linear-gradient(135deg, #3a2233 0%, #34232e 100%);

  --shadow-sm:  0 2px 10px rgba(0, 0, 0, .35);
  --shadow-md:  0 10px 30px rgba(0, 0, 0, .45);
  --shadow-lg:  0 18px 50px rgba(0, 0, 0, .55);
}

/* Logo según tema */
.brand__logo--dark { display: none; }
[data-theme="dark"] .brand__logo--light { display: none; }
[data-theme="dark"] .brand__logo--dark { display: block; }

/* Ajustes puntuales de componentes con colores fijos en modo oscuro */
[data-theme="dark"] .action-btn { background: var(--surface); }
[data-theme="dark"] .chip.active,
[data-theme="dark"] .rail-btn.active { background: var(--flame-grad); border-color: transparent; color: #fff; }
[data-theme="dark"] .nav-item:hover { background: #23232f; color: var(--ink); }
[data-theme="dark"] .chip:hover,
[data-theme="dark"] .rail-btn:hover { border-color: #3a3a48; }
[data-theme="dark"] .bubble.them { background: #262633; color: var(--text); }
[data-theme="dark"] .premium-card {
  background: var(--surface);
  border: 1px solid var(--line);
}
[data-theme="dark"] .premium-card h4 { color: var(--ink); }
[data-theme="dark"] .premium-card p { color: var(--muted); }
[data-theme="dark"] .premium-card__icon { background: rgba(255,255,255,.12); }
[data-theme="dark"] .btn-flame-dark { background: var(--flame-grad); }
[data-theme="dark"] .rail-btn .dot,
[data-theme="dark"] .bell .dot { border-color: var(--surface); }
[data-theme="dark"] .mobile-topbar,
[data-theme="dark"] .bottom-nav { background: rgba(16, 16, 24, .92); }
/* En modo oscuro, el ítem de navegación seleccionado va en blanco (no rosado). */
[data-theme="dark"] .nav-item.active { color: #fff; }
[data-theme="dark"] .bottom-nav a.active { color: #fff; }
[data-theme="dark"] .bottom-nav a.active i {
  background: none;
  -webkit-background-clip: border-box; background-clip: border-box;
  -webkit-text-fill-color: #fff; color: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* ---------- Marca / logo ---------- */
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; font-size: 1.6rem; color: var(--ink);
  letter-spacing: -.02em;
}
.brand__mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--flame-grad);
  display: grid; place-items: center; color: #fff; font-size: 1.25rem;
  box-shadow: 0 8px 18px rgba(255, 45, 111, .35);
}
.brand__logo {
  height: 32px; width: auto; display: block;
  margin-bottom: 15px;
}

/* =====================================================================
   LAYOUT EN 3 COLUMNAS (sidebar · main · rail)
   ===================================================================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--rail-w);
  min-height: 100vh;
  gap: 0;
}

/* ---------- Sidebar izquierdo ---------- */
.sidebar {
  background: var(--surface);
  padding: 22px 20px 16px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 90;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color .25s;
}
.sidebar:hover {
  scrollbar-color: rgba(140,140,160,.45) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 99px;
  transition: background .25s;
}
.sidebar:hover::-webkit-scrollbar-thumb { background: rgba(140,140,160,.45); }
.sidebar__nav { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 16px; border-radius: 14px;
  color: var(--muted); font-weight: 600; font-size: .9rem;
  transition: background .15s, color .15s;
}
.nav-item i { width: 19px; text-align: center; font-size: .98rem; }
.nav-item:hover { background: #f7f7fa; color: var(--text); }
.nav-item.active {
  background: var(--flame-grad-soft);
  color: var(--flame-pink);
}
.nav-item .badge-count {
  margin-left: auto;
  background: var(--flame-grad); color: #fff;
  font-size: .72rem; font-weight: 700;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; display: grid; place-items: center;
}

/* Tarjeta Premium */
.premium-card {
  margin-top: auto;
  background: linear-gradient(135deg, #e9d5ff 0%, #fbcfe8 100%);
  border-radius: var(--radius-md);
  padding: 14px 16px; text-align: left;
}
.premium-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.premium-card__icon {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: rgba(255,255,255,.6); color: var(--flame-pink);
  display: grid; place-items: center; font-size: .85rem;
}
.premium-card h4 { margin: 0; font-weight: 800; font-size: 1rem; color: var(--ink); line-height: 1.2; }
.premium-card p { margin: 0 0 10px; font-size: .8rem; color: #5b5b6b; line-height: 1.4; }
.btn-flame-dark {
  background: var(--ink-2); color: #fff; border: 0;
  display: block; width: 100%; padding: 10px; border-radius: 10px;
  font-weight: 700; font-size: .9rem; text-align: center; text-decoration: none;
  cursor: pointer; transition: transform .1s, opacity .15s;
}
.btn-flame-dark:hover { opacity: .92; transform: translateY(-1px); }

/* Perfil del usuario al pie */
.me-card {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.me-card img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.me-card .me-name { font-weight: 700; color: var(--ink); font-size: .95rem; }
.me-card .me-sub { font-size: .8rem; color: var(--muted); }
.me-card .chev { margin-left: auto; color: var(--muted); }

/* ---------- Columna central ---------- */
.main { padding: 22px 34px; min-width: 0; }
/* Layout exclusivo de Descubrir: ocupa la pantalla y no hace scroll */
.main--discover { display: flex; flex-direction: column; height: 100vh; overflow: hidden; position: relative; }
.main__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex: none;
}
.page-title { font-size: 1.45rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; margin: 0; }
/* Botón circular para cerrar/regresar en cabeceras de página (p.ej. Guardados). */
.page-close {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer;
  background: var(--line); color: var(--ink); font-size: 1rem;
}
.page-close:active { transform: scale(.92); }

/* Tabs con subrayado inferior — p.ej. Likes: "Quienes me gustan" / "A quienes les gusto". */
.tabs { display: flex; margin: 0 0 18px; flex: none; border-bottom: 1px solid var(--line); }
.tab {
  flex: 1 1 0; padding: 12px 8px; background: transparent; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--muted); font-weight: 700; font-size: 1rem;
  transition: color .15s, border-color .15s;
}
.tab.is-active { color: var(--ink); border-bottom-color: var(--flame-pink); }
.tab-panel.is-hidden { display: none; }

/* Visitas — plan gratis: fotos borrosas + banner de upsell. */
.visits-upsell {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 14px; margin: 0 0 20px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface);
}
.visits-upsell__count { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.visits-upsell__count i { color: var(--flame-pink); }
.visits-upsell .visits-upsell__cta { flex: 0 0 auto; }
.visits-locked .person-card__photo { pointer-events: none; }
.visits-locked .person-card__photo img { filter: blur(16px); transform: scale(1.05); }
.visits-locked .person-card__name,
.visits-locked .person-card__online { filter: blur(7px); }

/* Cerrar sesión al final del perfil propio. */
.profile-logout { margin: 28px 0 8px; }
.profile-logout .btn-soft { width: 100%; justify-content: center; padding: 13px 20px; }
.page-title .accent { color: var(--flame-pink); }
.bell {
  position: relative; width: 46px; height: 46px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text);
}
.bell .dot {
  position: absolute; top: 12px; right: 13px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--flame-pink); border: 2px solid #fff;
}

/* ---------- Barra vertical de filtros / acciones ---------- */
.side-rail {
  position: absolute; top: 22px; right: 10px; z-index: 6;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.rail-sep { width: 22px; height: 1px; background: var(--line); margin: 2px 0; }
.rail-btn {
  position: relative;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); display: grid; place-items: center;
  font-size: 1.05rem; cursor: pointer; transition: all .15s;
}
.rail-btn:hover { border-color: #ddd; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.rail-btn.active { background: var(--ink-2); color: #fff; border-color: var(--ink-2); }
.rail-btn .live-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); }
.rail-btn .dot {
  position: absolute; top: 11px; right: 12px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--flame-pink); border: 2px solid #fff;
}
/* Tooltip que aparece a la izquierda en hover */
.rail-tip {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%) translateX(6px);
  background: var(--ink-2); color: #fff; font-size: .8rem; font-weight: 600;
  padding: 6px 11px; border-radius: 9px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.rail-tip::after {
  content: ''; position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-left-color: var(--ink-2);
}
.rail-btn:hover .rail-tip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------- Tarjeta de descubrimiento ---------- */
/* El "stage" es el que ocupa el espacio disponible y centra la tarjeta. La
   info del perfil vive aquí (fuera de la tarjeta) para que el transform del
   swipe no la arrastre y pueda anclarse al viewport en móvil. */
/* Contenedor que envuelve la tarjeta y se reemplaza por AJAX al pasar de
   perfil. Asume el rol que antes tenían el stage y las acciones como hijos
   flex directos del main: crece para llenar el alto disponible y coloca la
   tarjeta, los botones y la pista en columna. */
#discover-content {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
}
.discover-stage {
  position: relative;
  flex: 1 1 auto; min-height: 0;
  width: 100%; max-width: 440px;
  align-self: center; margin: 0 auto;
}
.discover-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); background: #ddd;
  width: 100%; height: 100%;
  touch-action: none; user-select: none; /* arrastre limpio sin scroll de la página */
}
.discover-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.discover-card__overlay {
  position: absolute; inset: 0; cursor: pointer;
  background:
    linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.75) 20%, rgba(0,0,0,.4) 42%, transparent 72%),
    linear-gradient(to bottom, rgba(0,0,0,.65) 0%, rgba(0,0,0,.2) 14%, transparent 30%);
}
/* --- Tarjeta de anuncio (test de personalidad) ---
   Sustituye a la foto cada 10 swipes si falta el test; sin botones de
   acción, se descarta con swipe. */
.discover-card--ad .discover-card__img,
.discover-card--ad .discover-card__overlay { cursor: grab; }
.ad-card__content {
  position: absolute; left: 24px; right: 24px; bottom: 56px; z-index: 5;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  text-align: center; color: #fff; touch-action: none;
}
.ad-card__text {
  margin: 0; font-size: 1.15rem; font-weight: 500; letter-spacing: -.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}
.ad-card__cta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 28px; border-radius: 999px;
  background: #fff; color: #ad0e49; font-weight: 800; text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  transition: transform .15s ease;
}
.ad-card__cta:hover { transform: translateY(-2px); color: #8e0c3d; }

/* Sellos LIKE / NOPE / SUPER — íconos grandes tipo Tinder (corazón, X, rayo) */
.swipe-stamp {
  position: absolute; top: 30px; z-index: 5; pointer-events: none;
  font-size: 4.6rem; line-height: 1;
  opacity: 0; transition: opacity .1s ease;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .5));
}
.swipe-stamp.s-like  { left: 26px;  color: var(--flame-pink); transform: rotate(-12deg); }
.swipe-stamp.s-nope  { right: 26px; color: #fff;              transform: rotate(12deg); }
.swipe-stamp.s-super {
  left: 50%; top: 40%; transform: translate(-50%, -50%);
  color: var(--purple); font-size: 4rem;
}
.badge-online {
  position: absolute; top: 18px; left: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(20,20,30,.55); backdrop-filter: blur(6px);
  color: #fff; padding: 8px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 600;
}
.badge-online .live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.card-more {
  position: absolute; top: 18px; right: 18px;
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(20,20,30,.45); backdrop-filter: blur(6px);
  color: #fff; border: 0; display: grid; place-items: center;
}
/* Flechas de navegación sobre la tarjeta (escritorio) */
.card-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(20,20,30,.42); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  font-size: 1.05rem; z-index: 4;
  opacity: 0; transition: opacity .18s, background .15s, transform .12s;
}
.discover-card:hover .card-nav { opacity: 1; }
.card-nav:hover { background: rgba(20,20,30,.72); }
.card-nav:active { transform: translateY(-50%) scale(.9); }
.card-nav.prev { left: 12px; }
.card-nav.next { right: 12px; }
.card-nav.next:hover { background: var(--flame-grad); border-color: transparent; }

/* Segmentos de fotos (estilo historias) — cortos y centrados en la parte superior */
.card-segments {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; justify-content: center; gap: 5px;
}
.card-segments .seg {
  width: 6px; height: 3px; border-radius: 999px; background: rgba(255,255,255,.4);
}
.card-segments .seg.on { background: #fff; }

.discover-card__img { cursor: pointer; }

.discover-card__info { position: absolute; left: 20px; right: 20px; bottom: 18px; color: #fff; touch-action: none; }
.discover-card__name {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -.02em;
}
/* El nombre nunca parte a dos líneas; si no cabe, JS lo reduce al primer
   nombre (estilo Tinder). El min-width:0 permite que se recorte dentro del flex. */
.name-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Flecha ↑ a la derecha de la fila de intereses: abre el perfil. */
.open-profile {
  flex: 0 0 auto; margin-left: auto;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(20,20,30,.45); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff; font-size: 1rem; text-decoration: none;
  transition: transform .12s, background .15s;
}
.open-profile:hover  { background: rgba(20,20,30,.72); }
.open-profile:active { transform: scale(.92); }
.verified {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--flame-grad); display: grid; place-items: center;
  font-size: .7rem; flex-shrink: 0;
}
.verif-badge { display: inline-block; vertical-align: middle; object-fit: contain; flex-shrink: 0; }

/* Compositor de comentario / mensaje (perfil) */
.comment-sheet {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.55);
}
.comment-sheet[hidden] { display: none; }
.comment-sheet__panel {
  width: 100%; max-width: 520px;
  background: var(--card, #1b1b22); color: var(--ink);
  border-radius: 20px 20px 0 0; padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  box-shadow: 0 -8px 30px rgba(0,0,0,.4);
}
@media (min-width: 640px) {
  .comment-sheet { align-items: center; }
  .comment-sheet__panel { border-radius: 20px; }
}
.comment-sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.comment-sheet__head h3 { margin: 0; font-size: 1.05rem; }
.comment-sheet__close {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--line); color: var(--ink); font-size: 1rem;
}
.comment-sheet textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 84px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; margin-bottom: 12px;
}
.comment-sheet__err { color: #ef4444; font-size: .88rem; margin-bottom: 10px; }
.comment-sheet__err[hidden] { display: none; }
.comment-sheet__sub { margin: 0 0 12px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.meta-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; margin-bottom: 5px; opacity: .95; }
.meta-row i { width: 16px; opacity: .9; }
/* Fila inferior: pastillas de intereses a la izquierda y la flecha ↑ a la
   derecha, centradas verticalmente entre sí. */
.info-bottom { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.interest-tags {
  display: flex; flex-wrap: wrap; gap: 7px;
  flex: 1 1 auto; min-width: 0;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.22);
  color: #fff; padding: 6px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
}

/* ---------- Botones de acción ---------- */
.actions { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 14px 0 4px; }
.action-btn {
  border: 0; background: #fff; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-md); transition: transform .12s, box-shadow .12s;
}
.action-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: var(--shadow-lg); }
.action-btn:active { transform: scale(.95); }
.action-btn.sm { width: 46px; height: 46px; font-size: 1rem; }
.action-btn.lg { width: 60px; height: 60px; font-size: 1.4rem; }
.action-btn.rewind { color: var(--amber); }
.action-btn.pass   { color: var(--flame-coral); }
.action-btn.like   { background: var(--flame-grad); color: #fff; }
.action-btn.boost  { color: var(--purple); }
.action-btn.super  { color: #ffcc00; }

/* Barra flotante de acciones estilo Tinder (perfil de otra persona).
   Fija abajo; oculta la bottom-nav para dejarla en primer plano. */
.profile-fab {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: center; align-items: center; gap: 24px;
  padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 18px);
  background: linear-gradient(to top, var(--bg) 55%, transparent);
  pointer-events: none;
}
.profile-fab .action-btn { pointer-events: auto; }
/* En la barra flotante los tres botones comparten el mismo fondo oscuro;
   solo cambia el color del ícono (la X, la estrella y el corazón). */
.profile-fab .action-btn.like { background: #fff; color: var(--flame-pink); }
[data-theme="dark"] .profile-fab .action-btn.like { background: var(--surface); }
.page-profile--other .bottom-nav { display: none; }
.page-profile--other .main { padding-bottom: 128px; }

.swipe-hint { display: none; text-align: center; color: var(--muted); font-size: .85rem; margin-top: 8px; flex: none; }
.actions { flex: none; }
.swipe-hint i { color: var(--purple); margin-right: 6px; }
.swipe-hint b.r { color: var(--flame-pink); }
.swipe-hint b.l { color: var(--purple); }

/* ---------- Indicadores en Descubrir (monedas, etc.) ---------- */
.stats-card { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.coin-wrap { position: relative; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: none; border: 0; cursor: pointer;
  color: var(--ink); font-weight: 800; font-size: 1.25rem; padding: 0;
}
.coin-pill i { color: var(--amber); font-size: 1.1rem; }
.coin-gain {
  position: absolute; left: 4px; top: -4px; pointer-events: none;
  font-weight: 800; color: var(--amber); white-space: nowrap;
  animation: coin-gain-up .9s ease forwards;
}
@keyframes coin-gain-up {
  0%   { opacity: 0; transform: translateY(6px) scale(.9); }
  20%  { opacity: 1; transform: translateY(-2px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-26px) scale(1); }
}
.coin-pop {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 20; width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 14px 16px;
}
.coin-pop__title { font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.coin-pop__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.coin-pop__list li { display: flex; justify-content: space-between; align-items: center; font-size: .9rem; color: var(--text); }
.coin-pop__list b { color: var(--amber); font-weight: 800; }
.coin-pop__foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.coin-pop__foot i { color: var(--flame-pink); margin-right: 5px; }
@media (max-width: 980px) {
  .coin-wrap { align-self: flex-start; }
  .coin-pop { left: 0; right: auto; }
}

/* ---------- Rail derecho ---------- */
.rail {
  padding: 30px 26px 30px 0; display: flex; flex-direction: column; gap: 22px; min-width: 0;
  /* Scroll independiente con barra delgada y casi invisible */
  height: 100vh; overflow-y: auto; position: sticky; top: 0;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.rail:hover { scrollbar-color: var(--line) transparent; }
.rail::-webkit-scrollbar { width: 6px; }
.rail::-webkit-scrollbar-track { background: transparent; }
.rail::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; }
.rail:hover::-webkit-scrollbar-thumb { background: var(--line); }
.panel { background: var(--surface); border-radius: var(--radius-md); padding: 22px; box-shadow: var(--shadow-sm); }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel__head h3 { font-size: 1.15rem; font-weight: 800; color: var(--ink); margin: 0; }
.panel__head a { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* Matches (avatares con anillo) */
.matches-row { display: flex; gap: 14px; }
.match-avatar { position: relative; }
.match-avatar img {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  padding: 3px; background: #fff; border: 2.5px solid var(--flame-pink);
}
.match-avatar .live-dot {
  position: absolute; bottom: 3px; right: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--flame-pink); border: 2.5px solid #fff;
}

/* Lista de mensajes */
.msg-item { display: flex; align-items: center; gap: 13px; padding: 11px 0; }
.msg-item + .msg-item { border-top: 1px solid var(--line); }
.msg-item img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; }
.msg-item .msg-body { flex: 1; min-width: 0; }
.msg-item .msg-top { display: flex; justify-content: space-between; align-items: center; }
.msg-item .msg-name { font-weight: 700; color: var(--ink); font-size: .95rem; display: flex; align-items: center; gap: 6px; }
.msg-item .msg-name .verif-badge { width: 16px; height: 16px; border-radius: 0; }
.msg-item .msg-time { font-size: .78rem; color: var(--muted); }
.msg-item .msg-text { font-size: .87rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item .msg-unread {
  background: var(--flame-grad); color: #fff; font-size: .72rem; font-weight: 700;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center;
}

/* Sugerencias */
.suggest-item { display: flex; align-items: center; gap: 13px; padding: 11px 0; }
.suggest-item + .suggest-item { border-top: 1px solid var(--line); }
.suggest-item img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.suggest-item .s-body { flex: 1; min-width: 0; }
.suggest-item .s-name { font-weight: 700; color: var(--ink); font-size: .95rem; }
.suggest-item .s-job { font-size: .85rem; color: var(--text); }
.suggest-item .s-dist { font-size: .8rem; color: var(--muted); }
.s-like {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--line); background: #fff; color: var(--flame-pink);
  display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.s-like:hover { background: var(--flame-grad); color: #fff; border-color: transparent; }
.s-like.liked { background: var(--flame-grad); color: #fff; border-color: transparent; }
.s-like:disabled { opacity: .55; cursor: default; }
.s-like:disabled:hover { background: #fff; color: var(--flame-pink); border-color: var(--line); }
[data-theme="dark"] .s-like { background: var(--surface); }
[data-theme="dark"] .s-like:disabled:hover { background: var(--surface); }

/* Secciones de Juegos / Grupos (próximamente) */
.panel__soon {
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--flame-pink); background: var(--flame-grad-soft);
  padding: 3px 10px; border-radius: 999px;
}
.feature-ico {
  width: 56px; height: 56px; border-radius: 14px; flex: 0 0 auto; overflow: hidden;
  background: var(--flame-grad-soft); color: var(--flame-pink);
  display: grid; place-items: center; font-size: 1.25rem;
}
.feature-ico img { width: 100%; height: 100%; object-fit: cover; }

/* Panel colapsable (details/summary) */
.panel--collapsible summary { list-style: none; cursor: pointer; margin-bottom: 0; outline: none; }
.panel--collapsible summary::-webkit-details-marker { display: none; }
.panel--collapsible[open] summary { margin-bottom: 18px; }
.panel__chevron { color: var(--muted); font-size: .9rem; transition: transform .2s ease; }
.panel--collapsible[open] .panel__chevron { transform: rotate(180deg); }
.panel__more {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 14px;
  color: var(--flame-pink); font-size: .85rem; font-weight: 700;
}

/* =====================================================================
   AUTENTICACIÓN / ONBOARDING (pantallas centradas)
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 80% -10%, #ffe3ee 0%, transparent 60%), var(--bg); }
[data-theme="dark"] .auth-wrap { background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 38px 34px; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-title { text-align: center; font-size: 1.5rem; font-weight: 800; color: var(--ink); margin: 18px 0 4px; }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: 26px; }
.form-label { font-weight: 600; color: var(--text); font-size: .9rem; }
.form-control-flame {
  width: 100%; padding: 14px 16px; border-radius: 14px;
  border: 1.5px solid var(--line); font-size: .98rem; transition: border-color .15s;
  background: #fbfbfc;
}
.form-control-flame:focus { outline: none; border-color: var(--flame-pink); background: #fff; }
.btn-flame {
  background: var(--flame-grad); color: #fff; border: 0; width: 100%;
  padding: 15px; border-radius: 14px; font-weight: 700; font-size: 1rem;
  box-shadow: 0 10px 24px rgba(255,45,111,.3); transition: transform .12s, opacity .15s;
}
.btn-flame:hover { transform: translateY(-1px); opacity: .96; }
.auth-foot { text-align: center; margin-top: 20px; color: var(--muted); font-size: .92rem; }
.auth-foot a { color: var(--flame-pink); font-weight: 700; }
.alert-flame { background: #fff0f4; color: #c81e5b; border: 1px solid #ffd6e3;
  padding: 12px 16px; border-radius: 12px; font-size: .9rem; margin-bottom: 18px; }

/* Selector de idioma (pills) */
.lang-pills { display: flex; gap: 10px; justify-content: center; margin-bottom: 22px; }
.lang-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--text); font-weight: 600; cursor: pointer; font-size: .9rem;
}
.lang-pill.active { border-color: var(--flame-pink); background: var(--flame-grad-soft); color: var(--flame-pink); }
[data-theme="dark"] .lang-pill { background: #23232f; color: var(--text); border-color: var(--line); }
[data-theme="dark"] .lang-pill.active { background: rgba(255,45,111,.16); border-color: var(--flame-pink); color: var(--flame-pink); }

/* Onboarding: progreso y tareas */
.onb-progress-track { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.onb-progress-fill { height: 100%; background: var(--flame-grad); border-radius: 999px; transition: width .5s ease; }
.task-item {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px;
  transition: border-color .15s, background .15s; background: var(--surface);
}
.task-item.done { background: #f3fbf6; border-color: #c7ecd3; }
[data-theme="dark"] .task-item.done { background: rgba(34,197,94,.08); border-color: rgba(34,197,94,.25); }
.task-icon {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  background: var(--flame-grad-soft); color: var(--flame-pink);
  display: grid; place-items: center; font-size: 1.15rem;
}
.task-item.done .task-icon { background: #d8f5e3; color: var(--green); }
[data-theme="dark"] .task-item.done .task-icon { background: rgba(34,197,94,.15); }
.task-body { flex: 1; min-width: 0; }
.task-name { font-weight: 700; color: var(--ink); }
.task-reward { font-size: .85rem; color: var(--flame-pink); font-weight: 600; }
.task-item.done .task-reward { color: var(--green); }
.btn-task {
  border: 0; background: var(--ink-2); color: #fff; padding: 10px 18px;
  border-radius: 10px; font-weight: 700; font-size: .88rem; cursor: pointer; white-space: nowrap;
}
.btn-task:disabled { background: #d8f5e3; color: var(--green); cursor: default; }
[data-theme="dark"] .btn-task:disabled { background: rgba(34,197,94,.15); color: var(--green); }
.wallet-row { display: flex; gap: 12px; margin: 18px 0 26px; }
.wallet-chip {
  flex: 1; text-align: center; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 14px 8px;
}
.wallet-chip .n { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.wallet-chip .l { font-size: .78rem; color: var(--muted); }

/* Toast de recompensa */
.reward-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(120px);
  background: var(--ink-2); color: #fff; padding: 14px 22px; border-radius: 14px;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px;
  font-weight: 600; z-index: 999; transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.reward-toast.show { transform: translateX(-50%) translateY(0); }
.reward-toast i { color: #ffd54a; }

/* ---------- Visor de fotos (lightbox) ---------- */
.photo-viewer {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6, 6, 10, .985);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 24px;
  touch-action: none; overflow: hidden;
}
.photo-viewer[hidden] { display: none; }
.pv-stage { position: relative; display: flex; align-items: center; justify-content: center; max-width: 560px; width: 100%; touch-action: none; }
.pv-photo {
  max-width: 100%; max-height: 86vh; width: auto; border-radius: 16px;
  object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  touch-action: none; user-select: none; -webkit-user-drag: none;
  cursor: zoom-in; transform-origin: center center; transition: transform .2s ease-out;
}
.pv-photo.pv-zoomed { cursor: grab; }
.pv-photo.pv-dragging { cursor: grabbing; transition: none; }
.pv-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 24px; pointer-events: none;
}
.pv-topbar > * { pointer-events: auto; }
.pv-counter {
  background: rgba(0,0,0,.55); color: #fff; font-weight: 700; font-size: .85rem;
  padding: 5px 12px; border-radius: 999px;
}
.pv-close, .pv-nav {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.1rem;
  display: grid; place-items: center; flex-shrink: 0; transition: background .15s;
  z-index: 2;
}
.pv-close:hover, .pv-nav:hover { background: rgba(255,255,255,.28); }
.pv-close { position: absolute; top: 50%; right: 24px; transform: translateY(-50%); }
@media (max-width: 860px) {
  .photo-viewer { padding: 12px; gap: 6px; }
  .pv-topbar { padding: 12px; }
  .pv-nav { position: absolute; top: 50%; transform: translateY(-50%); }
  .pv-nav.prev { left: 10px; }
  .pv-nav.next { right: 10px; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */

/* Tablet: oculta el rail derecho */
@media (max-width: 1200px) {
  .app { grid-template-columns: var(--sidebar-w) 1fr; }
  .rail { display: none; }
}

/* Topbar móvil + bottom nav (ocultos en escritorio) */
.mobile-topbar, .bottom-nav { display: none; }

/* Cabecera de perfil estilo Tinder: oculta en escritorio, se muestra en móvil.
   Debe declararse ANTES del media query para que éste gane en la cascada. */
.profile-photohero { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 0 16px 96px; }
  /* Descubrir en móvil: pantalla completa estilo app, sin barra de logo.
     Los filtros van pegados arriba (estilo Tinder) y la foto ocupa todo el resto. */
  .page-discover .mobile-topbar { display: none; } /* por si algún flujo la incluyera */
  /* Perfil sin la barra flame + campana; se compensa el espacio superior. */
  .page-profile .mobile-topbar { display: none; }
  .page-profile .main { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
  .main--discover {
    display: flex; flex-direction: column;
    /* Viewport GRANDE (barra del navegador retraída). Discover no hace scroll,
       así que 100dvh se quedaba con el valor corto de la primera carga y la
       info salía muy arriba; sólo se corregía al recargar. 100lvh usa siempre
       el alto asentado (el mismo que da la recarga) → info estable desde el inicio. */
    height: 100vh; height: 100lvh;
    padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 66px;
    overflow: hidden; position: relative;
  }

  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
    padding: 14px 16px; border-bottom: 1px solid var(--line);
  }
  .mobile-topbar .brand { font-size: 1.25rem; }
  .mobile-topbar .brand__mark { width: 38px; height: 38px; border-radius: 11px; }

  .page-title { font-size: 1.4rem; }
  .main__header { margin: 18px 0 16px; }
  /* Perfil ajeno en móvil: el nombre y el cierre ya están en la foto de
     cabecera estilo Tinder, así que el encabezado clásico sobra. */
  .page-profile--other .main__header { display: none; }
  /* Perfil propio en móvil: el título "Mi Perfil" va encima de los botones,
     no en la misma línea. */
  .page-profile .main__header {
    flex-direction: column; align-items: flex-start; gap: 12px;
  }

  /* Cabecera de perfil estilo Tinder: barra superior con nombre + edad y flecha
     para cerrar, y debajo la foto principal a todo lo ancho. El .profile-hero
     compacto (avatar + nombre) se oculta porque ya queda cubierto arriba;
     el resto de esa tarjeta (empleo, ciudad, en línea) sigue visible debajo. */
  .page-profile .main { padding-top: 0; }
  .profile-photohero {
    display: block; margin: 0 -16px 16px;
  }
  .profile-photohero__bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: calc(env(safe-area-inset-top, 0px) + 12px) 8px 14px 18px;
    background: var(--bg);
  }
  .profile-photohero__id { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .profile-photohero__name {
    font-size: 1.55rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .profile-photohero__close {
    flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
    display: grid; place-items: center; border: 0; cursor: pointer;
    background: var(--line); color: var(--ink); font-size: 1.05rem;
  }
  .profile-photohero__close:active { transform: scale(.92); }
  .profile-photohero__stage {
    position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 72vh;
    overflow: hidden; background: #000;
  }
  .profile-photohero__img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .profile-photohero__overlay {
    position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(to top, rgba(0,0,0,.5) 0%, transparent 30%);
  }
  .profile-photohero__segments {
    position: absolute; top: 10px; left: 12px; right: 12px; z-index: 3;
    display: flex; gap: 5px;
  }
  .profile-photohero__segments .seg { flex: 1; height: 3px; border-radius: 999px; background: rgba(255,255,255,.4); }
  .profile-photohero__segments .seg.on { background: #fff; }
  .photohero-verified {
    position: absolute; left: 14px; bottom: 14px; z-index: 4;
    line-height: 0; filter: drop-shadow(0 2px 8px rgba(0,0,0,.45));
  }
  .photohero-verified img { width: 36px; height: 36px; display: block; }
  .photohero-comment {
    position: absolute; right: 14px; bottom: 14px; z-index: 4;
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    padding: 11px 20px; border: 0; border-radius: 999px;
    background: rgba(255,255,255,.95); color: #111; font-weight: 700; font-size: .95rem;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
  }
  .photohero-comment:active { transform: scale(.95); }
  .profile-hero img, .profile-hero .h-name { display: none; }
  /* Tarjeta que quedaría vacía en móvil (perfil propio sin empleo/ciudad). */
  .profile-card.is-empty-mobile { display: none; }
  /* Barra de filtros arriba: pastillas con icono + texto (sin hover en táctil) */
  .side-rail {
    position: static; flex-direction: row; align-items: center; flex: 0 0 auto;
    gap: 8px; margin: 0 0 8px; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .side-rail::-webkit-scrollbar { display: none; }
  .side-rail .bell, .side-rail .rail-sep { display: none; } /* el bell ya está en el topbar */
  .rail-btn {
    flex: 0 0 auto; width: auto; height: auto;
    gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: .88rem;
    display: inline-flex; align-items: center; white-space: nowrap;
  }
  /* El "tooltip" pasa a ser la etiqueta visible en línea */
  .rail-tip {
    position: static; transform: none; opacity: 1; pointer-events: auto;
    background: none; color: inherit; padding: 0; border-radius: 0;
    font-size: inherit; font-weight: 600;
  }
  .rail-tip::after { display: none; }
  /* El stage llena el espacio libre; la tarjeta lo rellena por completo. */
  .discover-stage { max-width: 100%; }
  .discover-card { aspect-ratio: auto; max-height: none; border-radius: 0; }
  .discover-card__name { font-size: 1.7rem; }
  /* La info se FIJA al viewport visual (como los botones y el nav), no al alto
     de la tarjeta. Así sale siempre a la misma altura, sin importar que la barra
     del navegador acorte el viewport en la primera carga. */
  .discover-card__info {
    position: fixed; z-index: 20;
    left: 28px; right: 28px;
    /* Anclada al viewport (estable desde la 1ª carga); queda justo por encima
       de los botones de acción (fijos a 74px + 62px de alto = tope en 136px). */
    bottom: 160px;
  }
  .card-nav { display: none; } /* en móvil se navega con swipe */
  .swipe-hint { display: none; } /* look limpio tipo app; los gestos se descubren solos */
  /* Anuncio: texto y botón despegados del nav inferior (no hay botones de acción). */
  .ad-card__content { bottom: 88px; }

  /* Botones de acción flotando sobre la parte baja de la foto (estilo Tinder).
     FIJOS al viewport (no absolutos): así se anclan siempre a la misma altura
     sobre la barra inferior, aunque al volver a Descubrir cambie el alto del
     viewport (bfcache) o de la tarjeta. */
  .main--discover .actions {
    position: fixed; left: 0; right: 0;
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    margin: 0; gap: 14px; z-index: 61; pointer-events: none;
  }
  .main--discover .actions .action-btn { pointer-events: auto; }

  /* Bottom nav fija */
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(255,255,255,.95); backdrop-filter: blur(12px);
    border-top: none; padding: 10px 8px env(safe-area-inset-bottom);
    justify-content: space-around;
  }
  .bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: #9aa0a6; font-size: .68rem; font-weight: 600; position: relative;
    padding: 4px 10px;
  }
  .bottom-nav a i {
    font-size: 1.5rem; line-height: 1;
    transition: transform .18s ease;
  }
  /* Estilo Tinder: el icono activo se rellena con el degradado de la marca */
  .bottom-nav a.active { color: var(--flame-pink); font-weight: 700; }
  .bottom-nav a.active i {
    background: var(--flame-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    transform: translateY(-1px) scale(1.1);
  }
  .bottom-nav a .badge-count {
    position: absolute; top: -2px; right: 4px;
    background: var(--flame-grad); color: #fff; font-size: .6rem; font-weight: 700;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    display: grid; place-items: center;
  }
  .action-btn.lg { width: 62px; height: 62px; font-size: 1.5rem; }
  .action-btn.sm { width: 48px; height: 48px; font-size: 1.05rem; }
  /* Sombra más marcada para que los botones destaquen sobre la foto */
  .main--discover .action-btn { box-shadow: 0 6px 20px rgba(0,0,0,.35); }
  .auth-card { padding: 30px 22px; }
}

/* =====================================================================
   PÁGINAS INTERNAS (lista de personas, chat, ajustes, perfil)
   ===================================================================== */

/* Layout sin rail derecho: la columna central ocupa el resto */
.app--norail { grid-template-columns: var(--sidebar-w) 1fr; }
@media (max-width: 860px) { .app--norail { grid-template-columns: 1fr; } }

/* Layout de perfil: header a todo el ancho + grid de dos columnas debajo */
.profile-grid {
  display: grid; gap: 22px; align-items: start;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
}
.profile-grid .profile-card { max-width: none; }
/* min-width:0 permite que las columnas se encojan por debajo de su contenido,
   necesario para que los scrollers horizontales (planes) no desborden la página. */
.profile-col, .profile-side { min-width: 0; }
@media (max-width: 1000px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}

.page-sub { color: var(--muted); margin: -14px 0 24px; font-size: .98rem; }

/* Contador de guardados (plan gratis vs. premium) */
.saved-meter {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  margin: -10px 0 22px;
}
.saved-meter__count {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .9rem; font-weight: 700; color: var(--ink);
  background: var(--line); padding: 6px 12px; border-radius: 999px;
}
.saved-meter__count i { color: var(--brand, #ff5b7f); }
.saved-meter__cta {
  font-size: .85rem; color: var(--muted); text-decoration: none;
}
.saved-meter__cta:hover { color: var(--ink); text-decoration: underline; }

/* Grid de tarjetas de personas */
.people-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
/* Likes: cuadrícula estilo Tinder — 2 columnas en móvil, más en pantallas anchas. */
.people-grid--tiles { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
/* Fotos bastante más bajas en Likes: cuadradas en vez del 3/4 por defecto.
   OJO: el contenedor es un <a> (inline), y aspect-ratio NO aplica a inline;
   por eso debe forzarse display:block para que el recorte surta efecto. */
.people-grid--tiles .person-card__photo { display: block; aspect-ratio: 1 / 1; }
/* El badge de verificado nunca debe agrandarse dentro del nombre de la tarjeta. */
.person-card__name .verif-badge { width: 16px; height: 16px; }
/* Tarjeta compacta para la cuadrícula de Likes. */
.people-grid--tiles .person-card__body { padding: 10px; }
.people-grid--tiles .person-card__job { font-size: .82rem; }
.people-grid--tiles .person-card__meta { font-size: .76rem; }
.people-grid--tiles .person-card__name { font-size: .95rem; }
/* Botones apilados (Corresponder arriba) para que el texto quepa en 2 columnas. */
.people-grid--tiles .person-card__actions { flex-direction: column-reverse; gap: 6px; }
.people-grid--tiles .person-card__actions .btn-soft { padding: 9px 8px; font-size: .82rem; }
.person-card {
  background: var(--surface); border-radius: var(--radius-md);
  overflow: hidden; box-shadow: var(--shadow-sm); position: relative;
  transition: transform .12s, box-shadow .12s;
}
.person-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.person-card__photo { position: relative; aspect-ratio: 3/4; background: #eee; }
.person-card__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person-card__grad {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 55%);
}
.person-card__name {
  position: absolute; left: 14px; bottom: 12px; right: 14px; color: #fff;
  font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 7px;
}
.person-card__name .verified { width: 18px; height: 18px; font-size: .6rem; }
.person-card__body { padding: 12px 14px 16px; }
.person-card__job { color: var(--text); font-size: .9rem; }
.person-card__meta { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.person-card__actions { display: flex; gap: 8px; margin-top: 12px; }
.person-card__online {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(20,20,30,.5); backdrop-filter: blur(6px); color: #fff;
  padding: 5px 10px; border-radius: 999px; font-size: .72rem; font-weight: 600;
}
.person-card__online .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.btn-soft {
  flex: 1; border: 1.5px solid var(--line); background: #fff; color: var(--text);
  padding: 9px; border-radius: 10px; font-weight: 700; font-size: .85rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all .15s;
}
.btn-soft:hover { border-color: #ddd; }
.btn-soft.primary { background: var(--flame-grad); color: #fff; border-color: transparent;
  box-shadow: 0 6px 16px rgba(255,45,111,.25); }
.btn-soft.danger:hover { border-color: #ffc2d2; color: var(--flame-pink); }

/* Estado vacío */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-state .ico {
  width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 18px;
  background: var(--flame-grad-soft); color: var(--flame-pink);
  display: grid; place-items: center; font-size: 1.8rem;
}
.empty-state h3 { font-weight: 800; color: var(--ink); margin: 0 0 6px; }
.empty-state p { color: var(--muted); margin: 0; }

/* ---- Chat ---- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 60px);
  background: var(--surface); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line); }
.chat__peer { display: flex; align-items: center; gap: 12px; color: inherit; min-width: 0; }
.chat__peer:hover .name { text-decoration: underline; }
.chat__head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat__head .name { font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__head .back { margin-left: auto; color: var(--muted); font-weight: 600; flex-shrink: 0; }
.chat__body { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 72%; padding: 11px 15px; border-radius: 18px; font-size: .95rem; line-height: 1.4; }
.bubble.them { align-self: flex-start; background: #f1f1f5; color: var(--text); border-bottom-left-radius: 6px; }
.bubble.me { align-self: flex-end; background: var(--flame-grad); color: #fff; border-bottom-right-radius: 6px; }
.chat__foot { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.chat__foot input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 12px 18px; font-size: .95rem; background: #fbfbfc; }
.chat__foot input:focus { outline: none; border-color: var(--flame-pink); background: #fff; }
.chat__foot button { border: 0; background: var(--flame-grad); color: #fff;
  width: 48px; height: 48px; border-radius: 50%; cursor: pointer; flex-shrink: 0; }

/* Vista de chat con top-padding propio en escritorio (antes iba inline). */
.page-chat .main { padding-top: 18px; }
/* En móvil el chat ocupa exactamente el hueco entre la barra superior y la
   bottom-nav, para que la casilla de escribir quede siempre visible sin scroll. */
@media (max-width: 860px) {
  .page-chat .main { padding: 0; }
  /* Sin barra superior ni bottom-nav: el chat ocupa todo el alto y el cuadro
     de escribir queda pegado al borde inferior (respetando el área segura). */
  .page-chat .bottom-nav { display: none; }
  .page-chat .chat {
    height: calc(100dvh - 60px - env(safe-area-inset-bottom, 0px));
    border-radius: 0; box-shadow: none;
  }
  .page-chat .chat__head { padding-top: calc(env(safe-area-inset-top, 0px) + 16px); }
}

/* Lista de conversaciones a página completa */
.conv-list { background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 8px 18px; }
.conv-list .msg-item { padding: 15px 0; }
.conv-list a { display: block; }

/* ---- Ajustes / Perfil ---- */
.settings-card, .profile-card {
  background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 26px; margin-bottom: 22px; max-width: 720px;
}
.settings-card h3, .profile-card h3 { font-weight: 800; color: var(--ink); margin: 0 0 18px; font-size: 1.1rem; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; color: var(--text); font-size: .9rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  font-size: .95rem; background: #fbfbfc; font-family: inherit;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--flame-pink); background: #fff; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.profile-hero { display: flex; align-items: center; gap: 20px; margin-bottom: 22px; }
.profile-hero > img { width: 96px; height: 96px; border-radius: 26px; object-fit: cover; }
.profile-hero .h-name { font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.profile-hero .h-job { color: var(--text); }
.profile-hero .h-meta { color: var(--muted); font-size: .9rem; }
.profile-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pg-item {
  border: 0; padding: 0; background: none; cursor: pointer;
  aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.pg-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.pg-item:hover img { transform: scale(1.05); }
.pg-item--hidden { display: none; }
.profile-gallery.is-expanded .pg-item--hidden { display: block; }
.facts-grid .fact--hidden { display: none; }
.facts-grid.is-expanded .fact--hidden { display: flex; }
.pg-showall {
  display: flex; align-items: center; gap: 18px; width: 100%; margin-top: 18px;
  border: 0; background: none; cursor: pointer;
}
.pg-showall::before, .pg-showall::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--line);
}
.pg-showall__lbl {
  display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto;
  color: var(--muted); font-weight: 700; font-size: 1.15rem; letter-spacing: .01em;
}
.pg-showall__lbl i { font-size: .8em; transition: transform .2s; }
.pg-showall.is-open .pg-showall__lbl i { transform: rotate(180deg); }
.interest-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.interest-chip { display: inline-flex; align-items: center; gap: 8px;
  background: var(--flame-grad-soft); color: var(--flame-pink); font-weight: 600;
  padding: 9px 15px; border-radius: 999px; font-size: .9rem; }

/* Datos del perfil (estilo de vida) */
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.fact { display: flex; align-items: center; gap: 12px; }
.fact-ico {
  width: 32px; height: 32px; flex-shrink: 0;
  color: var(--muted);
  display: grid; place-items: center; font-size: 1rem;
}
.fact-label { font-size: .76rem; color: var(--muted); font-weight: 600; }
.fact-value { font-size: .95rem; color: var(--ink); font-weight: 700; }
.toast-ok { background: #f3fbf6; color: #1c8a4b; border: 1px solid #c7ecd3;
  padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .92rem; }

/* ---- Ajustes estilo Tinder (secciones agrupadas) ---- */
.settings-page { padding-bottom: 100px; }
.set-group { max-width: 720px; margin-bottom: 26px; }
.set-group__title {
  text-transform: uppercase; letter-spacing: .06em; font-size: .76rem; font-weight: 700;
  color: var(--muted); margin: 0 4px 10px;
}
.set-group .settings-card { margin-bottom: 0; }
.set-save { max-width: 720px; display: flex; justify-content: flex-end; margin-bottom: 26px; }
.set-save .btn-soft { flex: 0 0 auto; padding: 12px 30px; }

/* Barra de guardado (fija, de extremo a extremo; el sidebar queda por encima) */
.save-bar {
  position: fixed; left: var(--sidebar-w); right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  padding: 14px 34px; background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .22);
}
.save-bar.dirty { justify-content: space-between; }
.save-bar__msg { font-weight: 700; color: var(--ink); display: none; align-items: center; gap: 10px; }
.save-bar.dirty .save-bar__msg { display: flex; }
.save-bar__msg i { color: var(--amber); }
.save-bar__actions { display: flex; gap: 10px; }
.save-bar #discardBtn { display: none; }
.save-bar.dirty #discardBtn { display: inline-flex; }
.save-bar .btn-soft { flex: 0 0 auto; padding: 11px 24px; }
.save-bar .btn-soft.primary,
[data-theme="dark"] .save-bar .btn-soft.primary {
  background: var(--flame-pink); box-shadow: none;
}
.save-bar .btn-soft.primary:hover,
[data-theme="dark"] .save-bar .btn-soft.primary:hover {
  background: var(--flame-pink); box-shadow: none; filter: brightness(.92);
}
@media (max-width: 860px) {
  /* La barra se ancla al fondo y su superficie se extiende por detrás de la
     bottom-nav (z-index mayor), eliminando el hueco entre ambas. El padding
     inferior mantiene los botones por encima de la navegación. */
  .save-bar { left: 0; bottom: 0; padding: 12px 16px calc(80px + env(safe-area-inset-bottom)); }
  /* En móvil el aviso no cabe: se oculta y los botones quedan a la derecha. */
  .save-bar.dirty { justify-content: flex-end; }
  .save-bar.dirty .save-bar__msg { display: none; }
  .settings-page { padding-bottom: 180px; }
  /* Sin barra superior "flame": se compensa el espacio bajo el notch. */
  .main.settings-page { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); }
}

/* Fila tipo "etiqueta · valor" */
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 4px 0;
}
.set-row__label { font-weight: 600; color: var(--text); font-size: .95rem; }
.set-row__value { color: var(--muted); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Slider con valor en vivo */
.slider-label { display: flex; align-items: center; justify-content: space-between; }
.slider-val { font-weight: 700; color: var(--flame-pink); font-size: .9rem; }
.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  border-radius: 999px; background: var(--line); outline: none; padding: 0; margin: 6px 0 0;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--flame-grad); cursor: pointer; box-shadow: 0 2px 8px rgba(255,45,111,.4);
  border: 3px solid var(--surface);
}
.range::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: #ff2d6f; cursor: pointer;
  border: 3px solid var(--surface); box-shadow: 0 2px 8px rgba(255,45,111,.4);
}
.field-row .range { flex: 1; }

/* Opciones de tema */
.theme-options { display: flex; gap: 12px; flex-wrap: wrap; }
.theme-opt {
  flex: 1; min-width: 150px; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .92rem;
  cursor: pointer; transition: all .15s;
}
.theme-opt i:first-child { font-size: 1.05rem; }
.theme-opt .chk { margin-left: auto; color: var(--flame-pink); opacity: 0; transition: opacity .15s; }
.theme-opt:hover { border-color: var(--flame-pink); }
.theme-opt.active { border-color: var(--flame-pink); background: var(--flame-grad-soft); color: var(--flame-pink); }
.theme-opt.active .chk { opacity: 1; }

/* Formularios en modo oscuro */
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea { background: #14141d; border-color: var(--line); color: var(--text); }
[data-theme="dark"] .field input:focus,
[data-theme="dark"] .field select:focus,
[data-theme="dark"] .field textarea:focus { background: #0f0f17; border-color: var(--flame-pink); }
[data-theme="dark"] .btn-soft { background: var(--surface); color: var(--text); }
[data-theme="dark"] .btn-soft.primary { background: var(--flame-grad); color: #fff; border-color: transparent; }
[data-theme="dark"] .range { background: #2a2a38; }
[data-theme="dark"] .toast-ok { background: #122019; color: #4ade80; border-color: #1f3a2a; }
[data-theme="dark"] .alert-flame { background: #2a1620; color: #ff90b3; border-color: #3a2030; }

.set-hint { color: var(--muted); font-size: .88rem; margin: -4px 0 16px; }

/* Tarjeta de completitud del perfil */
.completeness-card { margin-bottom: 0; }
.comp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.comp-title { font-weight: 800; color: var(--ink); font-size: 1.15rem; }
.comp-title #compPct { color: var(--flame-pink); }
.comp-sub { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.comp-credits {
  display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0;
  background: var(--flame-grad-soft); color: var(--flame-pink);
  font-weight: 800; font-size: 1rem; padding: 8px 14px; border-radius: 999px;
}
.comp-credits i { color: var(--amber); }
.comp-track { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.comp-fill {
  height: 100%; background: var(--flame-grad); border-radius: 999px;
  transition: width .5s cubic-bezier(.2,.8,.2,1);
}
.completeness-card.is-complete .comp-fill { background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%); }
.completeness-card.is-complete .comp-title #compPct { color: var(--green); }
.credits-toast i { color: var(--amber); }

/* Galería de fotos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 12px; }
.photo-tile {
  position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
  background: var(--line); box-shadow: var(--shadow-sm);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-badge {
  position: absolute; top: 8px; left: 8px; display: none;
  background: var(--flame-grad); color: #fff; font-size: .68rem; font-weight: 700;
  padding: 3px 9px; border-radius: 999px;
}
.photo-tile.is-primary .photo-badge { display: inline-block; }
.photo-tile.is-primary { outline: 3px solid var(--flame-pink); outline-offset: -3px; }
.photo-actions {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; gap: 8px;
  padding: 10px; opacity: 0; transition: opacity .15s;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 55%);
}
.photo-tile:hover .photo-actions { opacity: 1; }
.photo-actions button {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); color: #15151f; display: grid; place-items: center; font-size: .82rem;
}
.photo-actions .ph-del:hover { background: var(--flame-pink); color: #fff; }
.photo-actions .ph-star:hover { background: var(--amber); color: #fff; }
.photo-add {
  aspect-ratio: 3 / 4; border: 2px dashed var(--line); border-radius: 14px;
  display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 600; transition: all .15s;
}
.photo-add i { font-size: 1.3rem; }
.photo-add:hover { border-color: var(--flame-pink); color: var(--flame-pink); }
.ph-upload-spinner {
  display: none; width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--flame-pink);
  animation: ph-spin .7s linear infinite;
}
@keyframes ph-spin { to { transform: rotate(360deg); } }
.photo-add.loading { pointer-events: none; }
.photo-add.loading .ph-upload-spinner { display: block; }
.photo-add.loading i,
.photo-add.loading span:not(.ph-upload-spinner) { display: none; }

/* Zona de pegar/soltar fotos (crear perfil demo) */
.paste-zone {
  border: 2px dashed var(--line); border-radius: 16px; padding: 28px 20px;
  display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; color: var(--muted); transition: all .15s;
}
.paste-zone i { font-size: 1.6rem; color: var(--flame-pink); }
.paste-zone span { font-size: .92rem; }
.paste-zone:hover, .paste-zone:focus-visible, .paste-zone.is-drag {
  border-color: var(--flame-pink); background: var(--flame-grad-soft); color: var(--flame-pink);
  outline: none;
}

/* Chips de intereses / idiomas */
.int-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.int-chip {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 15px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 600; font-size: .88rem;
  transition: all .15s; user-select: none;
}
.int-chip input { display: none; }
.int-chip:hover { border-color: var(--flame-pink); }
.int-chip.active { border-color: var(--flame-pink); background: var(--flame-grad-soft); color: var(--flame-pink); }

@media (max-width: 600px) {
  .field-row { flex-direction: column; gap: 0; }
}

/* Ajustes con panel de vista previa (escritorio) */
.app--settings { grid-template-columns: var(--sidebar-w) 1fr var(--rail-w); }
.settings-preview { padding: 22px 52px 22px 8px; min-width: 0; }
.preview-sticky { position: sticky; top: 22px; }
.preview-label {
  text-transform: uppercase; letter-spacing: .06em; font-size: .76rem; font-weight: 700;
  color: var(--muted); margin: 0 2px 12px; display: flex; align-items: center; gap: 7px;
}
.preview-card {
  flex: none !important; width: 100%; max-width: 320px; min-height: 0;
  aspect-ratio: 3 / 4; align-self: auto; margin: 0;
}
/* Placeholder cuando aún no hay foto (sigue el tema) */
.pv-placeholder {
  position: absolute; inset: 0; display: none;
  flex-direction: column; gap: 10px; align-items: center; justify-content: center;
  background: var(--bg); color: var(--muted); text-align: center; padding: 20px;
}
.pv-placeholder i { font-size: 2.6rem; opacity: .7; }
.pv-placeholder span { font-size: .85rem; font-weight: 600; }
.preview-card.no-photo .discover-card__img { display: none; }
.preview-card.no-photo .pv-placeholder { display: flex; }
@media (max-width: 1200px) {
  .app--settings { grid-template-columns: var(--sidebar-w) 1fr; }
  .settings-preview { display: none; }
}
@media (max-width: 860px) {
  .app--settings { grid-template-columns: 1fr; }
}

/* Respeta usuarios que prefieren menos movimiento */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   Insignias (badges)
   ===================================================================== */
.badge-summary {
  max-width: 720px; display: flex; gap: 16px; align-items: stretch;
  margin-bottom: 18px; flex-wrap: wrap;
}
.badge-summary__progress {
  flex: 1 1 320px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.badge-summary__count { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--text); }
.badge-summary__label { color: var(--muted); font-size: .82rem; font-weight: 600; }
.badge-summary__credits {
  flex: 0 0 auto; display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 20px 26px; color: var(--amber);
}
.badge-summary__credits > i { font-size: 1.8rem; }
.badge-summary__creditval { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--text); }

.badge-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
}
.badge-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.badge-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.badge-card.is-earned { border-color: var(--green); }
.badge-card__top { display: flex; align-items: flex-start; justify-content: space-between; }
.badge-ico {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.35rem;
}
.badge-ico.c-purple { background: rgba(139,92,246,.16); color: var(--purple); }
.badge-ico.c-amber  { background: rgba(245,166,35,.16);  color: var(--amber); }
.badge-ico.c-pink   { background: rgba(255,45,111,.14);  color: var(--flame-pink); }
.badge-ico.c-green  { background: rgba(34,197,94,.16);   color: var(--green); }
.badge-ico.c-teal   { background: rgba(20,184,166,.16);  color: #14b8a6; }
.badge-check {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: #fff; font-size: .78rem;
}
.badge-card__name { font-weight: 700; font-size: 1.02rem; color: var(--text); }
.badge-card__desc { color: var(--muted); font-size: .86rem; line-height: 1.45; flex: 1; }
.badge-card__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.badge-credits {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--amber); font-weight: 700; font-size: .84rem;
}
.badge-btn { justify-content: center; padding: 10px 16px; }
.badge-earned-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-state-earned { color: var(--green); font-weight: 700; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.badge-result-chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  background: rgba(34,197,94,.14); color: var(--green); font-weight: 700; font-size: .78rem;
}
.badge-progress-hint { color: var(--muted); font-size: .78rem; text-align: center; }

/* --- Cuestionario --- */
/* Página del test a pantalla limpia: sin cabecera, con X para salir.
   La X vive DENTRO de la tarjeta (esquina del bloque superior) para no
   gastar espacio vertical. */
.main--quiz { padding-top: 30px; }
.quiz-close {
  position: absolute; top: 10px; right: 10px; z-index: 30;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  color: var(--muted); font-size: 1.4rem; text-decoration: none;
}
.quiz-close:hover { color: var(--ink); }
/* Botón X para volver en la galería de insignias (sin barra superior). */
.badge-topbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.badge-close {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--muted); font-size: 1.3rem; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: 50%;
}
.badge-close:hover { color: var(--text); }
/* La intro no debe meterse debajo de la X. */
.quiz .quiz-head { padding-right: 36px; }
@media (max-width: 860px) {
  /* La tarjeta abarca todo el alto disponible entre el borde superior y la
     bottom-nav (el padding inferior de .main ya reserva su hueco). Los
     botones Atrás/Continuar quedan anclados al fondo de la tarjeta. */
  .main--quiz {
    display: flex; flex-direction: column;
    min-height: 100dvh;
    padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
    /* Despega la tarjeta de la bottom-nav: los botones Atrás/Continuar
       quedan siempre visibles por encima del menú. */
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
  }
  .main--quiz .quiz,
  .main--quiz .quiz-result { flex: 1 1 auto; display: flex; flex-direction: column; }
  .main--quiz .quiz[hidden],
  .main--quiz .quiz-result[hidden] { display: none; }
  .main--quiz .quiz-q.active { flex: 1 1 auto; }
  .main--quiz .quiz-nav { margin-top: auto; padding-top: 16px; }
  .main--quiz .quiz-result { justify-content: center; }

  .main--quiz .quiz { padding: 20px 18px; }
  .main--quiz .quiz-head { gap: 12px; margin-bottom: 14px; }
  .main--quiz .quiz-head .badge-ico { width: 46px; height: 46px; border-radius: 14px; font-size: 1.15rem; }
  .main--quiz .quiz-intro { font-size: .85rem; line-height: 1.4; }
  .main--quiz .quiz-step-label { margin: 8px 0 14px; }
  .main--quiz .quiz-q__title { font-size: 1.08rem; margin-bottom: 14px; }
  .main--quiz .quiz-opts { gap: 10px; }
  .main--quiz .quiz-opt { padding: 13px 15px; border-radius: 13px; }
}

.quiz {
  position: relative; /* ancla de la X de cierre */
  max-width: 640px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); padding: 26px; box-shadow: var(--shadow-sm);
}
.quiz-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.quiz-intro { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.45; }
.quiz-progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.quiz-progress__fill { height: 100%; background: var(--flame-grad); border-radius: 999px; transition: width .25s; }
.quiz-step-label { color: var(--muted); font-size: .8rem; font-weight: 600; margin: 8px 0 18px; }
.quiz-q { border: 0; padding: 0; margin: 0; display: none; }
.quiz-q.active { display: block; animation: quizfade .25s ease; }
@keyframes quizfade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.quiz-q__title { font-weight: 700; font-size: 1.12rem; color: var(--text); margin-bottom: 16px; padding: 0; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px;
  transition: all .15s; user-select: none;
}
.quiz-opt:hover { border-color: var(--muted); }
.quiz-opt input { display: none; }
.quiz-opt__dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line);
  flex: 0 0 auto; transition: all .15s; position: relative;
}
.quiz-opt__text { color: var(--text); font-weight: 600; font-size: .92rem; }
.quiz-opt:has(input:checked) { border-color: var(--ink); background: rgba(128,128,150,.12); }
.quiz-opt:has(input:checked) .quiz-opt__dot { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px var(--surface); }
.quiz-nav { display: flex; gap: 10px; margin-top: 22px; }
.quiz-nav .btn-soft { flex: 1; justify-content: center; padding: 12px; }
.quiz-nav #quizPrev { flex: 0 0 auto; }

/* --- Resultado del test --- */
.quiz-result {
  position: relative; /* ancla de la X de cierre */
  max-width: 640px; text-align: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: 36px 26px; box-shadow: var(--shadow-sm);
}
.quiz-result__icon {
  width: 84px; height: 84px; border-radius: 24px; margin: 0 auto 18px;
  display: grid; place-items: center; font-size: 2.2rem;
}
.quiz-result__title { font-size: 1.4rem; font-weight: 800; margin: 0 0 6px; color: var(--text); }
.quiz-result__badge { color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.quiz-result__value {
  display: inline-block; font-size: 1.6rem; font-weight: 800; letter-spacing: .04em;
  color: var(--text); margin-bottom: 12px;
}
.quiz-result__credits { color: var(--amber); font-weight: 700; }
.quiz-result__credits i { color: var(--amber); }

/* --- Compatibilidad (en profile.php) --- */
.compat-card.is-high { --c: var(--green); }
.compat-card.is-mid  { --c: var(--amber); }
.compat-card.is-low  { --c: #e0524b; }
/* Gauge tipo herradura con el % de compatibilidad */
.compat-gauge-wrap { text-align: center; margin-bottom: 20px; }
.compat-gauge {
  position: relative; width: 100%; max-width: 240px; margin: 0 auto;
  aspect-ratio: 200 / 172;
}
.compat-gauge__svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cg-track { fill: none; stroke: var(--line); stroke-width: 20; stroke-linecap: round; }
.cg-progress { fill: none; stroke: url(#compatGaugeGrad); stroke-width: 20; stroke-linecap: round; }
.cg-knob {
  position: absolute; width: 12%; aspect-ratio: 1; border-radius: 50%;
  background: #c85a9c; border: 0.28rem solid #fff;
  box-shadow: 0 0 10px rgba(0,0,0,.35); transform: translate(-50%, -50%);
}
.cg-label {
  position: absolute; top: 44%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none; width: 100%;
}
.cg-num { font-size: clamp(1.9rem, 9vw, 2.5rem); font-weight: 800; color: var(--text); line-height: 1; }
.cg-sub { margin-top: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.compat-gauge__sub { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.compat-gauge__link { color: var(--flame-pink); font-weight: 700; text-decoration: underline; }
.compat-bars { display: flex; flex-direction: column; gap: 14px; }
.compat-row__top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; gap: 10px; }
.compat-row__label { font-weight: 600; font-size: .9rem; color: var(--text); }
.compat-row__detail { font-size: .8rem; color: var(--muted); text-transform: capitalize; }
.compat-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.compat-fill { height: 100%; border-radius: 999px; background: var(--c); transition: width .4s; }
.compat-fill.k-personality   { background: var(--purple); }
.compat-fill.k-love_language { background: #14b8a6; }
.compat-fill.k-values        { background: var(--amber); }
.compat-fill.k-intelligence  { background: #3b82f6; }
.compat-fill.k-interests     { background: var(--green); }

/* --- Desglose de personalidad (Big Five) en el perfil: tarjetas horizontales --- */
.ocean-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: 2px 2px 12px; margin: 0 -2px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.ocean-scroll::-webkit-scrollbar { height: 6px; }
.ocean-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.ocean-card {
  scroll-snap-align: start; flex: 0 0 180px; width: 180px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 16px;
}
.ocean-card.t-O { --tc: var(--purple); }
.ocean-card.t-C { --tc: #3b82f6; }
.ocean-card.t-E { --tc: var(--flame-pink); }
.ocean-card.t-A { --tc: #14b8a6; }
.ocean-card.t-N { --tc: var(--green); }
.ocean-card__ring {
  position: relative; width: 84px; height: 84px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; margin-bottom: 12px;
  background: conic-gradient(var(--tc) calc(var(--p) * 1%), var(--line) 0);
}
.ocean-card__ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--bg); }
.ocean-card__pct { position: relative; font-weight: 800; font-size: 1.1rem; color: var(--text); }
.ocean-card__label { font-weight: 700; font-size: .95rem; color: var(--text); }
.ocean-card__level { font-size: .78rem; font-weight: 700; margin-top: 3px; }
.ocean-card__level.high { color: var(--green); }
.ocean-card__level.mid  { color: var(--amber); }
.ocean-card__level.low  { color: var(--muted); }
.ocean-card__desc { font-size: .8rem; color: var(--muted); line-height: 1.45; margin-top: 10px; }
.personality-summary {
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; margin: -2px 0 18px;
  font-size: .86rem; color: var(--text); line-height: 1.5;
}
.personality-summary__p { margin: 0; }
.personality-summary__rel {
  margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line);
  color: var(--text); line-height: 1.5;
}
.personality-summary__rel-label {
  display: block; font-weight: 700; font-size: .76rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--flame-pink); margin-bottom: 3px;
}

/* --- Insignias en el perfil --- */
.profile-badges { display: flex; flex-wrap: wrap; gap: 10px; }
.pbadge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface);
}
.pbadge__ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; flex: 0 0 auto; }
.pbadge__txt { display: flex; flex-direction: column; line-height: 1.2; }
.pbadge__name { font-weight: 700; font-size: .85rem; color: var(--text); }
.pbadge__res { font-size: .75rem; color: var(--flame-pink); font-weight: 600; }

/* =====================================================================
   Juego Super Fan
   ===================================================================== */
.sf-balance {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  background: var(--flame-grad-soft); color: var(--amber);
  font-weight: 800; font-size: 1.05rem; padding: 9px 16px; border-radius: 999px;
}
.sf-controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 22px; }
.sf-segment { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; }
.sf-seg {
  padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem;
  color: var(--muted); text-decoration: none; transition: all .15s; white-space: nowrap;
}
.sf-seg:hover { color: var(--text); }
.sf-seg.active { background: var(--ink-2); color: #fff; }
[data-theme="dark"] .sf-seg.active { background: #34343f; color: #fff; }

.sf-list { display: flex; flex-direction: column; gap: 12px; }
.sf-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-sm); transition: transform .15s;
}
.sf-rank {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  background: var(--line); color: var(--muted);
}
.sf-avatar-link { flex: 0 0 auto; display: block; }
.sf-avatar { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; display: block; }
.sf-info { flex: 1; min-width: 0; }
.sf-name { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sf-name-link { color: var(--ink); text-decoration: none; }
.sf-name-link:hover { color: var(--flame-pink); }
.sf-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.sf-sub i { color: var(--amber); }
.sf-tag {
  font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  padding: 3px 8px; border-radius: 999px;
}
.sf-tag.mine { background: var(--flame-grad-soft); color: var(--flame-pink); }
.sf-coins { text-align: right; flex: 0 0 auto; }
.sf-coins__n { font-weight: 800; color: var(--ink); white-space: nowrap; }
.sf-coins__n i { color: var(--amber); font-size: .85rem; }
.sf-coins__mine { font-size: .72rem; color: var(--muted); }
.sf-give {
  flex: 0 0 auto; border: 0; cursor: pointer; white-space: nowrap;
  background: linear-gradient(135deg, #f7c948, #f5a623); color: #4a2d00; font-weight: 800; font-size: .9rem;
  padding: 10px 16px; border-radius: 12px; display: inline-flex; align-items: center; gap: 7px;
  transition: filter .15s, transform .1s;
}
.sf-give i { color: #b5651d; }
.sf-give:hover { filter: brightness(1.05); }
[data-theme="dark"] .sf-give { background: #34343f; color: #f4f4f9; }
[data-theme="dark"] .sf-give i { color: #f5a623; }
.sf-give:active { transform: scale(.96); }
.sf-give:disabled { opacity: .6; cursor: default; }
@keyframes sf-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.015); } 100% { transform: scale(1); } }
.sf-card.sf-pulse { animation: sf-pulse .35s ease; }
.sf-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(120px);
  z-index: 999; transition: transform .3s cubic-bezier(.2,.8,.2,1); max-width: 90vw;
}
.sf-toast.show { transform: translateX(-50%) translateY(0); }
.sf-toast.is-bad { background: #fff0f4; color: #c81e5b; border-color: #ffd6e3; }
@media (max-width: 560px) {
  .sf-coins { display: none; }
  .sf-card { gap: 10px; padding: 12px; }
}

/* ============================================================
   Suscripciones — carrusel de planes (settings.php)
   ============================================================ */
.plans-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 14px;
  margin: 0 -4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.plans-scroll::-webkit-scrollbar { height: 6px; }
.plans-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.plan-card {
  position: relative;
  flex: 0 0 320px;
  max-width: 320px;
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  padding: 22px 20px 20px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
/* Fondos por nivel (progresión de fuego) */
.plan--spark     { background: linear-gradient(150deg, #ff2d6f 0%, #ff6b9d 100%); }
.plan--blaze     { background: linear-gradient(155deg, #ffffff 0%, #fff2f7 45%, #ffe6f0 100%); color: #2b2b38; border-color: #ffd3e4; }
.plan--nova      { background: linear-gradient(150deg, #7a1035 0%, #b3143f 45%, #6f2da8 100%); }
.plan-card.is-popular { border-color: rgba(255,255,255,.6); box-shadow: 0 12px 34px rgba(217,165,32,.35); }

/* Plan Gratis (plan actual): tarjeta neutra, sin botón de mejora */
.plan--free { background: var(--bg); color: var(--text); border-color: var(--line); }
.plan--free .plan-badge { background: var(--line); color: var(--text); }
.plan--free .plan-compare { border-top-color: var(--line); }
.plan--free .plan-row { border-top-color: var(--line); }
.plan--free .plan-row__on i { color: var(--green); }
.plan-current {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.06); color: var(--text);
  border: 1px solid var(--line);
  font-weight: 800; font-size: .74rem; padding: 7px 12px; border-radius: 999px;
}
.plan-current i { color: var(--green); }
.plan-compare__head--free, .plan-row--free { grid-template-columns: 1fr 52px; }

.plan-flag {
  position: absolute; top: 14px; right: -34px;
  transform: rotate(45deg);
  background: #1a1a26; color: #ffd54a;
  font-size: .66rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase;
  padding: 5px 40px;
}
.plan-flag i { font-size: .6rem; }

.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.plan-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.plan-brand > i { font-size: 1.15rem; opacity: .95; }
.plan-brand__app { font-weight: 900; font-size: 1.15rem; letter-spacing: -.02em; }
.plan-badge {
  font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.9); color: #1a1a26;
}
.plan--blaze .plan-badge { background: var(--flame-grad); color: #fff; }

.plan-upgrade {
  flex: 0 0 auto;
  border: none; cursor: pointer;
  background: #fff; color: #1a1a26;
  font-weight: 800; font-size: .82rem;
  padding: 9px 16px; border-radius: 999px;
  transition: transform .12s, box-shadow .12s;
}
.plan-upgrade:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
/* En la tarjeta clara, el botón usa el degradado de marca para destacar */
.plan--blaze .plan-upgrade { background: var(--flame-grad); color: #fff; }

.plan-price { display: flex; align-items: baseline; gap: 5px; margin-bottom: 16px; opacity: .96; }
.plan-price__from { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }
.plan-price__num { font-size: 1.7rem; font-weight: 900; letter-spacing: -.02em; }
.plan-price__per { font-size: .8rem; opacity: .8; }

.plan-compare { border-top: 1px solid rgba(255,255,255,.22); }
.plan--blaze .plan-compare { border-top-color: rgba(0,0,0,.18); }
.plan-compare__head,
.plan-row {
  display: grid; grid-template-columns: 1fr 46px 52px; align-items: center;
  gap: 6px; padding: 11px 0;
}
.plan-compare__head { font-weight: 800; font-size: .78rem; opacity: .85; }
.plan-compare__head span:not(:first-child),
.plan-row__free, .plan-row__on { text-align: center; }
.plan-row { border-top: 1px solid rgba(255,255,255,.12); font-size: .84rem; }
.plan--blaze .plan-row { border-top-color: rgba(0,0,0,.1); }
.plan-row__feat { line-height: 1.3; }
.plan-row__free { opacity: .6; }
.plan-row__on i { color: #fff; }
.plan--blaze .plan-row__on i { color: var(--flame-pink); }

/* Botón "Ver todas las funciones" (abre el modal) */
.plan-seeall {
  width: 100%; margin-top: 12px; cursor: pointer;
  background: none; border: none; color: inherit;
  text-align: center; font-weight: 800; font-size: .86rem;
  padding: 12px 0 2px; opacity: .95; transition: opacity .12s;
}
.plan-seeall:hover { opacity: .7; text-decoration: underline; }

/* Página dedicada de planes: en escritorio los planes llenan el ancho
   (se acomodan en filas) en vez de un carrusel horizontal que deja hueco. */
@media (min-width: 561px) {
  .page-planes .plans-scroll { flex-wrap: wrap; overflow-x: visible; justify-content: center; }
  .page-planes .plan-card { flex: 1 1 300px; max-width: 360px; }
}

@media (max-width: 560px) {
  .plan-card { flex-basis: 90%; max-width: 90%; padding: 18px 16px 16px; }
  /* Columnas de candado/check más estrechas para dar aire al texto */
  .plan-compare__head, .plan-row { grid-template-columns: 1fr 34px 38px; }
  .plan-compare__head--free, .plan-row--free { grid-template-columns: 1fr 38px; }
  /* Si el encabezado no cabe, el botón baja en vez de encimarse al badge */
  .plan-head { flex-wrap: wrap; row-gap: 8px; }
}

/* ============================================================
   Modal de suscripciones (detalle + selección de período)
   ============================================================ */
body.plan-modal-open { overflow: hidden; }
.plan-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: stretch; justify-content: stretch; }
.plan-modal[hidden] { display: none; }
.plan-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity .2s; }
.plan-modal.is-open .plan-modal__overlay { opacity: 1; }
/* Móvil: pantalla completa */
.plan-modal__sheet {
  position: relative; width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border-radius: 0; box-shadow: none;
  transform: translateY(100%); transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
.plan-modal.is-open .plan-modal__sheet { transform: translateY(0); }
/* Escritorio: tarjeta centrada */
@media (min-width: 620px) {
  .plan-modal { align-items: center; justify-content: center; padding: 24px; }
  .plan-modal__sheet {
    width: 100%; max-width: 520px; height: auto; max-height: 92vh;
    border-radius: 24px; box-shadow: 0 24px 70px rgba(0,0,0,.5);
    transform: translateY(16px) scale(.98); opacity: 0; transition: transform .24s, opacity .24s;
  }
  .plan-modal.is-open .plan-modal__sheet { transform: none; opacity: 1; }
}

/* Cabecera del modal (fondo neutro, sin color) */
.plan-modal__top {
  position: relative; flex: 0 0 auto; padding: 18px 20px;
  background: var(--surface); color: var(--text); text-align: center;
  padding-top: calc(18px + env(safe-area-inset-top, 0px));
}
@media (min-width: 620px) { .plan-modal__top { border-radius: 24px 24px 0 0; padding-top: 18px; } }
.plan-modal__close {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; width: 36px; height: 36px;
  border: none; border-radius: 50%; cursor: pointer;
  background: var(--bg); color: var(--text); font-size: 1rem;
}
@media (min-width: 620px) { .plan-modal__close { top: 14px; } }
.plan-modal__brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.15rem; letter-spacing: -.02em; }
.plan-modal__brand > i { color: var(--flame-pink); }
.plan-modal__brand .plan-badge { font-size: .62rem; background: var(--bg); color: var(--text); border: 1px solid var(--line); }

/* Cuerpo desplazable */
.plan-modal__body {
  flex: 1 1 auto; overflow-y: auto; padding: 20px; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.plan-modal__body::-webkit-scrollbar { width: 10px; }
.plan-modal__body::-webkit-scrollbar-track { background: transparent; }
.plan-modal__body::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 999px;
  border: 3px solid transparent; background-clip: padding-box;
}
.plan-modal__body::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
.plan-modal__h { margin: 0 0 18px; font-size: 1.35rem; font-weight: 900; line-height: 1.2; letter-spacing: -.01em; }

.pm-section + .pm-section { margin-top: 22px; }
.pm-section__title {
  display: inline-block; margin-bottom: 12px; padding: 5px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: .8rem; font-weight: 700; color: var(--muted);
}
.pm-flist { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.pm-flist li { display: flex; gap: 12px; align-items: flex-start; }
.pm-flist li > i { margin-top: 3px; color: var(--flame-pink); font-size: 1rem; width: 18px; text-align: center; }
.pm-flist strong { display: block; font-size: 1rem; font-weight: 800; }
.pm-flist span { display: block; margin-top: 2px; color: var(--muted); font-size: .88rem; line-height: 1.4; }
/* Función bloqueada (no incluida en este plan): atenuada + candado gris */
.pm-flist li.is-locked { opacity: .5; }
.pm-flist li.is-locked > i { color: var(--muted); }

/* Selección de período */
.pm-plabel { font-weight: 800; font-size: 1rem; margin: 0 0 12px; }
/* Períodos apilados en vertical (a todo el ancho): siempre visibles, sin depender de flex-basis */
.pm-periods { display: block; margin-bottom: 22px; }
.pm-period {
  position: relative; display: block; width: 100%; margin-bottom: 12px;
  cursor: pointer; text-align: left;
  background: var(--bg); border: 2px solid var(--line); border-radius: 16px;
  padding: 16px 52px 16px 16px; color: var(--text);
  transition: border-color .15s;
}
.pm-period:last-child { margin-bottom: 0; }
.pm-period.is-sel { border-color: var(--flame-pink); }
.pm-period__badge { display: block; color: var(--flame-pink); font-weight: 800; font-size: .8rem; margin-bottom: 2px; }
.pm-period__label { display: inline-block; font-size: 1.35rem; font-weight: 900; letter-spacing: -.02em; }
.pm-period__per { display: block; font-size: .95rem; font-weight: 700; margin-top: 6px; }
.pm-period__save { display: inline-block; margin-top: 8px; background: var(--text); color: var(--surface); font-size: .72rem; font-weight: 800; padding: 4px 10px; border-radius: 999px; }
.pm-period__chk { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--flame-pink); opacity: 0; font-size: 1.1rem; }
.pm-period.is-sel .pm-period__chk { opacity: 1; }

.pm-included { border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px 16px; position: relative; }
.pm-included__tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 14px; font-size: .82rem; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.pm-included ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pm-included li { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: .95rem; }
.pm-included li i { color: var(--flame-pink); }

/* Resumen de confirmación */
.pm-summary { border: 2px solid var(--flame-pink); border-radius: 16px; padding: 18px 16px; margin-bottom: 22px; }
.pm-summary__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 1.05rem; font-weight: 800; }
.pm-summary__change { background: none; border: none; cursor: pointer; color: var(--flame-pink); font-weight: 800; font-size: .9rem; padding: 4px; }
.pm-summary__change:hover { text-decoration: underline; }
.pm-summary__period { margin-top: 4px; color: var(--muted); font-weight: 700; }
.pm-summary__total { margin-top: 12px; font-size: 1.9rem; font-weight: 900; letter-spacing: -.02em; }
.pm-summary__per { margin-top: 2px; color: var(--muted); font-size: .92rem; font-weight: 600; }

/* Estado de éxito */
.pm-success { text-align: center; padding: 30px 10px 10px; }
.pm-success__ico { font-size: 4rem; color: var(--flame-pink); line-height: 1; }
.pm-success__title { margin: 18px 0 8px; font-size: 1.5rem; font-weight: 900; }
.pm-success__sub { margin: 0; color: var(--muted); font-size: .98rem; line-height: 1.5; }

/* Pie fijo con términos y CTA */
.plan-modal__foot { flex: 0 0 auto; padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.plan-modal__terms { margin: 0 0 12px; font-size: .74rem; color: var(--muted); line-height: 1.45; }
.plan-modal__cta {
  width: 100%; cursor: pointer; border: none; border-radius: 999px;
  padding: 16px; font-size: 1.05rem; font-weight: 800;
  background: var(--flame-grad); color: #fff;
}
.plan-modal__cta:hover { filter: brightness(.95); }

/* Toast */
.plan-toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px);
  z-index: 300; background: var(--text); color: var(--surface);
  padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: .9rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); opacity: 0; transition: opacity .3s, transform .3s;
  max-width: 88vw; text-align: center;
}
.plan-toast.show { opacity: 1; transform: translate(-50%, 0); }
