/* ClimbWithMe — Diseño */
:root {
  --bg: #F2F6F7;
  --surface: #FFFFFF;
  --ink: #16211B;
  --ink-soft: #5C665E;
  --line: #E1E7E8;
  --accent: #2F6B4F;
  --accent-deep: #235340;
  --accent-soft: #E9F2EC;
  --accent-grad: linear-gradient(135deg, #35785A 0%, #2F6B4F 55%, #275C43 100%);
  --terra: #B4552D;
  --terra-soft: #F8ECE4;
  --danger: #B3382E;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22,33,27,.05), 0 8px 24px rgba(22,33,27,.06);
  --shadow-lift: 0 2px 6px rgba(22,33,27,.07), 0 16px 40px rgba(22,33,27,.10);
  --ring: 0 0 0 3px rgba(47,107,79,.18);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Entrada suave de cada vista */
#app > * { animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 500;
  background: rgba(242,246,247,.8);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.verify-banner {
  background: var(--terra-soft); border-bottom: 1px solid rgba(180,85,45,.2);
  color: var(--ink); font-size: 13.5px; padding: 10px 20px;
  display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap;
}
.verify-banner-btn {
  background: none; border: 1px solid var(--terra); color: var(--terra);
  border-radius: 8px; padding: 4px 12px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
}
.verify-banner-btn:hover { background: var(--terra); color: #fff; }

.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 6px; height: 62px;
}
.brand {
  font-weight: 800; font-size: 19px; letter-spacing: -.5px;
  display: flex; align-items: center; gap: 9px; margin-right: 16px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand .logo { width: 29px; height: 29px; border-radius: 8px; object-fit: cover; }
.nav-links { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  padding: 7px 13px; border-radius: 99px; color: var(--ink-soft);
  font-weight: 500; font-size: 14px; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.nav-link.active { background: var(--accent); color: #fff; font-weight: 600; }
.nav-right { display: flex; align-items: center; gap: 8px; }

.lang-toggle {
  border: 1px solid var(--line); background: var(--surface); border-radius: 99px;
  padding: 6px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
  color: var(--ink-soft); font-family: var(--font); letter-spacing: .3px;
  transition: border-color .15s, color .15s, box-shadow .15s;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow); }

.bell { position: relative; background: none; border: none; cursor: pointer; padding: 7px; border-radius: 99px; font-size: 17px; transition: background .15s; }
.bell:hover { background: var(--accent-soft); }
.bell .dot {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  background: var(--terra); color: #fff; border-radius: 9px; border: 2px solid var(--bg);
  font-size: 9.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-panel {
  position: absolute; right: 0; top: 46px; width: 330px; max-height: 400px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); padding: 8px;
  animation: pop-in .18s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.notif-item { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; cursor: pointer; transition: background .12s; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item .when { color: var(--ink-soft); font-size: 11px; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.avatar.lg { width: 76px; height: 76px; font-size: 27px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.avatar.has-photo { background-size: cover; background-position: center; }

/* Marcadores de usuario en el mapa */
.map-avatar-wrap { background: none; border: none; }
.map-avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(22,33,27,.35);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px; font-family: var(--font);
  background-size: cover; background-position: center;
}

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 32px 20px 64px; }
.narrow { max-width: 460px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
h1 { font-size: 27px; letter-spacing: -.7px; font-weight: 800; }
h2 { font-size: 19px; letter-spacing: -.3px; font-weight: 700; margin-bottom: 12px; }
.sub { color: var(--ink-soft); font-size: 14px; }

/* ---------- Landing ---------- */
.hero {
  text-align: center; padding: 104px 20px 88px; position: relative; color: #fff;
  background:
    linear-gradient(180deg, rgba(14,26,22,.62) 0%, rgba(14,26,22,.44) 45%, rgba(20,32,27,.72) 100%),
    url('/img/hero.jpg') center 32% / cover no-repeat;
}
.hero-logo {
  display: block; width: 108px; height: 108px; object-fit: cover;
  margin: 0 auto 22px; border-radius: 24px;
  box-shadow: 0 12px 34px rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.22);
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); border-radius: 99px;
  padding: 7px 17px; font-size: 13px; font-weight: 600; color: #fff;
  margin-bottom: 24px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.hero h1 {
  font-size: clamp(34px, 5.4vw, 58px); line-height: 1.06; letter-spacing: -1.8px;
  max-width: 800px; margin: 0 auto 20px; color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero .accent {
  background: linear-gradient(120deg, #9FE0BC, #6FCB99 70%, #E8A87C 150%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p {
  max-width: 560px; margin: 0 auto 34px; color: rgba(255,255,255,.88); font-size: 17.5px;
  text-shadow: 0 1px 14px rgba(0,0,0,.35);
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Botón "cristal" para fondos con foto */
.btn-glass {
  background: rgba(255,255,255,.14); color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.btn-glass:hover { background: rgba(255,255,255,.26); color: #fff; }

.landing-section { max-width: 1000px; margin: 0 auto; padding: 44px 20px; }
.section-title { font-size: clamp(22px, 3vw, 31px); letter-spacing: -.8px; margin-bottom: 18px; }
.section-title.centered { text-align: center; margin-bottom: 30px; }

.mission {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(28px, 5vw, 52px); box-shadow: var(--shadow);
  border-left: 4px solid var(--accent);
  display: grid; grid-template-columns: 3fr 2fr; gap: clamp(20px, 4vw, 44px); align-items: center;
}
.mission p { color: var(--ink-soft); font-size: 16px; max-width: 720px; }
.mission p + p { margin-top: 12px; }
.mission-photo {
  width: 100%; height: 100%; max-height: 300px; object-fit: cover;
  border-radius: 16px; box-shadow: var(--shadow-lift);
}
@media (max-width: 700px) {
  .mission { grid-template-columns: 1fr; }
  .mission-photo { max-height: 190px; }
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; position: relative; transition: transform .18s, box-shadow .18s;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.step-num {
  width: 36px; height: 36px; border-radius: 12px; background: var(--accent-grad); color: #fff;
  font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 15px; box-shadow: 0 4px 12px rgba(47,107,79,.3);
}
.step h3 { font-size: 16px; margin-bottom: 6px; letter-spacing: -.2px; }
.step p { color: var(--ink-soft); font-size: 14px; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; text-align: left; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: transparent; }
.feature .icon {
  font-size: 22px; margin-bottom: 14px; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); border-radius: 13px;
}
.feature h3 { font-size: 16px; margin-bottom: 6px; letter-spacing: -.2px; }
.feature p { color: var(--ink-soft); font-size: 14px; }

.safety-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 640px) { .safety-grid { grid-template-columns: 1fr; } }
.safety-item {
  background: var(--accent-soft); border-radius: var(--radius); padding: 22px 24px;
  border: 1px solid transparent; transition: border-color .18s;
}
.safety-item:hover { border-color: var(--accent); }
.safety-item h3 { font-size: 15px; margin-bottom: 5px; letter-spacing: -.2px; }
.safety-item p { color: var(--ink-soft); font-size: 13.5px; }

.final-cta {
  text-align: center; padding: 84px 20px; margin-top: 24px; color: #fff;
  background:
    linear-gradient(180deg, rgba(14,26,22,.66), rgba(14,26,22,.72)),
    url('/img/hero.jpg') center 70% / cover no-repeat;
}
.final-cta-inner { max-width: 640px; margin: 0 auto; }
.final-cta h2 { font-size: clamp(24px, 4vw, 36px); letter-spacing: -1px; margin-bottom: 8px; color: #fff; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.final-cta p { color: rgba(255,255,255,.85); margin-bottom: 26px; font-size: 16px; }

/* ---------- Cabecera del inicio (con sesión) ---------- */
.home-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  border-radius: 22px; padding: clamp(26px, 4vw, 40px); margin-bottom: 22px; color: #fff;
  background:
    linear-gradient(100deg, rgba(14,26,22,.78) 25%, rgba(14,26,22,.42) 75%, rgba(14,26,22,.28)),
    url('/img/hero.jpg') center 30% / cover no-repeat;
  box-shadow: var(--shadow-lift);
}
.home-hero h1 { color: #fff; font-size: clamp(22px, 3.4vw, 30px); letter-spacing: -.8px; }
.home-hero p { color: rgba(255,255,255,.82); margin-top: 3px; font-size: 14.5px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: 11px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; font-family: var(--font);
  transition: all .16s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.985); }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 2px 8px rgba(47,107,79,.25); }
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 4px 14px rgba(47,107,79,.35); text-decoration: none; color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.btn-danger { background: transparent; border-color: rgba(179,56,46,.4); color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 15px; }
.accept-terms {
  display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.45;
  margin-bottom: 16px; cursor: pointer;
}
.accept-terms input { margin-top: 2px; flex-shrink: 0; width: auto; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field-hint { font-size: 12px; color: var(--ink-soft); margin-top: 5px; }
input, select, textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px;
  font-family: var(--font); font-size: 14px; background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #CFD3C6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
textarea { resize: vertical; min-height: 90px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checks { display: flex; gap: 14px; flex-wrap: wrap; }
.checks label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 400; cursor: pointer; }
.checks input { width: auto; accent-color: var(--accent); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.person-card { display: flex; gap: 15px; align-items: flex-start; transition: transform .18s, box-shadow .18s; }
.person-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.person-card .info { flex: 1; min-width: 0; }
.person-card .name { font-weight: 700; font-size: 15px; }
.person-card .meta { color: var(--ink-soft); font-size: 13px; margin: 2px 0 8px; }
.person-card .bio { font-size: 13px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.group-card { display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.group-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.group-card .title { font-weight: 700; }
.group-card .meta { color: var(--ink-soft); font-size: 13px; }

/* Portada del grupo: foto propia, o bandera/icono sobre degradado si no hay */
.group-cover {
  height: 108px; margin: -24px -24px 14px; background-size: cover; background-position: center;
  border-radius: var(--radius) var(--radius) 0 0;
}
.group-cover-placeholder {
  position: relative; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.92);
  background: linear-gradient(135deg, var(--accent) 0%, #1F4A38 100%);
}
.group-cover-placeholder .icon-inline { width: 32px; height: 32px; }
.group-cover-flag {
  position: absolute; right: 10px; bottom: 8px; font-size: 19px; line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.4));
}
.group-cover-lg {
  height: 200px; margin: 0 0 18px; border-radius: var(--radius); position: relative;
}
.group-cover-lg .group-cover-edit {
  position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px;
}

.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: 11.5px; font-weight: 600; padding: 3.5px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-deep);
  border: 1px solid rgba(47,107,79,.12);
}
.tag.terra { background: var(--terra-soft); color: var(--terra); border-color: rgba(180,85,45,.15); }
.tag.gray { background: #EEEFE8; color: var(--ink-soft); border-color: transparent; }

/* ---------- Filtros ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.filters input, .filters select { width: auto; min-width: 140px; flex: 1; max-width: 220px; }

/* ---------- Foro ---------- */
.post-row { display: flex; gap: 13px; padding: 16px 2px; border-bottom: 1px solid var(--line); align-items: flex-start; border-radius: 6px; }
.post-row:last-child { border-bottom: none; }
.post-row .title { font-weight: 700; font-size: 15px; color: var(--ink); transition: color .12s; }
.post-row .title:hover { color: var(--accent); text-decoration: none; }
.post-row .meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.reply { display: flex; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.reply .body { font-size: 14px; }
.reply .meta { font-size: 12px; color: var(--ink-soft); margin-bottom: 3px; }

/* ---------- Mensajes ---------- */
.msg-layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; min-height: 480px; }
.convo-list { border-right: none; }
.convo {
  display: flex; gap: 11px; padding: 12px; border-radius: var(--radius-sm); cursor: pointer; align-items: center;
  transition: background .12s;
}
.convo:hover, .convo.active { background: var(--accent-soft); }
.convo .preview { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.convo .unread-dot { margin-left: auto; background: var(--terra); color: #fff; border-radius: 10px; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.thread { display: flex; flex-direction: column; height: 520px; }
.thread-msgs { flex: 1; overflow-y: auto; padding: 6px 4px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 72%; padding: 9px 14px; border-radius: 16px; font-size: 14px;
  animation: bubble-in .18s ease both;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(4px); } }
.bubble.mine { align-self: flex-end; background: var(--accent-grad); color: #fff; border-bottom-right-radius: 5px; box-shadow: 0 2px 8px rgba(47,107,79,.2); }
.bubble.theirs { align-self: flex-start; background: #EEEFE8; border-bottom-left-radius: 5px; }
.bubble .when { font-size: 10.5px; opacity: .65; margin-top: 2px; }
.bubble.request { border: 2px dashed var(--terra); background: var(--terra-soft); color: var(--ink); box-shadow: none; }
.thread-input { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.thread-input input { flex: 1; border-radius: 99px; padding-left: 16px; }
.thread-input .btn { border-radius: 99px; }

/* ---------- Mapa ---------- */
#map { height: 540px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; box-shadow: var(--shadow); }
.leaflet-popup-content { font-family: var(--font); }
.leaflet-popup-content-wrapper { border-radius: 12px !important; }

/* ---------- Admin ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-align: center; transition: transform .15s, box-shadow .15s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .num {
  font-size: 30px; font-weight: 800; letter-spacing: -1.2px;
  background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .lbl { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 9px 16px; font-weight: 600; font-size: 14px; color: var(--ink-soft); cursor: pointer; border: none; background: none; font-family: var(--font); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--terra); color: #fff; border-radius: 10px;
  font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px;
}

/* Filas de moderación (pendientes y reportes) */
.mod-row { padding: 16px 4px; border-bottom: 1px solid var(--line); }
.mod-row:last-child { border-bottom: none; }
.mod-row.resolved { opacity: .55; }
.mod-row .meta { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mod-excerpt {
  font-size: 13.5px; color: var(--ink-soft); background: var(--bg);
  border-left: 3px solid var(--line); border-radius: 0 8px 8px 0;
  padding: 8px 12px; margin: 6px 0; white-space: pre-wrap;
}
.mod-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.pending-banner {
  background: var(--terra-soft); border: 1px solid rgba(180,85,45,.4); color: var(--ink);
  border-radius: var(--radius-sm); padding: 11px 15px; font-size: 13.5px; margin-top: 12px;
}

.report-flag {
  background: none; border: none; cursor: pointer; color: var(--ink-soft);
  font-size: 12px; padding: 0 3px; transition: color .12s;
}
.report-flag:hover { color: var(--danger); }

.icon-inline {
  width: 1em; height: 1em; vertical-align: -0.15em; flex-shrink: 0;
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr, table tr { transition: background .12s; }
table tr:hover td { background: rgba(233,242,236,.35); }

/* ---------- Misc ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(22,33,27,.94); color: #fff; padding: 12px 22px; border-radius: 99px;
  font-size: 14px; font-weight: 500; z-index: 1000; box-shadow: var(--shadow-lift);
  backdrop-filter: blur(6px); animation: toast-in .25s cubic-bezier(.2,.8,.3,1.1);
  max-width: min(92vw, 520px); text-align: center;
}
.toast.error { background: rgba(179,56,46,.95); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px) scale(.97); } }
.empty { text-align: center; color: var(--ink-soft); padding: 48px 20px; font-size: 14px; }
.divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
footer { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 36px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-social { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; color: var(--ink-soft);
  border: 1px solid var(--line); transition: color .15s, border-color .15s, background .15s;
}
.footer-social a:hover { color: #fff; background: var(--accent-grad); border-color: transparent; text-decoration: none; }
.footer-social a .icon-inline { width: 19px; height: 19px; vertical-align: 0; }
.footer-links { margin-top: 6px; font-size: 12.5px; }
.footer-links a { color: var(--ink-soft); }
.footer-links a:hover { color: var(--accent); }

/* ---------- Legal ---------- */
.narrow-legal { max-width: 720px; }
.legal-content h2 { font-size: 16px; margin: 22px 0 8px; letter-spacing: -.2px; }
.legal-content h2:first-of-type { margin-top: 18px; }
.legal-content p, .legal-content li { color: var(--ink-soft); font-size: 14.5px; }
.legal-content ul { padding-left: 20px; margin: 6px 0; }
.legal-content li { margin: 4px 0; }
.legal-content .legal-updated { font-size: 13px; color: var(--ink-soft); margin-bottom: 4px; }

.modal-back {
  position: fixed; inset: 0; background: rgba(22,33,27,.45); z-index: 800;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: modal-back-in .18s ease; backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border-radius: 22px; padding: 30px; max-width: 520px; width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(22,33,27,.3);
  animation: modal-in .22s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes modal-back-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

.request-modal-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.request-modal-icon {
  width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.request-modal-hint {
  font-size: 12.5px; color: var(--ink-soft); background: var(--bg);
  border-radius: var(--radius-sm); padding: 10px 13px; display: flex; gap: 6px;
}
.detail-photo { height: 280px; border-radius: var(--radius); background: linear-gradient(135deg, #2F6B4F, #4A8A68 50%, #C2803D); background-size: cover; background-position: center; margin-bottom: 20px; }

/* ---------- Scrollbars sutiles ---------- */
.thread-msgs::-webkit-scrollbar, .notif-panel::-webkit-scrollbar, .modal::-webkit-scrollbar { width: 8px; }
.thread-msgs::-webkit-scrollbar-thumb, .notif-panel::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 8px;
}

/* ---------- Barra de pestañas inferior (solo móvil) ---------- */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 500;
  background: rgba(242,246,247,.92);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); /* muesca inferior del iPhone */
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 7px; color: var(--ink-soft); font-size: 10.5px; font-weight: 600;
  text-decoration: none; min-width: 0;
}
.tab-item span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab-item .icon-inline { width: 21px; height: 21px; }
.tab-item:hover { text-decoration: none; }
.tab-item.active { color: var(--accent); }

/* ---------- Móvil ---------- */
@media (max-width: 760px) {
  .msg-layout { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero { padding: 52px 16px 40px; }
  .grid[style*="2fr 1fr"] { grid-template-columns: 1fr !important; }
  .container { padding: 24px 16px 56px; }
  .card { padding: 18px; }
  h1 { font-size: 23px; }

  /* La navegación principal pasa a la barra inferior; arriba quedan solo
     logo, idioma, campana, avatar y salir. Con sesión de invitado no hay
     barra inferior (el tabbar se vacía por JS) y los enlaces siguen arriba. */
  .tabbar:not(:empty) { display: flex; }
  body:has(.tabbar:not(:empty)) .nav-links { display: none; }
  body:has(.tabbar:not(:empty)) #app { padding-bottom: 64px; }
  body:has(.tabbar:not(:empty)) #footer { padding-bottom: 76px; }
}

@media (max-width: 480px) {
  /* Invitados en pantallas estrechas: sin barra inferior, el enlace «Foro»
     y los botones de entrar/registrarse necesitan el sitio del nombre. */
  body:not(:has(.tabbar:not(:empty))) .brand-name { display: none; }
  body:not(:has(.tabbar:not(:empty))) .brand { margin-right: 4px; }
}

/* Respeta la preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
