/* ============================================================
   frother — design system
   Derivado de: brochures oficiales + análisis de 19 screens Clubhouse
   Doc de referencia: 11-design-system.md
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700;800&display=swap');

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* ── Tipografía ── */
  --font-family: 'Rubik', system-ui, -apple-system, sans-serif;
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   18px;
  --text-xl:   20px;
  --text-2xl:  24px;
  --text-3xl:  30px;
  --text-4xl:  36px;
  --font-light:     300;
  --font-regular:   400;
  --font-medium:    500;
  --font-semibold:  600;
  --font-bold:      700;
  --font-extrabold: 800;
  --leading-tight:   1.2;
  --leading-snug:    1.35;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;

  /* ── Familia Primaria (Púrpura) ── */
  --color-primary-50:  #F5EFF6;
  --color-primary-100: #ECDFEE;
  --color-primary-200: #D9BEDD;
  --color-primary-400: #A362AC;
  --color-primary-600: #771885;
  --color-primary-700: #631A74;
  --color-primary-800: #551C69;
  --color-primary-900: #3A1348;

  --color-primary:        var(--color-primary-600);
  --color-primary-dark:   var(--color-primary-800);
  --color-primary-light:  var(--color-primary-400);
  --color-primary-text:   #FFFFFF;
  --color-primary-bg:     var(--color-primary-50);

  /* ── Familia Acento (Amber/Amarillo) ── */
  --color-accent:         #FBBF24;
  --color-accent-dark:    #D97706;
  --color-accent-text:    #B45309;
  --color-accent-bg:      #FEF3C7;
  --color-accent-on-dark: #FBBF24;

  /* ── Fondos y Superficies ── */
  --color-bg:        #FFFFFF;
  --color-surface:   #F5EFF6;
  --color-surface-2: #ECDFEE;

  /* ── Texto ── */
  --color-text:           #1C1917;
  --color-text-secondary: #6B7280;
  --color-text-muted:     #9CA3AF;
  --color-text-on-primary: #FFFFFF;

  /* ── Bordes y Separadores ── */
  --color-border:   #D9BEDD;
  --color-divider:  #ECDFEE;

  /* ── Estados del sistema ── */
  --color-success: #16A34A;
  --color-error:   #DC2626;
  --color-warning: #D97706;

  /* ── Avatares ── */
  --avatar-1: #D9BEDD;
  --avatar-2: #FDE68A;
  --avatar-3: #FBCFE8;
  --avatar-4: #A7F3D0;
  --avatar-5: #BFDBFE;
  --avatar-6: #FED7AA;
  --avatar-7: #E6CFEA;
  --avatar-8: #D1FAE5;

  /* ── Espaciado ── */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --page-padding-x:   24px;
  --page-padding-top: 20px;
  --card-padding:     16px;
  --list-gap:          8px;
  --section-gap:      32px;

  --bottom-nav-height: 60px;
  --header-height:     52px;
  --input-height:      56px;
  --button-height:     52px;
  --fab-size:          56px;
  --avatar-sm:         36px;
  --avatar-md:         48px;
  --avatar-lg:         72px;
  --avatar-xl:        100px;

  /* ── Border Radius ── */
  --radius-sm:   8px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  24px;
  --radius-pill: 999px;
  --radius-full: 50%;
  /* Squircle estilo Clubhouse: cuadrado de esquinas muy redondeadas (relativo,
     escala proporcional al tamaño). Para avatares, fotos e íconos-tile.
     `corner-shape: superellipse()` lo convierte en una superelipse continua tipo
     iOS (solo Chromium hoy; en iOS Safari/Firefox cae al border-radius redondeado). */
  --radius-squircle: 30%;
  --corner-squircle: superellipse(1.77);

  /* ── Sombras ── */
  --shadow-none:  none;
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-fab:   0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-modal: 0 -2px 16px rgba(0, 0, 0, 0.08);

  /* ── Transiciones ── */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
}

/* ============================================================
   RESET + BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
  /* Elimina el zoom por doble-tap y el delay de 300ms del navegador.
     A diferencia de user-scalable=no, conserva el pinch-zoom (accesibilidad). */
  touch-action: manipulation;
}

#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  background: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ============================================================
   SPLASH LOADER (estado de carga inicial)
   ============================================================ */
.splash-loader {
  position: fixed;
  inset: 0;
  background: var(--color-primary-900);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  z-index: 9999;
  transition: opacity var(--transition-base);
}

.splash-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-loader__logo {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  color: var(--color-primary-text);
  letter-spacing: -1px;
}

.splash-loader__tagline {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: var(--color-accent-on-dark);
  letter-spacing: 0.5px;
}

/* ============================================================
   PANTALLA (contenedor base de cada vista)
   ============================================================ */
.screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--color-bg);
  background-image: url('/assets/img/pattern.png');
  background-repeat: repeat;
  background-size: 320px;
}

.screen--padded {
  padding: var(--page-padding-top) var(--page-padding-x);
}

.screen--with-nav {
  /* espacio para la píldora flotante (alto + offset inferior + safe-area) */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

/* ============================================================
   HEADER DE PANTALLA
   ============================================================ */
.screen-header {
  height: calc(var(--header-height) + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top) var(--page-padding-x) 0;
  background: var(--color-bg);
  flex-shrink: 0;
}

.screen-header__logo {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--color-text);
  letter-spacing: -0.5px;
}

.screen-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.screen-header__back {
  font-size: var(--text-xl);
  color: var(--color-text);
  padding: var(--space-2);
  margin-left: calc(var(--space-2) * -1);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.screen-header--modal {
  justify-content: center;
  position: relative;
}

.screen-header--modal .screen-header__back,
.screen-header--modal .screen-header__close {
  position: absolute;
  left: var(--page-padding-x);
}

/* ============================================================
   INPUT FIELD
   ============================================================ */
.input-field {
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  height: var(--input-height);
  padding: 0 var(--space-6);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--color-text);
  border: none;
  outline: none;
  width: 100%;
  transition: background var(--transition-fast);
}

.input-field::placeholder {
  color: var(--color-text-secondary);
  font-weight: var(--font-regular);
}

.input-field:focus {
  background: var(--color-surface-2);
}

/* ── Input estándar (no pill, para formularios) ── */
.input-field--square {
  border-radius: var(--radius-md);
}

/* ── Textareas: el .input-field es pill + alto fijo; acá lo adaptamos a multilínea ── */
textarea.input-field {
  height: auto;
  min-height: 88px;
  border-radius: var(--radius-md);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  line-height: 1.5;
  resize: vertical;
}

/* ── Select con chevron propio (la flecha nativa queda pegada al borde) ── */
select.input-field {
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--space-10);
  background: var(--color-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right var(--space-5) center / 16px;
}
select.input-field:focus {
  background: var(--color-surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right var(--space-5) center / 16px;
}

/* ── Fila de teléfono internacional (dial + número) ── */
.phone-row {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
  margin-top: var(--space-3);
}
.phone-row .input-field { flex: 1; }
.phone-dial {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 var(--space-4);
  height: var(--input-height);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-weight: var(--font-semibold);
  white-space: nowrap;
}

/* ── Vista pública del perfil (/u/:username) ── */
.uprofile-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  text-align: center;
  padding: 0 var(--page-padding-x);
}
.uprofile-name { font-size: var(--text-xl); font-weight: var(--font-bold); margin-top: var(--space-2); }
.uprofile-uname { font-size: var(--text-sm); color: var(--color-text-secondary); }
.uprofile-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.uprofile-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
}
.uprofile-chip--streak { background: #FEF3C7; color: #92400E; }
.uprofile-bio {
  font-size: var(--text-sm);
  color: var(--color-text);
  max-width: 32ch;
  margin-top: var(--space-2);
  line-height: var(--leading-relaxed);
}

/* ── Avatar editable (perfil) ── */
.avatar-edit {
  position: relative;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  line-height: 0;
}
.avatar-edit.loading { pointer-events: none; }
.avatar-edit.loading::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}
.avatar-edit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  z-index: 2;
}
.avatar-edit__cam {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--color-bg);
  font-size: 16px;
}

.input-field--error {
  background: #FEE2E2;
}

/* ── Search ── */
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .icon {
  position: absolute;
  left: var(--space-4);
  color: var(--color-text-secondary);
  font-size: 18px;
  pointer-events: none;
}

