/* ═══════════════════════════════════════════
   Almería Discreta — hoja de estilos
   ═══════════════════════════════════════════ */

:root {
  --bg:        #0e0d13;
  --bg-alt:    #14131b;
  --surface:   #1b1a24;
  --surface-2: #232231;
  --border:    #2e2c3d;

  --text:      #e9e7f0;
  --text-mut:  #a29fb4;
  --text-dim:  #736f87;

  --accent:    #c9a227;   /* oro discreto */
  --accent-2:  #e0bd4a;
  --accent-dim:rgba(201,162,39,.14);
  --violet:    #6b5ca5;
  --danger:    #c9534f;
  --ok:        #4b9e70;

  --radius:    14px;
  --radius-lg: 22px;
  --wrap:      1140px;

  --shadow:    0 18px 50px rgba(0,0,0,.45);
  --shadow-sm: 0 6px 20px rgba(0,0,0,.28);

  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.68;
  font-size: 17px;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.16rem; }
p  { margin: 0 0 1rem; }
kbd {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; font-size: .82em; font-family: inherit;
}
code {
  background: var(--surface-2); padding: 2px 6px;
  border-radius: 5px; font-size: .88em;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 2.5rem, 760px); }
.center { text-align: center; }
.mt-xl { margin-top: 3rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--accent); color: #17150c; padding: .6rem 1rem;
}
.skip-link:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ═══ HEADER ═══ */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(14,13,19,.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
.site-header.is-scrolled { box-shadow: 0 6px 26px rgba(0,0,0,.4); }

.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 68px;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; letter-spacing: -.01em; }
.brand-mark {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent-dim);
  color: var(--accent); font-size: 1.05rem; flex: none;
}
.brand-text { white-space: nowrap; }

.nav { display: flex; gap: 1.6rem; margin-left: auto; font-size: .95rem; }
.nav a { color: var(--text-mut); transition: color .2s; position: relative; padding: .3rem 0; }
.nav a:hover { color: var(--text); }
.nav a.is-active { color: var(--accent); }
.nav a.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent); border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: .6rem; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.35rem; border-radius: 100px; border: 1px solid transparent;
  font-size: .95rem; font-weight: 500; transition: all .22s ease;
  white-space: nowrap; background: none; color: var(--text);
}
.btn-lg { padding: 1rem 2rem; font-size: 1.05rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #17150c; font-weight: 600;
  box-shadow: 0 8px 26px rgba(201,162,39,.26);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(201,162,39,.36); }

