/* ============ WebAmigos - Estilos ============ */
:root {
  --bg: #faf7f5;
  --card: #ffffff;
  --ink: #221f2b;
  --muted: #6f6a7d;
  --line: #ece7f3;
  --primary: #6d28d9;
  --primary-2: #8b5cf6;
  --accent: #e11d74;
  --wa: #25d366;
  --wa-dark: #1eb457;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(34, 31, 43, .08);
  --shadow-lg: 0 14px 40px rgba(34, 31, 43, .14);
  --grad: linear-gradient(100deg, var(--primary), var(--accent));
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.center-page { display: flex; justify-content: center; padding-top: 60px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--ink); }
.logo-name { letter-spacing: -.3px; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a { padding: 7px 12px; border-radius: 999px; color: var(--ink); font-weight: 500; font-size: .88rem; transition: .15s; }
.main-nav a:hover { background: #f3eefc; color: var(--primary); }
.main-nav a.nav-cta { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(109, 40, 217, .35); }
.main-nav a.nav-cta:hover { opacity: .92; }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(600px 300px at 15% 0%, rgba(139, 92, 246, .14), transparent 60%),
    radial-gradient(600px 320px at 85% 10%, rgba(225, 29, 116, .12), transparent 60%),
    var(--bg);
  padding: 64px 0 40px;
  text-align: center;
}
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -1px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; margin-top: 10px; max-width: 620px; margin-inline: auto; }
.searchbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  padding: 12px; border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 28px;
  text-align: left;
}
.searchbar input, .searchbar select {
  flex: 1 1 160px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; background: #fbfaff; color: var(--ink);
  outline: none;
}
.searchbar input:focus, .searchbar select:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .92rem; transition: .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(109, 40, 217, .3); }
.btn-primary:hover { opacity: .92; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 6px 18px rgba(37, 211, 102, .35); }
.btn-wa:hover { background: var(--wa-dark); transform: translateY(-1px); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: #fff; color: var(--bad); border: 1px solid #f5c6c6; }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-lg { padding: 14px 26px; font-size: 1rem; width: 100%; }
.btn-mini { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 600; color: var(--ink); }
.btn-mini:hover { border-color: var(--primary-2); color: var(--primary); }
.btn-mini.danger:hover { border-color: var(--bad); color: var(--bad); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.btn-row form { display: inline-flex; gap: 8px; align-items: center; }
.btn-row form.inline input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-size: .85rem; width: 230px; }

/* ---------- Cards / grid ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 34px 0 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 22px; padding-bottom: 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.pad-lg { padding: 34px; }
.host-card { display: block; color: var(--ink); padding: 0; overflow: hidden; transition: .18s; }
.host-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-photo { position: relative; aspect-ratio: 3 / 3.6; overflow: hidden; background: #f1ecf9; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #ede9fe, #fce7f3); color: var(--primary);
  font-size: 2.6rem; font-weight: 800; letter-spacing: 1px;
}
.placeholder.big { font-size: 4rem; min-height: 320px; }
.card-body { padding: 14px 16px 16px; }
.card-name { font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 6px; }
.card-meta { color: var(--muted); font-size: .88rem; }
.card-stars { color: #f59e0b; font-weight: 600; font-size: .92rem; }
.card-tarifa { margin-top: 8px; font-size: .8rem; font-weight: 600; color: var(--primary); background: #f3eefc; padding: 4px 10px; border-radius: 999px; display: inline-block; }
.sex { font-size: .75rem; padding: 1px 6px; border-radius: 999px; }
.sex-f { background: #fce7f3; color: #db2777; }
.sex-m { background: #dbeafe; color: #2563eb; }
.chip { position: absolute; top: 10px; left: 10px; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff; }
.chip-featured { background: var(--grad); }
.chip-verif { background: rgba(22, 163, 74, .92); }
.empty { text-align: center; padding: 40px 20px; margin-bottom: 60px; }
.empty p { margin-bottom: 14px; color: var(--muted); }

/* ---------- Perfil ---------- */
.profile { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; margin-top: 26px; align-items: start; }
.profile-gallery { padding: 14px; }
.main-photo { width: 100%; aspect-ratio: 3 / 3.4; object-fit: cover; border-radius: 12px; cursor: zoom-in; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.thumbs img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .85; transition: .15s; }
.thumbs img:hover { opacity: 1; transform: scale(1.03); }
.profile-info h1 { font-size: 1.7rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-info .chip { position: static; }
.stars-line { margin: 6px 0 14px; }
.big-star { color: #f59e0b; font-size: 1.3rem; }
.meta { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: .95rem; }
.bio { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); white-space: pre-line; font-size: .95rem; }
.guarantee { margin-top: 16px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 12px; padding: 14px 16px; font-size: .9rem; color: #065f46; }
.cta { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.reviews { margin: 26px 0 60px; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-of-type { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mini-stars { color: #f59e0b; letter-spacing: 1px; }
.review-form { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.review-form h3 { margin-bottom: 12px; }

/* ---------- Formularios ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.form input, .form select, .form textarea {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-weight: 400; background: #fbfaff; color: var(--ink); outline: none;
}
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15);
}
.form textarea { resize: vertical; }
.form .check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
.form .check input { width: 18px; height: 18px; accent-color: var(--primary); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
h1.page-title { margin: 34px 0 6px; font-size: 1.6rem; }
.form h2 { margin-bottom: 8px; }

/* ---------- Alertas ---------- */
.alert { padding: 14px 18px; border-radius: 12px; margin: 18px 0; font-size: .92rem; font-weight: 500; }
.alert-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* ---------- Panel host ---------- */
.steps { margin-bottom: 22px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 14px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative; }
.step > span {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #ede9fe; color: var(--primary); font-weight: 800; font-size: .9rem; margin-bottom: 10px;
}
.step.done > span { background: var(--ok); color: #fff; }
.step h3 { font-size: .98rem; }
.step p { font-size: .84rem; color: var(--muted); margin-top: 4px; }
.step .btn { margin-top: 10px; font-size: .82rem; padding: 9px 14px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 16px; }
.photo-item { background: #fbfaff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.photo-item img { aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.photo-item form { display: flex; }
.photo-item .btn-mini { flex: 1; }
.tag { font-size: .72rem; font-weight: 700; color: var(--warn); text-align: center; }
.steps-list { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Admin ---------- */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 18px 0 26px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 1.6rem; font-weight: 800; }
.stat span { font-size: .78rem; color: var(--muted); }
.stat.warn strong { color: var(--warn); }
.stat.ok strong { color: var(--ok); }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); margin-bottom: 50px; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #fbfaff; font-size: .76rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fdfbff; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }
.verif-photo { max-width: 220px; border-radius: 12px; border: 1px solid var(--line); margin-top: 6px; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.review { background: #dbeafe; color: #1e40af; }
.badge.approved { background: #dcfce7; color: #166534; }
.badge.rejected { background: #fee2e2; color: #991b1b; }
.user-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(15, 10, 25, .92);
  display: none; align-items: center; justify-content: center; padding: 30px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; cursor: pointer;
  border-radius: 50%; width: 44px; height: 44px; font-size: 1.3rem; display: flex; align-items: center; justify-content: center;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.25); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }

/* ---------- Footer ---------- */
.site-footer { margin-top: auto; background: #fff; border-top: 1px solid var(--line); padding: 34px 0 20px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.footer-legal { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }

/* Menú: si la ventana no es suficientemente ancha (≤1160px) se usa hamburguesa
   para que los enlaces nunca se partan en dos líneas (bug en ventanas/zoom medios) */
@media (max-width: 1160px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 12px 20px 18px; gap: 4px;
    box-shadow: 0 14px 30px rgba(34, 31, 43, .12);
  }
  .main-nav.open { display: flex; }
  .main-nav a { width: 100%; text-align: center; }
  .main-nav .nav-app-btn { width: 100%; text-align: center; }
}
/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .profile { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .hero { padding: 44px 0 30px; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .card-body { padding: 12px; }
}

/* ---------- Logo ---------- */
.logo { display: flex; align-items: center; }
.logo-img { height: 42px; width: auto; display: block; }

/* ---------- Modal contratar ---------- */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(15,10,25,.6); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; }
.modal-box { position: relative; width: 100%; max-width: 420px; }
.modal-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.06); cursor: pointer; font-size: 1rem; line-height: 1; }

/* ---------- Chat (estilo WhatsApp con colores de la web) ---------- */
.chat-window { height: 55vh; overflow-y: auto; padding: 0; background: var(--bg); scroll-behavior: auto; }
/* El chat del admin (admin-chat.ejs) no usa #messages: dale su propio padding */
main:not(.chat-shell) .chat-window { padding: 14px; }
#messages { display: flex; flex-direction: column; gap: 10px; padding: 14px 12px; min-height: 100%; }
.chat-window .msg { display: flex; flex-direction: column; max-width: 78%; }
.chat-window .msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-window .msg.theirs { align-self: flex-start; align-items: flex-start; }
.bubble { position: relative; padding: 9px 14px; border-radius: 16px; background: #fff; color: var(--ink); white-space: pre-wrap; word-break: break-word; box-shadow: 0 1px 2px rgba(34, 31, 43, .08); }
.msg.mine .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.theirs .bubble { border-bottom-left-radius: 4px; }
/* Cola de la burbuja (como WhatsApp) */
.msg.mine .bubble::before, .msg.theirs .bubble::before { content: ''; position: absolute; bottom: 0; width: 15px; height: 15px; }
.msg.mine .bubble::before { right: -7px; background: var(--primary); border-bottom-left-radius: 15px; }
.msg.theirs .bubble::before { left: -7px; background: #fff; border-bottom-right-radius: 15px; }
.msg-time { font-size: .72rem; color: #8b8b9e; margin-top: 2px; padding: 0 2px; }
.chat-empty { margin: auto; text-align: center; padding: 20px; }

/* Barra superior del chat (cabecera estilo WhatsApp) */
.chat-topbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; }
.chat-back { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #f1ecf9; color: var(--primary); font-size: 1.2rem; flex-shrink: 0; transition: .15s; }
.chat-back:hover { background: #e9e2fb; }
.chat-top-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.chat-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem; flex-shrink: 0; }
.chat-top-text { min-width: 0; }
.chat-top-name { font-weight: 700; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-top-sub { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-top-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chat-top-actions .btn { padding: 8px 12px; font-size: .82rem; }
.chat-top-actions form { display: inline-flex; }
.chat-blocked-note { margin: 0 0 14px; }

/* Formulario de envío */
.chat-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; padding: 16px; }
.chat-form input[name="text"] { flex: 1; min-width: 160px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; font: inherit; background: #fbfaff; color: var(--ink); outline: none; }
.chat-form input[name="text"]:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(139, 92, 246, .15); }
.chat-send { border-radius: 999px; }

/* ---------- Bandeja de chats (inbox) ---------- */
.inbox { display: flex; flex-direction: column; gap: 10px; }
.inbox-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--ink); text-decoration: none; }
.inbox-item:hover { border-color: var(--primary); }
.inbox-avatar { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: linear-gradient(140deg, #ede9fe, #fce7f3); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.inbox-avatar img { width: 100%; height: 100%; object-fit: cover; }
.inbox-body { flex: 1; min-width: 0; }
.inbox-name { font-weight: 600; }
.inbox-last { color: #8b8b9e; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.badge-unread { background: var(--primary); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; padding: 2px 8px; }
.chip-danger { background: #fee2e2; color: #b91c1c; }

/* ---------- Imagenes en el chat ---------- */
.chat-img { max-width: 220px; max-height: 260px; border-radius: 10px; margin-top: 6px; display: block; cursor: zoom-in; }
.chat-form { flex-wrap: wrap; }
.chat-form input[name="text"] { flex: 1; min-width: 160px; }

/* ---------- Botón bonito para subir archivos ---------- */
.file-btn { position: relative; display: flex; align-items: center; gap: 10px; border: 1.5px dashed #c9b8f0; border-radius: var(--radius); padding: 8px 12px; background: #faf8ff; cursor: pointer; }
.file-btn:hover { border-color: var(--primary); background: #f4f0ff; }
.file-btn input[type="file"] { position: absolute; opacity: 0; width: 0.1px; height: 0.1px; overflow: hidden; }
.file-btn-label { display: inline-flex; align-items: center; gap: 6px; background: var(--primary); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.file-btn:hover .file-btn-label { background: var(--primary-dark, #7c3aed); }
.file-btn-name { color: #8b8b9e; font-size: .8rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-file-btn { border: 0; background: #f1ecf9; border-radius: 999px; padding: 4px 8px; }
.chat-file-btn .file-btn-label { background: transparent; color: var(--primary); padding: 2px 4px; font-size: 1.15rem; }
.chat-file-btn .file-btn-name { max-width: 80px; font-size: .7rem; }
.chat-file-btn:hover { background: #e9e2fb; }
/* Vista previa de la foto elegida en el chat (miniatura + nombre) */
.chat-photo-preview { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.chat-photo-preview:empty { display: none; }
.chat-photo-preview .photo-item { flex-direction: row; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; background: #faf8ff; border: 1px dashed #c9b8f0; border-radius: 999px; width: auto; }
.chat-photo-preview .photo-item img { width: 36px; height: 36px; aspect-ratio: auto; border-radius: 50%; object-fit: cover; }
/* Mensaje pendiente de envío (subiendo foto/texto) */
.msg.pending .bubble { background: #efe9fb; opacity: .85; }
.msg.pending .pending-label { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: #7c6ba6; margin-top: 6px; }
.msg.pending .pending-label::before { content: ''; width: 12px; height: 12px; border: 2px solid #c4b5fd; border-top-color: #7c3aed; border-radius: 50%; animation: chat-spin .8s linear infinite; }
@keyframes chat-spin { to { transform: rotate(360deg); } }

/* ---------- Adaptación móvil reforzada ---------- */
html, body { overflow-x: hidden; }
@media (max-width: 860px) {
  .wrap { padding: 0 14px; }
  .card { padding: 16px; }
  .pad-lg { padding: 20px; }
  .thumbs { grid-template-columns: repeat(3, 1fr); }
  .table th, .table td { padding: 10px 10px; }
  .searchbar { padding: 10px; }
}
@media (max-width: 600px) {
  .header-inner { height: 58px; }
  .main-nav { top: 58px; }
  .hero { padding: 34px 0 24px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-sub { font-size: .95rem; }
  /* Buscador en columna, nada se sale del bloque */
  .searchbar { flex-direction: column; gap: 8px; margin-top: 20px; }
  .searchbar input, .searchbar select, .searchbar button { flex: 1 1 auto; width: 100%; }
  /* Chat: input en su propia fila */
  .chat-form input[name="text"] { flex: 1 1 100%; }
  .chat-window { height: 62vh; }
  .chat-window .msg { max-width: 88%; }
  .chat-file-btn .file-btn-name { max-width: 90px; }
  .chat-img { max-width: 170px; }
  .inbox-item { padding: 12px; gap: 10px; }
  .inbox-meta .muted.small { display: none; }
  .profile-info h1 { font-size: 1.35rem; }
  .btn-lg { padding: 13px 18px; font-size: .95rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-body { padding: 10px 10px 12px; }
  .card-name { font-size: .95rem; }
  .card-meta { font-size: .8rem; }
  .card-stars { font-size: .84rem; }
  .card-tarifa { font-size: .74rem; padding: 3px 8px; }
  .section-head { margin: 24px 0 14px; }
  .section-head h2 { font-size: 1.05rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 12px; }
  .stat strong { font-size: 1.3rem; }
  h1.page-title { font-size: 1.3rem; margin: 24px 0 4px; }
  .btn-row form.inline { flex-wrap: wrap; }
  .btn-row form.inline input { width: 100%; }
  .steps-grid { grid-template-columns: 1fr; }
  .modal-box { max-width: 100%; }
  .verif-photo { max-width: 100%; }
  .placeholder.big { min-height: 220px; font-size: 3rem; }
  .footer-inner { flex-direction: column; gap: 14px; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .logo-img { height: 36px; }
  .wrap { padding: 0 10px; }
}

/* ---------- Badge de no leídos en el menú ---------- */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700; margin-left: 4px; vertical-align: middle; }

/* ---------- Botón instalar app (solo celulares) ---------- */
.nav-app-btn { display: none; background: none; border: 0; padding: 8px 14px; border-radius: 999px; color: var(--ink); font: inherit; font-weight: 500; font-size: .92rem; cursor: pointer; transition: .15s; }
.nav-app-btn:hover { background: #f3eefc; color: var(--primary); }
@media (hover: none) and (pointer: coarse) {
  .nav-app-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
}
@media (max-width: 860px) { .main-nav .nav-app-btn { width: 100%; text-align: center; } }.install-step ol { margin-top: 6px; }

/* ---------- Banner de notificaciones push ---------- */
.push-banner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.push-banner[hidden] { display: none; }
.push-banner-txt { flex: 1 1 220px; }
.push-banner .push-banner-btn { flex-shrink: 0; }

/* ================= Chat en celulares: pantalla completa tipo WhatsApp ================= */
/* En la página del chat, en pantallas pequeñas la web se convierte en una app:
   cabecera arriba, mensajes en el medio (única zona que hace scroll) y el
   input de escribir SIEMPRE visible abajo (nunca hay que hacer scroll para enviar). */
@media (max-width: 768px) {
  body.chat-page { height: 100vh; height: 100dvh; overflow: hidden; }
  body.chat-page .site-header { display: none; }
  body.chat-page .site-footer { display: none; }
  body.chat-page .wrap.narrow.chat-shell {
    max-width: 100%; padding: 0; margin: 0;
    flex: 1 1 auto; min-height: 0;
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column;
  }
  body.chat-page .wrap.narrow.chat-shell > .alert { margin: 8px 10px 0; flex-shrink: 0; }
  .chat-page .chat-topbar {
    margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-top: 0;
    box-shadow: none; padding: 8px 10px; flex-shrink: 0; gap: 8px;
  }
  .chat-page .chat-blocked-note { margin: 8px 10px 0; flex-shrink: 0; }
  .chat-page .chat-avatar { width: 38px; height: 38px; font-size: .95rem; }
  .chat-page .chat-top-name { font-size: .95rem; }
  .chat-page .chat-top-actions { gap: 6px; }
  .chat-page .chat-top-actions .btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; justify-content: center; }
  .chat-page .n-txt, .chat-page .b-txt { display: none; }
  .chat-page .chat-window {
    flex: 1 1 auto; min-height: 0; height: auto;
    border-radius: 0; border-left: 0; border-right: 0; border-top: 0; box-shadow: none;
    background-color: #efeaf8;
    background-image:
      radial-gradient(rgba(109, 40, 217, .07) 1.2px, transparent 1.6px),
      radial-gradient(rgba(225, 29, 116, .05) 1.2px, transparent 1.6px);
    background-size: 26px 26px, 34px 34px;
    background-position: 0 0, 13px 17px;
  }
  .chat-page .chat-window .msg { max-width: 85%; }
  .chat-page #messages { padding: 12px 10px; }
  .chat-page .chat-form {
    margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
    box-shadow: none; gap: 8px; align-items: center;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }
  .chat-page .chat-form input[name="text"] { flex: 1 1 120px; min-width: 100px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line); background: #f6f4fb; }
  .chat-page .chat-file-btn { flex-shrink: 0; }
  .chat-page .chat-send { width: 46px; height: 46px; padding: 0; border-radius: 50%; flex-shrink: 0; font-size: 0; box-shadow: 0 4px 14px rgba(109, 40, 217, .35); }
  .chat-page .chat-send::after { content: '📤'; font-size: 1.1rem; line-height: 1; }
  .chat-page .chat-photo-preview { order: 3; }
}
