/* ==========================================================================
   NimbookGR — páginas: auth, feed, perfil, mensajes, amigos, grupos, ajustes
   ========================================================================== */

/* ---------- autenticación ------------------------------------------------ */
.auth {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 8% 0%, rgba(8, 102, 255, .10), transparent 60%),
    radial-gradient(800px 500px at 95% 100%, rgba(139, 92, 246, .12), transparent 62%),
    var(--bg);
}
html[data-theme="dark"] .auth {
  background:
    radial-gradient(900px 500px at 8% 0%, rgba(45, 136, 255, .18), transparent 60%),
    radial-gradient(800px 500px at 95% 100%, rgba(139, 92, 246, .16), transparent 62%),
    var(--bg);
}
.auth-wrap {
  display: grid; grid-template-columns: 1.05fr .95fr; align-items: center;
  gap: 48px; width: min(100%, 1060px);
}
.auth-brand { max-width: 520px; }
.auth-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.auth-logo img { width: 60px; height: 60px; border-radius: 17px; box-shadow: 0 8px 20px -8px rgba(8, 102, 255, .55); }
.auth-logo span { font-size: 34px; font-weight: 800; letter-spacing: -1.2px; color: var(--text); }
.auth-tagline { font-size: 27px; line-height: 1.22; font-weight: 600; color: var(--text); letter-spacing: -.4px; }
.auth-illustration { margin-top: 8px; max-width: 470px; }
.auth-illustration svg { width: 100%; height: auto; display: block; }
.auth-card {
  background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 440px; margin: 0 auto;
}
.auth-card-head { text-align: center; margin-bottom: 2px; }
.auth-card h2 { font-size: 23px; letter-spacing: -.3px; margin-bottom: 4px; }
.auth-card .sub { font-size: 14px; color: var(--text-2); }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-card .input { min-height: 46px; font-size: 15.5px; }
.auth-card .btn.primary { min-height: 48px; font-size: 17px; font-weight: 700; border-radius: var(--r); margin-top: 2px; }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 2px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.auth-alt { background: #42b72a; color: #fff; min-height: 46px; font-size: 16px; font-weight: 700; }
.auth-alt:hover { background: #36a420; }
.auth-legal { font-size: 12px; line-height: 1.5; color: var(--text-3); text-align: center; }
.auth-divider {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.auth-divider .ico { color: var(--brand); }
.auth-conn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--card-2); border-radius: var(--r); font-size: 13px; color: var(--text-2);
}
.auth-conn .grow { min-width: 0; }
.auth-conn .repo { font-weight: 600; color: var(--text); }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-2); margin-top: 6px; }
.auth-loading { text-align: center; color: var(--text-2); font-size: 14px; }
.error-card { text-align: center; align-items: center; max-width: 420px; }
.error-illustration { max-width: 240px; margin: 0 auto; }
.error-illustration svg { width: 100%; height: auto; display: block; }
.intro-link:hover { text-decoration: underline; }

@media (max-width: 960px) {
  .auth-wrap { grid-template-columns: 1fr; gap: 10px; }
  .auth-brand { display: none; }
  .auth {
    align-items: flex-start; padding-top: max(24px, 6vh);
    background:
      radial-gradient(700px 420px at 50% -10%, rgba(8, 102, 255, .18), transparent 60%),
      var(--bg);
  }
}
@media (max-width: 560px) {
  .auth { padding-inline: 12px; }
  .auth-card { padding: 20px 16px; border-radius: var(--r-lg); }
  .auth-row { grid-template-columns: 1fr; }
}

/* ---------- feed: historias --------------------------------------------- */
.stories {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.stories::-webkit-scrollbar { display: none; }
.story-card {
  position: relative; flex: none; width: 112px; height: 200px;
  border-radius: var(--r-md); overflow: hidden; background: var(--card);
  box-shadow: var(--shadow-sm); scroll-snap-align: start;
  transition: transform var(--fast) var(--ease);
  display: block; padding: 0; border: 0; text-align: left; color: var(--text);
  appearance: none; -webkit-appearance: none;
}
.story-card:hover { transform: scale(1.02); }
.story-card img.cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.story-card .sc-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.15) 62%, rgba(0,0,0,.78) 100%);
}
.story-card .sc-name {
  position: absolute; left: 10px; right: 10px; bottom: 12px;
  color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.story-card .sc-avatar {
  position: absolute; top: 8px; left: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  box-shadow: 0 0 0 3px var(--brand), 0 0 0 5px var(--card);
}
.story-card.create { background: var(--card); }
.story-card.create .create-top { height: calc(100% - 52px); overflow: hidden; }
.story-card.create .create-top img { width: 100%; height: 100%; object-fit: cover; }
.story-card.create .create-bottom {
  height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: 8px; position: relative; flex: none;
}
.story-card.create .plus {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand); color: #fff; border: 4px solid var(--card);
  display: flex; align-items: center; justify-content: center;
}
.story-card.create .create-label { font-size: 12.5px; font-weight: 600; margin-top: 18px; }
.story-card.gradient .story-post {
  position: absolute; inset: 0; padding: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; text-align: center; line-height: 1.25;
}