.btn-outline { border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost { color: var(--text-mut); padding: .5rem .9rem; }
.btn-ghost:hover { color: var(--accent); }

.btn-chat-mini {
  border: 1px solid var(--border); font-size: .88rem; padding: .5rem 1rem;
  color: var(--text-mut);
}
.btn-chat-mini:hover { border-color: var(--accent); color: var(--accent); }

.btn-exit {
  background: rgba(201,83,79,.12); color: #e58884;
  border: 1px solid rgba(201,83,79,.32);
  font-size: .88rem; padding: .5rem 1rem; font-weight: 600;
}
.btn-exit:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* Menú móvil */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: 0; padding: .4rem; margin-left: auto;
}
.nav-toggle span {
  width: 24px; height: 2px; background: var(--text); border-radius: 2px;
  transition: transform .25s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ═══ HERO ═══ */
.hero { position: relative; padding: clamp(4rem, 10vw, 7.5rem) 0 clamp(3.5rem, 7vw, 5.5rem); overflow: hidden; }
.hero-glow {
  position: absolute; inset: -30% 0 auto; height: 620px;
  background:
    radial-gradient(ellipse 620px 340px at 50% 40%, rgba(201,162,39,.14), transparent 70%),
    radial-gradient(ellipse 480px 300px at 20% 60%, rgba(107,92,165,.16), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; text-align: center; }

.eyebrow {
  display: inline-block; font-size: .78rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 1rem; font-weight: 600;
}
.hero h1 { max-width: 16ch; margin-inline: auto; }
.accent { color: var(--accent); }

.lead {
  font-size: clamp(1.02rem, 2vw, 1.2rem); color: var(--text-mut);
  max-width: 60ch; margin-inline: auto;
}
.hero-cta { margin: 2.2rem 0 1.8rem; }

.trust-row {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem;
  font-size: .88rem; color: var(--text-mut);
}
.trust-row li {
  display: flex; align-items: center; gap: .45rem;
  background: var(--surface); border: 1px solid var(--border);
  padding: .45rem 1rem; border-radius: 100px;
}

/* ═══ SECCIONES ═══ */
.section { padding: clamp(3.5rem, 7vw, 5.5rem) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { margin-bottom: 2.8rem; max-width: 62ch; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.between {
  max-width: none; display: flex; align-items: flex-end;
  justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.section-head h2 { margin-bottom: 0; }

.page-hero {
  padding: clamp(3rem, 7vw, 5rem) 0 2rem;
  background: linear-gradient(180deg, rgba(107,92,165,.09), transparent);
  text-align: center;
}

/* ── Tarjetas ── */
.cards-3 {
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem 1.7rem;
  transition: transform .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(201,162,39,.4); }
.card-icon {
  width: 50px; height: 50px; display: grid; place-items: center;
  border-radius: 14px; background: var(--accent-dim);
  font-size: 1.4rem; margin-bottom: 1.1rem;
}
.card p { color: var(--text-mut); margin: 0; font-size: .96rem; }

/* ── Split (propuesta) ── */
.split {
  display: grid; gap: 3rem;
  grid-template-columns: 1.15fr .85fr; align-items: center;
}
.split-text p { color: var(--text-mut); }
.quote-lead {
  font-family: var(--serif); font-size: 1.22rem; font-style: italic;
  color: var(--text) !important; border-left: 3px solid var(--accent);
  padding-left: 1.2rem; margin-bottom: 1.4rem;
}
.check-list { list-style: none; padding: 0; margin: 1.4rem 0 1.8rem; }
.check-list li {
  position: relative; padding-left: 1.9rem; margin-bottom: .7rem;
  color: var(--text-mut); font-size: .96rem;
}
.check-list li::before {
  content: '✓'; position: absolute; left: 0; top: -1px;
  color: var(--accent); font-weight: 700;
}

/* Foto del anfitrión */
.photo-card {
  margin: 0; position: relative;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  background: var(--surface-2);
}
.photo-card img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 640 / 846; object-fit: cover;
  filter: saturate(.88) contrast(1.03);
  transition: transform .5s ease;
}
.photo-card:hover img { transform: scale(1.02); }
/* Velo cálido para integrar la foto en la paleta */
.photo-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14,13,19,.06) 0%, transparent 34%, rgba(14,13,19,.72) 100%);
}
.photo-card figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: .5rem;
  padding: 1.5rem 1.3rem 1.2rem;
  font-size: .84rem; color: var(--text-mut); line-height: 1.45;
}
.visual-quote {
  font-family: var(--serif); font-style: italic; text-align: center;
  color: var(--text-mut); margin: 1.4rem 0 0; font-size: 1.05rem;
}

/* ── Pasos ── */
.steps {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 1.4rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  counter-reset: s;
}
.step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2.2rem 1.7rem 1.8rem;
  position: relative;
}
.step-num {
  position: absolute; top: -18px; left: 1.7rem;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: #17150c;
  font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 6px 18px rgba(201,162,39,.3);
}
.step h3 { margin-top: .6rem; }
.step p { color: var(--text-mut); margin: 0; font-size: .96rem; }

/* ── Zonas ── */
.zones {
  list-style: none; padding: 0; margin: 2rem 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem;
}
.zones li {
  border: 1px solid var(--border); background: var(--surface);
  padding: .5rem 1.1rem; border-radius: 100px;
  font-size: .9rem; color: var(--text-mut);
}

/* ── FAQ ── */
.faq { display: flex; flex-direction: column; gap: .8rem; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s;
}
.faq details[open] { border-color: rgba(201,162,39,.4); }
.faq summary {
  padding: 1.15rem 1.4rem; cursor: pointer; font-weight: 500;
  list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+'; color: var(--accent); font-size: 1.35rem;
  line-height: 1; transition: transform .25s; flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  padding: 0 1.4rem 1.25rem; margin: 0;
  color: var(--text-mut); font-size: .96rem;
}

