/* =========================================================
   Citas — hoja de estilos única
   Fondo crema cálido, tinta marrón oscura y un solo acento coral
   para "Me gusta" y las acciones principales.
   ========================================================= */

@font-face {
  font-family: "Fraunces";
  src: url("/fonts/fraunces-latin.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/fonts/figtree-latin.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Color */
  --paper: oklch(97.5% 0.012 70);
  --paper-2: oklch(94.5% 0.018 65);
  --paper-3: oklch(91% 0.022 60);
  --surface: oklch(99.2% 0.006 70);
  --ink: oklch(23% 0.035 20);
  --ink-2: oklch(38% 0.03 25);
  --muted: oklch(50% 0.025 30);
  --rule: oklch(87% 0.02 55);
  --accent: oklch(53% 0.17 22);
  --accent-deep: oklch(45% 0.15 20);
  --accent-soft: oklch(94% 0.035 25);
  --on-accent: oklch(99% 0.005 70);
  --ok: oklch(52% 0.12 150);
  --ok-soft: oklch(94% 0.04 150);
  --danger: oklch(48% 0.18 28);
  --danger-soft: oklch(94% 0.04 28);
  --focus: oklch(45% 0.15 20);
  --scrim: oklch(23% 0.035 20 / 0.45);

  /* Tipografía */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem);
  --text-3xl: clamp(2.1rem, 1.4rem + 2.6vw, 3.2rem);
  --text-hero: clamp(2.6rem, 1.4rem + 5vw, 5.2rem);

  /* Espacio */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  /* Forma */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px oklch(23% 0.035 20 / 0.06), 0 2px 8px oklch(23% 0.035 20 / 0.05);
  --shadow-2: 0 2px 6px oklch(23% 0.035 20 / 0.07), 0 12px 32px oklch(23% 0.035 20 / 0.10);

  /* Movimiento */
  --dur: 160ms;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  --container: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --tabbar-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: clip; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

p { margin: 0; text-wrap: pretty; }

a { color: var(--accent-deep); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

::selection { background: var(--accent-soft); }

[hidden] { display: none !important; }

.visualmente-oculto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.saltar {
  position: absolute; left: var(--s-4); top: -100px; z-index: 100;
  padding: var(--s-2) var(--s-4); background: var(--ink); color: var(--paper);
  border-radius: var(--r-s);
}
.saltar:focus-visible { top: var(--s-4); }

.contenedor {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main { flex: 1; }

/* ---------- Marca ---------- */
.marca {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 500;
  color: var(--ink); text-decoration: none; letter-spacing: -0.02em;
}
.marca svg { width: 30px; height: 22px; flex: none; }
.marca:hover { color: var(--ink); }

/* ---------- Botones (ocho estados) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 46px; padding: 0 var(--s-5);
  border: 1px solid var(--ink); border-radius: var(--r-pill);
  background: transparent; color: var(--ink);
  font: 500 var(--text-md)/1 var(--font-body);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:hover { background: var(--paper-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; transition: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.75; }

.btn--primario { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primario:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--on-accent); }

.btn--tinta { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn--tinta:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }

.btn--suave { border-color: var(--rule); background: var(--surface); }
.btn--suave:hover { border-color: var(--ink-2); background: var(--surface); }

.btn--peligro { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn--peligro:hover { background: oklch(42% 0.17 28); border-color: oklch(42% 0.17 28); color: var(--on-accent); }

.btn--pequeno { min-height: 38px; padding: 0 var(--s-4); font-size: var(--text-sm); }
.btn--ancho { width: 100%; }

.enlace-boton {
  background: none; border: 0; padding: var(--s-1) 0; cursor: pointer;
  font: inherit; font-size: var(--text-sm); color: var(--muted);
  text-decoration: underline; text-underline-offset: 0.18em; text-decoration-color: var(--rule);
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
.enlace-boton:hover { color: var(--ink); text-decoration-color: currentColor; }
.enlace-boton:active { color: var(--ink-2); }
.enlace-boton:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; transition: none; }
.enlace-boton:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Formularios ---------- */
.campo { display: grid; gap: var(--s-2); }
.campo + .campo { margin-top: var(--s-4); }

label, .etiqueta { font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }

.ayuda { font-size: var(--text-xs); color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
  width: 100%; min-height: 48px; padding: var(--s-3) var(--s-4);
  border: 1px solid var(--rule); border-radius: var(--r-s);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: var(--text-md);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled, select:disabled, textarea:disabled { background: var(--paper-2); color: var(--muted); cursor: not-allowed; }
input:user-invalid, textarea:user-invalid { border-color: var(--danger); }
::placeholder { color: oklch(62% 0.02 40); }

.casilla { display: flex; gap: var(--s-3); align-items: flex-start; font-size: var(--text-sm); color: var(--ink-2); }
.casilla input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.fila-campos { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.fila-campos .campo + .campo { margin-top: 0; }

/* Selector segmentado (género) */
.segmentado { display: flex; flex-wrap: wrap; gap: var(--s-2); border: 0; padding: 0; margin: 0; }
.segmentado legend { padding: 0; margin-bottom: var(--s-2); font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }
.segmentado input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmentado label {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4);
  border: 1px solid var(--rule); border-radius: var(--r-pill); background: var(--surface);
  font-size: var(--text-md); font-weight: 400; color: var(--ink); cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.segmentado label:hover { border-color: var(--muted); }
.segmentado input:checked + label { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.segmentado input:focus-visible + label { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Avisos y estados ---------- */
.aviso {
  padding: var(--s-3) var(--s-4); border-radius: var(--r-s);
  font-size: var(--text-sm); border: 1px solid transparent;
}
.aviso--ok { background: var(--ok-soft); color: oklch(32% 0.08 150); border-color: oklch(85% 0.06 150); }
.aviso--error { background: var(--danger-soft); color: oklch(38% 0.15 28); border-color: oklch(85% 0.07 28); }
.aviso--info { background: var(--paper-2); color: var(--ink-2); }
.zona-aviso:empty { display: none; }
.zona-aviso { margin-bottom: var(--s-4); }

.estado { padding: var(--s-6) var(--s-4); text-align: center; color: var(--muted); }
.estado--error { color: var(--danger); }
.estado .btn { margin-top: var(--s-4); }

.vacio {
  display: grid; justify-items: center; gap: var(--s-3); text-align: center;
  padding: var(--s-8) var(--s-4); color: var(--ink-2);
}
.vacio h2 { font-size: var(--text-xl); }
.vacio p { max-width: 38ch; color: var(--muted); }

.insignia {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 var(--s-2);
  border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
  font-size: var(--text-xs); font-weight: 600; font-variant-numeric: tabular-nums;
}
.insignia--suave { background: var(--accent-soft); color: var(--accent-deep); }

/* =========================================================
   Barra superior (páginas privadas) + pestañas en móvil
   ========================================================= */
.barra {
  position: sticky; top: 0; z-index: 20;
  background: oklch(97.5% 0.012 70 / 0.92);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.barra__in { display: flex; align-items: center; gap: var(--s-5); min-height: 64px; }
.barra__extra { margin-left: auto; display: flex; align-items: center; gap: var(--s-4); font-size: var(--text-sm); }
.barra__extra a { color: var(--ink-2); text-decoration: none; }
.barra__extra a:hover, .barra__extra a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

.pestanas { display: flex; gap: var(--s-1); }
.pestanas a {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-3); border-radius: var(--r-pill);
  color: var(--ink-2); text-decoration: none; font-size: var(--text-sm); font-weight: 500;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.pestanas a svg { width: 20px; height: 20px; flex: none; }
.pestanas a:hover { background: var(--paper-2); color: var(--ink); }
.pestanas a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.pestanas a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (max-width: 760px) {
  .barra__in { min-height: 56px; }
  .pestanas {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    justify-content: space-around; gap: 0;
    padding: var(--s-1) var(--s-2) calc(var(--s-1) + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--rule);
  }
  .pestanas a {
    flex: 1; flex-direction: column; gap: 2px; min-height: var(--tabbar-h);
    padding: var(--s-2) 0; border-radius: var(--r-s); font-size: 0.72rem;
  }
  .pestanas a[aria-current="page"] { background: transparent; color: var(--accent-deep); }
  .pestanas a[aria-current="page"] svg { stroke-width: 2.2; }
  body.con-pestanas { padding-bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- Cabecera de página ---------- */
.pagina { padding-block: var(--s-7) var(--s-8); }
.pagina__cabecera { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.pagina__cabecera p { color: var(--muted); max-width: 52ch; margin-top: var(--s-2); }

.tarjeta-panel {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l);
  padding: clamp(20px, 3vw, 32px);
}
.tarjeta-panel + .tarjeta-panel { margin-top: var(--s-5); }
.tarjeta-panel h2 { font-size: var(--text-xl); margin-bottom: var(--s-2); }
.tarjeta-panel > p { color: var(--ink-2); max-width: 60ch; }
.tarjeta-panel .acciones { margin-top: var(--s-4); }

.acciones { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }

/* =========================================================
   Portada pública
   ========================================================= */
.cabecera-publica { border-bottom: 1px solid var(--rule); }
.cabecera-publica .barra__in { min-height: 72px; }
.cabecera-publica nav { margin-left: auto; display: flex; gap: var(--s-3); align-items: center; }

.portada {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px);
  min-height: min(calc(100dvh - 73px), 860px); padding-block: var(--s-8);
}
.portada h1 { font-size: var(--text-hero); font-weight: 400; letter-spacing: -0.025em; max-width: 12ch; }
.portada__frase { margin-top: var(--s-5); font-size: var(--text-lg); color: var(--ink-2); max-width: 36ch; }
.portada .acciones { margin-top: var(--s-6); }

/* El "dibujo" de la portada: los tres pasos reales, como una conversación */
.flujo { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); counter-reset: paso; }
.flujo li {
  counter-increment: paso;
  display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); align-items: start;
  padding: var(--s-5); border-radius: var(--r-l); background: var(--surface);
  border: 1px solid var(--rule); box-shadow: var(--shadow-1);
}
.flujo li:nth-child(2) { margin-left: clamp(0px, 4vw, 40px); }
.flujo li:nth-child(3) { margin-left: clamp(0px, 8vw, 80px); background: var(--ink); color: var(--paper); border-color: var(--ink); }
.flujo li::before {
  content: counter(paso);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-deep);
  font-family: var(--font-display); font-size: 1.25rem;
}
.flujo li:nth-child(3)::before { background: var(--accent); color: var(--on-accent); }
.flujo strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); margin-bottom: 2px; }
.flujo span { font-size: var(--text-sm); color: var(--muted); }
.flujo li:nth-child(3) span { color: oklch(85% 0.02 60); }

.seccion { padding-block: var(--s-9); border-top: 1px solid var(--rule); }
.seccion--banda { background: var(--paper-2); }
.seccion__titulo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-6); align-items: end; margin-bottom: var(--s-7); }
.seccion__titulo p { color: var(--ink-2); font-size: var(--text-lg); max-width: 44ch; }

.garantias { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); }
.garantias article { padding-top: var(--s-5); border-top: 2px solid var(--ink); }
.garantias h3 { font-size: var(--text-lg); margin-bottom: var(--s-2); }
.garantias p { color: var(--ink-2); font-size: var(--text-md); }

.cierre { text-align: center; display: grid; justify-items: center; gap: var(--s-5); }
.cierre h2 { font-size: var(--text-3xl); font-weight: 400; max-width: 18ch; }

.pie { border-top: 1px solid var(--rule); padding-block: var(--s-6); font-size: var(--text-sm); color: var(--muted); }
.pie .contenedor { display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; align-items: center; }
.pie a { color: var(--ink-2); }

@media (max-width: 900px) {
  .portada { grid-template-columns: 1fr; min-height: 0; padding-block: var(--s-7); }
  .seccion__titulo { grid-template-columns: 1fr; }
  .garantias { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .garantias { grid-template-columns: 1fr; }
  .cabecera-publica nav .btn--suave { display: none; }
}

/* =========================================================
   Acceso (login / registro)
   ========================================================= */
.acceso {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  min-height: 100dvh;
}
.acceso__lado {
  background: var(--ink); color: var(--paper);
  padding: var(--s-7) clamp(24px, 5vw, 64px);
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-7);
}
.acceso__lado .marca { color: var(--paper); }
.acceso__lado h1 { color: var(--paper); font-size: var(--text-3xl); font-weight: 400; max-width: 14ch; }
.acceso__lado p { color: oklch(84% 0.02 60); max-width: 36ch; margin-top: var(--s-4); }
.acceso__lado .acceso__pie { font-size: var(--text-sm); color: oklch(75% 0.02 60); }
.acceso__lado a { color: var(--paper); }

.acceso__form { display: grid; place-items: center; padding: var(--s-7) var(--gutter); }
.acceso__caja { width: 100%; max-width: 440px; }
.acceso__caja h2 { font-size: var(--text-2xl); margin-bottom: var(--s-2); }
.acceso__caja > p { color: var(--muted); margin-bottom: var(--s-6); }
.acceso__caja form .btn { margin-top: var(--s-5); }
.acceso__alterna { margin-top: var(--s-5); font-size: var(--text-sm); color: var(--muted); text-align: center; }

@media (max-width: 860px) {
  .acceso { grid-template-columns: 1fr; }
  .acceso__lado { padding: var(--s-5) var(--gutter); gap: var(--s-4); }
  .acceso__lado h1 { font-size: var(--text-2xl); }
  .acceso__lado .acceso__pie, .acceso__lado p { display: none; }
}

/* =========================================================
   Inicio (dashboard)
   ========================================================= */
.saludo { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-5); align-items: center; margin-bottom: var(--s-7); }
.saludo__foto { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--paper-3); border: 3px solid var(--surface); box-shadow: var(--shadow-1); }
.saludo h1 { font-weight: 400; }
.saludo p { color: var(--muted); margin-top: var(--s-1); }