.search-input-wrapper input {
  padding-left: var(--space-10);
}

/* ── OTP dots ── */
.otp-dots {
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  height: var(--input-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 0 var(--space-6);
  cursor: text;
}

.otp-dots__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-text-muted);
  transition: background var(--transition-fast);
}

.otp-dots__dot.filled {
  background: var(--color-text);
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  height: var(--button-height);
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-radius: var(--radius-pill);
  border: none;
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: background var(--transition-fast);
  letter-spacing: 0.1px;
}

.btn-primary:hover {
  background: var(--color-primary-700);
}

.btn-primary:active {
  background: var(--color-primary-dark);
}

.btn-primary:disabled,
.btn-primary.loading {
  background: var(--color-primary-light);
  cursor: not-allowed;
}

.btn-primary--full {
  max-width: 100%;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-4);
  height: 36px;
  background: transparent;
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.btn-secondary:hover {
  background: var(--color-surface);
}

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-primary);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1) 0;
}

/* ============================================================
   ICON BUTTON
   ============================================================ */
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 20px;
  transition: background var(--transition-fast);
}

.icon-btn--primary {
  background: var(--color-primary);
  color: white;
}

.icon-btn--outline {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text);
}

.icon-btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.icon-btn--ghost:hover {
  background: var(--color-surface);
}

/* ============================================================
   FAB
   ============================================================ */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  width: var(--fab-size);
  height: var(--fab-size);
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-fab);
  cursor: pointer;
  z-index: 10;
  font-size: 24px;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.fab:active {
  transform: translateX(-50%) scale(0.95);
}

/* ============================================================
   FLOATING NAVIGATION (v1.3)
   Píldora flotante con FAB central. Reemplaza a .bottom-nav.
   ============================================================ */
.floatnav {
  position: fixed;
  bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 32px rgba(76, 29, 149, 0.14), 0 2px 8px rgba(28, 25, 23, 0.06);
  z-index: 20;
}

.floatnav__item {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: none;
  background: none;
  border-radius: var(--radius-pill);
  color: var(--color-text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.floatnav__item.active {
  background: var(--color-primary-bg);
  color: var(--color-primary-dark);
}

.floatnav__label {
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  white-space: nowrap;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.25s ease, opacity var(--transition-base);
}

.floatnav__item.active .floatnav__label {
  max-width: 96px;
  opacity: 1;
}


/* ============================================================
   FEED CARD
   ============================================================ */
.feed-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.feed-card:active {
  background: var(--color-surface-2);
}

.feed-card__body {
  flex: 1;
  min-width: 0;
}

.feed-card__meta {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

.feed-card__title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
}

.feed-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: var(--leading-snug);
}

.feed-card__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.feed-card__pray-count {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.feed-card__avatars {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
}

/* ── Privacy badge ── */
.badge-privacy {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
}

/* ── Category badge ── */
.badge-category {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

/* ── Streak badge ── */
.badge-streak {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
  display: flex;
  align-items: center;
  gap: 2px;
}

/* ============================================================
   AVATAR
   ============================================================ */
.avatar {
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-bold);
  color: var(--color-text);
  font-size: var(--text-sm);
  overflow: hidden;
}

.avatar--sm  { width: var(--avatar-sm);  height: var(--avatar-sm);  font-size: var(--text-xs); }
.avatar--md  { width: var(--avatar-md);  height: var(--avatar-md);  }
.avatar--lg  { width: var(--avatar-lg);  height: var(--avatar-lg);  font-size: var(--text-xl); }
.avatar--xl  { width: var(--avatar-xl);  height: var(--avatar-xl);  font-size: var(--text-2xl); }

/* ── Avatar cluster (apilados) ── */
.avatar-cluster {
  display: flex;
  flex-direction: row-reverse;
}

.avatar-cluster .avatar {
  width: 32px;
  height: 32px;
  border: 2px solid var(--color-bg);
  margin-left: -8px;
  font-size: 11px;
}

.avatar-cluster .avatar:last-child {
  margin-left: 0;
}

.avatar-cluster__overflow {
  background: var(--color-surface-2);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: var(--font-semibold);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  border: 2px solid var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -8px;
}

/* ============================================================
   LIST ROW
   ============================================================ */
.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.list-row:active {
  background: var(--color-surface-2);
}

.list-row__content {
  flex: 1;
  min-width: 0;
}

.list-row__name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row__meta {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.list-row + .list-row {
  margin-top: var(--space-2);
}

/* ============================================================
   BOTTOM SHEET / MODAL
   ============================================================ */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 90;
  animation: fadeIn var(--transition-fast);
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--color-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-modal);
  padding: var(--space-4) var(--page-padding-x) calc(var(--space-8) + env(safe-area-inset-bottom));
  z-index: 100;
  animation: slideUp var(--transition-base);
}

.bottom-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  margin: 0 auto var(--space-5);
}

/* ============================================================
   TAB SWITCHER
   ============================================================ */
.tab-switcher {
  display: flex;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.tab-switcher__tab {
  flex: 1;
  text-align: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-family);
  transition: all var(--transition-fast);
}

.tab-switcher__tab.active {
  background: var(--color-bg);
  color: var(--color-text);
  font-weight: var(--font-semibold);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   PERMISSION TOGGLE CARD
   ============================================================ */
.permission-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.permission-card__icon {
  font-size: 24px;
  flex-shrink: 0;
}

.permission-card__body {
  flex: 1;
}

.permission-card__title {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin-bottom: 2px;
}

.permission-card__desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--leading-snug);
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--page-padding-x);
  gap: var(--space-4);
  text-align: center;
  flex: 1;
}

.empty-state__illustration {
  font-size: 64px;
  opacity: 0.3;
}

.empty-state__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text-secondary);
  line-height: var(--leading-snug);
}

.empty-state__desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: var(--leading-normal);
}

/* ============================================================
   TOAST / NOTIFICACIÓN IN-APP
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-8));
  max-width: 420px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  box-shadow: var(--shadow-fab);
  pointer-events: auto;
  animation: slideDown var(--transition-base);
}

.toast--success { background: var(--color-success); }
.toast--error   { background: var(--color-error); }
.toast--warning { background: var(--color-warning); }

/* ============================================================
   ONBOARDING LAYOUT
   ============================================================ */
.onboarding-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: 0 var(--page-padding-x);
  background: var(--color-bg);
}

.onboarding-screen--dark {
  background: var(--color-primary-900);
  color: white;
}

.onboarding-screen__back {
  padding-top: max(var(--space-12), env(safe-area-inset-top));
  padding-bottom: var(--space-4);
}

.onboarding-screen__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: var(--space-8);
}

.onboarding-screen__title {
  font-size: var(--text-4xl);
  font-weight: var(--font-extrabold);
  color: var(--color-text);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
  letter-spacing: -0.5px;
}

.onboarding-screen--dark .onboarding-screen__title {
  color: white;
}

.onboarding-screen__helper {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
  line-height: var(--leading-snug);
}

.onboarding-screen__footer {
  padding-bottom: max(var(--space-8), env(safe-area-inset-bottom));
  padding-top: var(--space-6);
}

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--color-divider);
  margin: var(--space-4) 0;
}

/* ============================================================
   SPINNER
   ============================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--color-primary-200);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateX(-50%) translateY(100%); }
  to   { transform: translateX(-50%) translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden   { display: none !important; }
.sr-only  { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-muted  { color: var(--color-text-secondary); }
.flex-1 { flex: 1; }

/* ── Padding safe area para iOS ── */
.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================================
   ONBOARDING SCREENS
   ============================================================ */
.ob-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: calc(var(--page-padding-top) + env(safe-area-inset-top, 0px))
           var(--page-padding-x)
           calc(var(--space-10) + env(safe-area-inset-bottom, 0px));
  background: var(--color-bg);
}

.ob-screen--dark {
  background: var(--color-primary-900);
}

.ob-screen__logo {
  font-size: 3rem;
  font-weight: var(--font-extrabold);
  color: var(--color-primary-text);
  letter-spacing: -1px;
  line-height: 1;
}

.ob-screen__tagline {
  font-size: var(--text-sm);
  color: var(--color-accent-on-dark);
  letter-spacing: 0.5px;
}

