/* Tipografías propias (Onest y Unbounded, licencia SIL Open Font 1.1): se sirven desde aquí, sin pedir nada a terceros. */
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/onest-v11-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/onest-v11-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/onest-v11-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/onest-v11-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fonts/unbounded-v12-cyrillic-ext.woff2) format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fonts/unbounded-v12-cyrillic.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fonts/unbounded-v12-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 600; font-display: swap; src: url(fonts/unbounded-v12-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Between — una pantalla, dos voces: cada persona tiene su color y el
   micrófono, donde se cruzan, lleva los dos. El logotipo usa aparte los
   colores de las dos banderas. */
:root {
  --bg: #f5f2f8;
  --surface: #ffffff;
  --ink: #1c1726;
  --muted: #6c6580;
  --line: #e2dcec;
  --me: #b4411d;          /* quien sostiene este teléfono */
  --me-bg: #ffe8dd;
  --them: #0b6a5c;        /* la otra persona */
  --them-bg: #d9f4ed;
  --danger: #b3261e;
  --seen: #1a7fe0;
  --shadow: 0 10px 30px rgb(40 24 70 / .12);
  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131019;
    --surface: #1d1926;
    --ink: #f1edf7;
    --muted: #a199b3;
    --line: #2f293c;
    --me: #ffb193;
    --me-bg: #3a2420;
    --them: #86e3cf;
    --them-bg: #14302c;
    --danger: #ff8a80;
    --seen: #5bb8ff;
    --shadow: 0 10px 30px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.45 var(--body);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--them); outline-offset: 2px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- entrada ---------- */
.setup {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding-block: 32px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.setup-card { width: 100%; max-width: 420px; display: grid; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font: 600 26px/1 var(--display); letter-spacing: -.02em; }
/* El logotipo: azul de Ucrania, rojo de España y, entre los dos, el amarillo que comparten. */
.brand-mark { width: 60px; height: 37px; flex: none; stroke: none; }
.brand-mark .ua { fill: #0057b7; }
.brand-mark .es { fill: #c60b1e; }
.brand-mark .mid { fill: #ffc400; }
.lede { margin: 0; font-size: 18px; color: var(--muted); text-wrap: balance; }

.fields { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); }
/* Los dos selectores de idioma van uno debajo del otro: sus nombres son largos y en un móvil no caben a la par. */
.field-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
/* Bienvenida: el logotipo y un botón, centrados. */
.welcome { min-height: 100%; display: flex; flex-direction: column; padding: 24px; text-align: center; }
.welcome[hidden] { display: none; }
.welcome-main { flex: 1; display: grid; place-content: center; justify-items: center; }
.head-logo { flex: none; width: 34px; height: 34px; stroke: none; border-radius: 9px; margin-inline-end: 10px; }
.head-logo[hidden] { display: none; }
.welcome .logo { width: 128px; height: 128px; stroke: none; border-radius: 30px; box-shadow: var(--shadow); }
.welcome h1 { margin: 20px 0 0; font: 600 28px/1 var(--display); }
/* El eslogan de la marca: siempre en inglés, bajo el nombre, en una sola línea. */
.slogan { margin: 3px 0 0; font: 400 11px/1.2 var(--body); letter-spacing: 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text { min-width: 0; }
.welcome .slogan { margin-top: 10px; font-size: 15px; }
.welcome .btn { min-width: 200px; margin-top: 104px; } /* aire entre el logotipo y el botón */
/* Al pie del todo: versión, fecha y dedicatoria. */
.welcome-foot { display: grid; gap: 4px; padding-bottom: env(safe-area-inset-bottom, 0px); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.welcome-foot p, .menu-version p { margin: 0; }
input[type="text"], input[type="password"], select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 16px; /* evita el zoom de iOS */
}
/* Los desplegables normales (género, voz…) se dibujan igual que el selector de idioma: misma altura,
   mismo borde y la misma flecha, sin el aspecto propio de cada navegador (Safari los hace más bajos). */
select {
  -webkit-appearance: none; appearance: none;
  height: 48px; padding: 0 40px 0 14px; line-height: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8598' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 9.5L12 15l5.5-5.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px 18px;
  text-overflow: ellipsis;
}
[dir="rtl"] select { padding: 0 14px 0 40px; background-position: left 10px center; }
/* Selector de idioma con banderas: por fuera, como cualquier otro campo. */
.flag { flex: none; width: 1.5em; height: 1em; border-radius: 2px; stroke: none; outline: 1px solid var(--line); }
.lang-pick { position: relative; }
.lang-btn {
  width: 100%; min-height: 48px; padding: 0 10px 0 14px; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-size: 16px; text-align: left;
}
.lang-btn span, .lang-list span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-btn .chev { flex: none; width: 18px; height: 18px; color: var(--muted); }
.lang-btn:focus-visible { outline-offset: 0; border-color: var(--them); }
.lang-list {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; margin: 0; padding: 6px; list-style: none;
  width: max-content; min-width: 100%; max-width: min(calc(100vw - 32px), 340px); max-height: min(60vh, 420px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.lang-list.right { left: auto; right: 0; }
.lang-list li { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: 10px; cursor: pointer; }
.lang-list li:hover, .lang-list li:focus-visible { background: var(--line); outline: none; }
.lang-list li[aria-selected="true"] { font-weight: 600; }
input:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--them); }
.form-error { margin: 0; color: var(--danger); font-size: 14px; }
.fineprint { margin: 0; font-size: 13px; color: var(--muted); }

.btn {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px; /* todos los botones son redondeados */
  background: var(--surface);
  font-weight: 600;
}
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
/* Lo que no se puede deshacer va en rojo, con el mismo rojo en tema claro y oscuro. */
.btn.danger { color: #fff; background: #c62828; border-color: #c62828; }
.confirm { text-align: center; }
.confirm h2 { line-height: 1.25; overflow-wrap: anywhere; }
.confirm p { margin: 0; color: var(--muted); }
.confirm .row { display: flex; gap: 10px; }
.confirm .row .btn { flex: 1; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.985); }

/* ---------- conversación ---------- */
.chat { height: 100dvh; display: flex; flex-direction: column; }
.chat > .scroll { flex: 1; min-height: 0; }
.bar {
  display: flex; align-items: center; gap: 8px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  border-bottom: 1px solid var(--line);
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--them-bg); color: var(--them);
  font: 600 15px/1 var(--display);
}
.who-text { display: grid; min-width: 0; }
.who-text strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* El apodo, bajo el nombre, en la cabecera y en la lista. */
.nick { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
/* La luz de la conversación, sin texto, justo delante del nombre. */
.status { flex: none; display: inline-flex; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.status.online::before { background: var(--them); }
.pill {
  flex: none; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  font-size: 12.5px; font-weight: 600; letter-spacing: .06em;
}
.icon-btn {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--line); }
/* El aviso de voces generadas por IA va pegado a su selector, en cursiva. */
.voice-note { font-style: italic; margin: -6px 0 0; text-align: left; }
/* Guardar y cerrar en los ajustes: dos círculos iguales; el de guardar, verde, solo se enciende si hay cambios. */
.sheet-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn.round { border-radius: 50%; background: var(--line); }
.icon-btn.round.ok { background: #16a34a; color: #fff; }
.icon-btn.round:disabled { opacity: .3; cursor: default; }
#voice-btn .off, #voice-btn[aria-pressed="false"] .on { display: none; }
#voice-btn[aria-pressed="false"] .off { display: block; }
#voice-btn[aria-pressed="false"] { color: var(--muted); }

.conn { margin: 0; padding: 6px 16px; text-align: center; font-size: 13px; background: var(--me-bg); color: var(--me); }

.scroll {
  overflow-y: auto; overscroll-behavior: contain;
  padding-block: 16px;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  display: flex; flex-direction: column; gap: 12px;
}
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 720px; align-self: center; }
.msg { max-width: min(86%, 560px); display: grid; gap: 4px; animation: rise .22s ease-out both; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.theirs { align-self: flex-start; justify-items: start; }
.bubble { padding: 11px 15px; border-radius: 20px; min-width: 0; }
.mine .bubble { background: var(--me-bg); border-bottom-right-radius: 6px; }
.theirs .bubble { background: var(--them-bg); border-bottom-left-radius: 6px; }
.bubble p { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.main { font-size: 19px; line-height: 1.35; font-weight: 500; }
.bubble { cursor: pointer; touch-action: manipulation; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .25s; }
/* Confirmación de "copiado": un contorno que dura un instante. */
.bubble.copied { outline-color: var(--seen); }
/* Versión alternativa (el original de la otra persona, o cómo le llegó lo mío): solo contorno. */
.msg.alt .bubble { background: transparent; }
.mine.alt .bubble { box-shadow: inset 0 0 0 1.5px var(--me); }
.theirs.alt .bubble { box-shadow: inset 0 0 0 1.5px var(--them); }
.note { border: 0; background: transparent; padding: 0 6px; font-size: 13px; color: var(--danger); text-decoration: underline; text-align: inherit; }
.chip { font-weight: 600; letter-spacing: .06em; }
/* Dos idiomas con su flecha: la flecha hereda el color y el tamaño del texto que acompaña. */
.lang-pair { display: inline-flex; align-items: center; gap: .3em; }
/* La caja de una línea se centra contando el hueco bajo la línea base; las mayúsculas no bajan de ella.
   Subir la flecha esa diferencia la deja centrada con las letras (medido en el navegador con esta tipografía). */
.lang-pair svg { flex: none; width: 1.15em; height: 1.15em; stroke-width: 2.2; transform: translateY(-.126em); }
.mine .chip { color: var(--me); }
.theirs .chip { color: var(--them); }
.meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 6px; }
/* Estado de mis mensajes: enviado, entregado, visto (azul) y escuchado (altavoz azul). */
.ticks { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); }
.ticks svg { width: 16px; height: 16px; stroke-width: 2; }
.ticks .t2 { width: 19px; }
.ticks[data-state="sent"] .t2, .ticks:not([data-state="sent"]) .t1 { display: none; }
.ticks[data-state="seen"], .ticks .th { color: var(--seen); }
.ticks:not([data-heard]) .th { display: none; }
.replay { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 50%; }
.replay svg { width: 17px; height: 17px; }
.replay:hover { color: var(--them); }

.dots { display: inline-flex; gap: 4px; align-items: center; height: 1em; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: blink 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }

.live { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--them); max-width: 720px; width: 100%; align-self: center; }
.empty { margin: auto; max-width: 32ch; text-align: center; color: var(--muted); font-size: 17px; text-wrap: balance; }

.invite { margin: auto; display: grid; gap: 14px; justify-items: center; text-align: center; max-width: 320px; }
.invite h2 { margin: 0; font: 600 19px/1.25 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.invite p { margin: 0; color: var(--muted); }
.invite canvas { width: 220px; height: 220px; max-width: 100%; padding: 12px; background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.invite-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- pie: escribir y hablar ---------- */
.dock {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.interim { margin: 0 0 8px; color: var(--me); font-size: 15px; font-style: italic; overflow-wrap: anywhere; max-height: 4.4em; overflow: hidden; }
/* Entre la caja y el botón queda el mismo hueco que entre el botón y el borde de la ventana. */
.composer { display: flex; align-items: flex-end; gap: var(--gutter-r); max-width: 720px; margin: 0 auto; }
/* La caja crece con el texto hasta cinco líneas; a partir de ahí, se desplaza por dentro. */
.composer textarea {
  --lh: 22px; --pad: 14px;
  flex: 1; min-width: 0; display: block; resize: none;
  height: calc(var(--lh) + 2 * var(--pad) + 2px); max-height: calc(5 * var(--lh) + 2 * var(--pad) + 2px);
  padding: var(--pad) 18px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px;
  font: inherit; font-size: 16px; line-height: var(--lh); color: var(--ink);
}
.composer textarea:focus-visible { outline-offset: 0; border-color: var(--them); }
.composer textarea:disabled { opacity: .55; }
/* Enviar y micrófono ocupan el mismo sitio y solo se ve uno. Miden lo mismo que la caja de una línea
   y no tienen margen ni nada que sobresalga, así que empiezan y acaban en los mismos píxeles que ella. */
.send {
  flex: none; width: 52px; height: 52px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--ink); color: var(--bg);
}
.send:disabled { opacity: .3; cursor: default; }
.mic {
  position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center;
  border: 0; border-radius: 50%; color: #fff;
  background: var(--mic-a, #c60b1e);
  /* anillo en el segundo color del idioma, separado por una línea del fondo; va por dentro para no sobresalir */
  box-shadow: inset 0 0 0 2.5px var(--mic-b, #ffc400), inset 0 0 0 5px var(--bg);
}
.mic svg { width: 24px; height: 24px; position: relative; }
.mic .ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--mic-b, #ffc400); opacity: 0; }
.mic .ring.r2 { border-color: var(--mic-a, #c60b1e); }
.mic[aria-pressed="true"] .ring { animation: ripple 1.6s ease-out infinite; }
.mic[aria-pressed="true"] .ring.r2 { animation-delay: .8s; }
.mic.paused { filter: saturate(.3); }
.mic.paused .ring { animation: none; }
.mic:disabled { opacity: .4; cursor: default; }

/* ---------- ajustes ---------- */
.sheet {
  width: 100%; max-width: 460px; margin: auto auto 0; padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  border: 0; border-radius: 24px 24px 0 0;
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
}
@media (min-width: 520px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet::backdrop { background: rgb(15 10 25 / .5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; font: 600 18px/1 var(--display); }
.sheet hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font-size: 14px; text-align: center; z-index: 10;
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes blink { 50% { opacity: 1; } }
@keyframes ripple { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(1.7); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .mic[aria-pressed="true"] { outline: 3px solid var(--me); outline-offset: 3px; }
}

/* ---------- páginas: lista, perfil, nueva conversación, invitación ---------- */
.page { min-height: 100%; display: flex; flex-direction: column; }
.page-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: 12px;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0; font: 600 20px/1.1 var(--display); letter-spacing: -.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head .brand-mark { width: 46px; height: 28px; }
.grow { flex: 1; }
.back { margin-inline-start: -8px; }
/* De derecha a izquierda, la flecha de volver apunta al otro lado. */
[dir="rtl"] .back svg { transform: scaleX(-1); }
.page-body {
  width: 100%; max-width: 480px; margin: 0 auto; display: grid; gap: 16px; align-content: start;
  padding-block: 20px; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.field small { font-size: 12.5px; color: var(--muted); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }
.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); }

/* Menú de la lista de conversaciones */
.menu-wrap { position: relative; flex: none; }
.menu {
  position: absolute; z-index: 5; right: 0; top: calc(100% + 6px); min-width: 250px; display: grid; gap: 2px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.menu button { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; text-align: left; font-weight: 500; }
.menu button:hover, .menu button:focus-visible { background: var(--line); }
.menu svg { flex: none; color: var(--muted); }
/* Versión y fecha de publicación, al pie del menú. */
.menu-version { display: grid; gap: 3px; margin: 4px 0 0; padding: 8px 14px 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu span:last-child { white-space: nowrap; }
.menu .avatar { width: 22px; height: 22px; font-size: 11px; }
#menu-open[aria-expanded="true"] { background: var(--line); }

/* Avatares: foto si la hay, inicial si no. El mío en cálido, el del otro en frío. */
.avatar { overflow: hidden; }
.avatar.mine { background: var(--me-bg); color: var(--me); }
.avatar.big { width: 76px; height: 76px; font-size: 28px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn { border: 0; padding: 0; background: transparent; border-radius: 50%; }
.photo-row { display: flex; align-items: center; gap: 14px; }
.photo-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.inviter { display: grid; gap: 12px; justify-items: start; }

.conv-list { list-style: none; margin: 0 calc(-1 * 8px); padding: 0; display: grid; gap: 2px; }
.conv-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 8px;
  border: 0; border-radius: 16px; background: transparent; text-align: left;
}
.conv-row:hover { background: var(--line); }
.conv-row .avatar { width: 48px; height: 48px; font-size: 18px; }
.conv-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.conv-side .langs { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.conv-main strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-main span { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-main span.waiting { color: var(--me); font-style: italic; }
.conv-side { flex: none; display: grid; gap: 4px; justify-items: end; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--them); color: var(--bg); font-size: 12px; font-weight: 600; }

.banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--them-bg); color: var(--ink); }
.banner p { margin: 0; flex: 1; font-size: 14px; }
.notif-row { display: flex; align-items: center; gap: 12px; }
.notif-row p { flex: 1; }
.pass-note { color: var(--me) !important; font-weight: 500; }
.sheet { max-height: 92dvh; overflow-y: auto; }

/* ---------- presencia: una luz si está conectada, otra si además está en esta conversación ---------- */
.avatar-wrap { position: relative; flex: none; display: inline-flex; }
/* Una sola luz por conversación: gris, ámbar, verde o roja. */
.light { position: absolute; right: -3px; bottom: -2px; width: 15px; height: 15px; border-radius: 50%; border: 2.5px solid var(--bg); background: #9a94a8; }
.light[data-state="amber"], .status[data-state="amber"]::before { background: #ffb300; }
.light[data-state="green"], .status[data-state="green"]::before { background: #22c55e; }
.light[data-state="red"], .status[data-state="red"]::before { background: #e5484d; }
.status[data-state="grey"]::before { background: #9a94a8; }
.away { display: flex; align-items: center; gap: 12px; max-width: 720px; margin: 0 auto 10px; padding: 10px 14px; border-radius: 16px; background: var(--me-bg); }
.away p { margin: 0; flex: 1; font-size: 14px; }