.cifras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.cifra {
  display: grid; gap: var(--s-1); padding: var(--s-5);
  border-radius: var(--r-l); background: var(--surface); border: 1px solid var(--rule);
  text-decoration: none; color: var(--ink);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.cifra:hover { border-color: var(--ink-2); color: var(--ink); }
.cifra:active { transform: translateY(1px); }
.cifra:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.cifra__n { font-family: var(--font-display); font-size: var(--text-hero); line-height: 1; font-variant-numeric: tabular-nums; }
.cifra__l { font-size: var(--text-sm); color: var(--muted); }

.inicio { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-5); align-items: start; }
.llamada {
  border-radius: var(--r-l); background: var(--ink); color: var(--paper);
  padding: clamp(24px, 4vw, 40px); display: grid; gap: var(--s-4); align-content: start;
}
.llamada h2 { color: var(--paper); font-weight: 400; font-size: var(--text-2xl); max-width: 16ch; }
.llamada p { color: oklch(84% 0.02 60); }
.llamada .btn { justify-self: start; }

.pendientes { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.pendientes li { display: flex; gap: var(--s-3); align-items: center; justify-content: space-between; padding: var(--s-3) 0; border-top: 1px solid var(--rule); }
.pendientes li:first-child { border-top: 0; }
.pendientes span { color: var(--ink-2); }

@media (max-width: 860px) { .inicio { grid-template-columns: 1fr; } }

/* =========================================================
   Personas
   ========================================================= */
.filtros {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: var(--s-3); align-items: end;
  padding: var(--s-4); border-radius: var(--r-l); background: var(--paper-2); margin-bottom: var(--s-6);
}
.filtros .campo + .campo { margin-top: 0; }
.filtros__abrir { display: none; }

@media (max-width: 860px) {
  .filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filtros .btn { grid-column: 1 / -1; }
}

.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: var(--s-5); }

