/* Roobert, la letra de VENAIR, servida desde la propia web (los mismos ficheros que usan otras aplicaciones
   de la casa). Solo hay normal y negrita: la negrita cubre también el peso 600. */
@font-face { font-family: "Roobert"; src: url("fuentes/roobert-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Roobert"; src: url("fuentes/roobert-bold.woff2") format("woff2"); font-weight: 600 700; font-style: normal; font-display: swap; }

:root {
  --fondo: #ffffff;
  --superficie: #f5f5f3;
  --texto: #0b0b0c;
  --cuerpo: #26282c;
  --suave: #62666d;
  --borde: #e3e4e6;
  --borde-campo: #a9adb4;
  --acento: #0b0b0c;
  --foco: #2f6fed;
  --negro: #060607;
  --pestana: #0a53c7;
  --negro-borde: #24262a;
  --error: #b3261e;
  --error-fondo: #fdf2f1;
  --correcto: #1b6b3a;
  --correcto-fondo: #eef7f1;
  --aviso-fondo: #faf6ea;
  --aviso-borde: #d9b64a;
  --radio: 0;
  --cabecera: 73px; /* canal.js la ajusta a la altura real de la cabecera */
  --margen: clamp(18px, 5vw, 72px);
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--cabecera) + 16px); }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--negro);
  color: var(--texto);
  font: 16px/1.6 "Roobert", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fondo de toda la web: muro de losetas hexagonales (herramientas/fondo_hexagonos.py). Va en una capa fija
   para que no se mueva al desplazar la página. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--negro) url("fondo-hexagonos.jpg") center / cover no-repeat; }

.salto { position: absolute; left: -9999px; }
.salto:focus { left: 12px; top: 12px; background: var(--fondo); padding: 10px 14px; border-radius: 8px; z-index: 100; }

