/* FONI · Tu asistente del FONE. Guinda #611232, dorado #edbd58, mascota quetzal (foni.png). */
:root {
  --guinda: #9b2247;
  --vino: #611232;
  --dorado: #edbd58;
  --oro: #b28a3d;
  --bosque: #1e5b4f;
  --fondo: #f9f7f4;
  --superficie: #ffffff;
  --texto: #30292c;
  --tenue: #7e7774;
  --borde: #e9e1dc;
  --acento: var(--guinda);
  --titulo: var(--vino);
  --acento-suave: #f6e7eb;
  --cita: #faf7f3;
  --cita-borde: #ca9f46;
  --tabla-cabeza: #faf5f0;
  --usuario: #efe9e3;
  --usuario-borde: #e7dcd5;
  --chip: #fffaf6;
  --chip-borde: #e1cec2;
  --error: #b3261e;
  --barra: #fffcf9f0;
  --sombra: 0 8px 32px rgba(58,30,36,.045);
  --lateral: linear-gradient(155deg, #64152e, #50152b 68%, #3c1727); --lateral-borde: transparent;
  --nuevo: linear-gradient(#fff9f3, #f9eae4); --nuevo-hover: #fff; --nuevo-borde: #ead2ce; --nuevo-texto: var(--vino);
  --resplandor: #fff9f1; --halo-1: #fbeccc; --halo-2: #faefe5; --borde-caja: #e5d8d0; --hover: #fff8f6; --anillo: #f2dfe5;
  --sug-texto: #6c4851; --sug-borde: #ead9c8; --pista: #ddd2cc; --visor-fondo: #ece7e2;
  --v-si: #eaf4ed; --v-si-t: #1d6b34; --v-si-b: #d1e7d8; --v-no: #fbeaea; --v-no-t: #a12626; --v-no-b: #f0cfcf;
  --v-cond: #fbf5e9; --v-cond-t: #7a5410; --v-cond-b: #e8d7b2; --v-dep: #e9eef8; --v-dep-t: #2b4f8a; --v-dep-b: #d3dcef;
  --fuente: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #1c1719; --superficie: #261f22; --texto: #ece6e3; --tenue: #a99c98; --borde: #3a2f33;
    --acento: #e07b97; --titulo: #ec9fb3; --acento-suave: #3b2229; --cita: #2e2629; --cita-borde: #b28a3d;
    --tabla-cabeza: #2e2629; --usuario: #33292c; --usuario-borde: #43363a; --chip: #2a2226; --chip-borde: #4a3a3f;
    --error: #f2b8b5; --barra: #211b1ef2; --sombra: 0 8px 28px rgba(0,0,0,.25); color-scheme: dark;
    --lateral: linear-gradient(155deg, #2e1520, #241119 68%, #1b0d13); --lateral-borde: #3a2f33;
    --nuevo: #3a1f2a; --nuevo-hover: #47263a; --nuevo-borde: #5e3646; --nuevo-texto: #f6dfe6;
    --bosque: #7cc4ad; --resplandor: #2a1f23; --halo-1: #4a3828; --halo-2: #2f2622; --borde-caja: #43363a; --hover: #33262b; --anillo: #4a2a33;
    --sug-texto: #e6dcd9; --sug-borde: #4a3a3f; --pista: #4a3f43; --visor-fondo: #161113;
    --v-si: #1f3a27; --v-si-t: #9fd8ae; --v-si-b: transparent; --v-no: #43231f; --v-no-t: #f2b0a8; --v-no-b: transparent;
    --v-cond: #3d3119; --v-cond-t: #f0cf8a; --v-cond-b: transparent; --v-dep: #1f2c42; --v-dep-t: #a9c3ee; --v-dep-b: transparent;
  }
}
:root[data-theme="dark"] {
  --fondo: #1c1719; --superficie: #261f22; --texto: #ece6e3; --tenue: #a99c98; --borde: #3a2f33;
  --acento: #e07b97; --titulo: #ec9fb3; --acento-suave: #3b2229; --cita: #2e2629; --cita-borde: #b28a3d;
  --tabla-cabeza: #2e2629; --usuario: #33292c; --usuario-borde: #43363a; --chip: #2a2226; --chip-borde: #4a3a3f;
  --error: #f2b8b5; --barra: #211b1ef2; --sombra: 0 8px 28px rgba(0,0,0,.25); color-scheme: dark;
  --lateral: linear-gradient(155deg, #2e1520, #241119 68%, #1b0d13); --lateral-borde: #3a2f33;
  --nuevo: #3a1f2a; --nuevo-hover: #47263a; --nuevo-borde: #5e3646; --nuevo-texto: #f6dfe6;
  --bosque: #7cc4ad; --resplandor: #2a1f23; --halo-1: #4a3828; --halo-2: #2f2622; --borde-caja: #43363a; --hover: #33262b; --anillo: #4a2a33;
  --sug-texto: #e6dcd9; --sug-borde: #4a3a3f; --pista: #4a3f43; --visor-fondo: #161113;
  --v-si: #1f3a27; --v-si-t: #9fd8ae; --v-si-b: transparent; --v-no: #43231f; --v-no-t: #f2b0a8; --v-no-b: transparent;
  --v-cond: #3d3119; --v-cond-t: #f0cf8a; --v-cond-b: transparent; --v-dep: #1f2c42; --v-dep-t: #a9c3ee; --v-dep-b: transparent;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--fondo); color: var(--texto); font: 14px/1.55 var(--fuente); font-synthesis: none; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #d9a5b6; outline-offset: 2px; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- mascota ---------- */
.mascota { display: block; object-fit: contain; user-select: none; animation: flotar 3.5s ease-in-out infinite;
           filter: drop-shadow(0 3px 2px #421b1b24); }
@keyframes flotar { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-4px); } }
.nombre-foni { font-weight: 850; letter-spacing: -1px; line-height: 1; }
.nombre-foni .punto { color: var(--dorado); }

/* ---------- inicio de sesión ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px;
         background: radial-gradient(circle at 50% 0%, var(--resplandor) 0, transparent 420px), var(--fondo); }
.login-tarjeta { width: min(390px, 100%); background: var(--superficie); border: 1px solid var(--borde);
                 border-radius: 20px; padding: 30px 28px 22px; box-shadow: 0 18px 50px rgba(97,18,50,.10); display: grid; gap: 15px; }
.login-marca { text-align: center; display: grid; justify-items: center; gap: 4px; margin-bottom: 6px; }
.login-mascota { width: 132px; height: 132px; display: grid; place-items: center; border-radius: 50%;
                 background: radial-gradient(circle, var(--halo-1), var(--halo-2) 68%, transparent 70%); margin-bottom: 4px; }
.login-mascota img { width: 136px; height: 136px; }
.login-marca .nombre-foni { font-size: 36px; color: var(--titulo); }
.login-marca small { font-size: 14px; color: var(--tenue); margin-top: 4px; }
.lema { color: var(--bosque); font-size: 11px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.login-tarjeta label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--tenue); }
input, textarea, select { font: inherit; color: var(--texto); background: var(--superficie); }
.login-tarjeta input { padding: 11px 12px; border: 1px solid var(--borde-caja); border-radius: 10px; }
.login-tarjeta input:focus { outline: 2px solid var(--acento); outline-offset: -1px; }
.primario { background: var(--guinda); color: #fff; border: 0; border-radius: 11px; padding: 12px; font-weight: 750; transition: background .15s; }
.primario:hover { background: var(--vino); }
.error { color: var(--error); min-height: 1.2em; margin: 0; font-size: 13px; }
.login-pie { margin: 2px 0 0; text-align: center; font-size: 11px; color: var(--tenue); }

/* ---------- estructura ---------- */
.app { display: grid; grid-template-columns: 268px 1fr; height: 100vh; height: 100dvh; }

/* ---------- barra lateral ---------- */
.lateral { background: var(--lateral); border-right: 1px solid var(--lateral-borde); color: #fff; display: flex; flex-direction: column;
           min-height: 0; position: relative; isolation: isolate; }
.lateral::before { content: ""; position: absolute; inset: auto 0 0; height: 180px; pointer-events: none; opacity: .11; z-index: -1;
                   background: repeating-linear-gradient(45deg, transparent 0 20px, #fff 21px 23px, transparent 24px 42px);
                   -webkit-mask-image: linear-gradient(transparent, black); mask-image: linear-gradient(transparent, black); }
.marca { display: flex; gap: 12px; align-items: center; padding: 22px 18px 16px; }
.marca-avatar { width: 59px; height: 62px; flex: none; display: grid; place-items: center; border-radius: 18px;
                background: linear-gradient(140deg, #fff7e5, #f9e6d1); border: 2px solid #ffffff4d; box-shadow: 0 5px 20px #2007102a; }
.marca-avatar img { width: 67px; height: 67px; }
.marca .nombre-foni { display: block; font-size: 27px; }
.marca small { display: block; font-size: 11px; line-height: 1.35; margin-top: 6px; color: #fff; opacity: .85; }
.marca .lema { display: block; color: #b9d7cb; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.lateral-cuerpo { padding: 0 12px; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.nuevo { display: flex; align-items: center; justify-content: center; gap: 8px; height: 45px; border-radius: 12px;
         border: 1px solid var(--nuevo-borde); background: var(--nuevo); color: var(--nuevo-texto); font-weight: 760;
         box-shadow: 0 4px 12px #25060d26; margin-bottom: 18px; }
.nuevo:hover { background: var(--nuevo-hover); }
.nuevo svg { stroke-width: 2.4; }
.historial-titulo { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #ffffff30;
                    padding: 14px 6px 8px; font-size: 11px; letter-spacing: .11em; color: #e6bec9; font-weight: 750; }
.historial-titulo svg { width: 15px; height: 15px; }
.buscar-chat { width: 100%; color: #fff; background: #ffffff12; border: 1px solid #ffffff38; outline: none; border-radius: 9px;
               height: 35px; padding: 0 11px; font-size: 12.5px; }
.buscar-chat::placeholder { color: #e7cbd3a8; }
.buscar-chat:focus { border-color: #ffffff80; background: #ffffff1c; }
.lista-chats { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 8px -3px; padding-right: 3px;
               scrollbar-width: thin; scrollbar-color: #bb8496 transparent; }
.grupo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #e6bec9; opacity: .8; font-weight: 700; padding: 10px 9px 4px; }
.item-chat { display: flex; align-items: center; gap: 2px; border-radius: 10px; padding: 0 4px 0 0; }
.item-chat:hover { background: #ffffff16; }
.item-chat.activo { background: #ffffff21; }
.item-chat .abrir { flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: #f3e5e8; padding: 10px 6px 10px 11px;
                    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.item-chat.activo .abrir { color: #fff; font-weight: 600; }
.item-chat .acc { opacity: 0; background: none; border: 0; color: #e6bec9; padding: 5px; border-radius: 6px; display: grid; }
.item-chat:hover .acc, .item-chat.activo .acc, .item-chat .acc:focus { opacity: 1; }
.item-chat .acc:hover { color: #fff; background: #ffffff24; }
.item-chat .acc svg { width: 15px; height: 15px; }
/* Expedientes: encabezado plegable con sus conversaciones debajo, un poco a la derecha */
.grupo.expediente { display: flex; align-items: center; gap: 1px; text-transform: none; letter-spacing: 0; opacity: 1;
                    padding: 6px 4px 2px 0; border-radius: 9px; }
.grupo.expediente:hover { background: #ffffff10; }
.exp-titulo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: none; border: 0; color: #f3e5e8;
              padding: 6px 6px 6px 7px; font-size: 12.5px; font-weight: 700; text-align: left; }
.exp-titulo svg { width: 15px; height: 15px; flex: none; color: var(--dorado); }
.exp-titulo svg:first-child { width: 12px; height: 12px; color: #e6bec9; transform: rotate(90deg); transition: transform .15s; }
.grupo.expediente.plegado .exp-titulo svg:first-child { transform: none; }
.exp-titulo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-titulo small { margin-left: auto; padding-left: 6px; font-size: 11px; font-weight: 600; color: #e6bec9; opacity: .8; }
.grupo.expediente .acc { display: none; background: none; border: 0; color: #e6bec9; padding: 5px; border-radius: 6px; }
.grupo.expediente:hover .acc, .grupo.expediente:focus-within .acc { display: grid; }
.grupo.expediente .acc:hover { color: #fff; background: #ffffff24; }
.grupo.expediente .acc svg { width: 15px; height: 15px; }
.item-chat.en-expediente { margin-left: 14px; }
.item-chat.plegada { display: none; }
.lista-chats.filtrando .item-chat.plegada { display: flex; }
.menu-expediente { position: fixed; z-index: 40; min-width: 230px; max-width: 300px; padding: 6px; background: var(--superficie);
                   border: 1px solid var(--borde-caja); border-radius: 12px; box-shadow: 0 12px 32px #3a1e2430; }
.menu-expediente[hidden] { display: none; }
.menu-expediente .menu-titulo { font-size: 11px; color: var(--tenue); padding: 4px 8px 6px; }
.menu-expediente button { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; color: var(--texto);
                          padding: 8px 9px; border-radius: 8px; text-align: left; font-size: 13px; }
.menu-expediente button:hover, .menu-expediente button:focus-visible { background: var(--usuario); outline: none; }
.menu-expediente button svg { width: 16px; height: 16px; flex: none; color: var(--titulo); }
.menu-expediente button span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-expediente button b { color: var(--acento); }
.menu-expediente button.actual { font-weight: 700; }
@media (max-width: 820px) { .grupo.expediente .acc { display: grid; } }
/* La chincheta de una fijada se ve siempre, rellena */
.item-chat.fijada .a-fijar { opacity: 1; color: var(--dorado); }
.item-chat.fijada .a-fijar svg { fill: currentColor; }
.item-chat input { flex: 1; min-width: 0; padding: 7px 9px; margin: 3px 0 3px 4px; border-radius: 8px; border: 1px solid #ffffff60;
                   background: #3a0f1f; color: #fff; font-size: 12.5px; }
.sin-resultados { font-size: 12px; color: #efdadf; opacity: .7; line-height: 1.5; padding: 4px 9px; margin: 0 0 auto; }
/* Mientras se busca, los títulos ocupan lo justo y debajo van las coincidencias en el texto */
.lateral-cuerpo.buscando .lista-chats { flex: 0 1 auto; max-height: 38%; }
.resultados-texto { flex: 1; min-height: 0; overflow-y: auto; margin: 2px -3px 8px; padding-right: 3px; display: flex; flex-direction: column;
                    gap: 2px; scrollbar-width: thin; scrollbar-color: #bb8496 transparent; }
.resultados-texto[hidden] { display: none; }
.rt-titulo { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #e6bec9; opacity: .8; font-weight: 700; padding: 8px 9px 4px; }
.rt-item { display: flex; flex-direction: column; gap: 3px; text-align: left; background: none; border: 0; border-radius: 10px;
           padding: 8px 10px; color: #f3e5e8; font-size: 12px; line-height: 1.45; }
.rt-item:hover, .rt-item:focus-visible { background: #ffffff16; outline: none; }
.rt-item b { font-weight: 650; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-item span { color: #ead3d9; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rt-item i { font-style: normal; color: #e6bec9; }
.rt-item mark { background: var(--dorado); color: #3a1520; border-radius: 3px; padding: 0 1px; }
.rt-mas { font-size: 11px; color: #e6bec9; opacity: .75; padding: 0 10px 6px; }
/* El mensaje al que se llegó desde el buscador */
.burbuja mark { background: #f6dc95; color: inherit; border-radius: 3px; padding: 0 1px; }
.msg.encontrado .burbuja { animation: encontrado 2.2s ease-out; }
@keyframes encontrado { 0%, 35% { box-shadow: 0 0 0 3px var(--dorado); } 100% { box-shadow: 0 0 0 3px transparent; } }
.pie-lateral { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 4px 14px; margin-top: 6px;
               border-top: 1px solid #ffffff26; font-size: 12.5px; color: #efdadf; }
.pie-lateral .quien { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enlace { background: none; border: 0; color: #e6bec9; text-decoration: underline; padding: 2px 4px; }
.enlace:hover { color: #fff; }
.pie-lateral .quien { flex: 1; min-width: 0; }
.tema { background: none; border: 1px solid #ffffff2b; color: #e6bec9; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.tema:hover { color: #fff; background: #ffffff1c; }
.tema svg { width: 16px; height: 16px; }
.velo { display: none; }

/* ---------- barra superior ---------- */
.principal { display: flex; flex-direction: column; min-width: 0; min-height: 0;
             background: radial-gradient(circle at 65% 0%, var(--resplandor) 0, transparent 360px), var(--fondo); }
.barra { display: flex; align-items: center; gap: 12px; height: 70px; flex: none; padding: 0 28px; border-bottom: 1px solid var(--borde);
         background: var(--barra); }
.barra-titulo { flex: 1; min-width: 0; }
.barra h1 { font-size: 15px; font-weight: 750; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barra-titulo small { display: block; color: var(--tenue); font-size: 11px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icono { background: none; border: 0; color: var(--tenue); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.icono:hover { background: var(--usuario); color: var(--titulo); }
.solo-movil { display: none; }
.barra .solo-movil { border: 1px solid var(--borde); background: var(--superficie); color: var(--titulo); width: 34px; height: 34px; border-radius: 9px; }

.selector-motor { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--tenue); }
.selector-motor select { font-size: 12px; color: var(--texto); background: var(--superficie); border: 1px solid var(--borde);
                         border-radius: 9px; padding: 7px 9px; cursor: pointer; }
.selector-motor select:hover { border-color: #d1a7b5; }

.interruptor { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tenue); cursor: pointer; user-select: none; white-space: nowrap; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pista { width: 34px; height: 19px; border-radius: 99px; background: var(--pista); position: relative; transition: .2s; flex: none; }
.pista::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.interruptor input:checked + .pista { background: var(--guinda); }
.interruptor input:checked + .pista::after { left: 17px; }
.interruptor input:focus-visible + .pista { outline: 3px solid #d9a5b6; outline-offset: 2px; }

/* ---------- conversación ---------- */
.conversacion { flex: 1; overflow-y: auto; padding: 30px 34px 12px; scrollbar-color: #d7cbc4 transparent; }
.mensajes, .bienvenida { max-width: 824px; margin: 0 auto; }

.bienvenida { text-align: center; max-width: 620px; padding: 3vh 0 24px; }
.bienvenida-mascota { width: 148px; height: 148px; display: grid; place-items: center; margin: 0 auto 3px; border-radius: 50%;
                      background: radial-gradient(circle, var(--halo-1), var(--halo-2) 68%, transparent 70%); }
.bienvenida-mascota img { width: 158px; height: 158px; }
.antetitulo { color: var(--bosque); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-top: 10px; }
.bienvenida h2 { font-size: 30px; color: var(--titulo); margin: 8px 0 9px; letter-spacing: -1px; }
.bienvenida h2 .destello { color: var(--oro); }
.bienvenida p { font-size: 13.5px; color: var(--tenue); line-height: 1.7; margin: 0 auto; max-width: 540px; }

.sugerencias { display: flex; flex-wrap: wrap; gap: 8px; }
.sugerencias.rejilla { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 26px; }
.sugerencias.rejilla button { text-align: left; border: 1px solid var(--borde); background: var(--superficie); border-radius: 12px;
                              padding: 14px 15px; color: var(--texto); font-size: 12.5px; line-height: 1.5; box-shadow: var(--sombra); }
.sugerencias.rejilla button:hover { border-color: #c7a1ad; background: var(--hover); }
.sugerencias.rejilla svg { display: block; width: 21px; height: 21px; color: var(--acento); margin-bottom: 8px; }
.sugerencias.rapidas { margin-top: 12px; }
.sugerencias.rapidas button { border: 1px solid var(--sug-borde); color: var(--sug-texto); background: var(--superficie); border-radius: 999px;
                              padding: 7px 12px; font-size: 12px; text-align: left; }
.sugerencias.rapidas button:hover { border-color: var(--acento); background: var(--hover); }

.msg { margin: 0 0 24px; display: flex; flex-direction: column; }
.msg.usuario { align-items: flex-end; }
.msg.usuario .burbuja { background: var(--usuario); border: 1px solid var(--usuario-borde); padding: 12px 17px; border-radius: 16px 16px 4px 16px;
                        max-width: 83%; white-space: pre-wrap; line-height: 1.65; }
/* Encabezado de cada respuesta: la mascota y el nombre, sin marcado extra en app.js. */
.msg.asistente::before { content: "FONI"; display: flex; align-items: center; height: 42px; padding-left: 52px; margin-bottom: 9px;
                         font-size: 14px; font-weight: 750; color: var(--titulo);
                         background: url("foni.png") 1px center / 40px 40px no-repeat,
                                     radial-gradient(circle at 21px 50%, #e6f3e2 0 20px, #cbe2d0 20.5px 21px, transparent 21.5px); }
.msg.asistente .burbuja { background: var(--superficie); border: 1px solid var(--borde); border-radius: 16px; padding: 20px 22px 16px;
                          box-shadow: var(--sombra); overflow-x: auto; line-height: 1.65; }
.burbuja h3 { font-size: 14px; margin: 18px 0 8px; color: var(--titulo); }
.burbuja h3:first-child, .burbuja .veredicto + h3 { margin-top: 2px; }
.burbuja p { margin: 0 0 10px; }
.burbuja ul { margin: 6px 0 12px; padding-left: 20px; }
.burbuja li { margin: 5px 0; }
.burbuja li::marker { color: var(--oro); }
.burbuja blockquote { margin: 8px 0 12px; padding: 10px 14px; background: var(--cita); border: 1px solid var(--borde);
                      border-left: 3px solid var(--cita-borde); border-radius: 10px; font-size: 13px; color: var(--texto); }
.burbuja code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; background: var(--cita); border: 1px solid var(--borde);
                padding: 0 5px; border-radius: 5px; }
.burbuja a { color: var(--acento); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.burbuja a:hover { background: var(--acento-suave); }
.burbuja table { border-collapse: collapse; margin: 8px 0 14px; font-size: 12.5px; }
.burbuja th, .burbuja td { border-bottom: 1px solid var(--borde); padding: 7px 10px; text-align: left; }
.burbuja td:not(:first-child), .burbuja th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.burbuja th { background: var(--tabla-cabeza); color: var(--titulo); font-weight: 700; font-size: 11.5px; }
.burbuja tbody tr:hover { background: var(--cita); }
.burbuja em { color: var(--tenue); }
.burbuja details { margin: 12px 0 4px; border: 1px solid var(--borde); border-radius: 12px; padding: 0 14px; background: var(--cita); }
.burbuja summary { cursor: pointer; font-size: 12.5px; color: var(--titulo); font-weight: 700; padding: 10px 0; }
.burbuja summary::marker { color: var(--oro); }
.burbuja details[open] { background: var(--superficie); padding-bottom: 6px; }
.burbuja details[open] summary { border-bottom: 1px solid var(--borde); margin-bottom: 10px; }

.veredicto { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
             padding: 4px 11px; border-radius: 99px; margin-bottom: 10px; border: 1px solid transparent; }
.v-si { background: var(--v-si); color: var(--v-si-t); border-color: var(--v-si-b); }
.v-no { background: var(--v-no); color: var(--v-no-t); border-color: var(--v-no-b); }
.v-si_con_condiciones { background: var(--v-cond); color: var(--v-cond-t); border-color: var(--v-cond-b); }
.v-depende { background: var(--v-dep); color: var(--v-dep-t); border-color: var(--v-dep-b); }
.v-informativa { background: var(--cita); color: var(--tenue); border-color: var(--borde); }

.acciones-msg { display: flex; gap: 7px; margin-top: 9px; }
.acciones-msg button { border: 1px solid var(--chip-borde); background: var(--chip); color: var(--titulo); border-radius: 8px;
                       padding: 5px 10px; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.acciones-msg button:hover { background: var(--acento-suave); border-color: #d1a7b5; }
.acciones-msg svg { width: 14px; height: 14px; }
.acciones-msg button.destacado { background: var(--acento); border-color: var(--acento); color: #fff; }
.acciones-msg button.destacado:hover { background: var(--vino); border-color: var(--vino); }
.aviso-reintento { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 10px; padding: 9px 13px;
                   background: var(--v-cond); color: var(--v-cond-t); border: 1px solid var(--v-cond-b); border-radius: 10px; font-size: 12.5px; font-weight: 600; }
.aviso-reintento span { flex: 1 1 220px; }
.aviso-reintento button { border: 0; background: var(--acento); color: #fff; border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 700; }
.aviso-reintento button:hover { background: var(--vino); }
.nota-intentos { margin: 7px 0 0; font-size: 11px; color: var(--tenue); font-style: italic; }

/* Acciones de la pregunta: aparecen al pasar el ratón (siempre en pantallas táctiles y si la respuesta falló) */
.acciones-pregunta { display: flex; gap: 2px; margin-top: 4px; opacity: 0; transition: opacity .15s; }
.msg.usuario:hover .acciones-pregunta, .acciones-pregunta:focus-within, .acciones-pregunta.con-falla { opacity: 1; }
@media (hover: none) { .acciones-pregunta { opacity: 1; } }
.acciones-pregunta button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--tenue);
                            display: grid; place-items: center; }
.acciones-pregunta button:hover { background: var(--usuario); color: var(--titulo); }
.acciones-pregunta svg { width: 15px; height: 15px; }
.acciones-pregunta button.destacado { background: var(--acento); color: #fff; }
.acciones-pregunta button.destacado:hover { background: var(--vino); }
.acciones-pregunta[hidden] { display: none; }
.msg.usuario.editando { align-items: stretch; }
.edicion { align-self: flex-end; width: min(100%, 640px); background: var(--superficie); border: 1px solid #c7a1ad; border-radius: 14px;
           padding: 10px 12px 8px; box-shadow: 0 0 0 3px var(--anillo); }
.edicion textarea { width: 100%; border: 0; outline: none; resize: none; background: transparent; color: var(--texto);
                    font: inherit; font-size: 13.5px; line-height: 1.6; max-height: 260px; }
.edicion-botones { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
.edicion-botones button { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; border: 1px solid var(--chip-borde);
                          background: var(--chip); color: var(--titulo); }
.edicion-botones button:hover { background: var(--acento-suave); }
.edicion-botones .edicion-enviar { background: var(--acento); border-color: var(--acento); color: #fff; }
.edicion-botones .edicion-enviar:hover { background: var(--vino); }
.edicion-botones svg { width: 16px; height: 16px; }

.pensando { display: inline-flex; gap: 4px; padding: 6px 0; }
.pensando i { width: 7px; height: 7px; border-radius: 50%; background: #b28a8f; animation: salto 1s infinite ease-in-out; }
.pensando i:nth-child(2) { animation-delay: .16s; } .pensando i:nth-child(3) { animation-delay: .32s; }
@keyframes salto { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.etapa { font-size: 12.5px; color: var(--bosque); font-weight: 600; margin: 0 0 8px; }
.etapa .pensando { padding: 0 8px 0 0; vertical-align: middle; }
.borrador { white-space: pre-wrap; }

/* ---------- redactor ---------- */
.redactor { flex: none; padding: 12px 30px 14px; background: linear-gradient(transparent, var(--fondo) 18%); }
.caja { max-width: 824px; margin: 0 auto; display: flex; align-items: flex-end; gap: 6px; background: var(--superficie);
        border: 1px solid var(--borde-caja); border-radius: 17px; padding: 9px 9px 9px 16px; box-shadow: 0 6px 20px #5c313a16; }
.caja:focus-within { border-color: #c7a1ad; box-shadow: 0 6px 20px #5c313a16, 0 0 0 3px var(--anillo); }
.caja textarea { flex: 1; border: 0; resize: none; max-height: 180px; min-height: 24px; padding: 8px 0; outline: none; background: transparent;
                 font-size: 13.5px; line-height: 1.55; }
.caja textarea::placeholder { color: #9a918e; }
.caja { position: relative; }
.caja .clip { width: 36px; height: 36px; color: #8f7c78; margin-left: -8px; }
.caja .clip svg { transition: transform .15s; }
.caja .clip:hover, .caja .clip.abierto { background: var(--usuario); color: var(--titulo); }
.caja .clip.abierto svg { transform: rotate(45deg); }
/* Menú del «+»: documento, foto o cámara, encima del redactor */
.menu-adjuntar { position: absolute; left: 6px; bottom: calc(100% + 8px); z-index: 15; min-width: 268px; padding: 6px;
                 background: var(--superficie); border: 1px solid var(--borde-caja); border-radius: 14px;
                 box-shadow: 0 12px 32px #3a1e2426, 0 2px 6px #3a1e2414; }
.menu-adjuntar[hidden] { display: none; }
.menu-adjuntar button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 9px;
                        background: none; color: var(--texto); text-align: left; font-size: 13px; }
.menu-adjuntar button:hover, .menu-adjuntar button:focus-visible { background: var(--usuario); outline: none; }
.menu-adjuntar button[hidden] { display: none; }
.menu-adjuntar svg { width: 18px; height: 18px; flex: none; color: var(--titulo); }
.menu-adjuntar span { flex: 1; display: flex; flex-direction: column; font-weight: 600; }
.menu-adjuntar small { font-weight: 400; font-size: 11px; color: var(--tenue); }
.menu-adjuntar kbd { font: inherit; font-size: 11px; color: var(--tenue); }
@media (pointer: coarse) { .menu-adjuntar kbd { display: none; } }
.caja.soltar { border-color: var(--acento); box-shadow: 0 0 0 3px var(--anillo); }
.adjuntos { max-width: 824px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.adjunto { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 6px 4px 10px; border-radius: 10px;
           background: var(--chip); border: 1px solid var(--chip-borde); color: var(--titulo); font-size: 12px; }
.adjunto svg { width: 14px; height: 14px; flex: none; }
.adjunto b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.adjunto small { color: var(--tenue); white-space: nowrap; }
.adjunto button { border: 0; background: none; color: var(--tenue); font-size: 16px; line-height: 1; width: 22px; height: 22px; border-radius: 6px; }
.adjunto button:hover { background: var(--acento-suave); color: var(--titulo); }
.adjunto.leyendo { opacity: .7; padding-right: 10px; }
.adjuntos-nota { font-size: 11px; color: var(--tenue); }
.adjuntos-error { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--error); }
.caja .mic { width: 36px; height: 36px; color: #8f7c78; }
.caja .mic:hover { background: var(--usuario); color: var(--titulo); }
.enviar { width: 39px; height: 38px; border-radius: 12px; background: var(--guinda); color: #fff; transition: background .2s, transform .2s; }
.enviar svg { width: 18px; height: 18px; }
.enviar:hover { background: var(--vino); color: #fff; transform: translateY(-1px); }
.enviar:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.mic.grabando, .mic.grabando:hover { background: var(--guinda); color: #fff; animation: pulso 1.3s infinite; }
@keyframes pulso { 0% { box-shadow: 0 0 0 0 rgba(155,34,71,.45); } 100% { box-shadow: 0 0 0 12px rgba(155,34,71,0); } }
.mic:disabled { opacity: .35; cursor: not-allowed; }
.estado-voz { max-width: 824px; margin: 7px auto 0; font-size: 12px; color: var(--titulo); text-align: center; }
.estado-voz:empty { display: none; }
.nota-redactor { max-width: 824px; margin: 7px auto 0; font-size: 10.5px; color: #a09a95; text-align: center; }
.estado-voz:not(:empty) + .nota-redactor { display: none; }

.detener, .detener:hover { background: var(--vino); }
.detener svg { fill: currentColor; stroke: none; width: 15px; height: 15px; }
.aviso-detenido { max-width: 824px; margin: -8px auto 22px; text-align: center; font-size: 12px; color: var(--tenue); font-style: italic; }

/* ---------- barra: exportar ---------- */
.barra-boton { width: 34px; height: 34px; border: 1px solid var(--borde); background: var(--superficie); color: var(--titulo); border-radius: 9px; }
.barra-boton:hover { background: var(--acento-suave); }
.barra-boton svg { width: 18px; height: 18px; }
.barra-boton:disabled { opacity: .4; cursor: default; background: var(--superficie); }

/* ---------- ir al final ---------- */
.principal { position: relative; }
.ir-final { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 5; width: 38px; height: 38px;
            border-radius: 50%; border: 1px solid var(--borde); background: var(--superficie); color: var(--titulo);
            display: grid; place-items: center; box-shadow: 0 6px 18px #5c313a24; }
.ir-final:hover { background: var(--acento-suave); }
.ir-final svg { width: 18px; height: 18px; }

/* ---------- visor de documentos ---------- */
.app.con-visor { grid-template-columns: 268px minmax(0, 1fr) minmax(360px, 44%); }
.visor { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid var(--borde); background: var(--superficie); }
.visor-barra { display: flex; align-items: center; gap: 9px; height: 70px; flex: none; padding: 0 12px 0 18px; border-bottom: 1px solid var(--borde);
               background: var(--barra); color: var(--titulo); }
.visor-barra > svg { flex: none; }
.visor-titulo { flex: 1; min-width: 0; }
.visor-titulo strong { display: block; font-size: 13.5px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visor-titulo small { display: block; font-size: 11px; color: var(--tenue); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visor-cuerpo { flex: 1; min-height: 0; background: var(--visor-fondo); }
.visor-cuerpo iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.app.con-visor .selector-motor .texto, .app.con-visor .interruptor .texto, .app.con-visor .barra-titulo small { display: none; }
.app.con-visor .barra { padding: 0 18px; }
@media (max-width: 1180px) { .app.con-visor { grid-template-columns: 0 minmax(0, 1fr) minmax(340px, 50%); } .app.con-visor .lateral { visibility: hidden; } }

/* ---------- móvil ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: fixed; inset: 0 auto 0 0; width: min(292px, 88vw); z-index: 20; transform: translateX(-105%); transition: transform .25s; }
  .app.menu-abierto .lateral { transform: none; }
  .app.menu-abierto .velo { display: block; position: fixed; inset: 0; background: #21111770; z-index: 10; }
  .solo-movil { display: grid; }
  .barra { height: 62px; padding: 0 12px; gap: 9px; }
  .barra h1 { font-size: 13px; }
  .barra-titulo small { font-size: 10px; }
  .selector-motor .texto, .interruptor .texto { display: none; }
  .selector-motor select { max-width: 132px; padding: 6px 7px; }
  .conversacion { padding: 17px 13px 8px; }
  .redactor { padding: 8px 11px 10px; }
  .msg.usuario .burbuja { max-width: 94%; }
  .msg.asistente .burbuja { padding: 14px 14px 12px; }
  .bienvenida { padding-top: 8px; }
  .bienvenida h2 { font-size: 24px; }
  .sugerencias.rejilla { grid-template-columns: 1fr; gap: 8px; margin-top: 20px; }
  .sugerencias.rejilla button { display: flex; align-items: center; gap: 11px; padding: 11px 13px; }
  .sugerencias.rejilla svg { margin: 0; flex: none; }
  .item-chat .acc { opacity: 1; }
}
@media (max-width: 440px) {
  .barra-titulo small { display: none; }
  .nota-redactor { font-size: 11px; line-height: 1.35; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- botón «Mi cuenta» en el pie lateral ---------- */
.cuenta-pie { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; background: none; border: 0; border-radius: 11px;
              padding: 5px 6px; color: inherit; text-align: left; transition: background .15s; }
.cuenta-pie:hover { background: #ffffff16; }
.cuenta-textos { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cuenta-textos .quien { font-weight: 650; color: #fff; }
.cuenta-textos small { font-size: 10.5px; color: #e2beca; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 750;
          letter-spacing: .02em; background: linear-gradient(145deg, var(--dorado), var(--oro)); color: #3a1520; }
.avatar:empty { display: none; }
.avatar.grande { width: 48px; height: 48px; font-size: 17px; }

/* ---------- ventanas propias (confirmaciones y «Mi cuenta») ---------- */
.ventana { padding: 0; border: 0; background: transparent; max-width: calc(100% - 32px); width: 420px; color: var(--texto); }
.ventana::backdrop { background: rgba(40, 14, 24, .42); backdrop-filter: blur(2px); }
.ventana[open] { animation: aparecer .16s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.ventana-tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: 18px; padding: 22px 22px 18px;
                   box-shadow: 0 24px 60px rgba(58, 18, 34, .22); display: grid; gap: 12px; }
.ventana h2 { margin: 0; font-size: 17px; color: var(--titulo); line-height: 1.3; }
.ventana p { margin: 0; color: var(--texto); line-height: 1.55; }
.ventana-botones { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ventana-botones .primario, .ventana-botones .peligro, .ventana-botones .secundario { padding: 9px 16px; border-radius: 10px; font-weight: 650; }
.secundario { background: var(--superficie); color: var(--texto); border: 1px solid var(--borde-caja); border-radius: 10px; padding: 9px 16px;
              font-weight: 600; transition: background .15s; }
.secundario:hover { background: var(--usuario); }
.secundario.chico { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; white-space: nowrap; flex: none; }
.peligro { background: #b3261e; color: #fff; border: 0; border-radius: 10px; transition: background .15s; }
.peligro:hover { background: #8c1d17; }
.primario:disabled, .secundario:disabled { opacity: .6; cursor: default; }

/* ---------- «Mi cuenta» ---------- */
.ventana.cuenta { width: 460px; }
.ventana.cuenta .ventana-tarjeta { gap: 16px; max-height: calc(100dvh - 48px); overflow-y: auto; }
.cuenta-cargando { color: var(--tenue); }
.cuenta-cabeza { display: flex; align-items: center; gap: 12px; }
.cuenta-cabeza > div { flex: 1; min-width: 0; }
.cuenta-cabeza h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cuenta-cabeza small { color: var(--tenue); font-size: 12.5px; }
.ventana .cerrar { align-self: flex-start; background: none; border: 0; color: var(--tenue); padding: 6px; border-radius: 8px; display: grid; }
.ventana .cerrar:hover { background: var(--usuario); color: var(--texto); }
.ventana .cerrar svg { width: 18px; height: 18px; }
.cuenta-aviso { background: var(--v-si); color: var(--v-si-t) !important; border: 1px solid var(--v-si-b); border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.cuenta-seccion { display: grid; gap: 10px; border-top: 1px solid var(--borde); padding-top: 14px; }
.cuenta-seccion-titulo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ventana h3 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--tenue); font-weight: 700; }
.cuenta-datos { margin: 0; display: grid; gap: 8px; }
.cuenta-datos div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; font-size: 13.5px; }
.cuenta-datos dt { color: var(--tenue); }
.cuenta-datos dd { margin: 0; overflow-wrap: anywhere; }
.cuenta-cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.cuenta-cifras div { background: var(--cita); border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; display: grid; gap: 1px; }
.cuenta-cifras b { font-size: 19px; color: var(--titulo); font-weight: 750; }
.cuenta-cifras span { font-size: 11.5px; color: var(--tenue); }
.cuenta-pie-ventana { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--borde); padding-top: 14px; }
.cuenta-pie-ventana small { color: var(--tenue); font-size: 11.5px; }
.cuenta-form { display: grid; gap: 12px; border-top: 1px solid var(--borde); padding-top: 14px; }
.cuenta-form label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--tenue); }
.cuenta-form label i { font-style: normal; font-weight: 400; }
.cuenta-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--borde-caja); border-radius: 10px; font-size: 14px; }
.cuenta-form input:focus { outline: 2px solid var(--acento); outline-offset: -1px; }
.cuenta-nota { font-size: 12.5px; color: var(--tenue) !important; }
.cuenta-form .error:empty { display: none; }
.ventana .error { color: var(--error); font-size: 13px; }
.campo-clave { position: relative; display: block; }
.campo-clave input { padding-right: 42px; }
.ver-clave { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--tenue);
             padding: 6px; border-radius: 7px; display: grid; }
.ver-clave:hover, .ver-clave.activo { color: var(--acento); }
.ver-clave svg { width: 18px; height: 18px; }
@media (max-width: 480px) {
  .ventana-tarjeta { padding: 18px 16px 16px; }
  .cuenta-datos div { grid-template-columns: 1fr; gap: 1px; }
}

/* ---------- nombres escritos en su sitio (expediente nuevo o renombrado) ---------- */
.grupo.expediente.editando { padding: 2px 0; }
.grupo.expediente input { flex: 1; min-width: 0; padding: 7px 9px; border-radius: 8px; border: 1px solid #ffffff60; background: #3a0f1f;
                          color: #fff; font-size: 12.5px; font-weight: 600; }
.menu-nuevo { padding: 4px 3px; }
.menu-nuevo input { width: 100%; padding: 8px 10px; border: 1px solid var(--borde-caja); border-radius: 8px; font-size: 13px; }
.menu-nuevo input:focus { outline: 2px solid var(--acento); outline-offset: -1px; }

/* ---------- «Mi cuenta» > Usuarios (sólo administradores) ---------- */
.ventana.cuenta.admin { width: 640px; }
.admin .primario.chico, .admin .peligro.chico { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; font-weight: 650; white-space: nowrap; flex: none; }
.peligro:disabled { opacity: .6; cursor: default; }
.admin-acciones { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.admin-error { background: var(--v-no); border: 1px solid var(--v-no-b); border-radius: 10px; padding: 9px 12px; }
.admin-consumo { display: grid; gap: 6px; font-size: 13px; background: var(--cita); border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; }
.admin-consumo b { color: var(--titulo); }
.admin-barra { display: block; height: 6px; border-radius: 4px; background: var(--borde); overflow: hidden; }
.admin-barra i { display: block; height: 100%; background: var(--bosque); border-radius: 4px; }
.admin-barra.llena i { background: var(--error); }
.admin-usuarios { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.admin-usuario { display: grid; gap: 5px; border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; background: var(--superficie); }
.admin-usuario.inactivo { background: var(--cita); }
.admin-usuario.inactivo .admin-quien b { color: var(--tenue); }
.admin-quien { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.admin-quien b { color: var(--titulo); font-weight: 700; overflow-wrap: anywhere; }
.admin-quien small, .admin-datos, .admin-uso { color: var(--tenue); font-size: 12px; }
.admin-uso { display: grid; gap: 4px; }
.admin-etiqueta { font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--acento-suave); color: var(--vino); }
.admin-etiqueta.apagada { background: var(--usuario); color: var(--tenue); }
.admin-etiqueta.tu { background: var(--v-si); color: var(--v-si-t); }
.admin-botones { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.admin-clave { display: flex; align-items: center; gap: 10px; background: var(--cita); border: 1px dashed var(--cita-borde); border-radius: 12px; padding: 12px 14px; }
.admin-clave code { flex: 1; font-size: 19px; font-weight: 700; letter-spacing: .06em; color: var(--titulo); overflow-wrap: anywhere; }
.cuenta-form label.admin-casilla { display: flex; align-items: center; gap: 8px; color: var(--texto); font-weight: 600; }
.cuenta-form .admin-casilla input { width: auto; margin: 0; }
.admin-tabla { max-height: 55dvh; overflow: auto; border: 1px solid var(--borde); border-radius: 12px; }
.admin-bitacora { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-bitacora th { position: sticky; top: 0; background: var(--tabla-cabeza); text-align: left; font-weight: 650; color: var(--tenue); padding: 7px 10px; }
.admin-bitacora td { padding: 6px 10px; border-top: 1px solid var(--borde); overflow-wrap: anywhere; }
.admin-bitacora tr.fallo td:last-child { color: var(--error); font-weight: 600; }
@media (max-width: 560px) {
  .admin-bitacora th:nth-child(3), .admin-bitacora td:nth-child(3) { display: none; }
}

/* ---------- celular: teclado, safe-area del iPhone, zonas táctiles y sin zoom al escribir ---------- */
@media (pointer: coarse) { input:not([type=checkbox]):not([type=radio]), textarea, select { font-size: 16px !important; } }
.login { padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
@media (max-width: 820px) {
  .app { height: var(--alto-visible, 100dvh); }
  .barra { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .redactor { padding: 8px max(11px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(11px, env(safe-area-inset-left)); }
  .lateral { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); }
  .ir-final { bottom: calc(104px + env(safe-area-inset-bottom)); }
  .interruptor::after { content: "Voz"; font-size: 11px; color: var(--tenue); }
}
@media (pointer: coarse) {
  .barra .solo-movil, .barra-boton { width: 40px; height: 40px; }
  .tema, .acciones-pregunta button, .edicion-botones button { width: 40px; height: 40px; }
  .item-chat .acc, .grupo.expediente .acc { padding: 10px; }
  .item-chat .abrir { padding-top: 13px; padding-bottom: 13px; }
  .adjunto button { width: 32px; height: 32px; }
  .acciones-msg button { min-height: 36px; padding: 7px 12px; }
  .ver-clave { padding: 10px; }
}
html, body { overscroll-behavior-y: none; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.conversacion, .lista-chats, .resultados-texto { overscroll-behavior: contain; }
button, a { -webkit-tap-highlight-color: transparent; }