.perfil {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l);
  box-shadow: var(--shadow-1);
}
.perfil__foto { position: relative; aspect-ratio: 4 / 5; background: var(--paper-3); }
.perfil__foto img { width: 100%; height: 100%; object-fit: cover; }
.perfil__foto .insignia { position: absolute; top: var(--s-3); left: var(--s-3); }
.perfil__cuerpo { display: grid; gap: var(--s-1); padding: var(--s-4) var(--s-4) 0; flex: 1; align-content: start; }
.perfil__nombre { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; line-height: 1.15; overflow-wrap: anywhere; }
.perfil__nombre span { font-weight: 300; color: var(--ink-2); }
.perfil__meta { font-size: var(--text-sm); color: var(--muted); }
.perfil__bio {
  margin-top: var(--s-2); font-size: var(--text-sm); color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.perfil__acciones { display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); padding: var(--s-4); }
.perfil__acciones .btn { min-height: 44px; }
.perfil__acciones .btn--ancho { grid-column: 1 / -1; }
.perfil__seguridad { display: flex; gap: var(--s-4); padding: 0 var(--s-4) var(--s-4); }
.perfil__resultado { grid-column: 1 / -1; text-align: center; font-size: var(--text-sm); color: var(--muted); padding: var(--s-3) 0; }