/* visor de historia */
.story-viewer {
  position: fixed; inset: 0; z-index: 1100; background: #000;
  display: flex; align-items: center; justify-content: center;
}
.story-viewer .sv-card {
  position: relative; width: min(420px, 100vw); height: min(760px, 100vh);
  background: #111; overflow: hidden; border-radius: 10px;
}
.story-viewer .sv-card img { width: 100%; height: 100%; object-fit: cover; }
.story-viewer .sv-head {
  position: absolute; top: 0; left: 0; right: 0; padding: 12px;
  display: flex; align-items: center; gap: 10px; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
}
.story-viewer .sv-name { font-weight: 600; font-size: 14px; }
.story-viewer .sv-time { font-size: 12px; opacity: .8; }
.story-viewer .sv-close {
  position: absolute; top: 10px; right: 10px; width: 34px; height: 34px;
  border-radius: 50%; background: rgba(255,255,255,.18); color: #fff;
  display: flex; align-items: center; justify-content: center; z-index: 3;
}
.story-viewer .sv-bars { position: absolute; top: 6px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.story-viewer .sv-bar { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.3); overflow: hidden; }
.story-viewer .sv-bar > i { display: block; height: 100%; width: 0; background: #fff; }
.story-viewer .sv-nav { position: absolute; top: 0; bottom: 0; width: 30%; }
.story-viewer .sv-nav.prev { left: 0; } .story-viewer .sv-nav.next { right: 0; }

/* ---------- compositor --------------------------------------------------- */
.composer { padding: 12px 16px; }
.composer-top { display: flex; align-items: center; gap: 8px; }
.composer-open {
  flex: 1; min-width: 0; text-align: left; height: 40px; padding: 0 14px;
  border-radius: var(--r-full); background: var(--card-2); color: var(--text-2);
  font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.composer-open:hover { background: var(--card-3); }
.composer-actions {
  display: flex; align-items: center; gap: 4px; margin-top: 10px;
  padding-top: 8px; border-top: 1px solid var(--line-soft);
}
.composer-act {
  flex: 1; min-width: 0; height: 38px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.composer-act:hover { background: var(--hover); }
.composer-act .ico { color: var(--text-2); }
.composer-act.photo .ico { color: #45bd62; }
.composer-act.feeling .ico { color: #f7b125; }
.composer-act.place .ico { color: #f3425f; }

/* modal de publicación */
.compose-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.compose-user .name { font-weight: 600; }
.compose-privacy {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
  padding: 2px 8px; border-radius: var(--r-sm); background: var(--card-2);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.compose-privacy:hover { background: var(--card-3); }
.compose-text {
  width: 100%; min-height: 100px; max-height: 40vh; overflow-y: auto;
  font-size: 22px; line-height: 1.35; resize: none; background: transparent;
}
.compose-text::placeholder { color: var(--text-3); }
.compose-tools {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.compose-tools .title { font-size: 14px; font-weight: 600; flex: 1; }
.compose-tools .tools { display: flex; gap: 2px; }
.compose-tool {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
}
.compose-tool:hover { background: var(--hover); }
.compose-media { display: grid; gap: 6px; margin-top: 12px; position: relative; }
.compose-media.n1 { grid-template-columns: 1fr; }
.compose-media.n2 { grid-template-columns: 1fr 1fr; }
.compose-media.n3, .compose-media.n4 { grid-template-columns: 1fr 1fr; }
.compose-media .cm-item {
  position: relative; border-radius: var(--r); overflow: hidden; background: var(--card-2);
  aspect-ratio: 1 / 1;
}
.compose-media.n1 .cm-item { aspect-ratio: auto; }
.compose-media.n1 .cm-item img { max-height: 420px; width: 100%; object-fit: contain; }
.compose-media .cm-item img { width: 100%; height: 100%; object-fit: cover; }
.compose-media .cm-del {
  position: absolute; top: 6px; right: 6px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.compose-add {
  aspect-ratio: 1/1; border: 2px dashed var(--line);
  border-radius: var(--r); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.compose-add:hover { background: var(--hover); border-color: var(--line-strong); }

/* ---------- tarjeta de publicación -------------------------------------- */
.post {
  position: relative;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 16px 32px -22px rgba(16, 24, 40, .35);
  transition: box-shadow var(--med) var(--ease);
}
.post:hover {
  box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 22px 40px -24px rgba(16, 24, 40, .42);
}
.post-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 0; }
.post-head .who { flex: 1; min-width: 0; }
.post-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.1px; }
.post-name:hover { text-decoration: underline; }
.post-meta {
  display: flex; align-items: center; gap: 4px;
  font-size: 12.5px; color: var(--text-2); margin-top: 2px;
}
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.post-more {
  width: 36px; height: 36px; border-radius: 50%; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.post-more:hover { background: var(--hover); }
.post-text {
  padding: 12px 16px 14px; font-size: 15.5px; line-height: 1.5; white-space: pre-wrap;
}
.post-text .mention { color: var(--brand); font-weight: 600; }
.post-text.collapsed { max-height: 9.6em; overflow: hidden; position: relative; }
.post-text .see-more { color: var(--text-2); font-weight: 600; cursor: pointer; }

.post-media {
  position: relative; margin: 0 12px 12px; border-radius: 16px; overflow: hidden;
  background: var(--card-2);
}
.post-media img { width: 100%; max-height: 540px; object-fit: cover; cursor: zoom-in; }
.post-media .pm-grid { display: grid; gap: 3px; }
.post-media .pm-grid.n2 { grid-template-columns: 1fr 1fr; }
.post-media .pm-grid.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.post-media .pm-grid.n3 .pm-cell:first-child { grid-row: span 2; }
.post-media .pm-grid.n4 { grid-template-columns: 1fr 1fr; }
.post-media .pm-cell { position: relative; overflow: hidden; aspect-ratio: 1/1; background: var(--card-3); }
.post-media .pm-grid.n3 .pm-cell:first-child { aspect-ratio: auto; }
.post-media .pm-grid.n2 .pm-cell { aspect-ratio: 4/5; }
.post-media .pm-cell img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.post-media .pm-more {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 26px; font-weight: 700;
  cursor: pointer;
}

.post-stats {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 10px; font-size: 13px; color: var(--text-2); gap: 8px;
}
.post-stats.hide { display: none; }
.post-stats .reactions-sum { display: flex; align-items: center; gap: 6px; }
.reactions-total { font-weight: 600; }
.react-stack { display: flex; align-items: center; }
.react-stack .rb {
  width: 19px; height: 19px; display: inline-flex; margin-left: -6px;
  border-radius: 50%; box-shadow: 0 0 0 2px var(--card);
}
.react-stack .rb:first-child { margin-left: 0; }
.react-stack .rb svg { width: 100%; height: 100%; display: block; }
.post-stats .right { display: flex; align-items: center; gap: 12px; }
.post-stats .right span:hover { text-decoration: underline; cursor: pointer; }

.post-actions {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-top: 1px solid var(--line-soft);
  margin: 0 0 2px;
}
.post-act {
  flex: 1; min-width: 0; height: 38px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.post-act:hover { background: var(--hover); color: var(--text); }
.post-act.liked { color: var(--brand); }
.post-act.liked:hover { background: var(--brand-soft); }
.post-act .ico { opacity: .85; }
.post-act.liked .ico { opacity: 1; }
.post-act .reaction-svg { width: 23px; height: 23px; }
.post-act.like-act.is-picking .reaction-svg { transform: scale(1.15); }
.post-act-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* reacciones */
.react-pop {
  position: absolute; z-index: 60;
  display: flex; align-items: center; gap: 2px;
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r-full); padding: 6px 8px;
  box-shadow: 0 18px 40px -12px rgba(16, 24, 40, .35), 0 2px 6px rgba(16, 24, 40, .12);
  animation: pop-in 140ms var(--ease);
}
.react-option {
  position: relative;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 160ms var(--ease), background var(--fast) var(--ease);
}
.react-option:hover { transform: translateY(-7px) scale(1.14); background: var(--hover); }
.react-option:active { transform: scale(.94); }
.react-option .reaction-svg { width: 34px; height: 34px; }
.react-option-label {
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #111827; color: #fff; font-size: 11px; font-weight: 600;
  padding: 4px 9px; border-radius: 7px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .14s, transform .14s;
  box-shadow: var(--shadow-md);
}
.react-option:hover .react-option-label { opacity: 1; transform: translateX(-50%) translateY(0); }

/* comentarios */
.comments { padding: 4px 16px 12px; }
.comment { display: flex; gap: 8px; margin-top: 10px; }
.comment-body { min-width: 0; flex: 1; }
.comment-bubble {
  display: inline-block; max-width: 100%;
  background: var(--card-2); border-radius: 16px; padding: 8px 12px;
}
.comment-name { font-size: 13px; font-weight: 600; }
.comment-name:hover { text-decoration: underline; }
.comment-text { font-size: 14.5px; line-height: 1.35; white-space: pre-wrap; }
.comment-text .mention { color: var(--brand); font-weight: 600; }
.comment-img { margin-top: 6px; border-radius: var(--r); overflow: hidden; max-width: 240px; }
.comment-meta {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0 0 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.comment-meta button { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.comment-meta button:hover { text-decoration: underline; }
.comment-meta button.liked { color: var(--brand); }
.comment-meta .time { font-weight: 400; color: var(--text-3); }
.comment-replies { margin-top: 2px; }
.comment-replies .comment { margin-top: 8px; }
.comment-more { font-size: 13.5px; font-weight: 600; color: var(--text-2); padding: 8px 0 0 40px; }
.comment-more:hover { text-decoration: underline; }
.comment-input { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.comment-input .wrapin {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px;
  background: var(--card-2); border-radius: var(--r-full); padding: 0 6px 0 14px;
  min-height: 38px;
}
.comment-input input { flex: 1; min-width: 0; font-size: 14.5px; background: transparent; }
.comment-input .ci-btn {
  width: 30px; height: 30px; border-radius: 50%; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.comment-input .ci-btn:hover { background: var(--hover); color: var(--text); }
.comment-input .ci-btn.photo { color: #45bd62; }
.comment-preview { position: relative; margin: 8px 0 0 40px; width: 96px; }
.comment-preview img { border-radius: var(--r); width: 96px; height: 96px; object-fit: cover; }
.comment-preview button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.replying-bar {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: var(--text-2); margin: 6px 0 0 40px;
}
.replying-bar button { color: var(--brand); font-weight: 600; }

/* ---------- perfil ------------------------------------------------------- */
.profile-cover {
  position: relative; border-radius: 0 0 var(--r) var(--r); overflow: hidden;
  background: linear-gradient(135deg, #1877f2, #42b0ff);
  aspect-ratio: 3.2 / 1; min-height: 180px; max-height: 360px;
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover .cover-edit {
  position: absolute; right: 16px; bottom: 16px;
  height: 36px; padding: 0 12px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.95); color: #050505;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-sm);
}
.profile-head {
  position: relative; background: var(--card); padding: 0 20px 16px;
  border-radius: 0 0 var(--r) var(--r); box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.profile-main {
  display: flex; align-items: flex-end; gap: 20px; margin-top: -60px; position: relative;
}
.profile-avatar-wrap { position: relative; flex: none; }
.profile-avatar {
  width: 168px; height: 168px; border-radius: 50%; overflow: hidden;
  border: 4px solid var(--card); background: var(--card-3);
  box-shadow: var(--shadow-xs); position: relative;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar .initials { font-size: 60px; }
.profile-avatar-edit {
  position: absolute; right: 6px; bottom: 6px; width: 38px; height: 38px;
  border-radius: 50%; background: var(--card-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card); box-shadow: var(--shadow-xs);
}
.profile-avatar-edit:hover { background: var(--card-3); }
.profile-titles { flex: 1; min-width: 0; padding-bottom: 6px; }
.profile-name { font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -.5px; }
.profile-friends {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
  font-size: 14px; color: var(--text-2);
}
.profile-actions {
  display: flex; align-items: center; gap: 8px; padding-bottom: 6px; flex-wrap: wrap;
}
.profile-actions .btn.primary { background: var(--brand); }

.profile-nav-wrap { background: var(--card); box-shadow: var(--shadow-sm); }
.profile-nav {
  display: flex; align-items: center; gap: 4px; padding: 4px 8px;
  border-top: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none;
}
.profile-nav::-webkit-scrollbar { display: none; }

.profile-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start;
}
.profile-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 16px; }
.intro-card { padding: 16px; }
.intro-item { display: flex; align-items: center; gap: 10px; font-size: 14.5px; padding: 5px 0; color: var(--text); }
.intro-item .ico { color: var(--text-2); }
.intro-item .muted { font-size: 13px; }
.profile-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; border-radius: var(--r); overflow: hidden; }
.profile-photos img { aspect-ratio: 1/1; object-fit: cover; cursor: zoom-in; }
.profile-friend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.profile-friend-grid .pf {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  font-size: 12.5px; font-weight: 600;
}
.profile-friend-grid .pf:hover { text-decoration: none; opacity: .85; }

/* ---------- amigos ------------------------------------------------------- */
.friends-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.friends-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.friend-card {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--r);
  transition: background var(--fast) var(--ease);
}
.friend-card:hover { background: var(--hover); }
.friend-card .fc-name { font-size: 15px; font-weight: 600; }
.friend-card .fc-sub { font-size: 13px; color: var(--text-2); }
.friend-card .fc-actions { display: flex; gap: 8px; margin-left: auto; }
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.user-tile {
  border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-xs);
  overflow: hidden; display: flex; flex-direction: column;
}
.user-tile .ut-img { aspect-ratio: 1/1; background: var(--card-2); overflow: hidden; }
.user-tile .ut-img img { width: 100%; height: 100%; object-fit: cover; }
.user-tile .ut-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.user-tile .ut-name { font-weight: 600; font-size: 15px; }
.user-tile .ut-sub { font-size: 12.5px; color: var(--text-2); }
.user-tile .ut-actions { display: flex; gap: 6px; align-items: center; }
.user-tile .ut-actions .btn { flex: 1 1 auto; }
.user-tile .ut-actions .btn.icon-only { flex: 0 0 36px; width: 36px; padding: 0; }

/* ---------- mensajes ----------------------------------------------------- */
.messenger {
  display: grid; grid-template-columns: 340px minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h) - 32px);
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.msgr-list { display: flex; flex-direction: column; border-right: 1px solid var(--line-soft); min-height: 0; min-width: 0; }
.msgr-list-head { padding: 12px 12px 8px; }
.msgr-list h1 { font-size: 24px; margin-bottom: 10px; }
.msgr-items { overflow-y: auto; flex: 1; padding: 0 8px 8px; }
.conv {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border-radius: var(--r); text-align: left;
  transition: background var(--fast) var(--ease);
}
.conv:hover { background: var(--hover); }
.conv.active { background: var(--brand-soft); }
.conv .cv-body { flex: 1; min-width: 0; }
.conv .cv-name {
  font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv .cv-last {
  font-size: 13px; color: var(--text-2); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.conv.unread .cv-last { color: var(--text); font-weight: 600; }
.conv .cv-time { font-size: 12px; color: var(--text-3); flex: none; align-self: flex-start; padding-top: 4px; }
.conv .cv-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; }
.conv-empty { padding: 30px 16px; text-align: center; color: var(--text-2); font-size: 14px; }

.msgr-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft); flex: none;
}
.chat-head .ch-name { font-size: 15px; font-weight: 600; }
.chat-head .ch-sub { font-size: 12.5px; color: var(--text-2); }
.chat-body {
  flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 4px;
  background: var(--card);
}
.chat-day { text-align: center; font-size: 12px; color: var(--text-3); margin: 12px 0 6px; }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 78%; margin-top: 2px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble {
  background: var(--card-2); padding: 8px 12px; border-radius: 18px;
  font-size: 15px; line-height: 1.35; word-break: break-word;
  white-space: pre-wrap;
}
.msg.me .bubble { background: var(--brand); color: #fff; }
.msg .bubble img {
  border-radius: 12px; max-width: 260px; max-height: 320px; object-fit: cover;
  cursor: zoom-in;
}
.msg .bubble img + span { display: block; margin-top: 6px; }
.msg .stamp { font-size: 11px; color: var(--text-3); flex: none; padding-bottom: 2px; }
.msg.me .stamp { text-align: right; }
.chat-input {
  display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--line-soft); flex: none;
}
.chat-input .box {
  flex: 1; display: flex; align-items: flex-end; gap: 4px;
  background: var(--card-2); border-radius: 20px; padding: 4px 6px 4px 14px;
  transition: box-shadow var(--fast) var(--ease);
}
.chat-input .box:focus-within { box-shadow: inset 0 0 0 2px var(--brand-soft-2); }
.chat-input textarea {
  flex: 1; resize: none; max-height: 120px; min-height: 28px; padding: 5px 0;
  font-size: 15px; line-height: 1.35; background: transparent;
}
.chat-input .ci {
  width: 32px; height: 32px; border-radius: 50%; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.chat-input .ci:hover { background: var(--hover); }
.chat-input .send {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.chat-input .send:disabled { background: var(--card-3); color: var(--text-3); }
.chat-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--text-2); text-align: center; padding: 20px;
}
.chat-empty .big-ic {
  width: 84px; height: 84px; border-radius: 50%; background: var(--card-2);
  display: flex; align-items: center; justify-content: center; color: var(--brand);
}
.chat-back { display: none; }

@media (max-width: 900px) {
  .messenger { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .messenger {
    grid-template-columns: 1fr; height: calc(100dvh - var(--topbar-h) - var(--nav-h));
    border-radius: 0; box-shadow: none;
  }
  .messenger.show-chat .msgr-list { display: none; }
  .messenger:not(.show-chat) .msgr-chat { display: none; }
  .chat-back { display: inline-flex; }
  .chat-body { padding: 12px 10px; }
  .msg { max-width: 85%; }
}

/* ---------- notificaciones ---------------------------------------------- */
.notif {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 10px 14px; border-radius: var(--r); text-align: left;
  transition: background var(--fast) var(--ease);
}
.notif:hover { background: var(--hover); }
.notif.unread { background: var(--brand-soft); }
.notif .n-avatar { position: relative; flex: none; }
.notif .n-icon {
  position: absolute; right: -4px; bottom: -2px; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff; border: 2px solid var(--card);
}
.notif .n-icon.like { background: #1877f2; }
.notif .n-icon.comment { background: #31a24c; }
.notif .n-icon.friend { background: #a033ff; }
.notif .n-icon.share { background: #f7b125; }
.notif .n-body {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  font-size: 14.5px; line-height: 1.3;
}
.notif .n-time { font-size: 12.5px; color: var(--brand); font-weight: 600; margin-top: 0; }
.notif .n-unread-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); flex: none; margin-top: 8px; }

/* ---------- grupos ------------------------------------------------------ */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.group-card {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-sm);
  overflow: hidden; display: flex; flex-direction: column;
}
.group-card .gc-cover { aspect-ratio: 2.2/1; background: var(--card-2); overflow: hidden; }
.group-card .gc-cover img { width: 100%; height: 100%; object-fit: cover; }
.group-card .gc-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.group-card .gc-name { font-size: 16px; font-weight: 700; }
.group-card .gc-sub { font-size: 13px; color: var(--text-2); }
.group-card .btn { margin-top: 4px; }
.group-head {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 16px;
}
.group-cover { aspect-ratio: 3/1; background: linear-gradient(135deg, #1c4f9c, #4da3ff); position: relative; overflow: hidden; }
.group-cover img { width: 100%; height: 100%; object-fit: cover; }
.group-info { padding: 16px; }
.group-info h1 { font-size: 26px; }
.group-info .meta { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.group-info .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- ajustes ----------------------------------------------------- */
.settings-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  text-align: left; width: 100%; font: inherit; color: inherit; background: none;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-soft);
}
.settings-row:last-child { border-bottom: none; }
.settings-row .sr-ic {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; background: var(--card-2);
}
.settings-row .sr-body { flex: 1; min-width: 0; }
.settings-row .sr-title { font-size: 15px; font-weight: 600; }
.settings-row .sr-sub { font-size: 13px; color: var(--text-2); }
.switch {
  position: relative; width: 50px; height: 28px; border-radius: 14px;
  background: var(--line); flex: none; transition: background var(--med) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs);
  transition: transform var(--med) var(--ease);
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(22px); }
.theme-opts { display: flex; gap: 8px; }
.theme-opt {
  flex: 1; padding: 10px; border-radius: var(--r); border: 2px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
}
.theme-opt.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.theme-swatch { width: 100%; height: 40px; border-radius: var(--r-sm); border: 1px solid var(--line); }

/* ---------- búsqueda ---------------------------------------------------- */
.search-page-head { padding: 16px; }
.search-tabs-wrap { background: var(--card); border-radius: var(--r) var(--r) 0 0; }
.person-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r);
}
.person-row:hover { background: var(--hover); }

/* ---------- piezas sueltas ---------------------------------------------- */
.shared-post:hover { background: var(--hover); text-decoration: none; }
.presence { position: relative; display: inline-flex; flex: none; }
.presence .dot {
  position: absolute; right: -1px; bottom: 0;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--online); border: 2px solid var(--card);
}
.presence.offline .dot { background: var(--text-3); }
.story-card .sc-count {
  position: absolute; left: 8px; right: 8px; bottom: 30px;
  color: rgba(255,255,255,.85); font-size: 11px; font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.chip[role="button"] { cursor: pointer; }
.img-failed { background: var(--card-2); }
.comment-more { color: var(--text-2); }
.comment-more:hover { text-decoration: underline; }
.user-tile .ut-img { display: block; }
.group-card a:hover { text-decoration: none; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- responsive de páginas --------------------------------------- */
@media (max-width: 1100px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-side { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .friends-layout { grid-template-columns: 1fr; }
  .friends-side { position: static; }
}
@media (max-width: 767px) {
  .profile-cover { border-radius: 0; min-height: 140px; }
  .profile-head { border-radius: 0; margin-bottom: 8px; }
  .profile-main { flex-direction: column; align-items: center; text-align: center; margin-top: -50px; gap: 8px; }
  .profile-avatar { width: 118px; height: 118px; }
  .profile-name { font-size: 24px; }
  .profile-friends { justify-content: center; }
  .profile-actions { justify-content: center; width: 100%; }
  .profile-actions .btn { flex: 1; }
  .profile-side { grid-template-columns: 1fr; }
  .profile-grid { gap: 8px; }
  .group-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .friend-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .story-card { width: 100px; height: 178px; }
  .compose-text { font-size: 18px; }
}

/* ==========================================================================
   v2 — cuenta, menú, personalización e instalación
   ========================================================================== */

.menu-section {
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); padding: 16px 16px 4px;
}

/* ---------- mi cuenta ---------- */
.account-layout { display: flex; flex-direction: column; gap: 16px; }
.account-hero {
  background: var(--card); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); position: relative;
}
.account-cover {
  height: 170px; background-size: cover; background-position: center; position: relative;
}
.account-cover::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.25));
}
.account-cover-btn {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-full);
  background: rgba(255,255,255,.94); color: #111; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.account-cover-btn:hover { background: #fff; }
.account-hero-body {
  display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
  padding: 0 20px 18px; margin-top: -44px; position: relative; z-index: 2;
}
.account-avatar {
  position: relative; padding: 0; background: none; border-radius: 50%; flex: none;
}
.account-avatar .avatar { box-shadow: 0 0 0 4px var(--card); }
.account-avatar-badge {
  position: absolute; right: 2px; bottom: 4px; width: 34px; height: 34px;
  border-radius: 50%; background: var(--card-2); border: 3px solid var(--card);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.account-hero-info { flex: 1 1 220px; min-width: 0; padding-bottom: 4px; }
.account-hero-info h2 { font-size: 26px; letter-spacing: -.5px; }
.account-stats {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
  font-size: 13px; color: var(--text-2);
}
.account-hero-actions { display: flex; gap: 8px; padding-bottom: 4px; flex-wrap: wrap; }
.account-form .field { flex: 1 1 180px; }

/* ---------- menú ---------- */
.page-card.menu-profile { padding: 16px; }
.menu-profile-link { display: flex; align-items: center; gap: 14px; }
.menu-profile-link:hover { text-decoration: none; }
.menu-profile-name { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.menu-profile-actions { display: flex; gap: 8px; margin-top: 14px; }
.menu-grid { display: grid; gap: 16px; }
@media (min-width: 1000px) { .menu-grid { grid-template-columns: 1fr 1fr; } }
.menu-row { text-decoration: none; color: inherit; background: none; border: 0; cursor: pointer; }
.menu-row:hover { background: var(--hover); text-decoration: none; }

/* ---------- control segmentado ---------- */
.segmented {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-full);
  background: var(--card-2);
}
.segmented-item {
  padding: 6px 12px; border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 600; color: var(--text-2);
}
.segmented-item:hover { color: var(--text); }
.segmented-item.active { background: var(--card); color: var(--brand); box-shadow: var(--shadow-xs); }

/* ---------- color de acento ---------- */
.accent-row { display: flex; gap: 8px; flex-wrap: wrap; }
.accent-dot {
  width: 28px; height: 28px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.accent-dot:hover { transform: scale(1.12); }
.accent-dot.active { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px currentColor; }

/* ---------- acerca de ---------- */
.about-hero { text-align: center; padding: 28px 16px 12px; }
.about-hero img {
  margin: 0 auto 12px; border-radius: 24px; box-shadow: var(--shadow-sm);
}
.about-hero h2 { margin-bottom: 4px; }

/* ---------- aviso de instalación ---------- */
.install-banner {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 22px; z-index: 900;
  display: flex; align-items: center; gap: 12px;
  width: min(94vw, 470px); padding: 12px 14px;
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  animation: slide-up var(--med) var(--ease);
}
.install-banner.hide { display: none; }
.ib-logo { border-radius: 12px; flex: none; }
.ib-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ib-text strong { font-size: 14px; }
.ib-text span { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.ib-close {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; color: var(--text-2);
}
.ib-close:hover { background: var(--hover); color: var(--text); }
@media (max-width: 767px) {
  .install-banner { bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom, 0px)); }
  .account-cover { height: 140px; }
  .account-hero-body { padding: 0 16px 16px; }
  .account-hero-actions { width: 100%; }
  .account-hero-actions .btn { flex: 1; }
}

/* ==========================================================================
   v3 — secciones, perfil nuevo, publicar y detalles
   ========================================================================== */

.page-head {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px; flex-wrap: wrap;
}
.page-head h1 { font-size: 24px; letter-spacing: -.4px; }
.page-back { margin: 0 0 12px; }
.page-card {
  background: var(--card); border-radius: var(--r-lg); border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-xs); overflow: hidden;
}

/* ---------- fila del compositor en el muro ---------- */
.composer-open-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 16px;
}
.composer-fake {
  flex: 1; min-width: 0; text-align: left; height: 42px; padding: 0 16px;
  border-radius: var(--r-full); background: var(--card-2); color: var(--text-2);
  font-size: 15px; font-weight: 500;
}
.composer-fake:hover { background: var(--card-3); }

/* ---------- publicar ---------- */
.compose-card { padding: 18px; }
.compose-text {
  width: 100%; border: 0; background: transparent; resize: vertical;
  font-size: 19px; line-height: 1.45; padding: 14px 0; min-height: 130px;
  font-family: inherit; color: var(--text);
}
.compose-text:focus { outline: none; }
.compose-media {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px; padding-top: 10px;
}
.compose-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; }
.compose-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-x {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center;
}
.compose-add {
  aspect-ratio: 1; border-radius: 12px; border: 2px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.compose-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- perfil ---------- */
.profile-header {
  background: var(--card); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-xs); margin-bottom: 16px;
}
.profile-cover {
  height: 190px; background: linear-gradient(135deg, var(--brand), #7c3aed);
  overflow: hidden; position: relative;
}
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-main-row {
  display: flex; align-items: flex-end; gap: 18px; padding: 0 20px 16px;
  margin-top: -48px; position: relative; flex-wrap: wrap;
}
.profile-avatar-big { flex: none; }
.profile-avatar-big .avatar { box-shadow: 0 0 0 4px var(--card); }
.profile-info { flex: 1 1 260px; min-width: 0; padding-bottom: 4px; }
.profile-name { font-size: 28px; letter-spacing: -.6px; }
.profile-stats {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
  font-size: 13.5px; color: var(--text-2);
}
.profile-stats a { color: var(--text-2); font-weight: 600; }
.profile-stats a:hover { color: var(--brand); }
.profile-actions-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.profile-dots { background: var(--card-2); }
.profile-avatar-stack { display: flex; gap: -6px; padding-bottom: 4px; }
.profile-avatar-stack a { margin-left: -8px; }
.profile-avatar-stack a:first-child { margin-left: 0; }
.profile-tabs {
  display: flex; gap: 4px; padding: 6px 12px; border-top: 1px solid var(--line-soft);
  overflow-x: auto;
}
.profile-tabs .tab { padding: 10px 14px; }
.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px;
}
.photo-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in;
}
.about-row {
  display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.about-row .muted { min-width: 130px; }

/* ---------- editar perfil ---------- */
.profile-edit-media { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avatar-edit .avatar { box-shadow: 0 0 0 3px var(--card-2); }

/* ---------- búsqueda ---------- */
.search-inline {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  background: var(--card-2); border-radius: var(--r-full); color: var(--text-2);
}
.search-inline input { flex: 1; min-width: 0; background: transparent; font-size: 15px; }
.search-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.search-row:last-child { border-bottom: none; }
.search-row:hover { background: var(--hover); text-decoration: none; }
.group-mini {
  width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: none;
  background: var(--card-2); display: flex; align-items: center; justify-content: center;
}
.group-mini img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- notificaciones ---------- */
.notif-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.notif {
  display: flex; gap: 12px; align-items: center; padding: 10px 8px; border-radius: 12px;
  color: inherit;
}
.notif:hover { background: var(--hover); text-decoration: none; }
.notif.unread { background: var(--brand-soft); }
.notif-avatar { position: relative; flex: none; }
.notif-badge {
  position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--card);
}
.notif .n-text { font-size: 14.5px; }
.notif .n-time { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* ---------- comentarios (sección) ---------- */
.comments-page { padding: 18px; }
.comments-page .card-title { margin-bottom: 12px; font-size: 18px; }
.comments-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; }
.comment-bubble {
  background: var(--card-2); border-radius: 16px; padding: 9px 13px;
}
.comment-name { font-weight: 700; font-size: 13.5px; }
.comment-text { font-size: 14.5px; margin-top: 2px; white-space: pre-wrap; }
.comment-img { margin-top: 8px; border-radius: 10px; max-height: 220px; object-fit: cover; }
.comment-meta {
  display: flex; gap: 12px; align-items: center; padding: 4px 8px 0;
  font-size: 12px; color: var(--text-2);
}
.comment-replies { margin: 10px 0 0 18px; display: flex; flex-direction: column; gap: 10px; }
.comment-compose { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.reply-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--card-2); border-radius: 10px; padding: 6px 10px; margin-bottom: 8px;
  font-size: 12.5px; color: var(--text-2);
}

/* ---------- grupos ---------- */
.group-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px;
}
.group-card {
  background: var(--card); border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line-soft); color: inherit; box-shadow: var(--shadow-xs);
}
.group-card:hover { text-decoration: none; box-shadow: var(--shadow-sm); }
.group-cover { height: 110px; overflow: hidden; }
.group-cover img { width: 100%; height: 100%; object-fit: cover; }
.group-cover-fallback {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff;
}
.group-cover-fallback.big { height: 100%; }
.group-body { padding: 12px 14px; }

/* ---------- tirar para actualizar ---------- */
.ptr {
  position: fixed; top: calc(var(--topbar-h) + 8px); left: 50%; transform: translate(-50%, 0);
  z-index: 400; width: 38px; height: 38px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .15s;
}
.ptr.visible { opacity: 1; }

/* ---------- reducir animaciones ---------- */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

/* ---------- móvil ---------- */
@media (max-width: 767px) {
  .compose-text { font-size: 17px; min-height: 110px; }
  .profile-cover { height: 150px; }
  .profile-main-row { padding: 0 14px 14px; gap: 12px; }
  .profile-name { font-size: 23px; }
  .profile-avatar-big .avatar { width: 92px; height: 92px; }
  .mobile-nav a[href="#/publicar"] .mn-ic {
    background: var(--brand); color: #fff; border-radius: 50%; padding: 4px;
  }
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================================
   Zuma · estilo iOS
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 12px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-2xl: 30px;
  --brand: #0a84ff;
  --brand-hover: #0071e3;
  --brand-active: #0063c8;
  --brand-soft: #e8f2ff;
  --bg: #f2f2f7;
  --card-2: #f2f2f7;
  --card-3: #e9e9ee;
  --text: #1c1c1e;
  --text-2: #6e6e73;
  --text-3: #8e8e93;
  --line: #e5e5ea;
  --line-soft: rgba(60, 60, 67, .12);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 18px -10px rgba(0, 0, 0, .18);
  --shadow-md: 0 8px 28px -12px rgba(0, 0, 0, .22);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .35);
  --topbar-h: 60px;
}

html[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1c1c1e;
  --card: #1c1c1e;
  --card-2: #2c2c2e;
  --card-3: #3a3a3c;
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #8e8e93;
  --line: #2c2c2e;
  --line-soft: rgba(255, 255, 255, .08);
  --hover: rgba(255, 255, 255, .06);
  --hover-strong: rgba(255, 255, 255, .1);
  --active: rgba(255, 255, 255, .14);
  --brand-soft: rgba(10, 132, 255, .16);
  --brand-soft-2: rgba(10, 132, 255, .22);
}

body, button, input, textarea, select {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
}

/* barra superior translúcida */
.topbar {
  background: rgba(10, 132, 255, .92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 rgba(255, 255, 255, .18), 0 10px 30px -18px rgba(0, 60, 160, .55);
  border-bottom: none;
}
html[data-theme="dark"] .topbar {
  background: rgba(18, 18, 20, .82);
  box-shadow: 0 0.5px 0 rgba(255, 255, 255, .08);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.02; }
.brand-word { font-size: 21px; font-weight: 800; letter-spacing: -.7px; color: #fff; }
.brand-sub {
  font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255, 255, 255, .72); margin-top: 1px;
}
.brand img { border-radius: 11px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2); }

.tb-search { background: rgba(255, 255, 255, .2); }
.tb-tab { border-radius: 14px; }
.tb-tab.active::after { border-radius: 3px; height: 2.5px; }
.tb-btn { border-radius: 14px; }

/* tarjetas y superficies */
.card, .page-card, .install-banner, .modal, .story-card, .group-card {
  border-radius: var(--r-xl);
  border: .5px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.card.post { border-radius: 24px; }
.composer-open-row { border-radius: 24px; }
.post-media { border-radius: 18px; }
.post-act { border-radius: 14px; }
.post-act:hover { background: var(--card-2); }
.comment-bubble { border-radius: 18px; }
.side-item { border-radius: 14px; }
.rail-item { border-radius: 14px; }

/* botones */
.btn {
  border-radius: 14px; font-weight: 600; letter-spacing: -.01em;
  transition: transform 140ms cubic-bezier(.2, .8, .3, 1), background var(--fast), box-shadow var(--fast);
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); box-shadow: 0 6px 16px -8px rgba(10, 132, 255, .7); }
.btn.primary:hover { background: var(--brand-hover); }
.btn.soft { background: var(--card-2); }
.btn.ghost { background: transparent; }

/* controles */
.input, .textarea {
  border-radius: 14px; background: var(--card-2); border: .5px solid var(--line-soft);
  padding: 12px 14px; font-size: 15px;
}
.input:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3.5px rgba(10, 132, 255, .18); }
.search-inline { border-radius: 14px; background: var(--card-2); border: .5px solid var(--line-soft); }
.tabs { gap: 6px; }
.tab { border-radius: 12px; }
.tab.active { background: var(--brand-soft); }
.profile-tabs { border-top: .5px solid var(--line-soft); }
.profile-tabs .tab { border-radius: 12px; }

