/* ============================================================
   Wateke · hoja de estilos compartida
   Tema "pop multicolor" con modo claro / oscuro vía variables.
   Pensado para usarse junto a Bootstrap 5 + Font Awesome 6.
   ============================================================ */

/* ---------- Tipografía ---------- */
:root {
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  /* Marca */
  --magenta: #FF2E7E;
  --orange:  #FF7A00;
  --yellow:  #FFC400;
  --purple:  #7A3CF0;
  --cyan:    #00C2D1;
  --green:   #15C26B;

  --grad:       linear-gradient(120deg, #FF2E7E 0%, #FF7A00 55%, #FFC400 100%);
  --grad-pink:  linear-gradient(135deg, #FF2E7E, #FF7A00);
  --grad-violet:linear-gradient(135deg, #7A3CF0, #FF2E7E);

  /* Superficies — modo claro */
  --bg:       #FFF7F0;
  --bg-2:     #FFFBF7;
  --surface:  #ffffff;
  --text:     #1A1230;
  --muted:    #9a8fb0;
  --soft:     #F6F1FA;
  --border:   #f1e9f0;
  --shadow:   0 6px 20px rgba(26,18,48,.07);
  --shadow-lg:0 12px 30px rgba(26,18,48,.12);

  /* Métricas del horario */
  --sched-col:   112px;   /* ancho por hora  */
}

[data-theme="dark"] {
  --bg:      #160E26;
  --bg-2:    #160E26;
  --surface: #241636;
  --text:    #FBF7FF;
  --muted:   #9a8fb0;
  --soft:    #1d1230;
  --border:  rgba(255,255,255,.07);
  --shadow:  0 6px 20px rgba(0,0,0,.35);
  --shadow-lg:0 12px 30px rgba(0,0,0,.45);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* Los fondos a sangre completa (.group-header::before/::after, 100vw) sobresalen por
   la derecha al estar el contenido descentrado por el sidebar; clip evita el scroll
   horizontal de página sin crear un scroll container (no rompe position:sticky). */
html { overflow-x: clip; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; }
.display { font-family: var(--font-display); letter-spacing: -.01em; }
.muted { color: var(--muted); }
.when-hidden { display: none !important; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(122,60,240,.28); border-radius: 8px; }

/* En móvil/tablet (donde existe la barra de navegación inferior) ocultamos la
   barra de scroll del documento: ocupa la franja derecha de todo el viewport y
   le resta espacio a la barra inferior. El scroll sigue funcionando con normalidad. */
@media (max-width: 991.98px) {
  html, body { scrollbar-width: none; -ms-overflow-style: none; }
  html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
}

/* ============================================================
   LAYOUT — escritorio: sidebar + topbar · móvil: bottom-nav
   ============================================================ */
.layout { min-height: 100vh; }

/* --- Sidebar (oculta en móvil) --- */
.sidebar {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  padding: 22px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  flex-direction: column;
  z-index: 30;
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 22px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px;
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; }

.nav-link-x {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px; border-radius: 13px;
  color: var(--muted); font-weight: 600; font-size: 14px;
}
.nav-link-x i { width: 18px; text-align: center; }
.nav-link-x.active {
  background: var(--grad-pink); color: #fff; font-weight: 800;
  box-shadow: 0 8px 18px rgba(255,46,126,.28);
}
.nav-link-x .badge-x {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 100px; background: color-mix(in srgb, var(--magenta) 14%, var(--surface));
  color: var(--magenta); font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.sidebar .user-pill {
  margin-top: auto; display: flex; align-items: center; gap: 11px;
  padding: 11px; border-radius: 14px; background: var(--bg-2); box-shadow: var(--shadow);
}

/* --- Top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .title { font-family: var(--font-display); font-weight: 800; font-size: 20px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--text);
  box-shadow: var(--shadow); border: none; position: relative; cursor: pointer;
}
.icon-btn .dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--magenta); border: 1.5px solid var(--surface); }

/* Botón de cambio de tema (luna/sol) oculto en todas las páginas. */
[data-theme-toggle] { display: none !important; }

/* --- Barras superiores de las secciones (Inicio, Mis grupos, Explorar, Amigos, Perfil)
   con el gradiente del tema. Se excluye data-immersive: el detalle de grupo comparte
   data-page="events" pero ya tiene su propia barra inmersiva. --- */
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar { background: var(--grad); border-bottom: none; }
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar::before { display: none; }
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar .title,
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar-brand { color: #fff; }
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar .brand-logo { background: rgba(255,255,255,.22); color: #fff; }
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar .icon-btn { background: rgba(255,255,255,.2); color: #fff; box-shadow: none; }
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar .icon-btn .dot { background: #fff; border-color: transparent; }
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar .searchbar { background: rgba(255,255,255,.2); color: rgba(255,255,255,.92); }
body:not([data-immersive]):is([data-page="home"],[data-page="events"],[data-page="explore"],[data-page="sintonia"],[data-page="friends"],[data-page="profile"]) .topbar .btn-grad { background: #fff; color: var(--magenta); }

.searchbar {
  flex: 1; max-width: 380px; display: flex; align-items: center; gap: 10px;
  background: var(--soft); border-radius: 13px; padding: 11px 15px; color: var(--muted);
}

/* Logo de la topbar (solo visible en móvil) */
.topbar-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text); min-width: 0; }
.topbar-brand .brand-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; }

/* --- Barra superior móvil (<768): respeta la safe-area y se encoge al hacer scroll --- */
@media (max-width: 767.98px) {
  .topbar {
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    transition: padding-top .22s ease, padding-bottom .22s ease, min-height .22s ease;
  }
  /* PWA (barra de estado translúcida): pinta la franja de la safe-area con el gradiente
     del tema para que el reloj/batería (en blanco) se lean sobre la barra clara. */
  .topbar::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0;
    height: env(safe-area-inset-top, 0px);
    background: var(--grad); pointer-events: none;
  }
  .topbar .brand-logo,
  .topbar .brand-name { transition: width .22s ease, height .22s ease, font-size .22s ease; }

  .topbar.is-shrunk {
    /* Altura fija (icon-btn encogido + padding): sin ella, las páginas sin
       iconos a la derecha quedarían con una barra más baja que el resto. */
    min-height: calc(60px + env(safe-area-inset-top, 0px));
    padding-top: calc(5px + env(safe-area-inset-top, 0px));
    padding-bottom: 5px;
  }
  .topbar.is-shrunk .brand-logo { width: 30px; height: 30px; font-size: 13px; }
  .topbar.is-shrunk .brand-name { font-size: 15px; }
  .topbar.is-shrunk .icon-btn { width: 36px; height: 36px; }
}

.content { padding: 22px 18px 110px; }
/* Marco de contenido: en escritorio se extiende; en móvil ocupa el ancho disponible. */
.page-scroll { max-width: 1200px; margin: 0 auto; }
/* Contenedor para páginas de formulario: ancho cómodo de lectura, centrado. */
.page-form { max-width: 760px; margin: 0 auto; }

/* --- Bottom nav (oculto en escritorio) --- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: 78px; padding: 12px 16px 0;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-around;
}
.bn-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 56px; color: var(--muted); font-weight: 600; font-size: 10px; }
/* Icono en contorno cuando está inactivo (relleno transparente + trazo) y
   relleno cuando está activo. Usa el glifo solid + text-stroke (funciona con
   cualquier icono, también los que no tienen variante regular en FA Free). */
.bn-item i { font-size: 19px; -webkit-text-stroke: 1.5px currentColor; text-stroke: 1.5px currentColor; -webkit-text-fill-color: transparent; }
.bn-item.active { color: var(--magenta); font-weight: 800; }
.bn-item.active i { -webkit-text-stroke-width: 0; text-stroke-width: 0; -webkit-text-fill-color: currentColor; }
.bn-item .badge-x { position: absolute; top: 4px; right: 6px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
/* El wrapper del badge del chrome (relleno por OOB) no debe ocupar sitio en la
   columna flex: si no, su hueco vacío empuja el texto «Perfil» hacia abajo y
   queda desalineado con el resto. display:contents lo saca del flujo; el
   .badge-x interior sigue posicionándose absoluto respecto al .bn-item. */
.bn-item #chrome-badge-bottom { display: contents; }
.bn-fab {
  width: 58px; height: 58px; border-radius: 20px; margin-top: -22px;
  background: var(--grad-pink); color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(255,46,126,.42);
}

/* CTA fija a pie de página: en móvil se apoya sobre el bottom-nav; en
   escritorio (sin bottom-nav) baja hasta el borde. */
.cta-dock {
  position: fixed; left: 0; right: 0; bottom: 78px; z-index: 39;
  padding: 48px 18px 16px;
  background: linear-gradient(180deg, transparent, var(--bg) 25%);
  pointer-events: none;   /* la franja del degradado no bloquea el contenido */
}
.cta-dock > * { pointer-events: auto; }

/* En escritorio: mostramos sidebar, ocultamos bottom-nav, desplazamos main */
@media (min-width: 992px) {
  .sidebar { display: flex; }
  .bottom-nav { display: none; }
  .main { margin-left: 248px; }
  .content { padding: 28px 32px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .cta-dock { bottom: 0; left: 248px; }
}

/* Pantallas muy anchas: el contenido se extiende más para no quedar como columna estrecha. */
@media (min-width: 1600px) {
  .page-scroll { max-width: 1440px; }
}

/* ============================================================
   COMPONENTES
   ============================================================ */
.btn-grad {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 12px 20px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--grad-pink); color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 10px 24px rgba(255,46,126,.32);
}
/* Variante de .btn-grad con el gradiente del evento (--c1/--c2 inline). */
.btn-event {
  background: linear-gradient(120deg, var(--c1, var(--magenta)), var(--c2, var(--orange)));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--c1, var(--magenta)) 32%, transparent);
}
.btn-soft {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 18px; border-radius: 13px; border: none; cursor: pointer;
  background: color-mix(in srgb, var(--purple) 12%, var(--surface));
  color: var(--purple); font-weight: 800; font-size: 13px;
}
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 11px 18px; border-radius: 13px; cursor: pointer;
  background: var(--surface); color: var(--text); font-weight: 700; font-size: 13px; box-shadow: var(--shadow);
}

/* Variantes de tamaño para .btn-grad / .btn-soft / .btn-ghost */
.btn-sm { font-size: 12px; padding: 6px 12px; border-radius: 11px; }
.btn-xs { font-size: 11px; padding: 4px 10px; border-radius: 10px; }
.btn-lg { font-size: 15px; padding: 12px 26px; }
/* Cápsula estilo iOS (mismo radio que chips y segmentos) */
.btn-pill { border-radius: 100px; }
/* Tile: botón a ancho completo con esquinas redondeadas (altura normal) */
.btn-tile { width: 100%; padding: 12px 20px; border-radius: 18px; font-size: 15px; }

/* Fila de CTAs de la sección Miembros: dos tiles a ancho completo */
.member-cta { display: flex; gap: 10px; }
.member-cta > .pop-menu { flex: 1; min-width: 0; }
/* CTA principal a todo el ancho (formularios, dock inferior) */
.btn-cta { width: 100%; height: 54px; font-size: 15px; }

.card-x { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); }

/* Cards de secciones y de elementos de sección: misma altura fija (carruseles). */
.sx-card {
  width: 200px; height: 220px; flex: none; padding: 0; overflow: hidden; font: inherit;
  display: flex; flex-direction: column; text-align: left; border: none;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); cursor: pointer;
}
.sx-card.is-featured { outline: 2px solid var(--magenta); }
.sx-card-media { position: relative; height: 104px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 26px; }
.sx-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-card-badge { position: absolute; top: 8px; left: 8px; background: var(--magenta); color: #fff; }
.sx-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow: hidden; }
.sx-card-title { font-weight: 800; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sx-card-sub { color: var(--muted); font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sx-add {
  width: 200px; height: 220px; flex: none; font: inherit; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  color: var(--purple); background: transparent; font-weight: 700; font-size: 12px;
  border: 1.5px dashed color-mix(in srgb, var(--purple) 35%, var(--border)); border-radius: 18px;
}
.sx-add i { font-size: 20px; }

/* Estado de carga de una card: al pulsarla (navegación de página completa, sin
   caché) se oscurece y muestra un spinner encima hasta que carga la siguiente
   página. Se aplica con la clase .card-loading desde JS. */
.card-loading { position: relative; pointer-events: none; }
.card-loading::after {
  content: ''; position: absolute; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, .5); border-radius: inherit;
}
.card-loading::before {
  content: ''; position: absolute; top: 50%; left: 50%; z-index: 41;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: card-spin .7s linear infinite;
}
@keyframes card-spin { to { transform: rotate(360deg); } }

/* Spinner dentro de un botón al enviar un formulario (data-submit-spinner).
   El botón se mantiene en su tamaño; el estado dura hasta que navega la página. */
.btn-spinner {
  display: inline-block; width: 20px; height: 20px; vertical-align: middle;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: card-spin .7s linear infinite;
}
button.is-loading { pointer-events: none; opacity: 1; }

/* Cabecera de sección dentro de una card (icono coloreado inline por uso) */
.card-eyebrow {
  display: flex; align-items: center; gap: 6px;
  font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}

/* Título de sección en las fichas de evento/grupo (Horarios, secciones del
   evento, Imágenes…): misma tipografía display que el resto de títulos. */
.sec-title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 800; font-size: 16px;
  margin: 0; min-width: 0;
}
.sec-title i { color: var(--magenta); flex: none; }

/* Sección plegable (acordeón): el título alterna el cuerpo con un chevrón */
[data-sec-toggle] { cursor: pointer; user-select: none; -webkit-user-select: none; }
.sec-title .sec-chevron { margin-left: auto; font-size: 12px; color: var(--muted); transition: transform .18s ease; }
[data-sec-collapse].is-collapsed .sec-chevron { transform: rotate(-90deg); }
[data-sec-collapse].is-collapsed [data-sec-body] { display: none; }
/* Plegada, la sección pierde su margen inferior: la separación queda en manos
   del gap del contenedor (16px) y las filas plegadas se compactan. */
[data-sec-collapse].is-collapsed { margin-bottom: 0 !important; }

/* Fila suave (ítem de lista dentro de una card) */
.soft-row { background: var(--soft); border-radius: 12px; padding: 12px 14px; }

/* Menú de ajustes: filas con icono + etiqueta + chevrón dentro de una card
   (perfil, configuración de grupo…). Aplicar sobre .card-x. */
.menu-list { overflow: hidden; }
.menu-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; text-align: left; text-decoration: none; color: var(--text);
  background: none; border: none; cursor: pointer; font: inherit;
}
.menu-row + .menu-row { border-top: 1px solid var(--border); }
.menu-row:hover { background: var(--soft); }
.menu-label { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.menu-chev { flex: none; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------
   Fila deslizable estilo iOS (swipe-to-reveal): el contenido se
   desliza a la izquierda descubriendo las acciones (editar/borrar)
   como círculos con etiqueta debajo. Gesto táctil (app.js).
   ------------------------------------------------------------ */
/* El contenedor NO tiene aspecto de card: solo posiciona. Las acciones
   quedan detrás (sobre el fondo de página) y la CARD entera se desliza. */
.swipe-row { position: relative; }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; align-items: center; z-index: 0; }
.swipe-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 70px; border: none; background: transparent; cursor: pointer; text-decoration: none;
  color: var(--muted); font: 600 11px var(--font-ui);
}
.swipe-ic {
  width: 40px; height: 40px; border-radius: 50%; color: #fff; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.swipe-act--edit .swipe-ic { background: var(--purple); }
.swipe-act--del  .swipe-ic { background: var(--magenta); }
.swipe-act-form  { display: contents; }
/* La card: es lo que se desliza (fondo, redondeo y sombra viven aquí) */
.swipe-content {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; min-height: 62px;
  transform: translateX(0); transition: transform .22s cubic-bezier(.22,1,.36,1);
  touch-action: pan-y;   /* permite el scroll vertical; el gesto horizontal lo captura JS */
}
/* Chevrón de pista (a la derecha): indica que la fila se puede deslizar */
.swipe-hint { flex: none; color: var(--muted); opacity: .45; font-size: 13px; }

/* Cuadradito de icono coloreado (menú de perfil, invitaciones, ayudas).
   El color se define con --c en el propio elemento. */
.tile-ic {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c, var(--purple)) 14%, var(--surface));
  color: var(--c, var(--purple));
}
.tile-ic--sm { width: 36px; height: 36px; border-radius: 10px; }