/* =========================================================
   Matches y bandeja de chat
   ========================================================= */
.lista { list-style: none; margin: 0; padding: 0; }
.fila {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center;
  padding: var(--s-4); border-radius: var(--r-m); text-decoration: none; color: var(--ink);
  transition: background-color var(--dur) var(--ease);
}
.fila:hover { background: var(--surface); color: var(--ink); }
.fila:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lista li + li { border-top: 1px solid var(--rule); }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--paper-3); flex: none; }
.avatar--pequeno { width: 40px; height: 40px; }
.fila__nombre { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; overflow-wrap: anywhere; }
.fila__sub { font-size: var(--text-sm); color: var(--muted); }
.fila__fin { display: flex; align-items: center; gap: var(--s-3); }

.rejilla-matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: var(--s-5); list-style: none; margin: 0; padding: 0; }
.match a { display: grid; gap: var(--s-3); text-decoration: none; color: var(--ink); }
.match__foto { position: relative; aspect-ratio: 1; border-radius: var(--r-l); overflow: hidden; background: var(--paper-3); transition: transform var(--dur) var(--ease); }
.match__foto img { width: 100%; height: 100%; object-fit: cover; }
.match__foto .insignia { position: absolute; top: var(--s-2); right: var(--s-2); }
.match a:hover .match__foto { transform: translateY(-2px); }
.match a:hover { color: var(--ink); }
.match a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: var(--r-l); }
.match__nombre { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; }
.match__desde { font-size: var(--text-sm); color: var(--muted); }