/* modales tipo hoja */
.modal-backdrop { background: rgba(0, 0, 0, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { border-radius: 28px; box-shadow: var(--shadow-lg); }
.modal-head h2 { font-size: 19px; font-weight: 700; }
.modal-foot { border-top: .5px solid var(--line-soft); }

@media (max-width: 640px) {
  .modal-root { align-items: flex-end; }
  .modal {
    width: 100% !important; max-width: 100%; border-radius: 28px 28px 0 0;
    margin: 0; animation: sheet-up 260ms cubic-bezier(.2, .9, .3, 1);
  }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* avisos y detalles */
.toast { border-radius: 16px; box-shadow: var(--shadow-md); font-weight: 500; }
.switch { border-radius: 16px; }
.react-pop { border-radius: 22px; }
.install-banner { border-radius: 22px; }
.splash { background: var(--bg); }
.splash img { border-radius: 26px; }

/* login */
.auth-card { border-radius: 30px; border: .5px solid var(--line-soft); box-shadow: var(--shadow-lg); }
.auth-title { font-size: 28px; font-weight: 800; letter-spacing: -.6px; }
.auth-sub { color: var(--text-2); font-size: 14.5px; }
.auth-illustration svg { width: 100%; height: auto; display: block; }
.auth-point { border-radius: 14px; background: var(--card-2); padding: 8px 12px; font-size: 13px; font-weight: 600; }
.auth-points { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* nav inferior iOS */
.mobile-nav {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--line-soft);
}
html[data-theme="dark"] .mobile-nav { background: rgba(18, 18, 20, .9); }
.mn-ic { border-radius: 12px; }

/* ---------- ajustes iOS: marca, gente y perfil ---------- */
.brand-word { display: block; }
.brand-text { min-width: 0; }
@media (max-width: 767px) {
  .brand-text { display: none; }
  .brand img { width: 36px; height: 36px; }
}
@media (min-width: 768px) {
  .brand-word { display: block; }
}

/* personas en lista compacta */
.friend-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px;
  padding: 4px 0 12px;
}
.user-tile {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 18px; background: var(--card-2);
  border: .5px solid var(--line-soft); min-width: 0;
}
.user-tile .ut-img {
  width: 56px; height: 56px; border-radius: 50%; overflow: hidden; flex: none;
  aspect-ratio: auto; background: var(--card-3);
}
.user-tile .ut-img img { width: 100%; height: 100%; object-fit: cover; }
.user-tile .ut-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.user-tile .ut-name { font-size: 15px; font-weight: 700; color: var(--text); }
.user-tile .ut-sub { font-size: 12.5px; color: var(--text-2); }
.user-tile .ut-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.user-tile .ut-actions .btn { height: 30px; padding: 0 12px; font-size: 13px; }

/* perfil: solo la foto se superpone a la portada */
.profile-cover { height: 180px; }
.profile-main-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 0 20px 18px; margin-top: -46px; position: relative; flex-wrap: wrap;
}
.profile-avatar-big { flex: none; }
.profile-avatar-big .avatar { width: 96px; height: 96px; box-shadow: 0 0 0 4px var(--card); }
.profile-info { flex: 1 1 260px; min-width: 0; padding-top: 54px; }
.profile-name { font-size: 25px; letter-spacing: -.5px; }
.profile-actions-row { margin-top: 10px; }
.profile-avatar-stack { padding-top: 58px; }
.profile-dots { width: 38px; height: 38px; border-radius: 50%; background: var(--card-2); }
@media (max-width: 767px) {
  .profile-info { padding-top: 50px; }
  .profile-avatar-big .avatar { width: 84px; height: 84px; }
  .friend-grid { grid-template-columns: 1fr; }
}

/* ---------- correcciones de especificidad ---------- */
.user-tile { flex-direction: row; align-items: center; overflow: visible; }
.user-tile .ut-img { aspect-ratio: auto; width: 56px; height: 56px; border-radius: 50%; }
.user-tile .ut-body { padding: 0; }
.profile-cover { aspect-ratio: auto; width: 100%; height: 180px; border-radius: 0; }
.profile-header { overflow: hidden; }
.profile-main-row { align-items: flex-start; }

.auth-point { display: inline-flex; align-items: center; gap: 7px; }
.auth-card .btn.success { background: var(--brand-soft); color: var(--brand); }
.auth-card .btn.success:hover { background: var(--brand-soft-2); }
.auth-panel { padding-left: 4px; }

/* ---------- Zuma: estado civil, usuario disponible y canales ---------- */
select.input { appearance: none; background-image: none; cursor: pointer; }
.field-hint.ok { color: var(--success); font-weight: 600; }
.field-hint.bad { color: var(--danger); font-weight: 600; }
.notif-welcome {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff;
}
.group-card .chip { font-size: 11px; }

/* ---------- barra del muro ---------- */
.feed-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 8px;
}
.feed-toolbar .btn { gap: 6px; }

