:root {
  --bg: #F7F5F0; --card: #FFFFFF; --ink: #233528; --ink2: #2B4431; --muted: #4E5F52;
  --green: #3E5E45; --sage: #7E9C7A; --sage-l: #DCE7D9; --sage-xl: #EEF3EC; --line: #CBD5C8; --line-l: #E4E9E2;
  --coral: #B14A2C; --coral-l: #FBE3DA; --coral-ink: #7A2E18; --peach: #F3B3A2;
  --warn-l: #FFF1CC; --warn-ink: #6B4A00;
  --r: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Nunito', system-ui, -apple-system, sans-serif; font-size: 16px; -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 8px 20px 110px; }
.screen.full { padding-bottom: 24px; }
.center { align-items: center; justify-content: center; text-align: center; }

/* Barra superior */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 20px 8px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; color: var(--ink2); text-decoration: none; }
.wordmark { font-family: 'Quicksand', 'Nunito', sans-serif; font-weight: 700; color: #4A6B4E; display: inline-flex; align-items: center; gap: 0.06em; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark svg { flex-shrink: 0; transform: translateY(0.04em); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.pill { display: inline-flex; align-items: center; gap: 4px; background: var(--card); border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; color: var(--ink2); border: 0; text-decoration: none; }
.pill svg { color: var(--coral); }
.round { position: relative; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--card); display: inline-flex; align-items: center; justify-content: center; color: var(--ink2); text-decoration: none; flex-shrink: 0; }
.badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* Navegación inferior */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; display: flex; justify-content: space-around; padding: 8px 8px calc(14px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line-l); z-index: 10; }
.nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 60px; min-height: 48px; justify-content: center; font-size: 12px; font-weight: 800; color: var(--muted); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--coral); }