a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 3px; border-radius: 0; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------- Cabecera */
/* Negra en toda la web, con el logo en blanco. */
.cabecera { position: sticky; top: 0; z-index: 50; background: var(--negro); color: #fff; border-bottom: 1px solid var(--negro-borde); }
.cabecera-fila { display: flex; align-items: center; gap: 12px 28px; padding: 19px var(--margen); }
.idioma { position: relative; margin-left: auto; flex: none; color: #fff; font-size: .88rem; }
.idioma summary { list-style: none; cursor: pointer; background: transparent; border: 1px solid #5a5d63; border-radius: 0; padding: 6px 14px; white-space: nowrap; transition: background-color .2s; }
.idioma summary::-webkit-details-marker { display: none; }
.idioma summary::after { content: ""; display: inline-block; margin-left: 10px; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.idioma summary:hover, .idioma[open] summary { background: #000; }
.idioma ul { position: absolute; right: 0; top: 100%; min-width: 100%; margin: 0; padding: 0; list-style: none; background: #000; border: 1px solid #5a5d63; border-top: 0; }
.idioma li a { display: block; padding: 8px 14px; color: #fff; text-decoration: none; white-space: nowrap; }
.idioma li a:hover { background: rgba(255, 255, 255, .12); }
.idioma li a[aria-current] { font-weight: 700; }
.marca { display: flex; align-items: center; gap: 16px; text-decoration: none; flex: none; color: #fff; }
.marca-logo { height: 26px; width: auto; display: block; }
.marca-texto { display: flex; flex-direction: column; border-left: 1px solid #3a3c41; padding-left: 16px; line-height: 1.25; }
.marca-nombre { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; }
.marca-sub { font-size: .78rem; color: #a3a7ae; }
.marca a { color: inherit; text-decoration: none; }

@media (max-width: 480px) {
  .marca-sub { display: none; }
  .marca { gap: 12px; }
  .marca-logo { height: 21px; }
  .marca-texto { padding-left: 12px; }
  .marca-nombre { font-size: .9rem; }
  .cabecera-fila { gap: 8px 12px; padding-top: 15px; padding-bottom: 13px; }
  .idioma { font-size: .82rem; }
}

/* ---------------------------------------------------- Páginas de contenido */
/* Sobre el fondo, encima de la tarjeta, el logo en grande y en blanco. */
.logo-grande { display: flex; justify-content: center; padding: clamp(32px, 6vw, 64px) 24px clamp(28px, 5vw, 56px); }
.logo-grande img { display: block; margin-top: 35px; height: clamp(48px, 8.5vw, 86px); width: auto; max-width: 100%; }

/* Todo el contenido va en una tarjeta blanca centrada sobre el fondo. Arriba, las pestañas para pasar de un
   texto a otro. */
.tarjeta { width: min(56rem, calc(100% - 2 * clamp(12px, 3vw, 32px))); margin: 0 auto calc(clamp(40px, 8vw, 96px) + 10px); background: var(--fondo); overflow: hidden; --aire: calc(clamp(20px, 5vw, 56px) + 5px); }
.pestanas { display: flex; gap: clamp(4px, 2vw, 20px); padding: 6px var(--aire) 0; border-bottom: 2px solid #c3c6cc; overflow-x: auto; scrollbar-width: none; }
.pestanas::-webkit-scrollbar { display: none; }
.pestanas a { flex: none; padding: 16px 6px 13px; border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: .98rem; text-decoration: none; white-space: nowrap; color: var(--cuerpo); transition: color .2s, border-color .2s; }
.pestanas a:hover { color: var(--pestana); }
.pestanas a[aria-current="page"] { color: var(--pestana); border-bottom-color: var(--pestana); }
main.pagina { padding: clamp(28px, 4.5vw, 48px) var(--aire) clamp(32px, 5vw, 60px); }
/* Los títulos van en mayúsculas (se escriben normal en las plantillas). */
.texto h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: .01em; font-weight: 600; text-transform: uppercase; margin: 0 0 24px; }
.texto h2 { font-size: clamp(1.02rem, 1.6vw, 1.2rem); line-height: 1.3; letter-spacing: .04em; font-weight: 600; text-transform: uppercase; margin: 52px 0 12px; }
.texto p, .texto li { font-size: 1.05rem; color: var(--cuerpo); }
.texto p { margin: 0 0 16px; }
.texto li { margin-bottom: 8px; }
.texto ol, .texto ul { padding-left: 1.3em; }
.texto ul { list-style: disc; }
.texto ol { list-style: decimal; }
.texto ol[type="a"] { list-style: lower-alpha; }
.entradilla { font-size: clamp(1.1rem, 1.6vw, 1.3rem); color: var(--suave); }
code { font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.texto a:not(.boton) { text-decoration: underline; text-decoration-thickness: 1px; }

/* ------------------------------------------------------------- Botones */
.boton { display: inline-flex; align-items: center; justify-content: center; background: var(--acento); color: #fff; border: 1px solid var(--acento); border-radius: 0; padding: 9px 20px; font: inherit; font-size: .92rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .2s, transform .2s; }
.boton:hover { background: #2b2d31; }
.boton:active { transform: scale(.98); }
.boton.secundario { background: transparent; color: var(--texto); border-color: var(--borde-campo); }
.boton.secundario:hover { background: var(--superficie); }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }
.acciones.final { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--borde); }
.acciones.final .boton { flex: 0 1 240px; }

/* -------------------------------------------------------------- Avisos */
.aviso { background: var(--aviso-fondo); border: 0; border-left: 3px solid var(--aviso-borde); padding: 6px 12px; font-size: .86rem; line-height: 1.45; border-radius: 0; }
.aviso.error { background: var(--error-fondo); border-left-color: var(--error); }
.aviso.correcto { background: var(--correcto-fondo); border-color: #cfe6d8; border-left-color: var(--correcto); }
.aviso.importante { border-width: 1px 1px 1px 4px; padding: 14px 18px; font-size: 1rem; }
.aviso ul { margin: 6px 0 0; }
.aviso p { margin: 2px 0; }
.nota, small { color: var(--suave); font-size: .92rem; }
.texto .nota { font-size: .92rem; color: var(--suave); margin: 4px 0 12px; }

/* --------------------------------------------------------- Formularios */
form { margin-top: 28px; }
fieldset { border: 1px solid var(--borde); border-radius: var(--radio); margin: 0 0 20px; padding: 10px 24px 24px; min-width: 0; }
legend { font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; padding: 0 8px; margin-left: -8px; }
label { display: block; margin-top: 16px; font-weight: 600; font-size: .95rem; }
label small { display: block; font-weight: 400; margin-top: 2px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="password"], textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; font: inherit; font-weight: 400; color: inherit;
  background: #fff; border: 1px solid var(--borde-campo); border-radius: 0; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--texto); box-shadow: 0 0 0 3px rgba(11, 11, 12, .12); }
textarea { resize: vertical; line-height: 1.55; }
input[type="file"] { font: inherit; max-width: 100%; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 600; margin-right: 12px; padding: 8px 16px; border-radius: 0; border: 1px solid var(--borde-campo); background: #fff; cursor: pointer; }
input[type="radio"], input[type="checkbox"] { accent-color: var(--texto); width: 18px; height: 18px; }
.fila { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.fila:has(input[name$="_apellidos"]) { grid-template-columns: 1fr 1fr 1fr; }
.casilla { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; font-size: 1rem; }
.casilla input { margin-top: 3px; flex: none; }
.opcion { display: flex; align-items: flex-start; gap: 14px; font-weight: 400; font-size: 1rem; margin-top: 12px; padding: 16px 18px; border: 1px solid var(--borde); border-radius: 0; cursor: pointer; transition: border-color .15s, background-color .15s; }
.opcion:hover { border-color: var(--borde-campo); }
.opcion:has(input:checked) { border-color: var(--texto); background: var(--superficie); }
.opcion input { margin-top: 3px; flex: none; }
.opcion small { display: block; margin-top: 2px; }
.anadir { margin-top: 16px; padding: 8px 18px; font-weight: 500; font-size: .93rem; }
.estrecho { max-width: 440px; }

/* -------------------------------------- Confirmación y seguimiento */
.credenciales { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 14px 0 4px; }
.credenciales dt { font-weight: 600; }
.credenciales dd { margin: 0; }
.credenciales code { font-size: 1.2rem; font-weight: 700; letter-spacing: .05em; overflow-wrap: anywhere; }
.titulo-fila { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.titulo-fila h1 { margin: 0; }
.titulo-fila form { margin: 0; }
.ficha { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; padding: 22px 24px; background: var(--superficie); border-radius: var(--radio); margin: 0 0 8px; }
.ficha dt { color: var(--suave); }
.ficha dd { margin: 0; }
/* Conversación con el canal, con aspecto de chat y los colores de la app: negro para lo propio, blanco para lo ajeno. */
.solo-lector { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat { display: flex; flex-direction: column; gap: 6px; min-height: 52vh; max-height: 70vh; overflow-y: auto; padding: 18px clamp(10px, 3vw, 22px); background: var(--superficie); border: 1px solid var(--borde); border-bottom: 0; border-radius: 16px 16px 0 0; }
.burbuja { position: relative; max-width: min(78%, 560px); padding: 8px 13px 6px; border-radius: 16px; background: #fff; color: var(--texto); border: 1px solid var(--borde); }
.burbuja.informante { align-self: flex-end; background: #e4edfb; color: var(--texto); border-color: #c8daf6; border-top-right-radius: 4px; }
/* «.gestor» también es la fila de elegir gestor en el formulario de denuncia: aquí se anula todo lo que trae. */
.burbuja.gestor { display: block; gap: 0; margin: 0; padding: 8px 13px 6px; cursor: auto; font-weight: 400; align-items: initial; align-self: flex-start; background: #fff; border: 1px solid var(--borde); border-radius: 16px; border-top-left-radius: 4px; }
.burbuja .autor { display: block; margin-bottom: 3px; font-size: .92rem; font-weight: 700; line-height: 1.3; letter-spacing: .01em; color: #083a8c; }
.burbuja p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.burbuja footer { margin-top: 3px; font-size: .7rem; color: var(--suave); text-align: right; }
.burbuja.informante footer { color: #5f6f8c; }
.burbuja .editar { margin-top: 6px; font-size: .85rem; }
.burbuja .editar summary { cursor: pointer; color: var(--suave); }
.burbuja.informante .editar summary { color: #5f6f8c; }
.burbuja .editar form { color: var(--texto); }
.redactor { margin: 0 0 24px; padding: 10px clamp(10px, 3vw, 22px) 12px; background: #fff; border: 1px solid var(--borde); border-radius: 0 0 16px 16px; }
.redactor-fila { display: flex; align-items: flex-end; gap: 8px; }
.redactor-texto { flex: 1; margin: 0; }
.redactor-texto textarea { display: block; width: 100%; height: 44px; max-height: 40vh; resize: none; overflow-y: auto; padding: 11px 16px; border: 1px solid var(--borde-campo); border-radius: 22px; background: var(--superficie); font: inherit; line-height: 1.35; }
.redactor-texto textarea:focus { outline: 2px solid var(--foco); outline-offset: 1px; background: #fff; }
.clip, .redactor-enviar { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 0; cursor: pointer; margin: 0; padding: 0; }
.clip { background: transparent; color: var(--suave); }
.clip:hover { background: var(--superficie); color: var(--texto); }
.redactor-enviar { background: var(--negro); color: #fff; }
.redactor-enviar:hover { background: var(--pestana); }
.clip svg, .redactor-enviar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.redactor input[type="file"]:focus-visible + .redactor-texto, .clip:focus-within { outline: 2px solid var(--foco); }
.redactor .nota { margin: 8px 0 0; font-size: .8rem; }

/* ----------------------------------------------------------------- Pie */
.pie { margin-top: auto; background: rgba(6, 6, 7, .82); border-top: 1px solid var(--negro-borde); color: #fff; font-size: .9rem; padding: 37px var(--margen) 43px; }
.pie div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px clamp(32px, 8vw, 120px); }
.pie nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.pie a { color: #fff; text-decoration: none; }
.pie a:hover { text-decoration: underline; }
.pie span { color: #fff; }

@media (max-width: 600px) {
  .fila, .ficha, .credenciales { grid-template-columns: 1fr; }
  .ficha dd, .credenciales dd { margin-bottom: 6px; }
  fieldset { padding: 8px 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .boton { transition: none; }
}

.barra-volver { width: min(56rem, calc(100% - 2 * clamp(12px, 3vw, 32px))); margin: 0 auto; padding: 88px 0 36px; }
.barra-volver a { font-size: 1.35rem; color: #fff; text-decoration: none; font-weight: 600; border: 0; background: none; padding: 0; }
.barra-volver a:hover { text-decoration: underline; }

.grabadora { margin: 8px 0 20px; }
.grabadora audio { display: block; width: 100%; margin-top: 8px; }
.grabadora .acciones { margin: 8px 0 0; }

.gestor { display: flex; align-items: center; gap: 16px; margin-top: 12px; padding: 12px 16px; background: #fff; border: 1px solid var(--borde); cursor: pointer; font-weight: 400; }
.gestor-nombre { flex: 1; font-weight: 700; font-size: 1.05rem; color: var(--texto); }
.avatar { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #9ea3ad; border: 2px solid #8fa6d6; color: #fff; font-size: 1.3rem; font-weight: 400; letter-spacing: .02em; }
.gestor input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: #1a6bff; cursor: pointer; }

.gestor.bloqueado { cursor: not-allowed; }
.gestor.bloqueado input { cursor: not-allowed; opacity: .55; }

/* Aire entre avisos, botones y el resto de elementos */
.aviso { margin: 16px 0; }
form .aviso { margin: 14px 0; }
form > p:last-child, form > .acciones { margin-top: 32px; margin-bottom: 8px; }
.casilla + .aviso, .casilla + p { margin-top: 20px; }
.acciones .boton { margin: 0; }

.separador-info { height: 56px; }
.estrecho + p { margin-top: 20px; }

/* ------------------------------------------------------------------ Panel de gestores */
.tarjeta.ancha { width: min(72rem, calc(100% - 2 * clamp(12px, 3vw, 32px))); }
.tarjeta.ancha .pagina { padding-top: 32px; }
.titulo-fila form { display: flex; align-items: center; gap: 12px; }
.qr { margin: 16px 0; max-width: 240px; }
.qr svg { display: block; width: 100%; height: auto; border: 1px solid var(--borde); }
.subpestanas { display: flex; flex-wrap: wrap; gap: 4px 20px; border-bottom: 2px solid #c3c6cc; margin: 0 0 24px; }
.subpestanas a { padding: 10px 4px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--cuerpo); text-decoration: none; }
.subpestanas a[aria-current="page"] { color: var(--pestana); border-bottom-color: var(--pestana); font-weight: 700; }
.contador { display: inline-block; min-width: 1.6em; padding: 0 6px; background: var(--superficie); color: var(--cuerpo); font-size: .8rem; text-align: center; }
.tabla-caja { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabla th { text-align: left; font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--borde); white-space: nowrap; }
.tabla td { padding: 12px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla tbody tr:hover { background: var(--superficie); }
.etiqueta { display: inline-block; margin-left: 6px; padding: 1px 8px; background: var(--superficie); border: 1px solid var(--borde); font-size: .78rem; color: var(--cuerpo); }
.relato { white-space: pre-wrap; background: var(--superficie); padding: 16px 18px; }
select { font: inherit; padding: 10px 12px; border: 1px solid var(--borde-campo); border-radius: 0; background: #fff; max-width: 100%; }
.acciones form { margin: 0; }

.editar { margin-top: 10px; }
.editar summary { cursor: pointer; color: var(--pestana); font-size: .92rem; }
.editar form { margin-top: 12px; }

.centrado { text-align: center; padding: 16px 0 0; }
.centrado p:last-child { margin-bottom: 0; }
main.pagina:has(.centrado) { padding-bottom: 28px; }
.centrado h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); margin-bottom: 44px; }

.tabla .acciones { margin: 0; gap: 8px; flex-wrap: nowrap; }
.tabla .boton { padding: 6px 12px; font-size: .82rem; white-space: nowrap; }

.sugerido { color: var(--suave); font-style: italic; }
label small { display: block; margin-top: 4px; font-weight: 400; }

/* Barras de desplazamiento finas, sin flechas */
/* Chrome/Edge/Safari: barra a medida (la propiedad estándar la anularía y trae flechas). Firefox: modo fino. */
.chat::-webkit-scrollbar, .redactor-texto textarea::-webkit-scrollbar { width: 5px; height: 5px; }
.chat::-webkit-scrollbar-button, .redactor-texto textarea::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.chat::-webkit-scrollbar-track, .redactor-texto textarea::-webkit-scrollbar-track { background: transparent; margin: 8px 0; }
.chat::-webkit-scrollbar-thumb, .redactor-texto textarea::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .22); border-radius: 3px; }
.chat::-webkit-scrollbar-thumb:hover, .redactor-texto textarea::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .4); }
@supports not selector(::-webkit-scrollbar) {
  .chat, .redactor-texto textarea { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, .25) transparent; }
}

/* Archivos adjuntos: tarjeta con tipo, nombre y tamaño (en el mensaje y, antes de enviar, sobre la caja de escribir) */
.adj { display: flex; align-items: center; gap: 10px; min-width: min(240px, 100%); max-width: 100%; margin: 2px 0 6px; padding: 8px 10px; background: rgba(255, 255, 255, .75); border: 0; border-radius: 12px; color: inherit; text-decoration: none; }
a.adj:hover { background: #fff; }
.burbuja.gestor .adj { background: var(--superficie); }
.burbuja.gestor a.adj:hover { background: #ebebe8; }
.adj-tipo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--pestana); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .03em; }
.adj-datos { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.adj-datos b { font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adj-datos small { font-size: .75rem; color: var(--suave); }
.adj-quitar { flex: none; width: 28px; height: 28px; margin-left: auto; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--suave); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.adj-quitar:hover { background: rgba(0, 0, 0, .08); color: #000; }
.elegidos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0 0 8px; }
.elegidos[hidden] { display: none; }
.elegidos .adj { margin: 0; background: var(--superficie); }

/* ------------------------------------------------------------------ Seguimiento del denunciante: dos columnas */
.caso-rejilla { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 24px; align-items: start; }
.caso-lateral { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--cabecera) + 16px); }
.caso-caja { padding: 20px 22px; background: var(--superficie); border-radius: 16px; }
.caso-caja h2, .caso-chat-cab h2 { margin: 0 0 12px; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--suave); }
.caso-estado { display: inline-block; margin: 0 0 16px; padding: 6px 14px; background: #e4edfb; color: var(--pestana); border-radius: 4px; font-weight: 700; }
.caso-datos { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 0; font-size: .92rem; }
.caso-datos dt { margin-top: 10px; color: var(--suave); font-size: .8rem; }
.caso-datos dd { margin: 0; color: var(--texto); overflow-wrap: anywhere; }
.adj-lista { display: flex; flex-direction: column; gap: 8px; }
.adj-lista .adj { margin: 0; }
.caso-chat { display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--borde); border-radius: 16px; overflow: hidden; }
.caso-chat-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 2px; }
.caso-chat-cab h2 { margin-bottom: 10px; }
.chat-expandir { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 8px; padding: 0; border: 1px solid var(--borde); border-radius: 10px; background: #fff; color: var(--texto); cursor: pointer; }
.chat-expandir:hover, .chat-expandir:focus-visible { background: #f3f4f6; border-color: #c9ccd2; }
.chat-expandir svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chat-expandir .ico-reducir, .expandido .chat-expandir .ico-ampliar { display: none; }
.expandido .chat-expandir .ico-reducir { display: block; }
/* Chat ampliado: ocupa toda el área bajo la cabecera */
body.chat-abierto { overflow: hidden; }
.caso-chat.expandido { position: fixed; top: var(--cabecera); left: 0; right: 0; bottom: 0; z-index: 40; border: 0; border-radius: 0; padding: 18px clamp(14px, 4vw, 56px); background: #fff; overflow: hidden; }
.caso-chat.expandido > * { width: min(1100px, 100%); margin-inline: auto; }
.caso-chat.expandido .caso-chat-cab { padding-inline: 0; }
.caso-chat.expandido .chat { flex: 1 1 0; min-height: 0; max-height: none; }
.caso-chat .chat { min-height: 48vh; max-height: 62vh; border: 0; border-radius: 0; border-top: 1px solid var(--borde); }
.chat-vacio { margin: auto; color: var(--suave); text-align: center; }
.caso-chat .redactor { margin: 0; border: 0; border-top: 1px solid var(--borde); border-radius: 0; }
.caso-error { margin: 0; padding: 10px 20px; border-radius: 0; }
.estado-chat { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: var(--superficie); border-top: 1px solid var(--borde); }
.estado-chat svg { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--pestana); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.estado-chat.cerrado svg { stroke: var(--suave); }
.estado-chat p { margin: 0; font-size: .92rem; color: var(--cuerpo); }
@media (max-width: 860px) {
  .caso-rejilla { grid-template-columns: minmax(0, 1fr); }
  .caso-lateral { position: static; }
}

/* Aviso temporal: abajo a la derecha, oscuro, unos segundos; se puede cerrar con la X */
.toast { position: fixed; z-index: 90; right: clamp(12px, 2vw, 28px); bottom: clamp(12px, 2vw, 28px); display: flex; align-items: center; gap: 12px; max-width: min(460px, calc(100vw - 24px)); padding: 13px 12px 13px 16px; background: #0c0d10; color: #f3f4f6; border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); font-size: .95rem; line-height: 1.4; animation: toast-vida 6s cubic-bezier(.2, .8, .2, 1) forwards; }
.toast-icono { flex: none; width: 20px; height: 20px; fill: none; stroke: #34d399; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast.error .toast-icono { stroke: #f87171; }
.toast-texto { flex: 1; font-weight: 500; }
.toast-cerrar { flex: none; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #9ca3af; cursor: pointer; }
.toast-cerrar:hover, .toast-cerrar:focus-visible { background: rgba(255, 255, 255, .1); color: #fff; }
.toast-cerrar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@keyframes toast-vida {
  0% { opacity: 0; transform: translateY(14px) scale(.98); }
  5% { opacity: 1; transform: none; }
  92% { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(8px); visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) { .toast { animation-name: toast-vida-simple; } @keyframes toast-vida-simple { 0%, 94% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } } }

/* Cuadro de confirmación (cerrar sesión) */
dialog.confirmar { width: min(400px, calc(100vw - 32px)); padding: 24px 24px 20px; border: 0; border-radius: 16px; background: #fff; color: var(--texto); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog.confirmar::backdrop { background: rgba(0, 0, 0, .5); }
dialog.confirmar p { margin: 0 0 20px; text-align: center; font-size: 1rem; line-height: 1.5; }
.confirmar-botones { display: flex; justify-content: center; gap: 10px; }
.confirmar-botones button { padding: 9px 20px; border-radius: 999px; font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; }
.confirmar-no { background: transparent; color: var(--texto); border: 1px solid #aeb2ba; }
.confirmar-no:hover { background: #f3f4f6; }
.confirmar-si { background: var(--acento); color: #fff; border: 1px solid var(--acento); }
.confirmar-si:hover { background: #2b2d31; }

/* Seguimiento en móvil: título en su sitio, cajas compactas y el chat enseguida */
.titulo-fila h1 code { white-space: nowrap; }
@media (max-width: 600px) {
  .titulo-fila { flex-wrap: nowrap; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
  .titulo-fila h1 { font-size: 1.25rem; line-height: 1.25; min-width: 0; }
  .titulo-fila h1 code { display: block; font-size: 1.05rem; }
  .titulo-fila form { flex: none; }
  .titulo-fila .boton { padding: 7px 14px; font-size: .85rem; }
  .caso-rejilla { gap: 14px; }
  .caso-lateral { gap: 12px; }
  .caso-caja { padding: 14px 16px; border-radius: 14px; }
  .caso-caja h2 { margin-bottom: 8px; }
  .caso-estado { margin: 0 0 8px; padding: 4px 12px; font-size: .95rem; }
  .caso-datos { grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .88rem; }
  .caso-datos dt { margin-top: 0; font-size: .88rem; }
  .caso-datos dd { text-align: right; }
  .caso-chat .chat { min-height: 50vh; max-height: 68vh; padding: 14px 10px; }
  .burbuja { max-width: 88%; }
  .caso-chat-cab { padding: 12px 16px 0; }
}

/* Caja de escribir: letra normal (no hereda la negrita de las etiquetas) y más ancho útil en móvil */
.redactor-texto textarea { font-weight: 400; font-size: 1rem; }
.redactor-texto textarea::placeholder { font-weight: 400; color: var(--suave); opacity: 1; }
@media (max-width: 600px) {
  .tarjeta.ancha main.pagina { padding-left: 14px; padding-right: 14px; }
  .redactor { padding: 10px 10px 12px; }
  .redactor-fila { gap: 4px; }
  .clip, .redactor-enviar { width: 40px; height: 40px; }
  .redactor-texto textarea { height: 42px; padding: 10px 14px; }
}

/* Un color por estado del caso */
.caso-estado-desc { margin: 0 0 14px; font-size: .88rem; line-height: 1.45; color: var(--cuerpo); }
.caso-estado.est-recibida { background: #e1f2f7; color: #0b6b88; }
.caso-estado.est-en_investigacion { background: #e4edfb; color: #0a53c7; }
.caso-estado.est-pendiente_respuesta { background: #ece8fb; color: #4a3a9c; }
.caso-estado.est-pendiente_ampliacion { background: #fdf0d3; color: #8a5a00; }
.caso-estado.est-archivada { background: #eceef1; color: #4b4f58; }
.caso-estado.est-resuelta_con_incumplimiento { background: #fbe6e4; color: #b3261e; }
.caso-estado.est-resuelta_sin_incumplimiento { background: #e3f4e9; color: #1b6b3a; }
@media (max-width: 600px) { .caso-estado-desc { margin-bottom: 10px; font-size: .84rem; } }

/* Aviso de advertencia: naranja */
.aviso.advertencia { background: #fff0dc; border-color: #f4cf9c; border-left-color: #e8820c; color: #5a3200; }

/* Las tarjetas de archivo que son enlaces no llevan subrayado */
.texto a.adj:not(.boton), a.adj, a.adj:hover, a.adj b, a.adj small { text-decoration: none; }

/* Reunión: cómo y cuándo */
.bloque-reunion { margin-top: 14px; padding: 4px 0 4px 18px; border-left: 3px solid var(--borde); }
.bloque-reunion[hidden] { display: none; }
.etiqueta-grupo { margin: 12px 0 4px; font-weight: 700; }

/* ----------------------------------------------------- Acceso del personal: pantalla dividida */
/* La cabecera, el fondo de escamas y el pie son los de toda la web. En el centro, una tarjeta oscura partida
   en dos: a la izquierda logo, trazos que se mecen despacio y lema; a la derecha el formulario. */
.pagina-acceso .salto, .pagina-acceso .barra-volver, .pagina-acceso .separador-info, .pagina-acceso .logo-grande { display: none; }
.tarjeta.acceso-caja { width: 100%; max-width: none; margin: 0; padding: clamp(24px, 6vw, 80px) clamp(16px, 4vw, 40px); background: transparent; overflow: visible; }
.tarjeta.acceso-caja main.pagina { padding: 0; }
.acceso { display: grid; grid-template-columns: 1fr 1fr; max-width: 1030px; min-height: 520px; margin: 0 auto; overflow: hidden; color: #fff;
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px; background: rgba(10, 10, 11, .82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 40px 120px rgba(0, 0, 0, .75), 0 0 0 1px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 255, 255, .07); }

.acceso-arte { position: relative; display: flex; flex-direction: column; padding: 40px; overflow: hidden; color: #fff;
  border-right: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(255, 255, 255, .03) 60%, rgba(255, 255, 255, .05) 100%); }
.acceso-marca { position: relative; z-index: 2; }
.acceso-marca img { display: block; width: 190px; max-width: 60%; height: auto; }
.acceso-trazos { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.acceso-trazos svg { position: absolute; inset: 0; width: 100%; height: 100%; color: #fff; }
.acceso-trazos svg { opacity: .42; }
.acceso-trazos path { stroke: currentColor; }
.acceso-trazos svg:nth-child(1) { animation: mecer 22s ease-in-out infinite alternate; }
.acceso-trazos svg:nth-child(2) { animation: mecer 30s ease-in-out -9s infinite alternate-reverse; }
@keyframes mecer { from { transform: translate3d(-14px, -8px, 0) scale(1.02); } to { transform: translate3d(14px, 8px, 0) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .acceso-trazos svg { animation: none; } }
.acceso-cita { position: relative; z-index: 2; max-width: 460px; margin-top: auto; }
.acceso .acceso-cita p { color: #fff; margin: 0 0 10px; font-size: 1.6rem; font-weight: 700; line-height: 1.25; text-shadow: 0 1px 14px rgba(0, 0, 0, .5); }
.acceso-cita span { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; font-weight: 600; color: rgba(255, 255, 255, .78); }

.acceso-form { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 64px); background: #f5f5f3; }
.acceso-form::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 45% at 85% 6%, rgba(6, 6, 7, .06) 0%, rgba(6, 6, 7, .02) 55%, transparent 80%); }
.acceso-bloque { width: min(100%, 400px); margin: 0 auto; }
.acceso-form h1 { margin: 0 0 6px; color: var(--texto); font-size: 1.7rem; font-weight: 700; letter-spacing: .01em; line-height: 1.2; text-transform: none; text-align: left; }
.acceso .acceso-sub { margin: 0 0 26px; color: var(--suave); font-size: 1rem; line-height: 1.5; }
.acceso-form .aviso { margin: 0 0 18px; border-radius: 8px; }
.acceso-form label { display: block; margin: 0 0 16px; font-size: .92rem; font-weight: 700; color: var(--texto); }
.campo { position: relative; display: block; margin-top: 8px; }
.campo svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; fill: none; stroke: var(--suave); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.campo input { display: block; width: 100%; height: 46px; padding: 0 14px 0 42px; border: 1px solid var(--borde-campo); border-radius: 8px; background: #fff; color: var(--texto); font: inherit; font-size: 1rem; font-weight: 400; }
.campo input:focus { outline: 0; border-color: var(--foco); box-shadow: 0 0 0 3px rgba(47, 111, 237, .18); }
.acceso-boton { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 46px; margin: 24px 0 0; padding: 0 20px; border-radius: 8px; font-size: 1rem; font-weight: 600; letter-spacing: 0; text-transform: none; transition: background-color .2s, transform .2s; }
.acceso-boton::after { content: "\2192"; font-size: 1.1rem; transition: transform .2s; }
.acceso-boton:hover, .acceso-boton:focus-visible { background: #24262b; }
.acceso-boton:hover::after, .acceso-boton:focus-visible::after { transform: translateX(4px); }
.acceso-boton:active { transform: scale(.99); }
.acceso .acceso-aviso { margin: 28px 0 0; text-align: center; color: var(--suave); font-size: .85rem; line-height: 1.5; }
.acceso-form .qr { width: fit-content; max-width: 100%; margin: 0 0 14px; padding: 0; }
.acceso-form .qr svg { display: block; width: auto; height: auto; max-width: 100%; border: 0; }
.acceso-form .qr svg path { shape-rendering: crispEdges; }
.acceso-form .nota, .acceso .texto .nota { margin: 0 0 22px; color: var(--suave); }
@media (max-width: 900px) {
  .acceso { grid-template-columns: 1fr; grid-template-rows: auto 1fr; border-radius: 0; border-width: 0; }
  .acceso { min-height: 0; }
  .acceso-arte { min-height: 180px; padding: 24px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .12); }
  .acceso-cita { display: none; }
  .acceso-form { padding: 32px 20px 48px; }
}

/* Botones del cuadro de confirmación: colores fijos, sin depender de variables ni de otros estilos */
dialog.confirmar .confirmar-botones .confirmar-si { -webkit-appearance: none; appearance: none; background-color: #060607; color: #fff; border: 1px solid #060607; }
dialog.confirmar .confirmar-botones .confirmar-si:hover, dialog.confirmar .confirmar-botones .confirmar-si:focus-visible { background-color: #2b2d31; border-color: #2b2d31; color: #fff; }
dialog.confirmar .confirmar-botones .confirmar-no { -webkit-appearance: none; appearance: none; background-color: #fff; color: #101114; border: 1px solid #aeb2ba; }
dialog.confirmar .confirmar-botones .confirmar-no:hover { background-color: #f3f4f6; }

.toast.error { animation-duration: 9s; }
.toast.fijo { animation: toast-entra .3s cubic-bezier(.2, .8, .2, 1) both; }
.toast-texto { max-height: 60vh; overflow-y: auto; overflow-wrap: anywhere; }
.toast-texto ul { margin: 6px 0 0; padding-left: 18px; }
.toast-texto li { margin: 2px 0; }
@keyframes toast-entra { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.toast .toast-texto, .toast .toast-texto li, .toast .toast-texto b { color: #f3f4f6; font-size: .95rem; line-height: 1.4; }
.toast .toast-texto li::marker { color: #9ca3af; }