/* ═══ BLOG ═══ */
.tag {
  display: inline-block; font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
  background: var(--accent-dim); padding: .28rem .7rem;
  border-radius: 100px; margin-bottom: .9rem; font-weight: 600;
}
.post-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .25s, border-color .25s;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(201,162,39,.4); }
.post-card a { display: block; padding: 1.8rem 1.6rem; height: 100%; }
.post-card h3 { font-size: 1.1rem; margin-bottom: .6rem; }
.post-card p { color: var(--text-mut); font-size: .93rem; margin-bottom: 1rem; }
.post-meta { font-size: .82rem; color: var(--text-dim); }

.post-feature {
  background: linear-gradient(140deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: border-color .25s;
}
.post-feature:hover { border-color: rgba(201,162,39,.45); }
.post-feature > a { display: grid; grid-template-columns: 1.3fr .7fr; }
.post-feature-body { padding: 2.6rem; }
.post-feature-body h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.post-feature-body p { color: var(--text-mut); }
.post-feature-art {
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(201,162,39,.18), transparent 68%);
  border-left: 1px solid var(--border);
}
.post-feature-art span { font-size: 5rem; color: var(--accent); opacity: .55; }

/* ── Artículo ── */
.article-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem; text-align: center; }
.back-link { display: inline-block; color: var(--text-mut); font-size: .9rem; margin-bottom: 1.5rem; }
.back-link:hover { color: var(--accent); }

.article-body { padding-bottom: 3rem; font-size: 1.05rem; }
.article-body h2 {
  font-size: 1.5rem; margin-top: 2.6rem; margin-bottom: .8rem;
  padding-top: 1.4rem; border-top: 1px solid var(--border);
}
.article-body h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.article-body p, .article-body li { color: var(--text-mut); }
.article-body strong { color: var(--text); }
.article-body ul { padding-left: 1.3rem; margin-bottom: 1.4rem; }
.article-body li { margin-bottom: .5rem; }
.article-note {
  background: var(--accent-dim); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem; margin-top: 2.5rem; font-size: .95rem;
  color: var(--text-mut);
}
.article-note strong { color: var(--text); }


/* ═══ CTA FINAL ═══ */
.cta-final {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
  background:
    radial-gradient(ellipse 700px 320px at 50% 0%, rgba(201,162,39,.13), transparent 70%),
    var(--bg-alt);
  border-top: 1px solid var(--border);
}
.cta-final p { color: var(--text-mut); }
.cta-final .btn { margin-top: 1rem; }
.cta-small { font-size: .9rem; margin-top: 1.4rem; }
.cta-small a { color: var(--accent); text-decoration: underline; }

/* ═══ FOOTER ═══ */
.site-footer { background: var(--bg); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; }
.footer-inner {
  display: flex; justify-content: space-between; gap: 2rem;
  flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid var(--border);
}
.footer-brand { display: flex; gap: .9rem; align-items: flex-start; max-width: 340px; }
.footer-brand p { color: var(--text-dim); font-size: .88rem; margin: .3rem 0 0; }
.footer-links { display: flex; flex-direction: column; gap: .6rem; font-size: .9rem; }
.footer-links a { color: var(--text-mut); }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding-top: 1.5rem; font-size: .82rem; color: var(--text-dim);
}
.footer-bottom p { margin: 0; }

/* ═══ CANALES DE CONTACTO ═══ */
.section-channels { padding-bottom: 1rem; }

.channels {
  display: grid; gap: 1.3rem;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}