/* Tipografía */
.h1 { font-size: 26px; font-weight: 800; color: var(--ink2); }
.h2 { font-size: 20px; font-weight: 800; color: var(--ink2); }
.h3 { font-size: 17px; font-weight: 800; color: var(--ink2); }
.lead { font-size: 16px; line-height: 1.5; color: var(--muted); }
.small { font-size: 13px; line-height: 1.45; color: var(--muted); }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* Botones */
.btn { height: 54px; border: 0; border-radius: var(--r); background: var(--green); color: #fff; font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; text-decoration: none; width: 100%; }
.btn.sec { background: transparent; border: 2px solid var(--green); color: var(--ink2); font-weight: 700; }
.btn.light { background: var(--card); border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; }
.btn.coral { background: var(--coral); }
.btn.sm { height: 46px; font-size: 15px; border-radius: 12px; }
.btn:disabled { background: #DDE3DB; color: #5B6B5E; cursor: not-allowed; border-color: #DDE3DB; }
.link { background: none; border: 0; padding: 0; min-height: 44px; color: var(--ink2); font-weight: 800; text-decoration: underline; align-self: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); color: var(--ink2); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: #fff; font-weight: 800; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 0 20px; }
.chips.scroll .chip { flex-shrink: 0; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink2); }
.input, .field input, .field select, .field textarea { height: 50px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--card); color: var(--ink); font-size: 16px; font-weight: 400; width: 100%; }
.field textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.hint { font-size: 12px; font-weight: 600; color: var(--muted); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.4; color: var(--ink); min-height: 44px; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--green); flex-shrink: 0; }
.err { background: var(--coral-l); color: var(--coral-ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.4; font-weight: 600; }

/* Tarjetas */
.card { background: var(--card); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tag { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.tag.alquiler { background: var(--green); color: #fff; }
.tag.prestamo { background: var(--sage-l); color: var(--ink); }
.tag.regalo { background: var(--coral-l); color: var(--coral-ink); }
.tag.venta { background: #F3E6C8; color: #6B4E12; }
.tag.gray { background: #ECEDEA; color: var(--muted); }
.tag.warn { background: var(--warn-l); color: var(--warn-ink); }
.tag.ok { background: var(--sage-l); color: var(--ink); }
.tag.bad { background: var(--coral-l); color: var(--coral-ink); }
.tag.fund { background: var(--coral-l); color: #8A3418; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--sage-l); color: var(--ink2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.avatar.lg { width: 68px; height: 68px; border-radius: 34px; font-size: 26px; background: var(--peach); color: var(--coral-ink); }
.ph { width: 100%; height: 100%; object-fit: cover; }
.ph-empty { background: var(--sage-xl); color: var(--sage); display: flex; align-items: center; justify-content: center; }
.thumb { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.stars { font-size: 14px; font-weight: 700; color: var(--ink2); }
.stars small { font-weight: 600; color: var(--muted); }
.info { display: flex; gap: 10px; align-items: flex-start; background: var(--sage-l); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; font-weight: 600; color: var(--ink); }
.info svg { flex-shrink: 0; color: var(--ink2); }
.info.coral { background: var(--coral-l); color: var(--coral-ink); }
.info.coral svg { color: var(--coral); }

/* Explorar */
.swipe { background: var(--card); border-radius: 24px; overflow: hidden; box-shadow: 0 8px 24px rgba(35,53,40,.10); display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.swipe .pic { position: relative; height: 300px; background: var(--sage-xl); }
.swipe .pic .tag { position: absolute; top: 14px; }
.swipe .pic .dist { left: 14px; background: #fff; color: var(--ink); }
.swipe .pic .mod { right: 14px; }
.swipe .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.actions { display: flex; justify-content: center; align-items: center; gap: 22px; }
.act { width: 64px; height: 64px; border-radius: 32px; border: 2px solid var(--line); background: var(--card); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.act.like { border: 0; background: var(--coral); color: #fff; }
.empty { background: var(--card); border-radius: var(--r); padding: 28px 20px; display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; }

/* Detalle */
.hero { position: relative; height: 280px; margin: 0 -20px; background: var(--sage-xl); }
.hero .round { position: absolute; top: 14px; left: 16px; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; height: 100%; scrollbar-width: none; }
.gallery img { flex: 0 0 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.sum { display: flex; flex-direction: column; gap: 10px; }
.sum .line { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.sum .line span { color: var(--muted); }

/* Chat */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; background: var(--card); border-bottom: 1px solid var(--line-l); position: sticky; top: 0; z-index: 5; }
.msgs { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 96px; }
.bubble { max-width: 80%; padding: 10px 14px; font-size: 15px; line-height: 1.4; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.bubble.them { align-self: flex-start; background: var(--card); border-bottom-left-radius: 4px; }
.bubble time { display: block; font-size: 11px; opacity: .75; margin-top: 2px; text-align: right; }
.composer { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; display: flex; gap: 10px; align-items: center; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line-l); }
.composer input { flex: 1; height: 48px; border: 1.5px solid var(--line); border-radius: 24px; padding: 0 16px; background: var(--bg); font-size: 16px; }
.send { width: 48px; height: 48px; border-radius: 24px; border: 0; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Segmentado */
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px; background: #E3EBE1; border-radius: 14px; }
.seg button { height: 44px; border-radius: 11px; border: 0; background: transparent; color: var(--muted); font-size: 15px; font-weight: 700; }
.seg button[aria-selected="true"] { background: var(--card); color: var(--ink2); font-weight: 800; box-shadow: 0 1px 4px rgba(35,53,40,.15); }

/* Fotos al publicar */
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.photos .slot { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--sage-xl); position: relative; }
.photos .slot img { width: 100%; height: 100%; object-fit: cover; }
.photos .slot button { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 16px; border: 0; background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; }
.photos label.add { aspect-ratio: 1; border-radius: 14px; border: 2px dashed var(--sage); background: var(--sage-xl); color: var(--ink2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 13px; font-weight: 800; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--green); }

/* Avisos */
.toast { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); max-width: 440px; width: calc(100% - 32px); background: var(--ink2); color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 15px; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.18); transition: opacity .4s; }
.toast.error { background: var(--coral); }
.toast.out { opacity: 0; }
.loading { flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 0; color: var(--muted); font-weight: 700; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--sage-l); border-top-color: var(--green); animation: spin 0.8s linear infinite; margin-right: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.welcome-logo svg { width: 140px; height: 112px; }

/* Instagram */
.insta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); color: var(--ink2); font-size: 14px; font-weight: 600; text-decoration: none; }
.insta svg { color: var(--coral); flex-shrink: 0; }

/* Páginas legales */
.legal p, .legal li { font-size: 15px; line-height: 1.55; color: var(--ink); }
.legal ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal h2 { margin-top: 8px; }
.legal a, .check a { color: var(--ink2); font-weight: 800; }

/* Solicitud enviada */
.done-check { width: 88px; height: 88px; border-radius: 44px; background: var(--green); color: #fff; display: inline-flex; align-items: center; justify-content: center; align-self: center; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--ink); }
/* Números del perfil */
.card.stat { align-items: center; text-align: center; gap: 2px; padding: 12px 6px; }
.card.stat strong { font-size: 24px; font-weight: 800; color: var(--ink2); }
.card.stat span { font-size: 12px; line-height: 1.3; color: var(--muted); }

/* Lo que ofrece este equipo */
.feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.feats li { display: flex; align-items: flex-start; gap: 12px; font-size: 15px; line-height: 1.4; color: var(--ink); }
.feats li svg { flex-shrink: 0; color: var(--green); }
.feats li.no { color: var(--muted); text-decoration: line-through; }
.feats li.no svg { color: var(--muted); }
/* Comunidad */
.impact { background: var(--green); color: #fff; border-radius: var(--r); padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.impact-title { font-weight: 700; opacity: .9; }
.impact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.impact-grid div { display: flex; flex-direction: column; gap: 2px; }
.impact-grid strong { font-size: 26px; font-weight: 800; line-height: 1.1; }
.impact-grid span { font-size: 13px; opacity: .9; }
.impact-note { font-size: 12px; line-height: 1.4; opacity: .8; }
.thanks { gap: 6px; }
.thanks-who { font-weight: 800; color: var(--coral-ink); }
.thanks p { font-size: 16px; line-height: 1.45; color: var(--ink); }
.info a { color: inherit; font-weight: 800; }

/* Números de la prueba (solo administradoras) */
.admin-nums { background: var(--ink2); color: #fff; text-decoration: none; gap: 10px; }
.admin-title { font-size: 13px; font-weight: 800; opacity: .85; }
.admin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
.admin-grid div { display: flex; flex-direction: column; align-items: center; text-align: center; }
.admin-grid strong { font-size: 22px; font-weight: 800; line-height: 1.1; }
.admin-grid span { font-size: 11px; opacity: .85; line-height: 1.2; }
.admin-grid .alert strong { color: var(--peach); }
