.lab-header { background:#172434; padding:22px max(6vw,24px); }
.lab-header a, .brand .lab-link { color:#e4f2e9; }
.switchboard { max-width:960px; margin:clamp(30px,8vh,90px) auto; padding:0 20px; }
.switchboard h1 { font:normal clamp(2.4rem,5vw,4rem)/1.08 Georgia,serif; }
.switchboard p { margin:18px 0 28px; }
.choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:12px; }
.choices button { text-align:left; background:white; color:#164740; border:1px solid #9eafa6; border-radius:12px; padding:22px; cursor:pointer; }
.choices button:hover, .choices button:focus-visible { background:#e8f2ec; border-color:#145f58; }
.choices strong, .choices span { display:block; }
.choices strong { font:normal 1.6rem Georgia,serif; margin-bottom:9px; }
.choices span { font:normal .95rem/1.35 system-ui; }
.brand-nav { display:flex; align-items:center; justify-content:flex-end; gap:clamp(12px,2.2vw,28px); margin-left:auto; font-size:.88rem; font-weight:600; letter-spacing:0; }
.brand-nav a { text-decoration:none; }
.brand .lab-link { color:#d5dedb; }
.brand .lab-link:hover { text-decoration:underline; }
.chat-nav { display:inline-flex; align-items:center; gap:.55rem; padding:.56rem .84rem; border-radius:7px; background:#e3f1e7; color:#173e39; line-height:1.15; position:relative; }
.chat-nav:hover { background:white; }
.chat-glyph { position:relative; width:15px; height:12px; border:1.5px solid currentColor; border-radius:4px 4px 4px 1px; }
.chat-glyph::after { content:""; position:absolute; top:3px; left:3px; width:6px; height:1px; background:currentColor; }
#orbita-aviso { position:fixed; z-index:8; right:max(16px,env(safe-area-inset-right)); bottom:max(16px,env(safe-area-inset-bottom)); width:min(350px,calc(100vw - 32px)); box-sizing:border-box; display:grid; grid-template-columns:34px 1fr 30px; gap:10px; padding:14px; border:1px solid #c0cfc5; border-radius:16px; background:#fffefa; color:#20382f; box-shadow:0 6px 25px #122c2930; font:normal .9rem/1.35 system-ui,sans-serif; }
#orbita-aviso[hidden],body:has(dialog[open]) #orbita-aviso { display:none; }
.aviso-avatar { display:grid; place-items:center; width:34px; height:34px; border-radius:50%; background:#173b38; color:#fffefa; }
.aviso-avatar .brand-mark { width:22px; height:22px; }
#aviso-texto { margin:3px 0 4px; }
#aviso-ver,#aviso-cerrar { border:0; background:transparent; color:#175f51; font:inherit; padding:0; }
#aviso-ver { font-weight:650; text-decoration:underline; text-underline-offset:2px; min-height:28px; }
#aviso-cerrar { align-self:start; width:30px; height:30px; border-radius:50%; font-size:1.4rem; }
#aviso-cerrar:hover { background:#edf3ef; }
#asistencia { display:grid; gap:10px; padding:16px 20px; background:#eaf2ec; border-bottom:1px solid #c8d9ce; }
.ensayo-resumen { display:flex; align-items:center; gap:12px; }
.ensayo-luz { flex:none; width:9px; height:9px; background:#31806b; border-radius:50%; box-shadow:0 0 0 4px #d8e8dd; margin-inline:3px; }
#lab-titulo { margin:0; color:#193e36; font-size:.98rem; line-height:1.35; }
#lab-detalle { color:#52625a; font-size:.84rem; line-height:1.4; margin-top:2px; }
.ensayo-acciones { display:flex; align-items:center; flex-wrap:wrap; gap:5px; }
.ensayo-acciones button { padding:.45rem .65rem; font-size:.85rem; min-height:36px; }
#lab-error:not(:empty), #soporte-error:not(:empty) { color:#913d31; padding:9px 14px; font-size:.88rem; }
.chat-fondo { position:fixed; inset:0; z-index:9; background:#0f201f5e; }
body:has(#ayuda-libre:not([hidden])) { overflow:hidden; }
.chat { position:fixed; z-index:10; top:0; bottom:0; right:0; width:min(440px,100%); max-height:100dvh; display:flex; flex-direction:column; color:var(--ink); background:#fafbf7; box-shadow:-9px 0 50px #17243433; }
.chat-cabecera { flex:none; min-height:76px; display:flex; align-items:center; gap:12px; padding:15px 22px; color:#f6fbf4; background:#173b38; }
.chat-cabecera h2 { font:600 1.25rem/1.25 var(--display); letter-spacing:0; }
.chat-avatar { width:37px; height:37px; border:1px solid #72968a; border-radius:50%; background:#26504c; display:grid; place-items:center; }
.chat-avatar .brand-mark { width:23px; height:23px; }
.chat-cerrar { font-family:system-ui,sans-serif; color:#ecf2e9; background:transparent; border:1px solid #77978d; border-radius:50%; width:36px; height:36px; font-size:26px; line-height:1; margin-left:auto; display:grid; place-content:center; }
.chat-cerrar:hover { background:#315b53; }
.chat-tabs { flex:none; display:flex; gap:12px; align-items:end; padding:0 20px; background:#fffefa; border-bottom:1px solid var(--rule); }
.chat-tabs button { flex:1; min-height:48px; padding:8px 3px; font-size:.88rem; font-weight:650; color:#5a6763; background:transparent; border:0; border-bottom:3px solid transparent; }
.chat-tabs button[aria-selected=true] { color:#125749; border-color:#227861; }
.chat-vista { display:flex; flex:1 1 auto; min-height:0; flex-direction:column; overflow:auto; }
.chat-contexto { display:flex; flex:none; align-items:center; justify-content:space-between; gap:8px; padding:8px 20px; min-height:42px; background:#f1f5ec; border-bottom:1px solid #dce3d9; }
.chat-estado { color:#42574c; font-size:.85rem; font-weight:600; line-height:1.45; }
.chat-nuevo { flex:none; background:transparent; color:#14574b; border:0; padding:5px 0; text-decoration:underline; text-underline-offset:3px; font-size:.85rem; }
.chat-hilos { display:flex; gap:10px; align-items:center; padding:9px 20px; background:white; color:#45574c; border-bottom:1px solid #dce3d9; font-size:.85rem; }
.chat-hilos select { min-width:0; flex:1; font:inherit; color:var(--ink); background:white; border:1px solid #a8b5aa; border-radius:6px; padding:6px; }
.chat-bienvenida { padding:28px 22px 18px; }
.chat-bienvenida strong { font:normal 1.5rem/1.25 var(--display); }
.chat-bienvenida p { color:#4c6056; font-size:.95rem; line-height:1.5; margin-top:8px; }
.chat-bienvenida a { display:inline-block; margin-top:1rem; color:var(--teal); font-weight:600; }
.mensajes { list-style:none; margin:0; padding:18px 20px; }
.chat-historial,.lab-historial { flex:1 1 auto; min-height:70px; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.mensajes:empty { display:none; }
.mensaje { display:flex; flex-direction:column; align-items:flex-start; margin-bottom:14px; }
.mensaje:last-child { margin-bottom:0; }
.mensaje-usuario { align-items:flex-end; }
.mensaje-metadatos { margin:0 4px 5px; font:600 .75rem/1.3 system-ui; color:#51625c; }
.mensaje-metadatos time { font-weight:400; }
.burbuja { margin:0; max-width:92%; padding:10px 13px; border-radius:14px 14px 14px 3px; background:#e8eee7; color:#20382f; font-size:.95rem; line-height:1.5; overflow-wrap:anywhere; white-space:pre-line; }
.mensaje-usuario .burbuja { background:#195d50; color:white; border-radius:14px 14px 3px 14px; }
.chat-acciones { display:flex; flex-wrap:wrap; gap:8px; padding-inline:20px; background:#fffefa; }
.chat-acciones:has(button:not([hidden])) { padding-block:14px; border-top:1px solid #dce3d9; }
.chat-acciones button { font-size:.91rem; }
.chat-componer { flex:none; display:grid; gap:8px; margin-top:auto; padding:14px 20px max(16px,env(safe-area-inset-bottom)); background:#fffefa; border-top:1px solid #dce3d9; }
.chat-componer label { font-weight:650; font-size:.9rem; }
.chat-componer textarea { width:100%; font:inherit; line-height:1.4; padding:9px 11px; resize:vertical; max-height:20dvh; border:1px solid #9baea1; border-radius:7px; color:#20352c; background:white; }
.chat-componer button { justify-self:end; }
.chat-opciones { flex:none; display:flex; flex-wrap:wrap; gap:6px; padding:12px 20px 0; background:#fffefa; border-top:1px solid #dce3d9; }
.chat-opciones:not([hidden]) + .chat-componer { border-top:0; margin-top:0; }
.chat-opciones button { background:#f1f6f0; color:#205648; border:1px solid #b8c9be; border-radius:15px; font-size:.82rem; padding:6px 10px; }
.chat-opciones button:hover { background:#e3eee5; }
.chat :focus-visible { outline:3px solid #328c76; outline-offset:2px; }
@media (max-width:680px) {
  .brand-nav { gap:12px; }
  .brand { font-size:1.1rem; gap:.4rem; }
  .brand-mark { width:24px; height:24px; flex:none; }
  #asistencia { gap:8px; padding:11px; }
  .ensayo-acciones { margin-left:20px; }
  .ensayo-acciones button { font-size:.8rem; }
}
@media (max-width:520px) {
  .chat { width:100%; }
  .chat-cabecera { min-height:60px; padding:10px 16px; }
  .chat-tabs,.mensajes,.chat-acciones,.chat-opciones,.chat-componer { padding-inline:16px; }
  .chat-componer textarea { font-size:16px; }
  .brand-nav { font-size:.78rem; gap:.7rem; }
  .chat-nav { padding:.56rem; }
}
@media (max-height:480px) {
  .chat-cabecera,.chat-tabs button { min-height:36px; padding-block:4px; }
  .chat-contexto,.chat-hilos { min-height:28px; padding-block:3px; }
  .chat-historial,.lab-historial { min-height:40px; padding-block:6px; }
  .chat-opciones { padding-top:5px; }
  .chat-componer { padding-block:6px; gap:4px; }
}