/* Estados vacíos: standalone (card completa) y compacto (dentro de una card) */
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state > i { display: block; font-size: 40px; margin-bottom: 14px; color: var(--muted); }
.empty-title { font-weight: 700; font-size: 15px; }
.empty-sub { margin-top: 6px; font-weight: 500; font-size: 13px; color: var(--muted); }
.empty-state--sm { padding: 16px 0; font-weight: 600; font-size: 13px; color: var(--muted); }
.empty-state--sm > i { font-size: 22px; margin-bottom: 8px; opacity: .4; }

/* Hueco inferior para que el contenido no quede bajo el dock/bottom-nav */
.pb-dock { padding-bottom: 100px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 100px; font-weight: 700; font-size: 11px;
}
.chip-go   { background: color-mix(in srgb, var(--green) 16%, var(--surface));  color: var(--green); }
.chip-imp  { background: color-mix(in srgb, var(--orange) 16%, var(--surface)); color: var(--orange); }
.chip-maybe{ background: color-mix(in srgb, var(--purple) 16%, var(--surface)); color: var(--purple); }
.chip-note { background: color-mix(in srgb, var(--purple) 16%, var(--surface)); color: var(--purple); }
/* Chip sobre imagen/cover (cristal oscuro) */
.chip-glass { background: rgba(12,8,20,.32); color: #fff; backdrop-filter: blur(4px); }

.seg { display: inline-flex; gap: 8px; }
.seg > * { padding: 9px 18px; border-radius: 100px; font-weight: 700; font-size: 12px; background: var(--surface); color: var(--muted); box-shadow: var(--shadow); cursor: pointer; }
.seg > .on { background: var(--text); color: var(--bg); box-shadow: none; }

/* Avatares apilados */
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 11px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -9px; }
/* Avatar con foto: la imagen llena el contenedor y hereda el redondeo */
.avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
img.avatar { object-fit: cover; }