/* ---------- usuario visible en el perfil ---------- */
.profile-fullname {
  margin-top: 2px; font-size: 14px; color: var(--text-2); font-weight: 500;
}
@media (max-width: 767px) {
  .profile-fullname { font-size: 13px; }
}

/* ---------- nombre completo debajo del usuario ---------- */
.post-meta .post-fullname { color: var(--text-2); font-weight: 600; }
.post-meta .post-fullname + .dot { opacity: .8; }
.comment-name { color: var(--text); }

/* ==========================================================================
   v4 — Shop, mensajes privados y muro mezclado
   ========================================================================== */

/* ---------- barra del muro ---------- */
.feed-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 10px; margin-bottom: 16px;
}
.feed-toolbar .segmented-item { padding: 7px 16px; font-size: 13.5px; }
.feed-toolbar .btn-icon { width: 32px; height: 32px; }
.feed-hint { padding-right: 2px; }

/* ---------- sugerencias dentro del muro ---------- */
.post-suggest {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px 0; color: var(--text-2);
  font-size: 12.5px; font-weight: 600;
}
.post-suggest .ico { color: var(--brand); }

/* ---------- chips extra ---------- */
.chip.red { background: var(--danger-soft); color: var(--danger); }

/* ---------- Shop: listado ---------- */
.shop-toolbar { padding: 12px 12px 10px; }
.shop-search-row { display: flex; align-items: center; gap: 12px; }
.shop-search-row .search-inline { max-width: 460px; }
.shop-cats {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px;
  scrollbar-width: none;
}
.shop-cats::-webkit-scrollbar { display: none; }
.shop-cat {
  flex: none; height: 34px; padding: 0 14px; border-radius: var(--r-full);
  background: var(--card); box-shadow: var(--shadow-xs);
  border: 1px solid var(--line-soft);
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.shop-cat:hover { background: var(--hover); color: var(--text); }
.shop-cat.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.shop-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.shop-grid.small { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.shop-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-xs);
  transition: box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.shop-card:hover { text-decoration: none; box-shadow: var(--shadow-md); transform: translateY(-1px); }
.shop-card-img { position: relative; aspect-ratio: 1/1; background: var(--card-2); overflow: hidden; }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; }
.shop-card.sold .shop-card-img img { opacity: .55; }
.shop-noimg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); background: var(--card-2);
}
.shop-noimg.big { min-height: 260px; }
.shop-sold {
  position: absolute; left: 8px; top: 8px; padding: 3px 9px;
  border-radius: var(--r-full); background: rgba(0, 0, 0, .72);
  color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
}
.shop-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.shop-price { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.shop-card-title {
  font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.shop-card-meta {
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Shop: detalle ---------- */
.shop-detail {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 16px; align-items: start; margin-bottom: 20px;
}
.shop-gallery {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-xs);
}
.shop-gallery-main {
  aspect-ratio: 4/3; background: var(--card-2);
  display: flex; align-items: center; justify-content: center;
}
.shop-gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.shop-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.shop-thumb {
  width: 64px; height: 64px; border-radius: 10px; overflow: hidden; flex: none;
  border: 2px solid transparent; background: var(--card-2);
}
.shop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-thumb.active { border-color: var(--brand); }
.shop-info-card {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-xs);
}
.shop-detail-title { font-size: 24px; letter-spacing: -.4px; margin: 10px 0 6px; }
.shop-detail-price { font-size: 30px; font-weight: 800; letter-spacing: -.8px; }
.shop-detail-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-2); margin-top: 6px;
}
.shop-detail-meta .ico { color: var(--text-3); }
.shop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.shop-sep { height: 1px; background: var(--line-soft); margin: 16px 0; }
.shop-seller { display: flex; align-items: center; gap: 10px; }
.shop-seller-name { font-weight: 700; font-size: 15px; }
.shop-desc { margin-top: 16px; }
.shop-desc-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.shop-desc p { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }
.shop-more { flex: none; }

