/* ═══ Inicio (#/home) · prefijo .hm- ═══ */
.hm-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 1640px; margin: 0; }
.hm-main, .hm-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
@media (min-width: 1100px) { .hm-wrap { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } }

/* saludo */
.hm-hello { gap: 14px; }
.hm-hello h1 { font-size: 24px; line-height: 1.15; }
.hm-date { margin-bottom: 2px; } .hm-date::first-letter { text-transform: uppercase; }   /* «Sábado, 19 de septiembre» (capitalize dejaba «De Septiembre») */
.hm-crowd-more { display: none; }
.hm-me { border-radius: 50%; transition: transform var(--t) var(--spring); }
.hm-me:hover { transform: scale(1.06) rotate(-4deg); }
.hm-bell { position: relative; width: 46px; height: 46px; flex: none; }
.hm-bell:hover { transform: translateY(-2px); }
.hm-bell .badge { position: absolute; top: -3px; right: -3px; }

/* encabezados de sección */
.hm-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 26px; }
.hm-link { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 700; color: var(--primary); padding: 6px 0 6px 10px; transition: gap var(--t) var(--ease); }
.hm-link .icon { width: 15px; height: 15px; }
.hm-link:hover { gap: 6px; }
.hm-none { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-radius: var(--r-lg); }