.ob-invite-hint {
  margin-top: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full, 999px);
  background: rgba(255, 255, 255, 0.12);
  color: var(--color-primary-text);
  font-size: var(--text-sm);
  line-height: 1.3;
}

.ob-screen__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-5);
}

.ob-screen__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
  line-height: 1.2;
  margin: 0;
}

.ob-screen__helper {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

.ob-screen__error {
  font-size: var(--text-sm);
  color: #DC2626;
  font-weight: var(--font-medium);
  margin-top: var(--space-2);
}

/* Sugerencias tappeables del primer motivo */
.fp-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: calc(-1 * var(--space-2));
}
.fp-chip {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full, 999px);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-family: var(--font-family);
  color: var(--color-text-secondary);
  line-height: 1.3;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.fp-chip:active {
  background: var(--color-primary-50, var(--color-surface-2));
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.ob-screen__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.ob-back {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-family: var(--font-family);
  padding: 0;
  cursor: pointer;
  align-self: flex-start;
  margin-bottom: var(--space-2);
}

/* ── OTP inputs ── */
.otp-inputs {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
}

.otp-input {
  width: 44px;
  height: 56px;
  text-align: center;
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  font-family: var(--font-family);
  color: var(--color-text);
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  outline: none;
  transition: background var(--transition-fast);
  caret-color: transparent;
}

.otp-input:focus {
  background: var(--color-surface-2);
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

/* ── Avatar upload ── */
.avatar-upload {
  width: var(--avatar-xl);
  height: var(--avatar-xl);
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-upload img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload__icon {
  font-size: 2.5rem;
  color: var(--color-text-secondary);
}

/* ============================================================
   FASE 2 — HOME / MOTIVOS
   ============================================================ */
.screen-header h1 {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
}

/* Botón Orar */
.btn-pray {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.btn-pray:active { transform: scale(0.96); }
.btn-pray--done,
.btn-pray:disabled {
  background: var(--color-surface-2);
  color: var(--color-success);
  cursor: default;
}

/* Label de formulario */
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
}

/* Texto de ayuda bajo un label + contador de caracteres */
.field-help {
  margin: calc(var(--space-1) * -1) 0 var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.field-count {
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.field-count__n { flex-shrink: 0; }

/* Feedback inline de auto-guardado, por campo */
.field-save {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}
.field-save:empty { margin-top: 0; }     /* sin estado → no ocupa lugar */
.field-save i { font-size: 0.95rem; }
.field-save--saved { color: var(--color-primary); }
.field-save--error { color: var(--color-error); }
.field-save--saving i { animation: spin 0.7s linear infinite; }

/* En la bio el estado vive dentro de la fila del contador → sin margen extra */
.field-count .field-save { margin-top: 0; flex: 1; justify-content: flex-end; }

/* Hint estático: aclara que no hay botón de guardar */
.autosave-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
}
.autosave-hint i { font-size: 1rem; }

/* Filas de la sección "cuenta" del perfil (teléfono / email) */
.account-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
}
.account-row__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  background: var(--color-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
}
.account-row__body { flex: 1; min-width: 0; }
.account-row__label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.account-row__value {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: var(--font-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sello "verificado" reutilizable (perfil propio + público + filas de cuenta) */
.verified-seal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}
.verified-seal--icon {
  font-size: var(--text-lg);
  color: var(--color-primary);
  vertical-align: middle;
}

/* Control segmentado (privacidad) */
.seg-control {
  display: flex;
  gap: var(--space-2);
}
.seg-control__opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid transparent;
  color: var(--color-text-secondary);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.seg-control__opt.active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: var(--font-semibold);
}

/* Logos de marca */
.splash-loader__brand { width: 160px; height: auto; }
.brand-logo { display: block; height: 26px; width: auto; }

/* ── Grupos ─────────────────────────────────────────────────── */
.group-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
}
.group-card:active { box-shadow: none; }
.group-card__cover {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  object-fit: cover;
  flex-shrink: 0;
}
.group-card__cover--initials {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.group-card__body { flex: 1; min-width: 0; }
.group-card__name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-card__desc {
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin: 0 0 var(--space-2);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.group-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-muted);
}

.group-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: var(--font-medium);
}
.group-type-badge--open {
  background: #d1fae5;
  color: #065f46;
}
.group-type-badge--closed {
  background: #fef3c7;
  color: #92400e;
}

.group-pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  font-weight: var(--font-bold);
}

/* Detalle de grupo */
.group-detail-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  object-fit: cover;
  flex-shrink: 0;
}
.group-detail-cover--initials {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 24px;
  font-weight: var(--font-bold);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Lista de miembros */
.member-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.member-row:last-child { border-bottom: none; }

.group-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--font-bold);
  padding: 1px 6px;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border-radius: 99px;
  vertical-align: middle;
  margin-left: var(--space-1);
}

/* Botones de grupo */
.btn-approve {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
}
.btn-approve:disabled { opacity: .6; cursor: not-allowed; }
.btn-remove {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  background: #fee2e2;
  color: #b91c1c;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.btn-remove:disabled { opacity: .6; cursor: not-allowed; }
.btn-leave {
  display: block;
  width: 100%;
  padding: var(--space-3);
  background: transparent;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}
.btn-group-join {
  display: block;
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  cursor: pointer;
}
.btn-group-join--done { background: #d1fae5; color: #065f46; cursor: not-allowed; }
.btn-group-join--pending { background: var(--color-surface); color: var(--color-muted); border: 1px solid var(--color-border); cursor: not-allowed; }

/* ============================================================
   CUADERNO + ORAR AHORA (v1.3)
   ============================================================ */

/* ── Tags de tipo (estados de oración → tokens frother) ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.tag--prayer   { background: var(--color-primary-bg); color: var(--color-primary-dark); }
.tag--urgent   { background: rgba(220, 38, 38, 0.10); color: #B42318; }
.tag--thanks   { background: var(--color-accent-bg);  color: var(--color-accent-text); }
.tag--answered { background: rgba(217, 119, 6, 0.12); color: var(--color-accent-text); }

/* ── Header del cuaderno ── */
.cuaderno-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: calc(var(--page-padding-top) + env(safe-area-inset-top)) var(--page-padding-x) var(--space-3);
}
.cuaderno-header__eyebrow {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.cuaderno-header__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin-top: 2px;
}

/* ── Stats (tarjetas) ── */
.cuaderno-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding: 0 var(--page-padding-x) var(--space-4);
}
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-2);
  text-align: center;
}
.stat-card__num {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-primary);
  line-height: 1.1;
}
.stat-card__num.t-answered { color: var(--color-accent-text); }
.stat-card__label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* ── Acciones del cuaderno (orar / agregar) ── */
.cuaderno-actions {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--page-padding-x) var(--space-4);
}
.cuaderno-actions__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.cuaderno-actions__btn:active { transform: scale(0.97); }
.cuaderno-actions__btn--primary {
  flex: 1.4;
  background: var(--color-primary);
  color: #fff;
}
.cuaderno-actions__btn--secondary {
  background: var(--color-surface);
  color: var(--color-primary-dark);
}

/* ── Filtros (pills) ── */
.filter-tabs {
  display: flex;
  gap: var(--space-2);
  padding: 0 var(--page-padding-x) var(--space-4);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.ftab {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.ftab.active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

/* ── Tarjeta del cuaderno ── */
.nb-card {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nb-card:active { background: var(--color-surface); }
.nb-card__menu {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 18px;
}
.nb-card__menu:active { background: var(--color-surface); }
.nb-card--answered {
  background: rgba(217, 119, 6, 0.07);
  border-color: rgba(217, 119, 6, 0.22);
}
.nb-card__author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  padding-right: 34px;
}
.nb-card__name {
  flex: 1;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nb-card__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  line-height: var(--leading-snug);
}
.nb-card__preview {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
  line-height: var(--leading-normal);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nb-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.nb-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
}
.nb-chip--group { color: var(--color-primary-dark); background: var(--color-primary-bg); }
.nb-card__prayed {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-primary);
}

/* ════════════════════════════════════════════════════════════
   ORAR AHORA — card inmersiva full-bleed (grilla tipo ref-003)
   ════════════════════════════════════════════════════════════ */
.pray-screen {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background: linear-gradient(160deg, var(--color-primary-900), var(--color-primary-700));
}

/* Overlay superior: segmentos del mazo + back. Scrim oscuro para legibilidad
   sobre cualquier variante de card (púrpura o crema). */
.pray-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 3;
  padding: calc(env(safe-area-inset-top) + var(--space-2)) var(--page-padding-x) var(--space-3);
  background: linear-gradient(to bottom, rgba(0,0,0,0.22), transparent);
  pointer-events: none;
}
.pray-segments {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-2);
}
.pray-seg {
  flex: 1;
  height: 3px;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.30);
  overflow: hidden;
  transition: background var(--transition-base);
}
.pray-seg.cur  { background: rgba(255,255,255,0.55); }
.pray-seg.done { background: #FFFFFF; }
.pray-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pray-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  color: #FFFFFF;
  font-size: 20px;
  pointer-events: auto;
}
.pray-label { font-size: var(--text-sm); font-weight: var(--font-semibold); color: rgba(255,255,255,0.85); }