/* ---------- Shop: publicar ---------- */
.shop-form-thumbs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px;
}
.shop-form-thumb {
  position: relative; aspect-ratio: 1; border-radius: 10px;
  overflow: hidden; background: var(--card-2);
}
.shop-form-thumb img { width: 100%; height: 100%; object-fit: cover; }
.shop-add-photo { min-height: 86px; }
.shop-related .section-head { margin-bottom: 12px; }

/* ---------- mensajes privados: detalles ---------- */
.msgr-list-head .btn-icon { color: var(--brand); background: var(--brand-soft); }
.msgr-list-head .btn-icon:hover { background: var(--brand-soft-2); }
.msgr-items { padding-top: 2px; }
.conv .avatar { flex: none; }
.chat-empty-soft { text-align: center; padding: 46px 20px; color: var(--text-2); }
.chat-empty-soft .strong { margin-bottom: 4px; color: var(--text); }
.chat-body .msg .avatar.xs { align-self: flex-end; margin-bottom: 2px; }
.chat-head .ch-name { display: block; color: var(--text); }
.chat-head a:hover { text-decoration: none; }
.new-chat-list { max-height: 340px; overflow-y: auto; margin-top: 4px; }
.new-chat-list .person-row + .person-row { border-top: 1px solid var(--line-soft); }
.col-center .messenger {
  height: calc(100vh - var(--topbar-h) - 40px);
  margin: 0 0 8px;
}