/* =========================================================
   Conversación
   ========================================================= */
.chat {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  height: calc(100dvh - 64px - var(--s-6) * 2);
  min-height: 420px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-l); overflow: hidden;
}
.chat__cabecera {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--rule); background: var(--surface);
}
.chat__volver {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  color: var(--ink); text-decoration: none; transition: background-color var(--dur) var(--ease);
}
.chat__volver:hover { background: var(--paper-2); color: var(--ink); }
.chat__volver svg { width: 22px; height: 22px; }
.chat__quien { flex: 1; min-width: 0; }
.chat__nombre { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; overflow-wrap: anywhere; line-height: 1.2; }
.chat__estado { font-size: var(--text-xs); color: var(--muted); }
.chat__estado--online { color: var(--ok); }
.chat__opciones { display: flex; gap: var(--s-3); }

.chat__mensajes {
  overflow-y: auto; padding: var(--s-5) var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
  background: var(--paper);
  overscroll-behavior: contain;
}
.burbuja {
  max-width: min(78%, 520px); padding: var(--s-2) var(--s-4) var(--s-2);
  border-radius: 20px; font-size: var(--text-md); line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.burbuja--suya { align-self: flex-start; background: var(--surface); border: 1px solid var(--rule); border-bottom-left-radius: 6px; }
.burbuja--mia { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 6px; }
.hora { display: block; margin-top: 2px; font-size: 0.7rem; opacity: 0.65; text-align: right; font-variant-numeric: tabular-nums; }

.chat__envio { display: flex; gap: var(--s-2); padding: var(--s-3); border-top: 1px solid var(--rule); background: var(--surface); }
.chat__envio input { border-radius: var(--r-pill); }
.chat__envio .btn { flex: none; }

@media (max-width: 760px) {
  .pagina--chat { padding-block: 0; }
  .pagina--chat .contenedor { padding-inline: 0; }
  .chat {
    height: calc(100dvh - 56px - var(--tabbar-h) - 12px - env(safe-area-inset-bottom, 0px));
    min-height: 0; border-radius: 0; border-inline: 0;
  }
}

/* =========================================================
   Ajustes: fotos
   ========================================================= */
.ajustes { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-5); align-items: start; }
@media (max-width: 900px) { .ajustes { grid-template-columns: 1fr; } }