/* ── Deck + transición vertical ── */
.pray-deck {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  touch-action: pan-y;
}
.pray-card-wrap {
  position: absolute;
  inset: 0;
  transition: transform 0.42s var(--transition-base), opacity 0.3s ease;
  will-change: transform;
}
.pray-card-wrap.above { transform: translateY(-100%); opacity: 0; }
.pray-card-wrap.cur   { transform: translateY(0);      opacity: 1; }
.pray-card-wrap.below { transform: translateY(100%);   opacity: 0; }

/* ── Card full-bleed ── */
.pray-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + var(--space-12)) var(--page-padding-x)
           calc(env(safe-area-inset-bottom) + var(--space-6));
  /* El tema (.motive-theme--<key>) provee --mt-bg / --mt-fg. Fallback = lila. */
  background: var(--mt-bg, linear-gradient(160deg, var(--color-primary-900) 0%, var(--color-primary-700) 55%, var(--color-primary-600) 100%));
  color: var(--mt-fg, #FFFFFF);
}
/* Textura tenue por detrás del texto (la "ilustración con píxeles"). */
.pray-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/assets/img/pattern.png');
  background-size: 320px;
  opacity: 0.06;
  pointer-events: none;
}
.pray-card > * { position: relative; z-index: 1; }

/* Comilla decorativa (top-left) */
.pray-card__quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 120px;
  line-height: 0.7;
  height: 44px;
  color: var(--mt-dim, rgba(255,255,255,0.16));
  user-select: none;
}

/* Encabezado: autor + fecha por encima del motivo, con separador horizontal */
.pray-card__head { margin-top: var(--space-3); }
.pray-card__name { font-size: var(--text-base); font-weight: var(--font-semibold); }
.pray-card__meta { font-size: var(--text-xs); opacity: 0.72; margin-top: 2px; }
.pray-card__sep {
  height: 1px;
  margin-top: var(--space-3);
  background: var(--mt-sep, rgba(255,255,255,0.22));
}

/* Anillo de dwell — fusionado con el hint (abajo), rodea el caret ↑.
   Se llena en DWELL_MS y, al completarse, "habilita" el deslizar. */
.pray-dwell {
  position: relative;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pray-ring {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  transform: rotate(-90deg);   /* arranca desde arriba */
}
.pray-ring__track { fill: none; stroke: var(--mt-track, rgba(255,255,255,0.22)); stroke-width: 3; }
.pray-ring__bar {
  fill: none;
  stroke: var(--mt-ring, var(--color-accent));
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 113.097;
  stroke-dashoffset: 113.097;
}

/* Cuerpo: motivo + "X frothers" como bloque, centrado vertical; scrollea si es largo */
.pray-card__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

/* Texto del motivo: grande, left-aligned, tamaño y peso adaptativos al largo */
.pray-card__text {
  font-weight: var(--font-semibold);
  letter-spacing: -0.01em;
  line-height: 1.16;
}
/* Corto y medio comparten un tamaño parejo; solo el texto largo se achica. */
.pray-card__text--xl,
.pray-card__text--lg { font-size: clamp(1.5rem, 5.8vw, 1.85rem); }
.pray-card__text--md { font-size: clamp(1.3rem, 5vw, 1.6rem); line-height: 1.3; font-weight: var(--font-medium); }
.pray-card__text--sm { font-size: clamp(1.1rem, 4.4vw, 1.35rem); line-height: 1.5; font-weight: var(--font-medium); }

/* Prueba social: cuántos ya oraron, justo debajo del motivo (sutil) */
/* Media línea entre el motivo y el "X frothers" (respiro antes del dato comunitario) */
.pray-card__tick {
  flex-shrink: 0;
  width: 36px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--mt-sep, rgba(255,255,255,0.30));
  margin-top: var(--space-4);
}
.pray-card__joined {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  opacity: 0.78;
  margin-top: var(--space-3);
}
/* 25px y elevado: el cuerpo (carita) se alinea al texto y la corona asoma por encima. */
.pray-card__iso { width: 25px; height: 25px; display: block; flex-shrink: 0; transform: translateY(-2px); }

/* Pie: solo el hint de deslizar (anillo de dwell + ↑), centrado abajo */
.pray-card__foot {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pray-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  opacity: 0.65;
  transition: opacity var(--transition-base);
}
.pray-hint i { position: relative; font-size: 20px; }
.pray-card-wrap.cur.ready .pray-hint { opacity: 1; }
.pray-card-wrap.cur.ready .pray-hint i { animation: pray-bob 1.2s ease-in-out infinite; }
@keyframes pray-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}

/* ── Cierre de sesión (sobre el gradiente púrpura) ── */
.pray-done {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  color: #FFFFFF;
}
.pray-done__icon { font-size: 56px; }
.pray-done__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: #FFFFFF;
  margin-top: var(--space-3);
}
.pray-done__sub { font-size: var(--text-base); color: rgba(255,255,255,0.85); margin-top: var(--space-2); }

/* ============================================================
   TESTIMONIOS + STORIES (v1.3)
   ============================================================ */

.t-accent { color: var(--color-accent-text); }

/* ── Card del feed de testimonios (cálido, antes verde) ── */
.t-card {
  background: rgba(217, 119, 6, 0.07);
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.t-card:active { transform: scale(0.985); }
.t-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.t-card__who { flex: 1; min-width: 0; }
.t-card__name { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--color-text); }
.t-card__time { font-size: var(--text-xs); color: var(--color-accent-text); }
.t-card__icon { color: var(--color-accent-dark); font-size: 18px; }
.t-card__body {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  font-style: italic;
}
.t-card__meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-2); }
.t-card__meta strong { color: var(--color-text-secondary); }

/* ── Vista de testimonio (hero cremita + texto oscuro, antes verde) ── */
.t-hero {
  background: linear-gradient(160deg, #FFF6E6 0%, #FCE9C9 100%);
  color: var(--color-primary-900);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}
.t-hero__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.t-hero__name { font-size: var(--text-base); font-weight: var(--font-semibold); }
.t-hero__sub { font-size: var(--text-xs); color: rgba(58, 19, 72, 0.6); margin-top: 1px; }
.t-hero__body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  font-style: italic;
  padding: var(--space-3) 0;
  border-top: 1px solid rgba(58, 19, 72, 0.15);
  border-bottom: 1px solid rgba(58, 19, 72, 0.15);
}
.t-hero__foot { font-size: var(--text-xs); color: rgba(58, 19, 72, 0.6); margin-top: var(--space-3); }
.t-hero__foot strong { color: var(--color-primary-900); }

.react-row { display: flex; gap: var(--space-2); margin-top: var(--space-4); }
.react-btn {
  flex: 1;
  border: none;
  border-radius: var(--radius-pill);
  padding: 13px;
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform var(--transition-fast);
}
.react-btn:active { transform: scale(0.97); }
.react-amen { background: rgba(217, 119, 6, 0.12); color: var(--color-accent-text); }
.react-amen--done { background: var(--color-accent-dark); color: #fff; cursor: default; }

/* ── Form marcar respondida ── */
.answer-original {
  background: rgba(217, 119, 6, 0.08);
  border-left: 3px solid var(--color-accent-dark);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-3) var(--space-4);
  margin-top: var(--space-3);
}
.answer-original__label {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent-text);
  margin-bottom: 2px;
}
.answer-original__title { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--color-text); }