/* fila de avatares conectados */
.hm-people-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; margin: 0 -2px; scrollbar-width: none; scroll-snap-type: x proximity; }
.hm-people-row::-webkit-scrollbar { display: none; }
.hm-person { width: 72px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; scroll-snap-align: start; transition: transform var(--t) var(--spring), opacity var(--t) var(--ease); }
.hm-person:hover { transform: translateY(-4px); }
.hm-person:active { transform: scale(.94); }
.hm-person.off { opacity: .55; }
.hm-person.off:hover { opacity: 1; }
.hm-person-name { max-width: 100%; font-size: 12px; font-weight: 600; color: var(--text-2); }
.hm-ring { padding: 3px; border-radius: 50%; border: 2px solid var(--line); transition: border-color var(--t) var(--ease); }
.hm-person:not(.off) .hm-ring { border-color: var(--primary); }
.hm-ring.live { border-color: var(--ok) !important; box-shadow: 0 0 0 4px var(--ok-soft); }
.hm-add { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--muted); color: var(--muted); transition: all var(--t) var(--ease); }
.hm-person:hover .hm-add { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* tarjeta héroe */
.hm-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 230px; padding: 26px; border-radius: var(--r-xl); color: #fff;
  background: linear-gradient(135deg, #143601 0%, #245501 45%, #538d22 100%); box-shadow: 0 22px 46px rgba(20, 54, 1, .36); }
/* Sin `filter: blur`: los dos ya son degradados radiales que mueren en transparente; el filtro no se notaba y obligaba a recalcularlo en cada cuadro de la animación. */
.hm-hero::before, .hm-hero::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; animation: hm-drift 14s var(--ease) infinite alternate; will-change: transform; }
.hm-hero::before { width: 340px; height: 340px; right: -90px; top: -140px; background: radial-gradient(circle at 30% 30%, rgba(205, 242, 160, .75), rgba(205, 242, 160, 0) 70%); }
.hm-hero::after { width: 300px; height: 300px; left: 28%; bottom: -190px; background: radial-gradient(circle at 50% 50%, rgba(253, 230, 138, .6), rgba(253, 230, 138, 0) 70%); animation-delay: -6s; }
.hm-hero-glow { position: absolute; inset: 0; z-index: -1; background: radial-gradient(600px 240px at 0% 100%, rgba(20, 10, 80, .45), transparent 70%); }
.hm-hero-text { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; max-width: 520px; }
.hm-live-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; }
.hm-live-pill .dot:not(.live) { background: rgba(255, 255, 255, .7); }
.hm-hero h2 { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.12; font-weight: 800; }
.hm-hero h2 em { font-style: normal; color: #cdf2a0; }
.hm-hero p { color: rgba(255, 255, 255, .86); font-size: 14px; max-width: 420px; }
.hm-hero-actions { margin-top: 6px; }
.hm-hero-btn { background: #fff; color: #143601; padding-left: 7px; box-shadow: 0 12px 26px rgba(10, 30, 2, .3); }
.hm-hero-btn:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 16px 32px rgba(10, 5, 70, .4); }
.hm-hero-btn-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #143601; color: #fff; transition: transform var(--t) var(--spring); }
.hm-hero-btn:hover .hm-hero-btn-ic { transform: rotate(-8deg) scale(1.06); }
.hm-hero-alt, .hm-hero-alt:hover { color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24); }
.hm-hero-alt:hover { background: rgba(255, 255, 255, .28); transform: translateY(-2px); }
.hm-hero-crowd { position: relative; flex: none; display: flex; align-items: center; }
.hm-hero-crowd .hm-float { display: block; margin-left: -12px; }
.hm-hero-crowd .hm-float:first-child { margin-left: 0; }
.hm-hero-crowd .hm-float .avatar { --s: 38px; border: 3px solid rgba(255, 255, 255, .85); box-shadow: 0 10px 22px rgba(10, 5, 70, .35); }
.hm-hero-crowd .hm-hero-wave { margin-left: 10px; }
.hm-hero-wave { display: inline-flex; align-items: center; gap: 9px; height: 34px; padding: 0 14px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (min-width: 620px) {
  .hm-hero-crowd { width: 214px; height: 176px; align-items: flex-end; justify-content: center; padding-right: 8px; }
  .hm-hero-crowd .hm-float { position: absolute; margin: 0; animation: hm-bob 5s ease-in-out infinite; animation-delay: calc(var(--i) * -1.1s); }
  .hm-hero-crowd .hm-float .avatar { --s: 52px; }
  .hm-hero-crowd .hm-float:nth-child(1) { left: 72px; top: 26px; } .hm-hero-crowd .hm-float:nth-child(1) .avatar { --s: 68px; }
  .hm-hero-crowd .hm-float:nth-child(2) { left: 6px; top: 6px; } .hm-hero-crowd .hm-float:nth-child(3) { left: 150px; top: 0; }
  .hm-hero-crowd .hm-float:nth-child(4) { left: 0; top: 74px; } .hm-hero-crowd .hm-float:nth-child(5) { left: 156px; top: 66px; }
  .hm-hero-crowd .hm-hero-wave { margin-left: 0; }
}
@media (max-width: 619px) {
  .hm-hero { flex-direction: column; align-items: stretch; padding: 22px 20px; min-height: 0; }
  .hm-hero-btn, .hm-hero-alt { flex: 1; }
}

/* mini-estadísticas */
.hm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hm-stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; min-width: 0;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.hm-stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.hm-stat:active { transform: scale(.97); }
.hm-stat-ic { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.hm-stat-ic.ok { background: var(--ok-soft); color: var(--ok); } .hm-stat-ic.info { background: var(--primary-soft); color: var(--primary); }
.hm-stat-ic.danger { background: var(--danger-soft); color: var(--danger); } .hm-stat-ic.warn { background: var(--warn-soft); color: var(--warn); }
.hm-stat-txt { display: flex; flex-direction: column; min-width: 0; }
.hm-stat-txt b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-stat-txt small { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.25; }
.hm-stat-sk { width: 44px; height: 22px; margin-bottom: 3px; }
@media (max-width: 560px) {
  .hm-stats { gap: 8px; }
  .hm-stat { flex-direction: column; align-items: flex-start; gap: 9px; padding: 12px; }
  .hm-stat-ic { width: 34px; height: 34px; border-radius: 11px; } .hm-stat-ic .icon { width: 17px; height: 17px; }
  .hm-stat-txt b { font-size: 18px; }
}

/* tarjetas pastel de salas */
.hm-rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.hm-room { --tint: #8cc152; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px; border-radius: 26px; cursor: pointer; position: relative; overflow: hidden;
  background: var(--card); background: color-mix(in srgb, var(--tint) 24%, var(--card)); border: 1px solid color-mix(in srgb, var(--tint) 34%, transparent);
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.hm-room::after { content: ''; position: absolute; width: 130px; height: 130px; right: -40px; top: -50px; border-radius: 50%; background: color-mix(in srgb, var(--tint) 30%, transparent); pointer-events: none; transition: transform var(--t-slow) var(--ease); }
.hm-room:hover { transform: translateY(-4px); box-shadow: 0 18px 34px color-mix(in srgb, var(--tint) 34%, transparent); }
.hm-room:hover::after { transform: scale(1.25); }
.hm-room:active { transform: scale(.975); }
.hm-room > * { position: relative; z-index: 1; }
.hm-room-emoji { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; background: var(--card); box-shadow: var(--shadow); margin-bottom: 8px; }
.hm-room h4 { font-size: 15px; }
.hm-room-sub { color: var(--text-2); opacity: .8; }
/* flex-wrap: con 4+ personas y más de 1 h, avatares + cronómetro no entran en una tarjeta de ~190px y el cronómetro quedaba cortado por el overflow de la tarjeta → baja a otra línea */
.hm-room-mid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; min-height: 36px; margin-top: 8px; }
.hm-room-timer { flex: none; }
.hm-room .avatar-stack .avatar { border-color: color-mix(in srgb, var(--tint) 24%, var(--card)); }
.hm-more { background: var(--text) !important; color: var(--card); font-size: 11px; }
.hm-room-timer { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; background: var(--card); color: var(--text-2); }
.hm-room-timer .icon { width: 13px; height: 13px; }
.hm-room-foot { margin-top: 10px; padding-top: 10px; border-top: 1px dashed color-mix(in srgb, var(--tint) 55%, transparent); font-size: 13px; }
.hm-room-go { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); transition: transform var(--t) var(--spring), background var(--t) var(--ease), color var(--t) var(--ease); }
.hm-room-go .icon { width: 16px; height: 16px; }
.hm-room:hover .hm-room-go { transform: translateX(3px); background: var(--text); color: var(--card); }
@media (max-width: 700px) {
  .hm-rooms { display: flex; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .hm-rooms::-webkit-scrollbar { display: none; }
  .hm-room { flex: 0 0 172px; scroll-snap-align: center; }
}

/* accesos rápidos con degradados */
.hm-quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hm-qa { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 22px; min-height: 148px; padding: 14px; border-radius: 26px; color: #fff; text-align: left;
  box-shadow: 0 14px 28px rgba(40, 30, 110, .2); transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease); }
.hm-qa::before, .hm-qa::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; transition: transform var(--t-slow) var(--ease); }
.hm-qa::before { width: 190px; height: 190px; right: -70px; bottom: -60px; background: rgba(255, 255, 255, .2); }
.hm-qa::after { width: 130px; height: 130px; right: -20px; bottom: -64px; background: rgba(255, 255, 255, .22); }
.hm-qa:hover { transform: translateY(-4px); box-shadow: 0 20px 36px rgba(40, 30, 110, .3); }
.hm-qa:hover::before { transform: scale(1.12) translate(-8px, -6px); } .hm-qa:hover::after { transform: scale(1.18); }
.hm-qa:active { transform: scale(.97); }
.hm-qa.violet { background: linear-gradient(140deg, #6aa82e, #245501); } .hm-qa.blue { background: linear-gradient(140deg, #8cc152, #3f7d1f); }
.hm-qa.pink { background: linear-gradient(140deg, #fbbf24, #f97316 60%, #c2410c); } .hm-qa.green { background: linear-gradient(140deg, #2f9e6b, #14705a); }
.hm-qa-ic { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #143601; box-shadow: 0 8px 18px rgba(10, 5, 70, .22); }
.hm-qa-ic .badge { position: absolute; top: -4px; right: -6px; }
.hm-qa-txt { display: flex; flex-direction: column; gap: 2px; }
.hm-qa-txt b { font-size: 14.5px; font-weight: 800; line-height: 1.2; }
.hm-qa-txt small { font-size: 11.5px; color: rgba(255, 255, 255, .85); font-weight: 600; line-height: 1.3; }
@media (min-width: 700px) and (max-width: 1099px) { .hm-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* próximas publicaciones */
.hm-posts { padding: 8px; border-radius: 26px; }
.hm-post { padding: 10px; }
.hm-post-thumb { width: 50px; height: 50px; border-radius: 15px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }
.hm-post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hm-post-meta { gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.hm-post-meta .platform { width: 18px; height: 18px; border-radius: 6px; font-size: 9px; }
.hm-post-sk { display: flex; align-items: center; gap: 12px; padding: 10px; }
.hm-post-sk > .skeleton { width: 50px; height: 50px; border-radius: 15px; flex: none; }
.hm-post-sk .col { gap: 7px; } .hm-post-sk .col .skeleton { height: 12px; } .hm-post-sk .col .skeleton:last-child { width: 55%; }

@keyframes hm-drift { to { transform: translate(-30px, 24px) scale(1.12); } }
@keyframes hm-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ═══ CELULAR ═══ (todo lo de abajo solo aplica ≤860px; el escritorio no cambia) */
@media (max-width: 860px) {
  .view-body.hm { padding-top: 2px; padding-bottom: calc(104px + var(--safe-b) + var(--dock-h, 0px)); }
  .hm-wrap, .hm-main, .hm-side { gap: 20px; }

  /* saludo: línea chica (saludo · fecha) + nombre grande, nunca cortado a la mitad */
  .hm-hello { gap: 12px; padding-bottom: 12px; }
  .hm-hello-txt { min-width: 0; }
  .hm-date { font-size: 13px; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hm-hello h1 { font-size: 25px; line-height: 1.15; }
  .hm-me:hover, .hm-bell:hover { transform: none; }
  .hm-me:active, .hm-bell:active { transform: scale(.94); }
  .hm-bell { width: 48px; height: 48px; }

  .hm-sec-head { margin-bottom: 10px; min-height: 28px; }
  .hm-sec-head h3 { font-size: 17px; }
  .hm-link { min-height: 44px; margin: -8px -4px -8px 0; padding: 0 4px 0 12px; font-size: 13px; }

  /* conectados: carrusel de borde a borde; el desvanecido de la derecha insinúa que hay más */
  .hm-people-row { gap: 4px; margin: 0 -16px; padding: 4px 34px 6px 12px; scroll-padding-left: 12px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); -webkit-overflow-scrolling: touch; }
  .hm-person { width: 70px; gap: 6px; }
  .hm-person:hover { transform: none; } .hm-person:active { transform: scale(.94); }
  .hm-person .avatar.lg { --s: 50px; }
  .hm-add { width: 60px; height: 60px; }
  .hm-person-name { font-size: 12.5px; }

  /* héroe: sin bloque índigo → tinta (--stage) con las brasas del fondo (--backdrop) asomando; todo sale de tokens */
  .hm-hero { background: var(--stage); box-shadow: var(--shadow); border: 1px solid var(--lg-border); }
  .hm-hero::before { inset: 0; width: auto; height: auto; right: 0; top: 0; border-radius: 0; filter: none; animation: none; background: var(--backdrop); opacity: .5; }
  :root[data-theme='dark'] .hm-hero::before { opacity: .7; }
  .hm-hero::after { inset: 0; width: auto; height: auto; left: 0; bottom: 0; border-radius: 0; filter: none; animation: none; background: linear-gradient(200deg, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, .5) 100%); }
  .hm-hero-glow { display: none; }
  .hm-hero h2 em { color: var(--ok); }
  .hm-hero-btn, .hm-hero-btn:hover { color: var(--stage); box-shadow: 0 10px 22px rgba(0, 0, 0, .28); transform: none; }
  .hm-hero-btn-ic { background: var(--stage); }
  .hm-hero-btn:active, .hm-hero-alt:active { transform: scale(.96); }
  .hm-stat:hover, .hm-room:hover, .hm-qa:hover { transform: none; } .hm-room:hover { box-shadow: none; } .hm-stat:hover { box-shadow: var(--shadow); }
  .hm-stat:active, .hm-room:active, .hm-qa:active { transform: scale(.97); }
}
@media (max-width: 619px) {
  /* héroe compacto: ~1/5 de la pantalla, no la mitad */
  .hm-hero { padding: 16px; gap: 0; border-radius: 26px; }
  .hm-hero-text { gap: 6px; max-width: none; }
  .hm-live-pill { height: 28px; padding: 0 11px; margin-bottom: 4px; }
  .hm-hero h2 { font-size: 22px; line-height: 1.15; }
  .hm-hero-rest { display: none; }
  .hm-hero p { font-size: 13.5px; line-height: 1.4; max-width: none; }
  .hm-hero-actions { width: 100%; gap: 8px; margin-top: 8px; flex-wrap: nowrap; }
  .hm-hero-btn, .hm-hero-alt { height: 48px; font-size: 14px; min-width: 0; padding-right: 16px; }
  .hm-hero-alt { flex: 0 1 auto; padding: 0 18px; }
  .hm-hero-btn-ic { width: 36px; height: 36px; flex: none; }
  .hm-hero-crowd { position: absolute; top: 15px; right: 14px; }
  .hm-hero-crowd .hm-float { margin-left: -9px; }
  .hm-hero-crowd .hm-float .avatar { --s: 30px; border-width: 2px; box-shadow: none; }
  .hm-hero-wave { display: none; }
  .hm-crowd-more { display: grid; place-items: center; min-width: 30px; height: 30px; margin-left: -9px; padding: 0 6px; border-radius: 15px; font-size: 11px; font-weight: 800; color: var(--stage); background: #fff; border: 2px solid rgba(255, 255, 255, .85); position: relative; }

  /* mosaicos: ícono y número en la misma fila, etiqueta abajo (más bajos, misma info) */
  .hm-stats { gap: 10px; }
  .hm-stat { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; padding: 12px; border-radius: 20px; }
  .hm-stat-txt { display: contents; }
  .hm-stat-txt b { font-size: 20px; }
  .hm-stat-txt b.long { grid-column: 1 / -1; font-size: 17px; margin-bottom: -4px; }   /* «7 h 45 m» no entra al lado del ícono: baja a su propia línea */
  .hm-stat-txt small { grid-column: 1 / -1; font-size: 11.5px; min-height: 2.5em; }
  .hm-stat-sk { width: 34px; margin: 0; }

  /* salas: carrusel de borde a borde, se asoma la siguiente tarjeta */
  .hm-rooms { gap: 12px; padding: 2px 16px 10px; scroll-padding-left: 16px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .hm-room { flex: 0 0 164px; scroll-snap-align: start; padding: 14px; border-radius: 24px; }
  .hm-room-emoji { width: 40px; height: 40px; font-size: 19px; margin-bottom: 6px; }
  .hm-room-go { width: 36px; height: 36px; }
  .hm-room-foot { margin-top: 8px; padding-top: 8px; }

  /* accesos rápidos: 2×2 más bajos */
  .hm-quick { gap: 10px; }
  .hm-qa { min-height: 118px; gap: 14px; padding: 13px; border-radius: 24px; }
  .hm-qa-ic { width: 42px; height: 42px; }
  .hm-qa-txt b { font-size: 14px; }
  .hm-qa-txt small { font-size: 11.5px; }

  /* próximas publicaciones */
  .hm-posts { padding: 6px; border-radius: 24px; }
  .hm-post { padding: 10px 8px; min-height: 64px; }
  .hm-post-thumb { width: 48px; height: 48px; border-radius: 14px; }
  .hm-post-meta { gap: 6px; margin-top: 4px; }
  .hm-post-meta .pill { height: 20px; padding: 0 8px; font-size: 10.5px; }
  .hm-none { flex-direction: column; align-items: stretch; text-align: center; gap: 10px; }
}
@media (max-width: 374px) { .hm-hero-alt { display: none; } .hm-hello h1 { font-size: 23px; } }

/* iPhone con iOS < 16.2 no entiende color-mix(): sin esto las tarjetas de sala quedaban blancas, sin su color pastel */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .hm-room { border: 1px solid var(--line); }
  .hm-room::before { content: ''; position: absolute; inset: 0; background: var(--tint); opacity: .2; pointer-events: none; }
  .hm-room::after { background: var(--tint); opacity: .22; }
  .hm-room-foot { border-top: 1px dashed var(--line); }
}