.channel-card {
  position: relative; display: flex; flex-direction: column;
  text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.9rem 1.6rem 1.5rem;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  overflow: hidden;
}
.channel-card::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: var(--ch, var(--accent)); opacity: .85;
}
.channel-card:hover {
  transform: translateY(-4px);
  border-color: var(--ch, var(--accent));
  box-shadow: 0 16px 40px rgba(0,0,0,.32);
}
.channel-telegram { --ch: #2ea6da; }
.channel-whatsapp { --ch: #3fae54; }
.channel-web      { --ch: var(--accent); }

.channel-icon {
  width: 52px; height: 52px; display: grid; place-items: center;
  border-radius: 15px; margin-bottom: 1.1rem; font-size: 1.5rem;
  background: color-mix(in srgb, var(--ch) 15%, transparent);
  color: var(--ch);
}
/* Reserva para navegadores sin color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .channel-icon { background: var(--surface-2); }
}
.channel-card h2 { font-size: 1.22rem; margin-bottom: .5rem; }
.channel-card p { color: var(--text-mut); font-size: .93rem; margin-bottom: 1.1rem; flex: 1; }
.channel-card strong { color: var(--text); }

.channel-badge {
  position: absolute; top: 1.4rem; right: 1.3rem;
  font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  font-weight: 700; color: var(--ch);
  background: color-mix(in srgb, var(--ch) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ch) 32%, transparent);
  padding: .25rem .6rem; border-radius: 100px;
}
.channel-handle {
  display: block; font-size: .88rem; color: var(--text-dim);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  margin-bottom: .9rem; word-break: break-all;
}
.channel-go { font-size: .92rem; font-weight: 600; color: var(--ch); }

.channels-note {
  margin: 1.8rem auto 0; max-width: 68ch; text-align: center;
  font-size: .87rem; color: var(--text-dim); line-height: 1.6;
}

/* ═══ PÁGINA DE CHAT — ocupa el alto de la ventana ═══
   El <main> es flexible y la caja se estira dentro; así el
   campo de escritura queda anclado abajo y solo scrollea el log. */
body[data-page="chat"] {
  overflow: hidden;
  display: flex; flex-direction: column;
  height: 100vh;
  height: 100dvh;          /* dvh: descuenta la barra del navegador móvil */
}
body[data-page="chat"] #main {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
/* En esta página el header no necesita ser sticky: nada scrollea detrás */
body[data-page="chat"] .site-header { position: static; flex: none; }
/* El pie general sobra cuando el chat ocupa toda la pantalla */
body[data-page="chat"] .site-footer { display: none; }

.chat-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0;
}
.chat-shell {
  /* flex-basis 0 + grow: se estira en vertical sin tocar el ancho máximo */
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column;
  width: 100%; max-width: 820px; margin-inline: auto;
  padding: 1rem .75rem 1.2rem;
}

/* Título solo para lectores de pantalla */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.chat-rules {
  font-size: .8rem; color: var(--text-dim); margin: .9rem 0 0; line-height: 1.5;
}
.chat-alias-note {
  font-size: .84rem; color: var(--text-dim); margin: 1.6rem 0 0;
  max-width: 46ch; line-height: 1.6;
}
.chat-alias-note a { color: var(--accent); text-decoration: underline; }

.chat-alias-help {
  font-size: .82rem; color: var(--text-dim); margin: 1.2rem 0 0;
  max-width: 44ch; line-height: 1.55;
}

/* Campo de contraseña con botón de ver */
.pass-wrap { position: relative; display: flex; }
.pass-wrap input { flex: 1; padding-right: 3rem !important; }
.pass-eye {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-dim);
  font-size: .95rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; opacity: .6;
  transition: opacity .2s, color .2s;
}
.pass-eye:hover { opacity: 1; }
.pass-eye.is-on { opacity: 1; color: var(--accent); }

.chat-error {
  margin: .9rem 0 0; font-size: .87rem; color: #e58884;
  background: rgba(201,83,79,.12); border: 1px solid rgba(201,83,79,.35);
  border-radius: var(--radius); padding: .6rem .9rem;
}

/* ═══ CAJA DEL CHAT ═══ */
.chat-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; overflow: hidden;
  flex: 1; min-height: 0;          /* se estira y permite scroll interno */
}