/* ── Stories row ── */
.stories-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-2) var(--page-padding-x);
  overflow-x: auto;
  scrollbar-width: none;
}
.stories-row::-webkit-scrollbar { display: none; }
.story {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  width: 64px;
}
.story-ring {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  padding: 2.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}
.story:active .story-ring { transform: scale(0.92); }
.story-flag {
  position: absolute;
  bottom: -1px;
  right: -1px;
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.story-ring--prayer    { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-400)); }
/* Testimonio = cálido (dorado), antes verde. El cremita es relleno, no acento. */
.story-ring--testimony { background: linear-gradient(135deg, var(--color-accent), #FCD34D); }
.story-ring--add {
  background: var(--color-surface);
  border: 2px dashed var(--color-text-muted);
  color: var(--color-text-muted);
  font-size: 22px;
}
.story-ring .avatar {
  width: 100%;
  height: 100%;
  border: 2.5px solid var(--color-bg);
  font-size: var(--text-base);
}
.story-name {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-name--me { color: var(--color-primary); font-weight: var(--font-semibold); }

/* ── Story overlay (full-screen) ── */
.story-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s var(--transition-base);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.story-overlay.open { transform: translateY(0); pointer-events: auto; }
.story-overlay__bg { position: absolute; inset: 0; z-index: -1; }
/* Mismos fondos que la card "orar ahora": oración púrpura, testimonio cremita. */
.story-overlay__bg--prayer    { background: linear-gradient(160deg, var(--color-primary-900) 0%, var(--color-primary-700) 55%, var(--color-primary-600) 100%); }
.story-overlay__bg--testimony { background: linear-gradient(160deg, #FFF6E6 0%, #FCE9C9 100%); }
.story-overlay__progress {
  display: flex;
  gap: 3px;
  margin: calc(14px + env(safe-area-inset-top)) var(--space-4) 0;
}
.story-seg {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.30);
  overflow: hidden;
}
.story-seg__fill {
  display: block;
  height: 100%;
  width: 0;
  background: rgba(255, 255, 255, 0.95);
}
.story-overlay__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: #fff;
}
.story-overlay__name { font-size: var(--text-sm); font-weight: var(--font-semibold); }
.story-overlay__time { font-size: var(--text-xs); color: rgba(255, 255, 255, 0.6); }
.story-overlay__close,
.story-overlay__more {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}
.story-overlay__more { margin-left: auto; }
.story-overlay__content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-6) var(--space-6);
  color: #fff;
}
/* Comilla decorativa (igual que la card "orar ahora") */
.story-overlay__quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 120px;
  line-height: 0.7;
  height: 44px;
  color: rgba(255, 255, 255, 0.16);
  user-select: none;
}
.story-overlay__type {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  margin: var(--space-3) 0 var(--space-4);
}
/* Texto del motivo/testimonio: grande, peso y tamaño adaptativos al largo */
.story-overlay__text {
  font-weight: var(--font-semibold);
  letter-spacing: -0.01em;
  line-height: 1.18;
}
/* Corto y medio comparten un tamaño parejo; solo el texto largo se achica. */
.story-overlay__text--xl,
.story-overlay__text--lg { font-size: clamp(1.5rem, 5.8vw, 1.85rem); }
.story-overlay__text--md { font-size: clamp(1.3rem, 5vw, 1.6rem); line-height: 1.3; font-weight: var(--font-medium); }
.story-overlay__text--sm { font-size: clamp(1.1rem, 4.4vw, 1.35rem); line-height: 1.5; font-weight: var(--font-medium); }

/* ── Variante testimonio: fondo cremita → texto oscuro ── */
.story-overlay--testimony .story-overlay__head,
.story-overlay--testimony .story-overlay__content { color: var(--color-primary-900); }
.story-overlay--testimony .story-overlay__time { color: rgba(58, 19, 72, 0.6); }
.story-overlay--testimony .story-overlay__type { color: rgba(58, 19, 72, 0.5); }
.story-overlay--testimony .story-overlay__quote { color: rgba(58, 19, 72, 0.12); }
.story-overlay--testimony .story-overlay__close,
.story-overlay--testimony .story-overlay__more { background: rgba(58, 19, 72, 0.10); color: var(--color-primary-900); }
.story-overlay--testimony .story-seg { background: rgba(58, 19, 72, 0.18); }
.story-overlay--testimony .story-seg__fill { background: rgba(58, 19, 72, 0.60); }
.story-overlay__foot {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-4) var(--space-4);
  padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
}