/* Inputs */
.field { display: block; margin-bottom: 14px; }
.field > label { display: block; font-weight: 700; font-size: 12px; margin-bottom: 7px; }
.input {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 14px 15px; font: 600 14px var(--font-ui); color: var(--text);
}
.input input, .input select, .input textarea { border: none; outline: none; background: transparent; color: var(--text); font: 600 14px var(--font-ui); width: 100%; }
.input select { cursor: pointer; }
.input textarea { resize: vertical; }
.input i { color: var(--muted); }
.input.focus { border-color: var(--magenta); box-shadow: 0 6px 18px rgba(255,46,126,.12); }
/* Variante compacta (formularios dentro de una card) */
.input.input-sm { padding: 8px 12px; font-size: 13px; }
.input.input-sm input { font-size: 13px; }

/* Número de paso (landing y flujo Añadir evento) */
.step-num {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--grad-pink); color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.step-num--sm { width: 30px; height: 30px; border-radius: 10px; font-size: 13px; }

/* Placeholder ajedrezado para imágenes pendientes */
.ph-block {
  background: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--purple) 8%, var(--surface)),
    color-mix(in srgb, var(--purple) 8%, var(--surface)) 8px,
    var(--surface) 8px, var(--surface) 16px);
}

/* Dropzone */
.dropzone { border: 1.5px dashed var(--orange); background: color-mix(in srgb, var(--orange) 8%, var(--surface)); border-radius: 16px; padding: 22px; text-align: center; }
.dropzone .ic { width: 44px; height: 44px; border-radius: 13px; background: var(--surface); color: var(--orange); display: flex; align-items: center; justify-content: center; font-size: 18px; margin: 0 auto 10px; box-shadow: 0 3px 10px rgba(255,122,0,.18); }
.dashed-card { border: 1.5px dashed color-mix(in srgb, var(--purple) 35%, var(--border)); border-radius: 18px; background: var(--surface); }

/* Cover de festival (placeholder festivo) */
.cover { position: relative; color: #fff; overflow: hidden; }
.cover .ph { position: absolute; bottom: 8px; right: 12px; font: 600 9px ui-monospace, monospace; color: rgba(255,255,255,.6); }
/* Logo del festival superpuesto y centrado sobre el cover/gradiente de la card.
   Los !important anulan el object-fit:cover/inset del <img> de fondo (regla de clase
   en .hcard-cover img y estilos inline en otras cards). */
.cover-logo {
  position: absolute !important; inset: auto !important;
  top: 50% !important; left: 50% !important; transform: translate(-50%, -50%);
  width: auto !important; height: auto !important; max-width: 66%; max-height: 52%;
  object-fit: contain !important; z-index: 2; pointer-events: none;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,.45));
}
/* Capas de la zona de imagen de la card (de abajo a arriba):
   fondo (cover/gradiente) → oscurecimiento (.has-scrim::after) → logo (.cover-logo)
   → nombre (.cover-name). */