/* Flecha de vuelta en la cabecera */
.chat-back-icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; border-radius: 9px;
  color: var(--text-mut); font-size: 1.15rem; text-decoration: none;
  transition: background .2s, color .2s;
}
.chat-back-icon:hover { background: var(--border); color: var(--text); }
.chat-head-text { flex: 1; min-width: 0; }
.chat-head-text h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.2rem;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.chat-head h2,
.chat-head h3 { margin: 0; font-size: 1rem; letter-spacing: 0; }
.chat-sub { margin: .15rem 0 0; font-size: .78rem; color: var(--text-dim); display: flex; align-items: center; gap: .4rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(75,158,112,.2); }
.chat-head-actions { display: flex; gap: .3rem; }
.chat-icon {
  width: 32px; height: 32px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-mut); font-size: .95rem;
  display: grid; place-items: center; transition: background .2s, color .2s;
}
.chat-icon:hover { background: var(--border); color: var(--text); }

/* `hidden` debe ganar a cualquier display de abajo */
.chat-box [hidden] { display: none !important; }

/* El alta ocupa el alto disponible y scrollea si la pantalla es baja */
.chat-alias {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 2rem 1.5rem; text-align: center;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.chat-alias form { width: 100%; max-width: 340px; }
.chat-alias p { font-size: .93rem; color: var(--text-mut); }
.chat-alias form { display: flex; flex-direction: column; gap: .7rem; margin: 1.3rem 0 1rem; }
.chat-alias input {
  width: 100%; padding: .8rem 1rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); font: inherit;
}
.chat-alias input:focus { outline: none; border-color: var(--accent); }
.chat-alias input::placeholder { color: var(--text-dim); }
.chat-alias small { font-size: .78rem; color: var(--text-dim); }

.chat-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-log {
  flex: 1; overflow-y: auto; padding: 1.2rem;
  display: flex; flex-direction: column; gap: .7rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.msg {
  /* Tope en ch además del %: en pantallas anchas la línea no se hace ilegible */
  max-width: min(82%, 56ch); padding: .65rem .95rem; border-radius: 16px;
  font-size: .93rem; line-height: 1.5; word-wrap: break-word;
  animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.msg-me   { align-self: flex-end; background: var(--accent); color: #17150c; border-bottom-right-radius: 5px; }
.msg-them { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.msg-sys  { align-self: center; background: transparent; color: var(--text-dim); font-size: .8rem; text-align: center; max-width: 92%; }
.msg-time { display: block; font-size: .68rem; opacity: .6; margin-top: .25rem; }

.typing { display: flex; gap: 4px; align-items: center; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim);
  animation: blink 1.3s infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* Barra inferior: no se encoge, queda siempre visible */
.chat-foot-bar {
  flex: none;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.chat-foot-bar .chat-error { margin: .8rem .8rem 0; }

.chat-form {
  display: flex; gap: .5rem; padding: .8rem;
}
.chat-form input {
  flex: 1; padding: .75rem 1rem; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 100px; font: inherit; font-size: .93rem;
}
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-form .btn { padding: .7rem 1.05rem; }
.chat-foot {
  margin: 0; padding: 0 .9rem .8rem; font-size: .73rem;
  color: var(--text-dim); text-align: center; background: var(--surface-2);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .split, .post-feature > a { grid-template-columns: 1fr; }
  .post-feature-art { display: none; }
  .post-feature-body { padding: 2rem 1.6rem; }
  /* La foto acompaña al texto: ni a pantalla completa ni por delante del H2 */
  .split-visual { max-width: 420px; margin-inline: auto; }
}

@media (max-width: 780px) {
  .nav {
    position: fixed; inset: 68px 0 auto; flex-direction: column; gap: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: .5rem 0; margin: 0;
    transform: translateY(-140%); transition: transform .3s; z-index: 190;
  }
  .nav.is-open { transform: none; }
  .nav a { padding: .9rem 1.5rem; border-bottom: 1px solid var(--border); }
  .nav a.is-active::after { display: none; }

  .header-inner { gap: .6rem; }
  .brand-text { font-size: .95rem; }
  .btn-chat-mini { display: none; }
  .header-actions { margin-left: auto; }
  .nav-toggle { display: flex; margin-left: 0; }

  /* A pantalla completa el chat va sin márgenes ni esquinas redondeadas */
  .chat-shell { width: 100%; padding: 0; }
  .chat-box { border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }

  .footer-inner { flex-direction: column; }
  .section-head.between { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .btn-exit span { display: none; }
  .btn-exit::before { content: '✖ '; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .chat-box, .cta-final, .site-footer { display: none !important; }
}