/* Input "responder…" — enviar mensaje sin salir de la story (estilo IG) */
.story-reply { flex: 1; min-width: 0; position: relative; display: flex; }
.story-reply__input {
  width: 100%;
  height: 46px;
  padding: 0 48px 0 var(--space-4);   /* espacio a la derecha para el botón enviar */
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-family: var(--font-family);
  font-size: var(--text-base);
  outline: none;
}
.story-reply__input::placeholder { color: rgba(255, 255, 255, 0.7); }
/* Botón enviar, dentro de la caja al extremo derecho; aparece al escribir */
.story-reply__send {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 18px;
}
.story-reply.has-text .story-reply__send { display: inline-flex; }
.story-overlay--prayer    .story-reply__send { background: #fff; color: var(--color-primary); }
.story-overlay--testimony .story-reply__send { background: var(--color-primary); color: #fff; }

/* Acción rápida por tipo (bookmark / amén), adaptada por variante */
.story-action {
  flex-shrink: 0;
  height: 46px;
  min-width: 46px;
  padding: 0 var(--space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-family);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.story-action:active { transform: scale(0.96); }
.story-action i { font-size: 22px; }
/* oración: bookmark blanco translúcido, lleno al guardar */
.story-overlay--prayer .story-action--save {
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  color: #fff;
}
/* Guardado: solo el ícono pasa a dorado; el fondo lila se mantiene. */
.story-overlay--prayer .story-action--save.is-done { color: var(--color-accent); }
/* testimonio: amén púrpura sobre cremita + input oscuro */
.story-overlay--testimony .story-action--amen { background: var(--color-primary); color: #fff; }
.story-overlay--testimony .story-reply__input {
  border-color: rgba(58, 19, 72, 0.25);
  background: rgba(58, 19, 72, 0.06);
  color: var(--color-primary-900);
}
.story-overlay--testimony .story-reply__input::placeholder { color: rgba(58, 19, 72, 0.5); }

/* Eyebrow "paso N de 3" del onboarding (v1.3) */
.ob-step {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

/* ============================================================
   POLISH — banner de conexión + skeletons (R4)
   ============================================================ */
.offline-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: calc(6px + env(safe-area-inset-top)) var(--space-4) 6px;
  background: var(--color-accent-bg);
  color: var(--color-accent-text);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}
.offline-banner[hidden] { display: none; }

/* Skeletons */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-surface) 25%, var(--color-surface-2) 50%, var(--color-surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.3s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-list { display: flex; flex-direction: column; gap: var(--list-gap); }
.skeleton-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.skeleton-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); }
.skeleton-avatar { width: 32px; height: 32px; border-radius: var(--radius-squircle); corner-shape: var(--corner-squircle); flex-shrink: 0; }
.skeleton-line { height: 12px; width: 100%; }
.skeleton-line--title { height: 15px; width: 55%; }
.skeleton-line--sm { width: 35%; }

/* Selector de idioma (splash) */
.ob-lang { display: flex; gap: var(--space-1); align-self: flex-end; }
.ob-lang__btn {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-family: var(--font-family);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  cursor: pointer;
}
.ob-lang__btn.active { background: #fff; color: var(--color-primary); }

/* ============================================================
   VERSE HERO — versículo del día
   ============================================================ */
.verse-hero {
  background: linear-gradient(155deg, var(--color-primary-900) 0%, var(--color-primary-700) 65%, var(--color-primary-600) 100%);
  padding: calc(var(--page-padding-top) + env(safe-area-inset-top, 0px)) var(--page-padding-x) 0;
  display: flex;
  flex-direction: column;
  align-items: center;   /* solo el logo queda centrado */
  gap: var(--space-5);
  min-height: clamp(185px, 44vw, 240px);
}

.verse-hero__topbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.verse-hero__logo {
  display: block;
  height: 30px;
  width: auto;
}

.verse-hero__avatar-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.verse-hero__avatar-btn .avatar {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.verse-hero__avatar-ghost {
  width: var(--avatar-sm);
  height: var(--avatar-sm);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* bloque de texto — 70% del ancho, anclado a la izquierda */
.verse-hero__content {
  width: 70%;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: left;
}

.verse-hero__date {
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: rgba(255, 255, 255, 0.55);
  text-transform: capitalize;
  letter-spacing: 0.3px;
}

/* titular grande — primeras palabras del versículo */
.verse-hero__headline {
  font-size: var(--text-2xl);
  font-weight: var(--font-medium);
  color: #fff;
  line-height: 1.2;
  margin: 0;
}

/* texto completo debajo — más pequeño */
.verse-hero__text {
  font-size: var(--text-sm);
  font-weight: var(--font-regular);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.55;
}

.verse-hero__ref {
  font-size: var(--text-xs);
  font-weight: var(--font-regular);
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.4px;
}

/* onda SVG — cúpula (∩): el morado baja en el centro */
.verse-hero__wave {
  display: block;
  width: 100%;
  height: 52px;
  flex-shrink: 0;
  margin-top: auto;
}

/* skeleton mientras carga */
.verse-hero--loading .verse-hero__headline {
  width: 70%;
  height: 28px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s ease-in-out infinite;
}

.verse-hero--loading .verse-hero__text {
  width: 90%;
  height: 48px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ============================================================
   HOME SECTIONS — secciones contextuales
   ============================================================ */
.home-section {
  padding: var(--space-6) 0 0;
}

.home-section__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 0 var(--page-padding-x) var(--space-3);
}

.home-section__title--group {
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.home-section__feed {
  display: flex;
  flex-direction: column;
  gap: var(--list-gap);
  padding: 0 var(--page-padding-x) var(--space-4);
}

/* ============================================================
   PARA VOS HOY — cards horizontales
   ============================================================ */
.for-you-row {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  padding: 0 var(--page-padding-x) var(--space-2);
  scrollbar-width: none;
}

.for-you-row::-webkit-scrollbar { display: none; }

.foryou-card {
  flex-shrink: 0;
  width: 180px;
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  cursor: pointer;
}

.foryou-card--dark {
  background: linear-gradient(145deg, var(--color-primary-900), var(--color-primary-700));
  color: #fff;
}

.foryou-card--light {
  background: var(--color-surface);
  color: var(--color-text);
}

.foryou-card__label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.foryou-card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  line-height: 1.2;
}

.foryou-card__sub {
  font-size: var(--text-xs);
  opacity: 0.7;
}

.foryou-card__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-family: var(--font-family);
  margin-top: auto;
}

/* ============================================================
   SOCIAL — amigos + mensajería 1:1
   ============================================================ */

/* Disparador al perfil público (avatar + nombre clickeable) */
.user-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  min-width: 0;
}
.user-link:active { opacity: 0.6; }

/* Badge de no-leídos sobre la pestaña mensajes del floatnav */
.floatnav__item { position: relative; }
.floatnav__badge {
  position: absolute;
  top: -2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--font-bold);
  line-height: 1;
  color: #fff;
  background: var(--color-error);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.94);
}

/* `display:flex` pisa al atributo [hidden] del navegador: lo restauramos
   explícitamente para que hidden=true realmente oculte el badge. */
.floatnav__badge[hidden] { display: none; }

/* Variante punto (sin número) — pestaña Grupos con grupo recién unido. */
.floatnav__badge--dot {
  min-width: 10px;
  width: 10px;
  height: 10px;
  padding: 0;
  top: 0;
  right: 6px;
  background: var(--color-primary);
}

/* ── Bandejas (mensajes + campanita) en el header del Home ── */
.hero-inbox {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
/* Spacer izquierdo invisible: mantiene el logo centrado frente al cluster real. */
.hero-inbox--ghost { visibility: hidden; pointer-events: none; }
.hero-inbox__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hero-inbox__btn .ph { font-size: 24px; }
.hero-inbox__btn:active { opacity: 0.6; }
.hero-inbox__badge {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--font-bold);
  line-height: 1;
  color: #fff;
  background: var(--color-error);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 2px var(--color-primary-900);
}
.hero-inbox__badge[hidden] { display: none; }
/* Variante punto (sin número) — campanita con no-leídas. Dorado para contrastar
   sobre el hero morado. */
.hero-inbox__badge--dot {
  min-width: 9px;
  width: 9px;
  height: 9px;
  padding: 0;
  top: 6px;
  right: 6px;
  background: var(--color-accent);
}

/* ── Filas del centro de notificaciones (campanita) ── */
.notif-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-primary-50);
  cursor: pointer;
}
.notif-row--unread { background: var(--color-primary-50); }
.notif-row__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--avatar-md, 44px);
  height: var(--avatar-md, 44px);
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  background: var(--color-primary-100);
  color: var(--color-primary);
  flex: 0 0 auto;
}
.notif-row__icon .ph { font-size: 22px; }
.notif-row__body { flex: 1 1 auto; min-width: 0; }
.notif-row__text { display: block; color: var(--color-text, #1a1a1a); line-height: 1.35; }
.notif-row__time { display: block; margin-top: 2px; font-size: 12px; color: var(--color-text-muted, #888); }
.notif-row__actions { display: flex; align-items: center; gap: var(--space-2); flex: 0 0 auto; }
.notif-row__resolved { font-size: 13px; color: var(--color-text-muted, #888); }

/* ── Moderación de motivos en grupos (chip + acciones del líder) ── */
.motive-mod__chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--color-accent-text, #B45309);
  background: var(--color-accent-bg, #FEF3C7);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  margin-bottom: var(--space-2);
}
.motive-mod__chip--rejected {
  color: var(--color-error);
  background: #FEE2E2;
}
.motive-mod__actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ── Pantalla de bienvenida por invitación ── */
.invite-screen {
  justify-content: flex-start;
  text-align: center;
}

/* Logo frother, espaciado por encima de la foto del invitador. */
.invite-logo {
  height: 26px;
  width: auto;
  opacity: 0.95;
  margin-bottom: var(--space-4);
}

/* Cuerpo centrado: el conjunto (logo + avatar + textos + card + botón) se
   agrupa, así el botón queda cerca del contenido y no anclado al fondo. */
.invite-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  width: 100%;
}

.invite-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-primary-text);
  line-height: 1.2;
  max-width: 18ch;
}

.invite-inviter-sub {
  font-size: var(--text-sm);
  color: var(--color-accent-on-dark);
}

/* Card del grupo destacada (fondo translúcido sobre el morado) */
.invite-group-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.10);
}

.invite-group__name {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-primary-text);
}

.invite-group__members {
  font-size: var(--text-sm);
  color: var(--color-accent-on-dark);
}

.invite-group__desc {
  font-size: var(--text-sm);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.invite-actions {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.invite-avatar {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: 2rem;
  color: var(--color-primary-text);
}

.invite-avatar--loading {
  animation: invite-pulse 1.4s ease-in-out infinite;
}

@keyframes invite-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 0.8; }
}

.invite-loading {
  font-size: var(--text-sm);
  color: var(--color-accent-on-dark);
}

.invite-link {
  background: none;
  border: none;
  color: var(--color-primary-text);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-decoration: underline;
  cursor: pointer;
  padding: var(--space-2);
}

.invite-browser-hint {
  margin-top: var(--space-4);
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--color-accent-on-dark);
  text-align: left;
}
.invite-browser-hint i { flex-shrink: 0; font-size: 1rem; }

/* ── Banner "te uniste a un grupo" en el home ── */
.joined-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: calc(100% - 2 * var(--page-padding-x));
  margin: var(--space-3) var(--page-padding-x) 0;
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: var(--radius-lg);
  background: var(--color-primary-50, rgba(119, 24, 133, 0.08));
  box-shadow: inset 0 0 0 1px var(--color-primary);
  cursor: pointer;
  text-align: left;
}

.joined-banner__icon {
  display: flex;
  font-size: var(--text-xl);
  color: var(--color-primary);
}

.joined-banner__text {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
}

.joined-banner__arrow {
  color: var(--color-primary);
}