@media (max-width: 1100px) {
  .shop-detail { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .col-center .page-head,
  .col-center .page-back { padding-left: 12px; padding-right: 12px; }
  .col-center .page-head { margin-top: 6px; }
  .col-center .section-head { padding-left: 12px; padding-right: 12px; }
  .col-center .messenger {
    height: calc(100dvh - var(--topbar-h) - var(--nav-h) - 8px);
    border-radius: 0; margin-bottom: 0;
  }
  .shop-toolbar { border-radius: 0; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .shop-card { border-radius: var(--r); }
  .shop-cats { padding-bottom: 10px; }
  .shop-gallery { border-radius: 0; border-left: 0; border-right: 0; }
  .shop-info-card { border-radius: var(--r); }
  .shop-detail-title { font-size: 21px; }
  .shop-detail-price { font-size: 26px; }
  .shop-actions .btn { flex: 1 1 auto; }
  .new-chat-list { max-height: 52vh; }
  .feed-toolbar { border-radius: 0; }
}
@media (max-width: 420px) {
  .feed-hint { display: none; }
}

/* ==========================================================================
   v5 — Shop flotante, contactos de venta, ventas en el muro y chat vivo
   ========================================================================== */

/* ---------- Shop: botón flotante para vender ---------- */
.shop-page { padding-bottom: 84px; }
.shop-fab {
  position: fixed; right: 24px; bottom: 28px; z-index: 420;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 20px; border-radius: var(--r-full);
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 14px 30px -10px rgba(8, 102, 255, .75), 0 2px 6px rgba(0, 0, 0, .16);
  transition: transform var(--fast) var(--ease), background var(--fast) var(--ease);
}
.shop-fab:hover { background: var(--brand-hover); transform: translateY(-1px); }
.shop-fab:active { transform: scale(.96); }
.shop-fab .ico { flex: none; }

/* ---------- Shop: contacto de la venta (formulario) ---------- */
.shop-contact-field {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card-2); border-radius: var(--r-lg); padding: 14px;
}
.shop-contact-head { display: flex; align-items: center; gap: 12px; }
.shop-contact-head .strong { font-size: 15px; }
.shop-contact-box { display: flex; flex-direction: column; gap: 10px; }
.shop-contact-box.hide { display: none; }
.shop-contact-opts { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-contact-opt {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px; border-radius: var(--r-full);
  background: var(--card); border: 1px solid var(--line-soft);
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
    background var(--fast) var(--ease);
}
.shop-contact-opt:hover { border-color: var(--line); color: var(--text); }
.shop-contact-opt.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.shop-contact-opt.whatsapp .ico { color: #25d366; }
.shop-contact-opt.instagram .ico { color: #e1306c; }

/* ---------- Shop: contacto en la ficha del producto ---------- */
.shop-contact-card {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--r-lg);
  background: var(--card-2); border: 1px solid var(--line-soft);
}
.shop-contact-card-title {
  font-size: 11.5px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-3); margin-bottom: 8px;
}
.shop-contact-card-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.shop-contact-btn { border: 0; }
.shop-contact-btn.whatsapp { background: #25d366; color: #fff; }
.shop-contact-btn.whatsapp:hover { background: #1fb958; }
.shop-contact-btn.instagram {
  background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7); color: #fff;
}
.shop-contact-btn.instagram:hover { filter: brightness(1.06); }
.shop-contact-value { font-size: 13px; font-weight: 600; color: var(--text-2); }

/* ---------- Venta de Shop dentro del muro ---------- */
.shop-feed {
  position: relative;
  border: 1px solid var(--line-soft); border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 16px 32px -22px rgba(16, 24, 40, .35);
}
.shop-feed-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.shop-feed-head .who { flex: 1; min-width: 0; }
.shop-feed-avatar {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  box-shadow: 0 0 0 1px var(--line-soft);
}
.shop-feed-chip { flex: none; gap: 4px; height: 26px; font-size: 12px; padding: 0 10px; }
.shop-feed-media {
  position: relative; display: block; margin: 0 12px;
  border-radius: 16px; overflow: hidden; background: var(--card-2);
}
.shop-feed-media:hover { text-decoration: none; }
.shop-feed-media img { width: 100%; max-height: 470px; object-fit: cover; display: block; }
.shop-feed-tag {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: var(--r-full);
  background: rgba(5, 12, 25, .72); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.shop-feed-watermark {
  position: absolute; left: 10px; bottom: 10px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 6px; border-radius: var(--r-full);
  background: rgba(6, 14, 30, .58); color: #fff;
  font-size: 12.5px; font-weight: 800; letter-spacing: -.1px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.shop-feed-watermark img { width: 18px; height: 18px; border-radius: 5px; }
.shop-feed-watermark small {
  font-size: 9px; font-weight: 800; letter-spacing: .14em; opacity: .72;
}
.shop-feed-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.shop-feed-title { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.3; }
.shop-feed-title:hover { text-decoration: underline; }
.shop-feed-price { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.shop-feed-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-2);
}
.shop-feed-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }
.shop-feed-meta a { color: var(--text-2); font-weight: 600; }
.shop-feed-meta a:hover { color: var(--brand); }
.shop-feed-actions { border-top: 1px solid var(--line-soft); }

/* ---------- mensajes: estado de envío ---------- */
.msg.pending .bubble { opacity: .62; }
.msg.pending .stamp { color: var(--text-3); }

@media (max-width: 767px) {
  .shop-page { padding-bottom: 108px; }
  .shop-fab {
    right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
    width: 56px; height: 56px; padding: 0;
  }
  .shop-fab-label { display: none; }
  .shop-feed { border-radius: 0; }
  .shop-feed-media { margin: 0 8px; border-radius: 12px; }
  .shop-feed-media img { max-height: 380px; }
  .shop-feed-head { padding: 12px 14px 8px; }
  .shop-feed-body { padding: 10px 14px; }
  .shop-feed-title { font-size: 16px; }
  .shop-feed-price { font-size: 20px; }
  .shop-contact-card { border-radius: var(--r); }
}