.galeria { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-top: var(--s-4); }
.galeria figure { margin: 0; display: grid; gap: var(--s-2); }
.galeria__foto { position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-m); overflow: hidden; background: var(--paper-3); }
.galeria__foto img { width: 100%; height: 100%; object-fit: cover; }
.galeria__foto--principal { box-shadow: 0 0 0 3px var(--accent); }
.galeria__foto .insignia { position: absolute; left: var(--s-2); bottom: var(--s-2); }
.galeria__borrar {
  position: absolute; top: var(--s-2); right: var(--s-2);
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: oklch(23% 0.035 20 / 0.7); color: var(--paper); cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.galeria__borrar svg { width: 16px; height: 16px; }
.galeria__borrar:hover { background: var(--danger); }
.galeria__borrar:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.galeria figcaption { text-align: center; }

.subir {
  position: relative; display: grid; place-items: center; gap: var(--s-2); text-align: center;
  aspect-ratio: 4 / 5; border-radius: var(--r-m); border: 1.5px dashed var(--muted);
  color: var(--ink-2); font-size: var(--text-sm); cursor: pointer; padding: var(--s-3);
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.subir:hover { border-color: var(--ink); background: var(--paper-2); }
.subir input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.subir:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.subir svg { width: 28px; height: 28px; }
.subir[aria-busy="true"] { cursor: progress; opacity: 0.7; }

@media (max-width: 420px) { .galeria { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================
   Privacidad y admin
   ========================================================= */
.zona-peligro { border-color: oklch(85% 0.07 28); }
.zona-peligro h2 { color: var(--danger); }

.cifras-admin { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: var(--s-3); margin-bottom: var(--s-6); }
.cifras-admin div { padding: var(--s-4); border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--rule); }
.cifras-admin strong { display: block; font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 500; font-variant-numeric: tabular-nums; }
.cifras-admin span { font-size: var(--text-sm); color: var(--muted); }

.busqueda { display: flex; gap: var(--s-3); margin-bottom: var(--s-4); }
.busqueda input { flex: 1; }

.etiquetas { display: inline-flex; gap: var(--s-1); flex-wrap: wrap; margin-left: var(--s-2); vertical-align: middle; }
.etiqueta-estado { font-size: var(--text-xs); padding: 2px var(--s-2); border-radius: var(--r-pill); background: var(--paper-2); color: var(--ink-2); }
.etiqueta-estado--mal { background: var(--danger-soft); color: var(--danger); }

/* =========================================================
   Texto largo (política)
   ========================================================= */
.prosa { max-width: 68ch; }
.prosa h1 { margin-bottom: var(--s-4); }
.prosa h2 { font-size: var(--text-xl); margin: var(--s-7) 0 var(--s-3); }
.prosa p, .prosa li { color: var(--ink-2); }
.prosa p + p { margin-top: var(--s-3); }
.prosa ul { padding-left: 1.2em; display: grid; gap: var(--s-2); }
.prosa .pendiente { background: var(--accent-soft); color: var(--accent-deep); padding: 0 4px; border-radius: 4px; }

/* =========================================================
   Diálogo de reporte
   ========================================================= */
dialog {
  width: min(100% - 32px, 480px); padding: 0; border: 0; border-radius: var(--r-l);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2);
}
dialog::backdrop { background: var(--scrim); }
.dialogo { padding: var(--s-6); display: grid; gap: var(--s-4); }
.dialogo h2 { font-size: var(--text-xl); }
.dialogo p { color: var(--ink-2); font-size: var(--text-sm); }
.dialogo .acciones { justify-content: flex-end; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Marca: dos círculos que se cruzan, uno en tinta y otro en el acento */
.marca__acento { stroke: var(--accent); }
.acceso__lado .marca__acento { stroke: oklch(70% 0.15 25); }

/* Estados vacíos dentro de rejillas: ocupan toda la fila */
.rejilla > .vacio, .rejilla > .estado, .rejilla-matches > .vacio, .rejilla-matches > .estado { grid-column: 1 / -1; }
.lista > .vacio, .lista > .estado { list-style: none; }

/* Paneles en rejilla (Perfil): sin el margen de "panel debajo de panel" */
.ajustes > .tarjeta-panel + .tarjeta-panel { margin-top: 0; }
.tarjeta-panel > form { margin-top: var(--s-4); }

/* Desplegables con la misma altura y flecha que el resto de campos */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 44px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a4640' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}

/* En móvil la cabecera no lleva desenfoque: backdrop-filter convertiría a la
   barra en el contenedor de la barra de pestañas fija, y esta saldría arriba
   en vez de pegada al borde inferior de la pantalla. */
@media (max-width: 760px) {
  .barra { backdrop-filter: none; background: var(--paper); }
}