/* ── Pre-prompt de notificaciones en el home ── */
.push-offer {
  display: flex;
  gap: var(--space-3);
  width: calc(100% - 2 * var(--page-padding-x));
  margin: var(--space-3) var(--page-padding-x) 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-primary-50, rgba(119, 24, 133, 0.08));
  box-shadow: inset 0 0 0 1px var(--color-primary);
}
.push-offer__icon {
  display: flex;
  font-size: var(--text-xl);
  color: var(--color-primary);
  flex-shrink: 0;
}
.push-offer__body { flex: 1; }
.push-offer__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-1);
}
.push-offer__text {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-3);
}
.push-offer__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.push-offer__cta {
  height: 36px;
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  max-width: max-content;
}
.push-offer__dismiss {
  background: none;
  border: none;
  font-family: var(--font-family);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  padding: var(--space-2);
}

/* ── Empty-state que enseña (secciones vacías del home) ── */
.empty-teach {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4);
}
.empty-teach__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-squircle);
  corner-shape: var(--corner-squircle);
  background: var(--color-primary-50, rgba(119, 24, 133, 0.08));
  color: var(--color-primary);
  font-size: 1.75rem;
  margin-bottom: var(--space-1);
}
.empty-teach__title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0;
}
.empty-teach__text {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
  max-width: 280px;
}
.empty-teach__cta {
  margin-top: var(--space-3);
  max-width: max-content;
  padding: 0 var(--space-5);
}

/* ── Checklist de primeros pasos (home) ── */
.checklist {
  width: calc(100% - 2 * var(--page-padding-x));
  margin: var(--space-3) var(--page-padding-x) 0;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-divider);
}
.checklist__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.checklist__title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0;
}
.checklist__progress {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 2px 0 0;
}
.checklist__close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: var(--text-lg);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.checklist__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
}
.checklist__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  cursor: pointer;
}
.checklist__item[data-route]:active { opacity: .6; }
.checklist__check {
  display: flex;
  font-size: var(--text-xl);
  color: var(--color-text-muted);
}
.checklist__item--done {
  cursor: default;
}
.checklist__item--done .checklist__check { color: var(--color-primary); }
.checklist__item--done .checklist__label {
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.checklist__label {
  flex: 1;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.checklist__go { color: var(--color-text-muted); }

/* ── Card de grupo recién unido ── */
.group-card--new {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.group-new-chip {
  flex-shrink: 0;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
}

/* ── Lista de conversaciones ── */
.conv-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-1);
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-family);
}
.conv-row__body { flex: 1; min-width: 0; }
.conv-row__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}
.conv-row__name {
  font-weight: var(--font-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-row__time { font-size: var(--text-xs); color: var(--color-text-muted); flex-shrink: 0; }
.conv-row__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  margin-top: 2px;
}
.conv-row__preview {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.conv-row__preview.is-unread { color: var(--color-text); font-weight: var(--font-medium); }
.conv-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-pill);
}

/* ── Pantalla de chat ── */
.chat-screen {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}
.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.chat-header__user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-family);
}
.chat-header__name { font-weight: var(--font-semibold); color: var(--color-text); font-size: var(--text-base); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--page-padding-x);
}
.chat-bubble {
  max-width: 78%;
  align-self: flex-start;
  background: var(--color-surface);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}
.chat-bubble--mine {
  align-self: flex-end;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-sm);
}
.chat-bubble__text { font-size: var(--text-base); line-height: var(--leading-snug); word-wrap: break-word; white-space: pre-wrap; }
.chat-bubble__time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 2px;
  align-self: flex-end;
}
.chat-motive {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255,255,255,0.18);
  border: 1px solid currentColor;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  font-family: var(--font-family);
  text-align: left;
  color: inherit;
}
.chat-bubble:not(.chat-bubble--mine) .chat-motive { background: var(--color-bg); border-color: var(--color-border); }
.chat-motive__label { font-size: var(--text-xs); opacity: 0.8; }
.chat-motive__title { font-weight: var(--font-semibold); font-size: var(--text-sm); }

/* Snippet citado de la story a la que se responde (arriba del texto) */
.chat-quote {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 3px solid currentColor;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  margin-bottom: var(--space-1);
}
.chat-bubble:not(.chat-bubble--mine) .chat-quote { background: rgba(0, 0, 0, 0.05); }
.chat-quote__type { font-size: 10px; font-weight: var(--font-semibold); text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.75; }
.chat-quote__snippet {
  font-size: var(--text-xs);
  font-style: italic;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-composer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
}
.chat-input {
  flex: 1;
  height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-family: var(--font-family);
  font-size: var(--text-base);
  background: var(--color-surface);
  color: var(--color-text);
}
.chat-input:focus { outline: none; border-color: var(--color-primary); }
.chat-send {
  flex-shrink: 0;
  background: var(--color-primary);
  color: #fff;
}

/* ── Filas de amigos / solicitudes ── */
.friend-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-1);
  background: none;
  border-bottom: 1px solid var(--color-divider);
  cursor: pointer;
}
.friend-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.friend-row__name {
  font-weight: var(--font-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-row__sub { font-size: var(--text-sm); color: var(--color-text-secondary); }
.friend-row__actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.friend-accept { background: var(--color-primary); color: #fff; }
.btn-secondary--sm { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); flex-shrink: 0; }
.btn-secondary--sm.is-sent {
  color: var(--color-text-muted);
  border-color: var(--color-divider);
  pointer-events: none;
}

/* Chip "por qué te lo sugerimos" en descubrir amigos */
.discover-reason {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--color-primary);
}
.discover-reason i { font-size: 0.9rem; }

/* ── Bottom-sheet (elegir motivo a compartir) ── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;   /* por encima de la story inmersiva (500) y el banner offline (600) */
  background: rgba(28, 25, 23, 0.45);
  display: flex;
  align-items: flex-end;
  animation: sheet-fade 0.2s ease;
}
.sheet {
  width: 100%;
  max-height: 70dvh;
  background: var(--color-bg);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  padding: var(--space-3) var(--page-padding-x) calc(var(--space-6) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.25s ease;
}
.sheet__handle {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  margin: 0 auto var(--space-3);
}
.sheet__title { font-size: var(--text-lg); font-weight: var(--font-semibold); margin-bottom: var(--space-3); }
.sheet__subtitle { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.4; margin: calc(var(--space-2) * -1) 0 var(--space-3); }
.sheet__body { overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-1); }
.sheet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-family);
  text-align: left;
  color: var(--color-text);
}
.sheet-item__title { font-weight: var(--font-medium); }
.sheet-item--danger { color: var(--color-error); }
.sheet-item--danger .sheet-item__title { color: var(--color-error); }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ── Menú flotante anclado (popover) — datos y estética del motivo (v1.4) ── */
.popover-overlay {
  position: fixed;
  inset: 0;
  z-index: 710;   /* sobre el sheet (700) por si conviven */
  background: transparent;
}
.popover {
  position: fixed;
  min-width: 200px;
  max-width: min(86vw, 320px);
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: var(--space-2);
  animation: popover-in 0.14s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;   /* el alto máximo lo fija JS; el cuerpo scrollea */
}
@keyframes popover-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }
.popover__title {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-2) var(--space-2) var(--space-1);
}
.popover__body { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.popover__swatches { overflow-y: auto; }
.popover-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: none;
  background: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-family);
  text-align: left;
  color: var(--color-text);
}
.popover-item:active { background: var(--color-surface); }
.popover-item__icon { font-size: 1.25rem; color: var(--color-text-secondary); }
.popover-item__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.popover-item__label { font-weight: var(--font-medium); }
.popover-item__sub { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 1px; }
.popover-item__check { color: var(--color-primary); }
.popover-item.active .popover-item__label,
.popover-item.active .popover-item__icon { color: var(--color-primary); }
.popover-item--danger .popover-item__label { color: var(--color-error); }
.popover__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-2);
  max-width: 264px;
}
.popover-swatch {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-squircle);
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.popover-swatch.active { border-color: var(--color-primary); }