.has-scrim::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,.18), rgba(0,0,0,.08) 45%, rgba(0,0,0,.5));
}
.cover-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; margin: 0;
  padding: 10px 14px;
  font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.15; color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,.9), 0 1px 2px rgba(0,0,0,.85);
  /* Nombres largos: envuelven hasta 2 líneas (crece hacia arriba sobre el
     cover al estar anclado abajo); a partir de ahí, ellipsis. */
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.cover-pink   { background: var(--grad); }
.cover-violet { background: linear-gradient(135deg,#7A3CF0,#00C2D1); }
.cover-sun    { background: linear-gradient(135deg,#FF7A00,#FFC400); }
/* Gradiente propio del evento: --c1/--c2 llegan inline (Event.gradient_style);
   sin ellas cae a los colores de marca. */
.cover-event  { background: linear-gradient(135deg, var(--c1, var(--magenta)), var(--c2, var(--orange))); }

/* Toggle de tema */
.switch { width: 50px; height: 30px; border-radius: 100px; background: var(--text); position: relative; border: none; cursor: pointer; flex: none; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); transition: left .2s ease; }
[data-theme="dark"] .switch .knob { left: 23px; }

/* ============================================================
   HORARIO (días × escenarios × horas)
   ============================================================ */
.day-tabs { display: flex; gap: 8px; }
.day-tabs button { flex: 1; padding: 10px 0; border-radius: 14px; border: none; cursor: pointer; background: var(--surface); color: var(--muted); font-weight: 700; font-size: 12px; box-shadow: var(--shadow); }
.day-tabs button.on { background: var(--text); color: var(--bg); box-shadow: none; font-weight: 800; }

/* Panel del día: sin padding para que la banda de escenarios llegue a los
   bordes; overflow hidden para que el contenido redondee con la card. */
.day-panel { padding: 0; overflow: hidden; margin-bottom: 12px; }

/* Leyenda: escenarios filtrables + marcas. Scroll horizontal (no envuelve). */
.sched-legend { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; padding: 14px 14px 12px; overflow-x: auto; }
.sched-legend > * { flex: none; }
.legend-chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap;
  padding: 6px 12px; border-radius: 100px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: 11px; opacity: .5;
}
.legend-chip .dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend-chip.on { opacity: 1; border-color: color-mix(in srgb, var(--c) 55%, var(--border)); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
/* Chip "Todos" (por defecto activo): sólido, sin color de escenario */
.legend-all.on { opacity: 1; background: var(--text); color: var(--bg); border-color: var(--text); }
/* Chips de marcas: mismo comportamiento de filtro que las de escenario */
.sched-legend [data-mark-filter] { cursor: pointer; border: 0; opacity: .5; }
.sched-legend [data-mark-filter].on { opacity: 1; }
.legend-sep { width: 1px; align-self: stretch; background: var(--border); margin: 3px 4px; }

.sched { overflow: auto; }
/* El ancho lo marca la cabecera de horas (nº de horas real de la jornada).
   El padding lateral separa las primeras/últimas actuaciones del borde;
   las barras de escenario lo compensan para seguir yendo a sangre. */
.sched-inner { width: max-content; min-width: 100%; padding: 0 10px; }

.sched-hours { display: flex; height: 34px; position: sticky; top: 0; z-index: 5; background: var(--bg); margin: 0 -10px; padding: 0 10px; }
/* flex:none — si las columnas encogen, dejan de coincidir con los left_px de los actos. */
.sched-hour { width: var(--sched-col); flex: none; padding-left: 8px; display: flex; align-items: center; font: 700 11px ui-monospace, monospace; color: var(--muted); }

/* Cada escenario es un grupo: nombre completo encima + carril a ancho completo. */
.sched-group { margin-bottom: 6px; }
/* Barra a todo el ancho con el color del escenario. El nombre (dentro) se queda
   fijo a la izquierda al hacer scroll horizontal, así siempre se ve a qué
   escenario pertenece cada fila. */
.sched-space-name {
  display: flex; align-items: center; margin: 6px -10px 4px;
  padding: 5px 12px; background: var(--c);
}
.sched-space-name .sched-name { position: sticky; left: 12px; font-weight: 800; font-size: 12px; line-height: 1.2; color: #fff; }
/* Sin hueco entre la cabecera de horas y la primera barra de escenario. */
.sched-hours + .sched-group .sched-space-name { margin-top: 0; }

.sched-row { height: 84px; }
.sched-track { position: relative; height: 100%; }

.act {
  position: absolute; top: 6px; bottom: 6px;
  border-radius: 11px; padding: 8px 10px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 18%, var(--surface));
}
.act .t { font: 700 9px ui-monospace, monospace; color: var(--c); }
.act .n { font-weight: 800; font-size: 12px; margin-top: 1px; color: var(--text); }
.act--head { background: var(--grad-pink); border-left: none; box-shadow: 0 6px 16px rgba(255,46,126,.3); }
.act--head .t { color: rgba(255,255,255,.85); }
.act--head .n { font-family: var(--font-display); font-weight: 800; font-size: 14px; color: #fff; }

.act .flag { position: absolute; right: 7px; top: 7px; width: 18px; height: 18px; border-radius: 50%; color: #fff; font-size: 9px; display: flex; align-items: center; justify-content: center; }
.flag-go  { background: var(--green); }
.flag-imp { background: var(--orange); }
.act--head .flag-imp { background: #fff; color: var(--orange); }
a.act { text-decoration: none; color: inherit; }
a.act:focus-visible { outline: 2px solid var(--magenta); outline-offset: 2px; }
.act .flags { position: absolute; right: 7px; top: 7px; display: flex; gap: 3px; }
.act .flags .flag { position: static; right: auto; top: auto; }

/* Color por escenario */
.s-main   { --c: var(--magenta); }
.s-sunset { --c: var(--orange); }
.s-cosmic { --c: var(--purple); }
.s-jungle { --c: var(--green); }
.s-bay    { --c: var(--cyan); }
/* Paleta extendida de escenarios (20 colores fijos sin repetición) */
.s-6  { --c: #2E7DFF; }
.s-7  { --c: #FFC400; }
.s-8  { --c: #FF4D4D; }
.s-9  { --c: #FF6FB5; }
.s-10 { --c: #00B894; }
.s-11 { --c: #A55EEA; }
.s-12 { --c: #26C6DA; }
.s-13 { --c: #FD9644; }
.s-14 { --c: #20BF6B; }
.s-15 { --c: #EB3B5A; }
.s-16 { --c: #4B7BEC; }
.s-17 { --c: #F7B731; }
.s-18 { --c: #8854D0; }
.s-19 { --c: #2BCBBA; }
.s-20 { --c: #FA8231; }

/* Carril de anotaciones (plan del grupo) */
.ann-lane { height: 46px; }
.ann-group { --c: var(--purple); }
.ann {
  position: absolute; top: 5px; bottom: 5px;
  border: 1.5px dashed color-mix(in srgb, var(--purple) 45%, var(--border));
  background: color-mix(in srgb, var(--purple) 12%, var(--surface));
  border-radius: 10px; padding: 6px 9px; display: flex; align-items: center;
  font-weight: 800; font-size: 11px; color: var(--purple);
  overflow: hidden; white-space: nowrap; cursor: pointer;
}

/* Tabs de día -> mostrar/ocultar */
.day-panel { display: none; }
.day-panel.on { display: block; }

/* Disabled nav items */
.is-disabled{opacity:.45;pointer-events:none;}

/* ============================================================
   COMPONENTES UI-2 (Fase 7)
   ============================================================ */

/* Flags gestionados por JS (apilados arriba a la derecha) */
.act-flags { position: absolute; right: 6px; top: 6px; display: flex; gap: 3px; z-index: 2; }
.act-flags .flag { position: static; }
.flag-note { background: var(--purple); }
.act.is-active { outline: 2px solid var(--text); outline-offset: 1px; }

/* ------------------------------------------------------------
   POPUPS · un único panel base (.pop-panel) con dos variantes
   de posicionamiento:
   · .act-pop  → flotante global (fixed), colocado por app.js
                 (actuaciones, anotaciones del plan, ítems de sección).
   · .pop-menu → menú anclado a su botón ([data-pop-menu] +
                 [data-pop-toggle], p. ej. los tres puntitos).
   ------------------------------------------------------------ */
.pop-panel {
  min-width: 196px; padding: 7px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(4px) scale(.97); transform-origin: top left;
  transition: opacity .12s ease, transform .12s ease; pointer-events: none;
}
.pop-panel .pop-head { display: flex; align-items: center; gap: 8px; padding: 7px 9px 9px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.pop-panel .pop-head .pt { font: 700 9px ui-monospace, monospace; color: var(--muted); }
.pop-panel .pop-head .pn { font-weight: 800; font-size: 13px; color: var(--text); line-height: 1.1; }
/* Filas de acción: solo hijos directos, para no pisar formularios anidados */
.pop-panel > button, .pop-panel > a {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border: none; background: transparent; cursor: pointer;
  padding: 9px 9px; border-radius: 11px; font: 700 13px var(--font-ui); color: var(--text);
}
.pop-panel > button:hover, .pop-panel > a:hover { background: var(--soft); }
.pop-panel .ic {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  background: color-mix(in srgb, var(--c, var(--purple)) 14%, var(--surface));
  color: var(--c, var(--purple));
}
.pop-panel .chk { margin-left: auto; color: var(--green); opacity: 0; font-size: 13px; }
.pop-panel button.on .chk { opacity: 1; }
/* Variantes de color: definen --c para el .ic genérico del panel */
.ic-go  { --c: var(--green); }
.ic-imp { --c: var(--orange); }
.ic-note{ --c: var(--purple); }

/* Solo lectura (visor público del evento): sin acciones de marcado */
.pop-panel .pop-empty { display: none; padding: 6px 9px 9px; font-weight: 600; font-size: 13px; color: var(--muted); }
.act-pop.is-readonly button { display: none; }
.act-pop.is-readonly .pop-empty { display: block; }

/* Estado visible (válido para cualquier variante) */
.pop-panel.show { opacity: 1; transform: none; pointer-events: auto; }

/* Variante flotante global (posición calculada por app.js) */
.act-pop { position: fixed; z-index: 60; }

/* Variante menú anclado al botón que lo abre */
.pop-menu { position: relative; }
.pop-menu .pop-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 200px; transform-origin: top right;
}
.pop-menu .pop-panel > a, .pop-menu .pop-panel > button { white-space: nowrap; }
.pop-menu.open .pop-panel { opacity: 1; transform: none; pointer-events: auto; }
/* Variante formulario (p. ej. Añadir plan): panel ancho con campos apilados.
   En móvil la hoja inferior manda (el media query posterior la ensancha). */
.pop-panel--form { width: 320px; padding: 14px; }
/* Opciones del exportador de calendario: check circular (izquierda,
   estilo selección de miembros) + icono + etiqueta. */
.cal-opt { display: flex; align-items: center; gap: 11px; padding: 10px 4px; cursor: pointer; }
.cal-opt + .cal-opt { border-top: 1px solid var(--border); }
.cal-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cal-opt input:checked ~ .invite-check { background: var(--magenta); border-color: var(--magenta); }
.cal-opt input:checked ~ .invite-check i { opacity: 1; }
.cal-opt-ic {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  background: color-mix(in srgb, var(--c, var(--purple)) 14%, var(--surface));
  color: var(--c, var(--purple));
}
.cal-opt-label { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }

/* Variante invitar amigos: cabecera fija (título + buscador) · lista con
   scroll · CTA fijo abajo. Panel alto (en móvil ocupa el 90% de pantalla). */
.pop-panel--invite { width: 360px; max-height: 72vh; padding: 0; display: flex; flex-direction: column; }
.invite-head { padding: 14px 14px 10px; }
.pop-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; margin: 0 0 12px; }
.invite-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 2px 8px 8px; }
.invite-sub { font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 6px 4px; }
.invite-foot { padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); }
.invite-row { display: flex; align-items: center; gap: 11px; padding: 9px 8px; border-radius: 13px; cursor: pointer; }
.invite-row:hover { background: var(--soft); }
.invite-row.is-selected { background: color-mix(in srgb, var(--magenta) 8%, var(--surface)); }
.invite-row input { position: absolute; opacity: 0; pointer-events: none; }
.invite-check {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 2px solid var(--border); color: #fff; font-size: 11px;
  display: flex; align-items: center; justify-content: center; transition: background .12s ease, border-color .12s ease;
}
.invite-check i { opacity: 0; }
.invite-row.is-selected .invite-check { background: var(--magenta); border-color: var(--magenta); }
.invite-row.is-selected .invite-check i { opacity: 1; }
.invite-empty { padding: 24px 8px; text-align: center; font-weight: 600; font-size: 13px; color: var(--muted); }
/* Variante compartir: QR + enlace + CTA */
.pop-panel--share { width: 300px; padding: 14px; text-align: center; }
.qr-box {
  width: 200px; max-width: 100%; margin: 4px auto 12px; padding: 12px;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
}
.qr-box svg { display: block; width: 100%; height: auto; }
.qr-url {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 11px; color: var(--muted); word-break: break-all;
  margin-bottom: 12px; line-height: 1.4;
}

/* Backdrop compartido (solo móvil): oscurece la interfaz bajo la hoja */
.pop-backdrop {
  position: fixed; inset: 0; z-index: 88;
  background: rgba(12,8,20,.45); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.pop-backdrop.show { opacity: 1; pointer-events: auto; }
@media (min-width: 768px) { .pop-backdrop { display: none; } }

/* En móvil todo popup se presenta como hoja inferior (estilo iOS): a sangre
   abajo, por encima de toda la interfaz y deslizándose desde el borde.
   Los !important anulan el top/left inline que app.js calcula para la
   variante flotante de tablet/escritorio. */
@media (max-width: 767.98px) {
  .pop-panel {
    position: fixed;
    top: auto !important; left: 0 !important; right: 0; bottom: 0;
    width: 100%; max-width: 460px; min-width: 0; margin: 0 auto;
    z-index: 89; border: none; border-radius: 26px 26px 0 0;
    /* Sin padding-top: el hueco superior lo aporta el propio grabber (margen),
       así es igual en toda variante aunque anule el padding (p. ej. --invite). */
    padding: 0 14px calc(16px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(0,0,0,.25);
    /* Cerrado: opacidad 0 (además del desplazamiento) — un panel atrapado en
       un ancestro con transform (gh-bar) no debe verse aunque cambie su
       containing block. */
    transform: translateY(100%);
    transition: transform .26s cubic-bezier(.22,1,.36,1), opacity .2s ease;
  }
  /* Barra de agarre para arrastrar la hoja. El margen (no el padding del panel)
     define su separación con el borde superior → consistente en toda variante. */
  .pop-panel::before {
    content: ''; display: block; width: 44px; height: 5px; border-radius: 100px;
    margin: 10px auto; background: color-mix(in srgb, var(--text) 16%, var(--surface));
  }
  .pop-panel.show, .pop-menu.open .pop-panel { transform: none; }
  /* Filas más táctiles dentro de la hoja */
  .pop-panel > button, .pop-panel > a { padding: 13px 10px; font-size: 15px; border-radius: 12px; }
  .pop-panel .ic { width: 32px; height: 32px; border-radius: 10px; font-size: 14px; }
  .pop-panel .pop-head { padding: 4px 10px 12px; }
  .pop-panel .pop-head .pn { font-size: 15px; }
  /* Invitar amigos: hoja alta al 90% con cabecera/lista/CTA propios (padding 0) */
  .pop-panel--invite { height: 90vh; max-height: 90vh; width: 100%; padding: 0; }
  .pop-panel--invite .pop-title { font-size: 19px; }
  .pop-panel--invite .invite-row { padding: 11px 8px; }
}

/* Toast breve */
.toast-x {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(10px);
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 13px;
  padding: 12px 18px; border-radius: 100px; box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity .18s ease, transform .18s ease; z-index: 70; pointer-events: none;
}
.toast-x.show { opacity: 1; transform: translateX(-50%); }
@media (min-width: 992px) { .toast-x { bottom: 32px; } }

/* ============================================================
   AMIGOS · panel de perfil (drawer)
   ============================================================ */
.profile-drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.profile-drawer.open { display: block; }
.pd-backdrop { position: absolute; inset: 0; background: rgba(12,8,20,.45); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s ease; }
.profile-drawer.open .pd-backdrop { opacity: 1; }
.pd-card {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--bg); border-radius: 26px 26px 0 0; overflow: hidden;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.22,1,.36,1);
  max-width: 460px; margin: 0 auto;
}
.profile-drawer.open .pd-card { transform: none; }
.pd-banner { height: 84px; }
.pd-avatar { width: 84px; height: 84px; border-radius: 26px; border: 4px solid var(--bg); font-family: var(--font-display); font-weight: 800; font-size: 30px; margin: -42px auto 0; position: relative; z-index: 1; }
.pd-x { position: absolute; top: 14px; right: 14px; z-index: 2; width: 36px; height: 36px; border-radius: 11px; border: none; background: rgba(255,255,255,.85); color: #1A1230; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Centrado tipo modal en pantallas grandes */
@media (min-width: 768px) {
  .profile-drawer { display: none; }
  .profile-drawer.open { display: flex; align-items: center; justify-content: center; }
  .pd-card { position: relative; left: auto; right: auto; bottom: auto; margin: 0; width: 420px; border-radius: 24px; transform: translateY(12px) scale(.98); box-shadow: var(--shadow-lg); }
  .profile-drawer.open .pd-card { transform: none; }
}

/* ============================================================
   HOME · secciones con scroll horizontal (carruseles)
   Mis grupos · Más eventos · Eventos de amigos. Cada sección filtra
   Próximos/Pasados en cliente (JS). Mismo comportamiento en móvil y
   escritorio; en escritorio el contenido se ensancha.
   ============================================================ */
.hsec { margin-bottom: 28px; }
.hsec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.hsec-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; margin: 0; }
.page-title { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin: 0 0 18px; }
.seg-sm > * { padding: 6px 13px; font-size: 11px; }

/* Carril horizontal. Sangra hasta los bordes del contenido (margen negativo
   igual al padding de .content) para que las cards no se corten contra el
   contenedor: desaparecen por el borde de la pantalla. */
.hscroll {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
  margin: 0 -18px; padding: 4px 18px 14px;
  scroll-snap-type: x proximity; scroll-padding-left: 18px;
  -webkit-overflow-scrolling: touch;
}
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }
@media (min-width: 992px) {
  .hscroll { margin: 0 -32px; padding: 4px 32px 14px; scroll-padding-left: 32px; }
}

/* Tarjeta del carril */
.hcard { width: 260px; max-width: 80vw; overflow: hidden; display: block; }
.hcard-cover { height: 130px; position: relative; }
.hcard-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hcard-body { padding: 13px 15px; }
.hcard-title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hcard-meta { font-weight: 600; font-size: 12px; margin-top: 3px; }
.hcard-friends { display: flex; align-items: center; gap: 8px; margin-top: 10px; }

/* Tarjeta "Añadir" */
.hcard-add { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 18px; }
.hcard-add-ic { width: 44px; height: 44px; border-radius: 13px; background: color-mix(in srgb, var(--purple) 12%, var(--surface)); color: var(--purple); display: flex; align-items: center; justify-content: center; font-size: 18px; }

/* Card de grupo compacta a todo el ancho (listado vertical del inicio).
   La imagen del festival sangra a todo el fondo (sin container) y se difumina
   hacia la derecha; el logo va a la izquierda centrado y el texto encima de la
   imagen (blanco con sombra negra para destacar). */
.grow-card {
  position: relative; overflow: hidden; display: block; padding: 14px 16px; min-height: 104px;
  border-radius: 18px; box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--c1, var(--magenta)), var(--c2, var(--orange)));
}
.grow-cover { position: absolute; inset: 0; z-index: 0; }
/* La imagen (si la hay) sangra a la izquierda y se funde en el gradiente. */
.grow-cover img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: linear-gradient(to right, #000 40%, transparent 88%);
  mask-image: linear-gradient(to right, #000 40%, transparent 88%);
}
/* Oscurecido (más a la izquierda) para que el texto blanco destaque sobre el
   gradiente/imagen; se aclara hacia la derecha dejando ver el color. */
.grow-cover::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,.5) 0%, rgba(0,0,0,.28) 50%, rgba(0,0,0,.08) 100%);
}
.grow-content { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; min-height: 76px; }
.grow-logo { width: 54px; height: 54px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.55)); }
.grow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.grow-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; line-height: 1.15; color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow-sub { font-weight: 600; font-size: 12px; display: flex; align-items: center; gap: 6px; min-width: 0; color: rgba(255,255,255,.95); text-shadow: 0 1px 4px rgba(0,0,0,.85); }
.grow-sub i { flex: none; font-size: 11px; }
.grow-sub > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow-avatars { margin-top: 8px; }
.grow-avatars .avatar { width: 26px; height: 26px; font-size: 11px; box-shadow: 0 1px 4px rgba(0,0,0,.4); }

.hsec-empty { font-weight: 600; font-size: 13px; padding: 8px 2px; }

/* Reutilizable también en el aside de Explorar */
.hs-eyebrow { font-weight: 800; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 7px; }

@media (min-width: 1280px) {
  body[data-page="home"] .page-scroll { max-width: 1600px; }
  .hcard { width: 280px; }
  .hcard-cover { height: 150px; }
}

/* ============================================================
   SPLIT · patrón feed + aside reutilizable (Explorar, Perfil)
   A diferencia de .home-aside (que se oculta en móvil), aquí el
   aside es contenido esencial: fluye bajo el feed en móvil/tablet
   y pasa a columna lateral sticky en escritorio amplio (≥1280).
   ============================================================ */
.split-grid { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.split-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.split-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (min-width: 1280px) {
  .split-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; }
  .split-aside { position: sticky; top: 88px; }
}

/* ============================================================
   EXPLORAR · resultados de búsqueda en rejilla
   ============================================================ */
.results-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.results-grid > * { margin: 0 !important; min-width: 0; }

@media (min-width: 768px) {
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   AMIGOS · listas (mis amigos / solicitudes / resultados) en rejilla
   Mantiene el sistema de pestañas; solo cambia cómo se distribuyen
   las tarjetas dentro del panel activo.
   ============================================================ */
.friends-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.friends-grid > * { min-width: 0; }

@media (min-width: 768px) {
  .friends-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
  .friends-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================================================
   PERFIL
   · Móvil/Tablet (<1280) → tarjeta de perfil arriba, opciones y
     cerrar sesión debajo (apilado y centrado).
   · Escritorio (≥1280)   → opciones a la izquierda; la tarjeta de
     perfil (toda la identidad) a la derecha, fija al hacer scroll.
   ============================================================ */
.profile-grid { display: flex; flex-direction: column; gap: 16px; max-width: 760px; margin: 0 auto; }

/* Tarjeta única con todo el perfil: banner + avatar + datos + stats */
.profile-card { overflow: hidden; }
.profile-card .cover { height: 110px; }
/* El avatar sube con margin negativo; lo posicionamos por encima del banner. */
.profile-card .avatar { position: relative; z-index: 1; }
/* En móvil/tablet la tarjeta mantiene un ancho cómodo y centrado. */
.profile-card { max-width: 520px; margin-left: auto; margin-right: auto; width: 100%; }

@media (min-width: 1280px) {
  .profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 16px 24px;
    align-items: start;
    max-width: none;
    grid-template-areas:
      "menu   card"
      "logout card";
  }
  .profile-card   { grid-area: card; max-width: none; position: sticky; top: 88px; }
  .profile-menu   { grid-area: menu; }
  .profile-logout { grid-area: logout; }
}

/* ============================================================
   MIS EVENTOS · galería responsive
   · Móvil/Tablet (<992) → tarjetas en 1–2 columnas; "Añadir otro
     evento" como barra inferior (más el FAB del bottom-nav).
   · Escritorio (≥992)   → "Añadir evento" en la topbar; sin barra
     inferior. En ≥1280 el contenido se ensancha y admite más columnas.
   Las pestañas Próximos/Pasados reutilizan .group-tabs (detalle de grupo).
   ============================================================ */

.my-events-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.my-events-grid > * { min-width: 0; }

@media (min-width: 576px)  { .my-events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 992px)  { .my-events-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { body[data-page="events"] .page-scroll { max-width: 1600px; } }
@media (min-width: 1600px) { .my-events-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ============================================================
   DETALLE DE GRUPO · estética moderna
   · Móvil/Tablet (<1280) → apilado: cabecera · horario · grupo · plan
   · Escritorio (≥1280)   → cabecera a todo el ancho; horario + plan a la
     izquierda y "Tu grupo" como aside fijo a la derecha.
   ============================================================ */
.group-detail { display: flex; flex-direction: column; gap: 16px; }

/* Pestañas de la página de grupo: segmented control estilo iOS (pista gris,
   segmento activo en píldora clara con sombra). Todo el ancho en móvil.
   Sticky: al hacer scroll quedan fijas bajo la barra superior (gh-bar en móvil,
   topbar en escritorio) para poder cambiar de pestaña desde cualquier punto. */
.group-tabs {
  display: flex; gap: 4px; padding: 4px;
  border-radius: 16px;
  position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 15;
}
/* Dos capas bajo los botones (los hijos con z negativo pintan SOBRE el fondo del
   propio elemento, así que el fondo va también en pseudo-elementos):
   ::before = banda a sangre que tapa el contenido al quedar fijas;
   ::after  = la pista del segmented control. */
.group-tabs::before {
  content: ''; position: absolute; inset: -10px -18px -6px;
  background: var(--bg); z-index: -2;
}
.group-tabs::after {
  content: ''; position: absolute; inset: 0; border-radius: 16px;
  background: color-mix(in srgb, var(--text) 7%, var(--bg)); z-index: -1;
}
@media (min-width: 768px) {
  .group-tabs { top: 72px; }
  .group-tabs::before { inset: -12px -32px -6px; }
}
.group-tabs button {
  flex: 1; padding: 9px 0; border-radius: 12px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 700; font-size: 13px;
  transition: background .15s ease, color .15s ease;
}
.group-tabs button.on {
  background: var(--surface); color: var(--text); font-weight: 800;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .14);
}
/* Modo oscuro (variante píldora): la sombra negra de la píldora activa no se ve
   sobre fondo oscuro y la pista queda casi del color del fondo → poco contraste.
   Hundimos la pista, aclaramos la píldora activa y le damos anillo + sombra
   visibles; subimos algo el texto inactivo para legibilidad. */
@media (max-width: 991.98px) {
  [data-theme="dark"] .group-tabs::after {
    background: color-mix(in srgb, #000 30%, var(--bg));
  }
  [data-theme="dark"] .group-tabs button {
    color: color-mix(in srgb, var(--text) 62%, var(--bg));
  }
  [data-theme="dark"] .group-tabs button.on {
    background: color-mix(in srgb, var(--text) 15%, var(--surface));
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .12);
  }
}
/* En escritorio: pestañas de texto con subrayado (patrón desktop), sin pista.
   La pista (::after) pasa a ser la línea base inferior. */
@media (min-width: 992px) {
  .group-tabs {
    gap: 6px; padding: 0;
    border-radius: 0;
  }
  .group-tabs::after {
    inset: auto 0 0 0; height: 1px; border-radius: 0;
    background: var(--border);
  }
  .group-tabs button {
    flex: none; position: relative;
    padding: 10px 20px 13px; border-radius: 0;
    font-size: 14px;
  }
  .group-tabs button:hover { color: var(--text); }
  .group-tabs button.on { background: transparent; color: var(--text); box-shadow: none; }
  .group-tabs button.on::after {
    content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px;
    height: 3px; border-radius: 3px 3px 0 0; background: var(--grad);
  }
}

/* Cuerpo de la pestaña Evento: pila en móvil, grid en escritorio (ver media query) */
.group-body { display: flex; flex-direction: column; gap: 16px; }

/* --- Pestaña Configuración del grupo (solo admin) --- */
.cfg-form { display: flex; flex-direction: column; gap: 18px; }
.cfg-field { display: flex; flex-direction: column; }
.cfg-label { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.cfg-help { color: var(--muted); font-size: 12px; margin: 6px 0 0; font-weight: 500; }
.cover-upload { display: block; cursor: pointer; }
.cover-upload-preview {
  position: relative; height: 150px; border-radius: 16px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: center;
  box-shadow: var(--shadow);
}
.cover-upload-hint {
  margin-bottom: 12px; padding: 8px 14px; border-radius: 100px;
  background: rgba(0, 0, 0, .5); color: #fff; font-weight: 700; font-size: 12px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cover-upload-hint i { margin-right: 6px; }

/* Cabecera a sangre completa (no es una card): compensa el padding del .content
   con márgenes negativos y se difumina hacia el fondo dando paso al contenido. */
.group-header {
  position: relative; border-radius: 0;
  padding: 16px 18px 46px;
  margin: -22px -18px 0;   /* anula el padding del .content (móvil) */
  /* Sombra heredada por TODO el texto del hero: legible sobre el logo/portada. */
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55), 0 2px 10px rgba(0, 0, 0, .38);
}
.group-header > * { position: relative; z-index: 1; }   /* contenido sobre el difuminado */
/* Descripción del grupo bajo el nombre (máx. 200 car.) */
.gh-desc {
  margin-top: 6px; max-width: 560px;
  font-weight: 500; font-size: 13.5px; line-height: 1.4;
  color: rgba(255, 255, 255, .96); white-space: pre-line;
}
/* Logo del evento: grande y centrado, sobre el fondo pero bajo el texto */
.group-header-logo {
  position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92%, 640px); max-height: 82%; object-fit: contain;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, .45));
}
.group-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(to bottom, transparent, var(--bg)); z-index: 0; pointer-events: none;
}
.group-sched { min-width: 0; }

/* Barra superior dentro de un grupo (solo móvil): sustituye a la barra global.
   Oculta por defecto; aparece deslizándose al hacer scroll (JS añade .is-visible).
   Lleva el icono de atrás + el nombre del festival. */
.gh-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 35;
  display: flex; align-items: center; gap: 10px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
  /* Cristal esmerilado con el gradiente del evento (--c1/--c2 inline;
     fallback a los colores de marca). */
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--c1, var(--magenta)) 76%, transparent) 0%,
    color-mix(in srgb, var(--c2, var(--orange)) 76%, transparent) 100%);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid rgba(255,255,255,.18);
  color: #fff;
  transform: translateY(-100%);
  transition: transform .22s ease;
  pointer-events: none;
}
.gh-bar.is-visible { transform: translateY(0); pointer-events: auto; }
.gh-back, .gh-act {
  width: 38px; height: 38px; border-radius: 12px; flex: none; border: none; cursor: pointer;
  background: rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.gh-bar-title { font-family: var(--font-display); font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.gh-actions { display: flex; gap: 8px; flex: none; }

/* En el detalle inmersivo (evento/grupo/sintonía) el hero hace de barra: oculta
   la barra global en TODOS los tamaños. En móvil la sustituye la gh-bar; en
   escritorio queda el sidebar como navegación. Es sticky (ocupa flujo), así que
   al ocultarla el hero sube solo, sin dejar hueco. */
body[data-immersive] .topbar { display: none; }

/* En móvil el banner sube al borde superior y respeta la safe-area. */
@media (max-width: 767.98px) {
  .group-header { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
}

/* En escritorio el .content tiene más padding → ajustamos el sangrado y el aire. */
@media (min-width: 992px) {
  .group-header { margin: -28px -32px 0; padding: 18px 32px 52px; }
}

/* ============================================================
   AUTH · login / registro / recuperación de contraseña
   Hero con gradiente + hoja blanca (compartido por todas las
   páginas que extienden base_auth con este patrón).
   ============================================================ */
.login-hero { min-height: 100vh; display: flex; flex-direction: column; background: linear-gradient(165deg,#FF2E7E 0%,#9B2BD6 55%,#7A3CF0 100%); }
.login-top { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; color: #fff; }
.login-badge {
  width: 78px; height: 78px; border-radius: 24px; background: rgba(255,255,255,.16);
  display: flex; align-items: center; justify-content: center; font-size: 34px;
  margin-bottom: 22px; box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
.login-sheet { background: var(--surface); border-radius: 32px 32px 0 0; padding: 32px 24px; max-width: 460px; width: 100%; margin: 0 auto; }
@media (min-width: 768px) {
  .login-sheet { border-radius: 28px; margin-bottom: 40px; box-shadow: 0 30px 70px rgba(0,0,0,.25); }
  .login-hero { justify-content: center; }
  .login-top { flex: none; }
}

@media (min-width: 1280px) {
  .group-header {
    min-height: 240px;
    display: flex; flex-direction: column; justify-content: space-between;
    margin: 0;             /* el contenido vuelve al container centrado */
    padding: 20px 20px 56px;
    overflow: visible;     /* permite que el fondo se alargue fuera del container */
  }
  /* Solo el FONDO se alarga a todo el ancho del área principal (el sidebar, fijo y
     por encima, tapa el sobrante de la izquierda). El contenido queda centrado. */
  .group-header::before {
    content: ''; position: absolute; z-index: 0; top: 0; bottom: 0;
    left: 50%; transform: translateX(-50%); width: 100vw;
    background-image: inherit; background-size: cover; background-position: center;
  }
  .group-header::after { left: 50%; right: auto; transform: translateX(-50%); width: 100vw; }
  /* La tarjeta "Tu grupo" vive en la pestaña Configuración: sin ancho de lectura infinito */
  .group-aside { max-width: 720px; }
}

/* ============================================================
   SINTONÍA · baraja de tarjetas y panel de perfil
   ============================================================ */

.deck-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  max-width: 420px; margin: 0 auto;
  border-radius: 22px; background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.deck-photo {
  position: relative; aspect-ratio: 3 / 4; width: 100%;
  background: var(--grad-violet);
}
.deck-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* En móvil la card llena el alto disponible hasta la barra inferior y se
   adapta a la altura de cada dispositivo (dvh). La foto crece; las acciones
   quedan fijas al pie. Offset ≈ barra superior + pestañas + bottom-nav + márgenes. */
@media (max-width: 767.98px) {
  .deck-card {
    height: calc(100dvh - 210px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    min-height: 360px;
  }
  .deck-photo { flex: 1 1 auto; aspect-ratio: auto; min-height: 0; }
}

.deck-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 40px 18px 16px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(12,8,20,.72));
}
.deck-name { font-weight: 800; font-size: 22px; line-height: 1.15; }
.deck-name span { font-weight: 600; opacity: .85; }
.deck-common {
  margin-top: 6px; font-size: 12px; font-weight: 700;
  color: color-mix(in srgb, #fff 88%, var(--magenta));
}
.deck-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.deck-chips .chip {
  background: rgba(12,8,20,.34); color: #fff; backdrop-filter: blur(4px);
}

.deck-actions {
  display: flex; justify-content: center; gap: 22px;
  padding: 16px 0 18px;
}
.sbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 62px; height: 62px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 24px;
  background: var(--surface); box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .18s ease;
}
.sbtn:hover { transform: translateY(-2px); }
.sbtn:active { transform: scale(.94); }
.sbtn.no  { color: var(--muted); }
.sbtn.no:hover  { color: var(--magenta); box-shadow: 0 8px 22px color-mix(in srgb, var(--magenta) 26%, transparent); }
.sbtn.yes {
  color: #fff; background: var(--grad-pink);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--magenta) 34%, transparent);
}
.sbtn.yes:hover { box-shadow: 0 12px 30px color-mix(in srgb, var(--magenta) 44%, transparent); }

/* --- Sintonía: animación al dar me gusta / no me gusta (sin salir por los lados) ---
   Al pulsar: emblema central con destello + micro-reacción de la card. La siguiente
   card entra con un fundido-zoom (deckIn). */
.deck-card { transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease, filter .3s ease; }
#deck .deck-card { animation: deckIn .3s cubic-bezier(.22,1,.36,1); }
@keyframes deckIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.deck-stamp {
  position: absolute; inset: 0; z-index: 6; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(64px, 22vw, 120px); opacity: 0;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.35));
  animation: deckStampPop .45s ease forwards;
}
.deck-stamp.like { color: var(--green); }
.deck-stamp.nope { color: var(--magenta); }

.deck-card--like { transform: translateY(-6px) scale(1.03); box-shadow: 0 24px 50px color-mix(in srgb, var(--green) 42%, transparent); }
.deck-card--nope { transform: translateY(5px) scale(.98); filter: saturate(.55); }
.deck-card--like .deck-actions, .deck-card--nope .deck-actions { pointer-events: none; }

.deck-card--like::after, .deck-card--nope::after {
  content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  animation: deckFlash .45s ease forwards;
}
.deck-card--like::after { background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--green) 48%, transparent), transparent 62%); }
.deck-card--nope::after { background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--magenta) 42%, transparent), transparent 62%); }

@keyframes deckStampPop {
  0%   { opacity: 0; transform: scale(.3) rotate(-14deg); }
  45%  { opacity: 1; transform: scale(1.15) rotate(0); }
  70%  { transform: scale(1); }
  100% { opacity: 0; transform: scale(1.02); }
}
@keyframes deckFlash { 0% { opacity: 0; } 28% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #deck .deck-card, .deck-stamp,
  .deck-card--like, .deck-card--nope { animation: none; transform: none; filter: none; }
}

.dating-photos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px; margin: 6px 0 12px;
}
.dating-photo {
  position: relative; aspect-ratio: 1;
  border-radius: 14px; overflow: hidden;
  background: var(--soft); box-shadow: var(--shadow);
}
.dating-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Tile «añadir foto» (dentro de la rejilla de fotos) */
.dating-add {
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--purple); font-size: 22px; box-shadow: none;
  border: 1.5px dashed color-mix(in srgb, var(--purple) 35%, var(--border));
  background: color-mix(in srgb, var(--purple) 6%, var(--surface));
}
.dating-photo button {
  position: absolute; top: 5px; right: 5px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; cursor: pointer; line-height: 1;
  color: #fff; background: rgba(12,8,20,.6); backdrop-filter: blur(4px);
}
.dating-photo button:hover { background: var(--magenta); }

/* ----- Sintonía · flujo de match a pantalla completa (overlay + etapas) ----- */
.match-overlay {
  position: fixed; inset: 0; z-index: 200;
  animation: matchIn .32s cubic-bezier(.22,1,.36,1);
}
.match-overlay.is-leaving { animation: matchOut .3s cubic-bezier(.4,0,1,1) forwards; }
.match-stage { height: 100%; }
@keyframes matchIn  { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes matchOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(1.04); } }

.flow-card {
  height: 100%; display: flex; flex-direction: column;
  padding: calc(24px + env(safe-area-inset-top,0px)) 22px calc(24px + env(safe-area-inset-bottom,0px));
  animation: flowStageIn .24s ease both;
}
@keyframes flowStageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Etapas de celebración / compartido: fondo de marca, contenido centrado */
.flow-card--accent { background: var(--grad-pink); color: #fff; text-align: center; }
.flow-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.flow-emoji {
  width: 92px; height: 92px; border-radius: 30px; margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; color: #fff; background: rgba(255,255,255,.18);
  animation: flowPop .5s cubic-bezier(.22,1.4,.5,1) both;
}
@keyframes flowPop { 0% { transform: scale(0); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.flow-title { font-family: var(--font-display); font-weight: 800; font-size: 32px; letter-spacing: -.02em; margin: 0 0 6px; }
.flow-sub { font-weight: 600; font-size: 15px; opacity: .95; margin: 0 0 26px; }

.flow-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; margin: 0 auto; }
.flow-share { display: flex; flex-direction: column; gap: 10px; }
.flow-note { font-size: 13px; font-weight: 600; opacity: .9; margin: 0; }

/* Botón «frosted» blanco (cristal esmerilado) para el flujo sobre degradado */
.btn-frost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 13px; font-weight: 700; cursor: pointer;
  background: rgba(255,255,255,.16); color: #fff; border: none; box-shadow: none;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .15s ease, transform .12s ease;
}
.btn-frost:hover { background: rgba(255,255,255,.26); transform: translateY(-1px); }
.btn-frost:active { transform: scale(.98); }

/* Botón blanco sólido (texto oscuro fijo: la tarjeta es siempre el degradado) */
.btn-white {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 13px; font-weight: 700; cursor: pointer; border: none;
  background: #fff; color: #1A1230; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .18s ease;
}
.btn-white:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-white:active { transform: scale(.98); }

/* Botón inferior a todo el ancho (col. de acciones), fijado al pie de la tarjeta */
.flow-bottom { width: 100%; max-width: 340px; margin: 22px auto 0; align-self: center; }

/* Etapa perfil: foto arriba, contenido con scroll, acciones fijas abajo */
.flow-card--profile { background: var(--surface); padding: 0; }
.flow-photo {
  position: relative; width: 100%; flex: none; height: 42vh; min-height: 260px;
  background: var(--grad-violet); overflow: hidden;
}
.flow-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.flow-photo-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 72px;
}
.flow-photo-name {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 22px 18px; color: #fff;
  font-family: var(--font-display); font-weight: 800; font-size: 26px;
  background: linear-gradient(180deg, transparent, rgba(12,8,20,.72));
}
.flow-photo-name span { font-weight: 600; opacity: .85; }
.flow-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 8px; }
.flow-gallery { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.flow-gallery img { width: 72px; height: 90px; object-fit: cover; border-radius: 12px; flex: none; }
.flow-foot {
  flex: none; display: flex; flex-direction: column; gap: 10px;
  padding: 14px 22px calc(18px + env(safe-area-inset-bottom,0px));
  border-top: 1px solid var(--border);
}

body.match-open { overflow: hidden; }

/* ----- Splash «Añadir evento» a pantalla completa (mismo estilo que Sintonía) ----- */
.splash { position: fixed; inset: 0; z-index: 210; display: none; }
.splash.is-open { display: block; animation: matchIn .32s cubic-bezier(.22,1,.36,1); }
.splash.is-open.is-leaving { animation: matchOut .3s cubic-bezier(.4,0,1,1) forwards; }
.splash-x {
  position: absolute; top: calc(12px + env(safe-area-inset-top,0px)); right: 14px; z-index: 2;
  width: 40px; height: 40px; border-radius: 14px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  background: rgba(255,255,255,.2); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.splash-x:hover { background: rgba(255,255,255,.32); }
.splash-opt { display: flex; flex-direction: column; gap: 6px; }
.splash-opt + .splash-opt { margin-top: 8px; }
.splash-desc { margin: 0; font-weight: 600; font-size: 12px; line-height: 1.4; color: rgba(255,255,255,.92); text-align: center; }
/* En la sección de Eventos ya se está buscando: el splash del + solo ofrece
   crear (se oculta la opción de buscar y se ajusta el subtítulo). */
.splash-sub-create { display: none; }
body[data-page="explore"] .splash-opt--search { display: none; }
body[data-page="explore"] .splash-sub-default { display: none; }
body[data-page="explore"] .splash-sub-create { display: block; }
body.splash-open { overflow: hidden; }

/* Página de crear evento como splash a pantalla completa: cubre el chrome
   (barra superior + inferior) con un overlay fijo. Fondo de gradiente completo;
   el formulario va directo encima y cada campo (input) tiene fondo blanco y
   destaca. Cancelar = icono X (igual que el otro splash). */
body[data-page="create"] { overflow: hidden; }
.form-splash {
  position: fixed; inset: 0; z-index: 200; overflow-y: auto; color: #fff;
  background: linear-gradient(165deg, #FF2E7E 0%, #9B2BD6 55%, #7A3CF0 100%);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(44px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; -ms-overflow-style: none;   /* oculta el indicador de scroll */
}
.form-splash::-webkit-scrollbar { display: none; width: 0; height: 0; }
.form-splash-inner { max-width: 640px; margin: 0 auto; }
/* Variante centrada (splash de éxito «Evento creado»). */
.form-splash--center { display: flex; align-items: center; justify-content: center; }
.form-splash--center .form-splash-inner { width: 100%; max-width: 420px; }
.form-splash-head { text-align: center; margin-bottom: 24px; }
.form-splash-emoji {
  width: 72px; height: 72px; border-radius: 22px; margin: 6px auto 14px;
  background: rgba(255, 255, 255, .2);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.form-splash-title { font-family: var(--font-display); font-weight: 800; font-size: 28px; letter-spacing: -.02em; margin: 0; }
.form-splash-sub { font-weight: 600; font-size: 14px; opacity: .95; margin: 6px 0 0; }
/* Elementos con fondo blanco dentro del splash → su texto va en oscuro
   (los .input ya fijan su propio color; aquí van las tarjetas de toggle y el
   dropzone, cuyo texto heredaría el blanco del splash). */
.form-splash .fs-toggle,
.form-splash .dropzone,
.form-splash .sched-prompt { color: var(--text); }
/* Botón (bajo el dropzone) que abre el modal del prompt de IA. */
.sched-prompt-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px; border: none; border-radius: 100px; cursor: pointer;
  background: rgba(255, 255, 255, .2); color: #fff; font-weight: 700; font-size: 13px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.sched-prompt-open:hover { background: rgba(255, 255, 255, .3); }
/* Modal del prompt de IA (por encima del splash de crear evento). */
.prompt-modal {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.prompt-modal.is-open { display: flex; }
/* Splashes en página (subir horarios / añadir espacio): ocultos salvo al abrirse,
   con animación de intro (matchIn) y outro (matchOut, vía .is-leaving). */
.form-splash.app-splash { display: none; }
.form-splash.app-splash.is-open { display: block; animation: matchIn .32s cubic-bezier(.22,1,.36,1); }
/* Variante centrada (confirmaciones): centra vertical/horizontal al abrirse. */
.form-splash.app-splash.is-open.form-splash--center { display: flex; }
.form-splash.app-splash.is-open.is-leaving { animation: matchOut .3s cubic-bezier(.4,0,1,1) forwards; }
.prompt-modal-card {
  position: relative; background: var(--surface); color: var(--text);
  border-radius: 22px; padding: 22px 20px; width: 100%; max-width: 460px;
  max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
/* Inputs de archivo nativos ocultos: el área (dropzone / ph-block) es el disparador. */
#create-event-form input[type="file"] { display: none; }
/* Al elegir imagen, el ph-block muestra la previsualización y oculta icono/texto. */
.img-pick-preview.is-selected i,
.img-pick-preview.is-selected span { display: none; }

/* El splash de lanzamiento del PWA (#pwa-splash) tiene su CSS crítico inline en
   el <head> (templates/_partials/_pwa_splash_head.html) para pintarse al primer
   render sin esperar a esta hoja ni a las webfonts. */

/* ----- Sintonía · lista de sintonías (fila → detalle en popup) ----- */
.match-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border: none; cursor: pointer;
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .18s ease;
}
.match-row:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.match-row-av {
  width: 44px; height: 44px; border-radius: 14px; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.match-row-av img { width: 100%; height: 100%; object-fit: cover; }
.match-row-av--ph { background: var(--grad-violet); color: #fff; font-weight: 800; font-size: 17px; }
.match-row-main { flex: 1; min-width: 0; }
.match-row-name { display: block; font-weight: 800; font-size: 15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-row-sub { display: block; font-weight: 600; font-size: 12px; color: var(--muted); margin-top: 2px; }
.match-row-go { color: var(--muted); font-size: 13px; flex: none; }

/* Detalle del match (popup de la lista de sintonías): perfil casi a pantalla
   completa reutilizando la estética del perfil del flujo de match. */
.pop-panel--match {
  width: 400px; max-width: 100%; height: min(78vh, 560px);
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.pop-menu .pop-panel--match { left: 0; right: auto; transform-origin: top left; }
.pop-panel--match .flow-photo { height: 42vh; min-height: 220px; max-height: 360px; }
/* En móvil el popup es una hoja inferior alta, pero su borde superior se
   detiene justo bajo la safe-area (notch/barra de estado), sin solaparla. */
@media (max-width: 767.98px) {
  .pop-panel--match {
    width: 100%;
    height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - 12px);
  }
}
.match-chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* Formulario de perfil bloqueado (cuando «quiero aparecer» está desactivado) */
.profile-fields.is-locked { opacity: .5; transition: opacity .15s ease; }
.contact-row { display: flex; align-items: center; gap: 11px; padding: 8px 2px; }
.contact-row + .contact-row { border-top: 1px solid var(--border); }
.contact-ic {
  width: 34px; height: 34px; border-radius: 11px; flex: none; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c, var(--purple)) 15%, var(--surface));
  color: var(--c, var(--purple));
}
.contact-row--instagram { --c: var(--magenta); }
.contact-row--whatsapp  { --c: var(--green); }
.contact-row--telegram  { --c: var(--cyan); }
.contact-main { min-width: 0; }
.contact-medium { display: block; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.contact-value { display: block; font-weight: 700; font-size: 14px; word-break: break-all; }

/* ---- Skeletons (carga de contenido por HTMX) ---- */
.skel{position:relative;overflow:hidden;background:var(--soft);border-radius:14px}
.skel::after{content:"";position:absolute;inset:0;transform:translateX(-100%);
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent);
  animation:skel 1.2s infinite}
[data-theme="dark"] .skel::after{background:linear-gradient(90deg,transparent,rgba(255,255,255,.08),transparent)}
@keyframes skel{100%{transform:translateX(100%)}}
.skel-line{height:12px;border-radius:8px;margin:10px 0}
.skel-card{height:120px;border-radius:18px;margin-bottom:12px}
.skel-chip{height:34px;width:120px;border-radius:999px}
.content-offline{padding:40px 16px;text-align:center;color:var(--muted);font-weight:600}

/* ---- Transiciones de navegación (View Transitions API) ----
   Cross-fade suave al navegar entre documentos. El shell se sirve al instante
   desde la caché del SW, así que la transición cae sobre el skeleton y luego el
   contenido llega por HTMX. Degrada limpio donde no haya soporte. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}