/* ── Lienzo de composición del motivo (v1.4) — limpio, pintado por el tema ── */
.compose {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--mt-bg);
  color: var(--mt-fg);
  transition: background 0.3s ease, color 0.3s ease;
}
.compose__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: calc(env(safe-area-inset-top) + var(--space-3)) var(--page-padding-x) var(--space-2);
}
.compose__actions { display: flex; align-items: center; gap: var(--space-1); }
.compose .icon-btn--ghost { color: var(--mt-fg); background: transparent; }
.compose__save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  background: var(--mt-ring);
  color: #fff;
  font-size: 1.3rem;
}
.compose__save:disabled { opacity: 0.5; }
/* Contenedor del lienzo: título (1ª línea) + descripción (modelo Notes). */
.compose__canvas {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--space-3) var(--page-padding-x) calc(var(--space-12) + 60px);
  overflow: hidden;
}
.compose__title,
.compose__desc {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-family);
  color: var(--mt-fg);
  caret-color: var(--mt-ring);
}
.compose__title {
  flex-shrink: 0;
  resize: none;
  overflow: hidden;   /* el alto lo ajusta JS según el contenido (envuelve y crece) */
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: var(--font-bold);
  line-height: 1.2;
  margin-bottom: var(--space-2);
}
.compose__desc {
  flex: 1;
  min-height: 96px;
  resize: none;
  font-size: clamp(1.05rem, 4.4vw, 1.25rem);
  font-weight: var(--font-regular);
  line-height: 1.5;
}
.compose__title::placeholder,
.compose__desc::placeholder { color: var(--mt-fg); opacity: 0.45; }

/* Barra flotante de datos (estilo IMG_1014) — anclada al layout, NO al teclado.
   Se oculta al escribir para no pelear con el teclado (sin trackear el viewport). */
.compose__bar {
  position: fixed;
  left: 50%;
  /* --kb-inset = alto del teclado (medido por visualViewport); 0 si está cerrado.
     Así la barra flota por encima del teclado sin relayoutear nada más. */
  bottom: calc(env(safe-area-inset-bottom) + var(--space-4) + var(--kb-inset, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--color-bg);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-modal);
  z-index: 50;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.compose--typing .compose__bar {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(24px);
}
.compose__bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-pill);
  color: var(--color-text-secondary);
  font-size: 1.4rem;
}
.compose__bar-btn.active { color: var(--color-primary); background: var(--color-primary-50); }

/* ── Temas estéticos del motivo (v1.4) ──
   Variables consumidas por: .compose, .pray-card (full bleed) y .nb-card (tinte suave). */
.motive-theme--lila {
  --mt-bg: linear-gradient(160deg, #3A1348 0%, #631A74 55%, #771885 100%);
  --mt-fg: #FFFFFF;
  --mt-soft: #F1E7F4; --mt-spine: #771885;
  --mt-dim: rgba(255,255,255,0.16); --mt-sep: rgba(255,255,255,0.22);
  --mt-track: rgba(255,255,255,0.22); --mt-ring: var(--color-accent);
}
.motive-theme--cremita {
  --mt-bg: linear-gradient(160deg, #FFF6E6 0%, #FCE9C9 100%);
  --mt-fg: var(--color-primary-900);
  --mt-soft: #FEF6E2; --mt-spine: #E0A82E;
  --mt-dim: rgba(58,19,72,0.12); --mt-sep: rgba(58,19,72,0.16);
  --mt-track: rgba(58,19,72,0.16); --mt-ring: var(--color-primary);
}
.motive-theme--cielo {
  --mt-bg: linear-gradient(160deg, #E6F0FC 0%, #CFE2F7 100%);
  --mt-fg: #10314F;
  --mt-soft: #EEF5FD; --mt-spine: #3E78B8;
  --mt-dim: rgba(16,49,79,0.12); --mt-sep: rgba(16,49,79,0.16);
  --mt-track: rgba(16,49,79,0.14); --mt-ring: #3E78B8;
}
.motive-theme--durazno {
  --mt-bg: linear-gradient(160deg, #FCEAE0 0%, #F8D9C7 100%);
  --mt-fg: #5A2A18;
  --mt-soft: #FCF0E9; --mt-spine: #D9824E;
  --mt-dim: rgba(90,42,24,0.12); --mt-sep: rgba(90,42,24,0.16);
  --mt-track: rgba(90,42,24,0.14); --mt-ring: #D9824E;
}
.motive-theme--rosa {
  --mt-bg: linear-gradient(160deg, #FBE7EE 0%, #F6D4E0 100%);
  --mt-fg: #5A1E38;
  --mt-soft: #FCEFF4; --mt-spine: #C65C86;
  --mt-dim: rgba(90,30,56,0.12); --mt-sep: rgba(90,30,56,0.16);
  --mt-track: rgba(90,30,56,0.14); --mt-ring: #C65C86;
}
.motive-theme--arena {
  --mt-bg: linear-gradient(160deg, #F4EEE4 0%, #E9DEC9 100%);
  --mt-fg: #4A3F2C;
  --mt-soft: #F7F2E9; --mt-spine: #A8895A;
  --mt-dim: rgba(74,63,44,0.12); --mt-sep: rgba(74,63,44,0.16);
  --mt-track: rgba(74,63,44,0.14); --mt-ring: #A8895A;
}
/* Tarjeta del cuaderno: tinte suave + lomo de color (no aplica a respondidos). */
.nb-card[class*="motive-theme--"]:not(.nb-card--answered) {
  background: var(--mt-soft);
  border-left: 3px solid var(--mt-spine);
}

/* ── Bandeja de reportes (S2, doc 46) ── */
.report-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.report-card__top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.report-card__reason {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-error);
}
.report-card__type {
  font-size: var(--text-xs);
  color: var(--color-muted);
  background: var(--color-bg);
  border-radius: var(--radius-full);
  padding: 2px var(--space-2);
}
.report-card__time { margin-left: auto; font-size: var(--text-xs); color: var(--color-muted); }
.report-card__target { margin: 0 0 var(--space-1); color: var(--color-text); line-height: 1.4; }
.report-card__details { margin: 0 0 var(--space-2); font-style: italic; color: var(--color-muted); font-size: var(--text-sm); }
.report-card__reporter { margin: 0 0 var(--space-3); font-size: var(--text-xs); color: var(--color-muted); }
.report-card__actions { display: flex; gap: var(--space-2); }
.report-card__actions .btn-secondary,
.report-card__actions .btn-primary { flex: 1; justify-content: center; height: var(--button-height); }

/* ── Consentimiento en onboarding (S3, doc 47) ── */
.ob-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  line-height: 1.4;
  color: var(--color-muted);
  cursor: pointer;
}
.ob-consent input[type="checkbox"] {
  width: 22px; height: 22px;
  flex: 0 0 auto;
  margin-top: 1px;
  accent-color: var(--color-primary);
}
.ob-consent a { color: var(--color-primary); font-weight: var(--font-medium); }

/* ── Links de cuenta + borrar (perfil) ── */
.account-links { display: flex; flex-direction: column; }
.account-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4) 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-divider);
  color: var(--color-text);
  font-size: var(--text-base);
  cursor: pointer;
}
.account-link i { color: var(--color-muted); }
.account-link:last-child { border-bottom: none; }
.account-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  background: none;
  border: none;
  color: var(--color-error);
  font-size: var(--text-sm);
  cursor: pointer;
}

/* ── Páginas legales (Términos / Privacidad) ── */
.legal { line-height: 1.6; color: var(--color-text); }
.legal__draft {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-muted);
}
.legal__h { font-size: var(--text-base); font-weight: var(--font-bold); margin: var(--space-5) 0 var(--space-2); }
.legal p { margin: 0 0 var(--space-2); }
.legal__contact, .legal__updated { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-4); }

/* ── Accesibilidad (S4, doc 48) ── */

/* Foco visible para teclado en todo lo interactivo (WCAG 2.4.7/2.4.11).
   Solo :focus-visible → no molesta al puntero/touch, sí al tabular. */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
/* Inputs rellenos: el anillo se ve mejor por dentro. */
.input-field:focus-visible,
textarea.input-field:focus-visible,
select.input-field:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}
/* Sobre fondos oscuros (stories) el anillo va en claro. */
.story-overlay :focus-visible { outline-color: #fff; }
/* El lienzo de composición es una superficie de escritura sin bordes: el cursor
   titilando ya marca el foco, así que el anillo rectangular sobra acá. */
.compose__title:focus-visible,
.compose__desc:focus-visible { outline: none; }

/* Movimiento reducido (WCAG 2.3.3): respeta la preferencia del sistema.
   Neutraliza animaciones y transiciones; el spinner queda exento porque
   comunica "cargando". */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .spinner { animation-duration: 0.8s !important; animation-iteration-count: infinite !important; }
}
