/* Estilos comunes del panel (19 oct, bloque 3). Antes vivían dentro de base.html. Nada de internet: letras guardadas
   en app/static/fonts (licencia OFL) y estilos aquí. El color de marca llega como --brand en la etiqueta <html>
   (BRAND_COLOR); todos los tonos se derivan de él con color-mix. Verde, ámbar y azul solo para estados.
   Reglas que no se rompen: texto de 16 px o más (notas al pie desde 14); botones de 44 px o más; contraste de 4.5 a 1;
   sin desplazamiento de lado; las palabras no se parten (solo teléfonos, correos y enlaces largos, si no caben); en
   celular las tablas de datos son fichas; lo que cancela o borra va en rojo y separado; movimiento solo con
   transform/opacity, de 350 ms o menos, y nada si la persona pidió reducir el movimiento.
   Sin modo oscuro por ahora: las variables de color están juntas abajo para agregarlo después en un solo lugar. */

@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap;
             src: url("/static/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap;
             src: url("/static/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 700; font-display: swap;
             src: url("/static/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }

:root {
  /* Marca (de BRAND_COLOR) */
  --brand: #0f766e;
  --brand-fuerte: color-mix(in srgb, var(--brand) 76%, #000);
  --brand-suave: color-mix(in srgb, var(--brand) 11%, #fff);
  --brand-tint: var(--brand-suave);
  --brand-dark: var(--brand-fuerte);
  /* Superficies y texto */
  --bg: #eef2f2; --surface: #fff; --surface-2: #f5f8f7; --line: #d3dedc; --field: #9fb0ad;
  --ink: #12211f; --muted: #445754; --tone: var(--line);
  /* Estados (solo para estado; oscuros para contraste 4.5:1 sobre su fondo suave) */
  --ok: #166534; --ok-bg: #dcf5e4; --warn: #8a3c06; --warn-bg: #fdf0cf; --info: #1e40af; --info-bg: #dde9fd;
  --bad: #a11818; --bad-bg: #fbe8e8;
  /* Forma */
  --radius: 10px; --radio-tarjeta: 14px; --tap: 48px; --gap: .75rem;
  --letra: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --titulos: "Bricolage Grotesque", "Atkinson Hyperlegible", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--letra); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--bg);
       overflow-wrap: break-word; }
a { color: var(--brand-fuerte); text-underline-offset: .18em; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 1rem; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
        stroke-linejoin: round; vertical-align: middle; }

/* Barra superior: nombre y menú. Escritorio: enlaces en píldora. Celular: menú plegado en un botón (sin scripts). */
header { background: var(--surface); border-bottom: 1px solid var(--line); }
header .bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem 1rem; flex-wrap: wrap;
              min-height: 64px; padding-block: .4rem; }
header a.logo { font-family: var(--titulos); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; color: var(--ink);
                text-decoration: none; display: inline-flex; align-items: center; gap: .6rem; min-height: var(--tap); }
/* 20 oct: símbolo de Angelia (concepto 3, app/static/brand) en lugar del cuadro de color; el nombre sigue como texto */
header a.logo .simbolo { width: 28px; height: 28px; flex: none; display: block; }
nav { display: flex; flex-wrap: wrap; gap: .25rem; }
nav a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .85rem; color: var(--muted);
        text-decoration: none; border-radius: 999px; }
nav a:hover { background: var(--surface-2); color: var(--ink); }
nav a[aria-current="page"] { background: var(--brand-suave); color: var(--brand-fuerte); font-weight: 700; }
.menu-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.menu-btn { display: none; }
header.with-menu nav { flex-basis: 100%; padding-bottom: .5rem; margin-left: -.85rem; }

/* Texto */
main.wrap { padding-top: 1.75rem; padding-bottom: 3rem; }
h1, h2, h3 { font-family: var(--titulos); }
h1 { font-size: clamp(1.7rem, 1.25rem + 1.8vw, 2.3rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 1rem;
     text-wrap: balance; }
h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.01em; margin: 0 0 .75rem; text-wrap: balance; }
h3 { font-size: 1.1rem; line-height: 1.3; margin: 1.25rem 0 .5rem; }
p, ul, ol { margin: 0 0 .9rem; }
p, li, .hint, label, .flash, .error { max-width: 72ch; }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: .3rem; }
.hint { color: var(--muted); font-size: 1rem; margin: .3rem 0 0; }
.hint.parrafos > p { margin: 0 0 .5rem; }
.hint.parrafos > p:last-child { margin-bottom: 0; }
ul.definiciones { list-style: none; padding: 0; margin: 1rem 0 0; color: var(--muted); }
ul.definiciones li { margin: 0 0 .6rem; }
ul.definiciones strong { color: var(--ink); }
/* Nota al pie: información de apoyo después de la lista; discreta pero legible (15 px, contraste alto) */
.nota-pie { color: var(--muted); font-size: .9375rem; line-height: 1.5; margin: .6rem 0 0; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Tarjetas: borde suave, esquinas redondeadas; título con ícono de 20 px en un recuadro suave */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radio-tarjeta); padding: 1.35rem;
        margin-bottom: 1rem; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.card > h2:first-child, .titulo-con-icono { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; }
.ic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: inline-grid; place-items: center;
      background: var(--brand-suave); color: var(--brand-fuerte); }
.ic.ok { background: var(--ok-bg); color: var(--ok); }
.ic.warn { background: var(--warn-bg); color: var(--warn); }
.rejilla { display: grid; gap: 1rem; }
@media (min-width: 860px) { .rejilla { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } .rejilla > .card { margin-bottom: 0; } }

/* Formularios: campos y botones cómodos para el pulgar */
label { display: block; font-weight: 700; margin: 1rem 0 .35rem; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: .65rem .8rem; border: 1px solid var(--field);
                          border-radius: var(--radius); font: inherit; color: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 110px; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; margin: 0 .6rem 0 0; flex: none;
                                          accent-color: var(--brand); vertical-align: middle; }
/* Casilla con su texto: el texto corre como una oración normal (con enlaces o negritas) y la casilla va a la izquierda */
label:has(> input[type=checkbox]), label:has(> input[type=radio]) {
  display: block; position: relative; min-height: var(--tap); padding: .7rem 0 .5rem 2.1rem; font-weight: 400;
  margin: .25rem 0 0; cursor: pointer; }
label:has(> input[type=checkbox]) > input, label:has(> input[type=radio]) > input { position: absolute; left: 0;
  top: .78rem; margin: 0; }

/* Botones: primario (relleno), contorno (secondary), discreto (ghost) y peligro (danger) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: var(--tap);
       padding: .55rem 1.3rem; margin-top: 1rem; border: 2px solid var(--brand); border-radius: var(--radius);
       background: var(--brand); color: #fff; font: inherit; font-weight: 700; line-height: 1.25; text-align: center;
       text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-fuerte); border-color: var(--brand-fuerte); color: #fff; }
.btn.secondary { background: var(--surface); color: var(--brand-fuerte); }
.btn.secondary:hover { background: var(--brand-suave); color: var(--brand-fuerte); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand-fuerte); padding-inline: .7rem; }
.btn.ghost:hover { background: var(--brand-suave); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn.small { min-height: 44px; padding: .4rem 1rem; margin-top: 0; }
.btn + .btn, form + form .btn { margin-left: .5rem; }
details > summary { min-height: 44px; display: flex; align-items: center; gap: .5rem; cursor: pointer;
                    color: var(--brand-fuerte); font-weight: 700; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
/* Flecha de los desplegables (gira al abrir) */
details > summary::after { content: ""; flex: none; width: .55em; height: .55em; margin: 0 .3rem 0 auto;
                           border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
                           transform: translateY(-25%) rotate(45deg); }
details[open] > summary::after { transform: translateY(15%) rotate(225deg); }
/* Grupo de acciones: en fila con separación; lo que cancela o borra queda aparte */
.acciones { display: flex; flex-wrap: wrap; gap: var(--gap); margin-top: .75rem; align-items: center; }
.acciones .btn { margin: 0; }
.acciones + .card { margin-top: 1rem; }
.acciones .btn.danger { margin-left: auto; }
span.acciones { display: flex; }
/* Un enlace que va solo (no dentro de una oración), como "Olvidé mi contraseña": 44 px de alto */
.enlace-solo { display: inline-flex; align-items: center; min-height: 44px; }

/* Avisos: un bloque legible con franja de color (nunca dentro de tablas ni columnas) */
.flash, .error, .aviso-linea { padding: .9rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
                               border-left: 5px solid; }
.flash { background: var(--ok-bg); border-color: var(--ok); }
.error { background: var(--bad-bg); border-color: var(--bad); }
.flash > :last-child, .error > :last-child { margin-bottom: 0; }
.error .btn.small { margin: .6rem 0 0; }
.aviso-linea { display: block; margin: .6rem 0 0; padding: .6rem .8rem; }
.aviso-linea.bad { background: var(--bad-bg); border-color: var(--bad); color: var(--ink); }
.aviso-linea.warn { background: var(--warn-bg); border-color: var(--warn); color: var(--ink); }
/* Etiquetas de estado en píldora */
.badge { display: inline-block; padding: .1rem .7rem; border-radius: 999px; font-size: 1rem; font-weight: 700;
         line-height: 1.5; white-space: normal; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.bad { background: var(--bad); color: #fff; }
.etiquetas { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.detalle { display: block; margin-top: .35rem; }

/* Barras de avance (se llenan desde cero con transform) */
.medidor { display: grid; gap: .35rem; margin: .9rem 0; }
.medidor-fila { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; color: var(--muted); }
.medidor-fila b { color: var(--ink); }
.barra { height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.barra > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); transform-origin: left center;
             transform: scaleX(var(--v, 0)); }
.barra.warn > i { background: var(--warn); }

/* Conversación: globos por quién escribe (tono de fondo, sin contorno salvo lo no enviado) */
.mensaje { margin: .6rem 0; padding: .7rem .9rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.mensaje.de-asistente { background: var(--info-bg); border-color: transparent; }
.mensaje.de-equipo { background: var(--ok-bg); border-color: transparent; }
.mensaje.no-enviado { background: var(--bad-bg); border: 2px dashed var(--bad); }
.mensaje-quien { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; margin-bottom: .2rem; }
.mensaje-texto { white-space: pre-wrap; max-width: 72ch; }
h1 .telefono { font-family: var(--letra); font-size: 1rem; font-weight: 400; letter-spacing: 0; }

ul.steps { list-style: none; padding: 0; margin: 0; }
ul.steps li { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1rem; padding: .7rem 0;
              margin: 0; max-width: none; }
ul.steps li + li { border-top: 1px solid var(--line); }
/* Dentro de filas flexibles un dato largo sin espacios (un nombre técnico) puede partirse en vez de salirse */
ul.steps li > *, .row > *, .acciones > *, .etiquetas > * { min-width: 0; }

/* Tablas */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--muted); }
td.cuando { white-space: nowrap; }
td.semana { min-width: 14rem; }
table.fichas td:last-child { min-width: 15rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row input[type=time] { width: auto; }
.row > input:not([type=time]):not([type=checkbox]):not([type=radio]) { min-width: min(100%, 14rem); }
ol.howto li { margin-bottom: .45rem; }
/* Horario: el día y sus dos bloques "hora a hora" */
.dia-horario { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .25rem 1rem; align-items: center;
               padding: .6rem 0; border-bottom: 1px solid var(--line); }
.dia-horario label.dia { margin: 0; font-weight: 700; }
.bloques { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.bloque { display: flex; align-items: center; gap: .5rem; flex: 1 1 15rem; min-width: 0; }
.bloque input[type=time] { flex: 1 1 0; min-width: 0; width: auto; padding-inline: .45rem; }
footer.wrap { padding-bottom: 2rem; }

/* Documentos para pacientes (aviso de privacidad): letra grande, renglón cómodo, nada que deslizar de lado */
body.doc main.wrap { max-width: 760px; }
body.doc .card { padding: 1.5rem 1.25rem; }
body.doc main p, body.doc main li, body.doc main td { font-size: 1.0625rem; line-height: 1.65; }
body.doc main h2 { margin-top: 2rem; font-size: 1.25rem; }
body.doc main li { margin-bottom: .4rem; }

@media (max-width: 900px) {
  /* Tablas de datos como fichas: una ficha por fila, cada dato con su título encima */
  table.fichas, table.fichas tbody, table.fichas tr, table.fichas td { display: block; width: 100%; }
  table.fichas tr:has(th) { display: none; }
  table.fichas tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1.25rem;
                    padding: .9rem 0; border-bottom: 1px solid var(--line); }
  table.fichas tr:last-child { border-bottom: 0; }
  table.fichas td { grid-column: 1 / -1; border: 0; padding: .25rem 0; white-space: normal; }
  table.fichas td.cuando { grid-column: auto; font-weight: 700; }
  table.fichas td[data-label]::before { content: attr(data-label); display: block; font-weight: 700; color: var(--muted); }
  table.fichas td:empty { display: none; }
}
@media (max-width: 720px) {
  main.wrap { padding-top: 1.25rem; }
  .card { padding: 1.1rem 1rem; }
  header:not(.with-menu) nav { margin-left: -.85rem; }
  header.with-menu .menu-btn { display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap);
                               padding: 0 1rem; border: 2px solid var(--line); border-radius: var(--radius);
                               font-weight: 700; cursor: pointer; background: var(--surface); }
  .menu-toggle:focus-visible + .menu-btn { outline: 3px solid var(--brand); outline-offset: 2px; }
  header.with-menu nav { display: none; flex-direction: column; gap: 0; margin: 0; padding-bottom: .75rem; }
  header.with-menu .menu-toggle:checked ~ nav { display: flex; }
  header.with-menu nav a { padding: 0 .75rem; font-size: 1.05rem; min-height: var(--tap); }
  ul.steps li { flex-wrap: wrap; }
  .dia-horario { grid-template-columns: minmax(0, 1fr); }
  .bloque { flex-basis: 100%; }
  ul.steps li .btn { width: 100%; }
  table.fichas td > .btn { width: 100%; }
  .row > .btn { flex: 1 1 auto; }
  .btn + .btn, form + form .btn { margin-left: 0; }
  /* Acciones apiladas a lo ancho; lo que cancela o borra, al final y con más separación */
  .acciones { flex-direction: column; align-items: stretch; }
  .acciones .btn { width: 100%; }
  .acciones .btn.danger { margin: .75rem 0 0; }
  body.doc table, body.doc tbody, body.doc tr, body.doc td { display: block; }
  body.doc tr:has(th) { display: none; }
  body.doc tr { padding: .6rem 0; border-bottom: 1px solid var(--line); }
  body.doc td { border: 0; padding: .1rem 0; }
  body.doc td[data-label]::before { content: attr(data-label) ": "; font-weight: 700; }
}
@media (max-width: 360px) {
  header .bar { gap: .5rem; }
  header a.logo { font-size: 1.05rem; gap: .45rem; }
  header a.logo::before { width: 20px; height: 20px; }
  header.with-menu .menu-btn { padding: 0 .7rem; }
  .bloque { flex-wrap: wrap; }
  .bloque input[type=time] { flex-basis: 100%; padding-inline: .8rem; }
}

/* Movimiento: aparición escalonada de las primeras tarjetas, barras que se llenan, botones con transición.
   Nada en listas largas ni en tablas. Todo apagado si la persona pidió reducir el movimiento. */
@keyframes panel-aparece { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes panel-llena { from { transform: scaleX(0); } to { transform: scaleX(var(--v, 0)); } }
@media (prefers-reduced-motion: no-preference) {
  main.wrap > :is(.card, .rejilla, .hoy, .saludo, details):nth-child(-n+6) { animation: panel-aparece .32s ease-out both; }
  main.wrap > :nth-child(2) { animation-delay: .04s; } main.wrap > :nth-child(3) { animation-delay: .08s; }
  main.wrap > :nth-child(4) { animation-delay: .12s; } main.wrap > :nth-child(5) { animation-delay: .16s; }
  main.wrap > :nth-child(6) { animation-delay: .2s; }
  .barra > i { animation: panel-llena .35s ease-out .15s both; }
  .btn { transition: background-color .15s ease, transform .1s ease; }
  .btn:active { transform: translateY(1px); }
  details > summary::after { transition: transform .2s ease; }
}

/* Inicio (19 oct, bloque 4) */
.saludo { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.saludo h1 { margin: .15rem 0 .4rem; }
.saludo-fecha { margin: 0; color: var(--muted); font-weight: 700; }
.insignia-prueba { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .3rem 1rem;
                   border-radius: 999px; background: var(--warn-bg); color: var(--warn); font-weight: 700; text-decoration: none; }
/* "Tu día de hoy": el único degradado del panel (decisión del dueño); color base oscuro para medir el contraste */
.hoy { display: grid; gap: 1.1rem; margin-bottom: 1rem; padding: 1.4rem; border-radius: 18px; color: #fff;
       background-color: var(--brand-fuerte); background-image: linear-gradient(135deg, var(--brand), var(--brand-fuerte)); }
.hoy-arriba { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; flex-wrap: wrap; }
.hoy h2 { margin: 0; color: #fff; }
.hoy-fecha { color: #fff; }
.hoy-resumen { margin: 0; font-size: 1.1rem; max-width: 62ch; }
.hoy-resumen b { font-weight: 700; }
.indicadores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.indicador { display: grid; gap: .15rem; padding: .8rem .9rem; border-radius: 12px; background: var(--brand-fuerte);
             border: 1px solid color-mix(in srgb, #fff 22%, transparent); min-width: 0; }
.indicador-nombre { display: flex; gap: .4rem; align-items: center; font-weight: 700; }
.indicador-valor { font-family: var(--titulos); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.hoy-cuerpo { display: grid; gap: .9rem; }
.siguiente, .agenda-hoy { background: var(--surface); color: var(--ink); border-radius: 14px; }
.siguiente { display: grid; gap: .35rem; align-content: start; padding: 1rem 1.1rem; }
.siguiente-titulo { color: var(--muted); font-weight: 700; }
.siguiente-hora { font-family: var(--titulos); font-size: 2rem; font-weight: 700; line-height: 1; }
.siguiente-quien { font-weight: 700; font-size: 1.1rem; }
.siguiente .badge { justify-self: start; }
.agenda-hoy { list-style: none; margin: 0; padding: .35rem .5rem; min-width: 0; }
.agenda-hoy li { display: grid; grid-template-columns: 3.6rem minmax(0, 1fr) auto; gap: .4rem .8rem; align-items: center;
                 margin: 0; padding: .6rem .5rem; border-radius: 10px; max-width: none; }
.agenda-hoy li + li { border-top: 1px solid var(--line); }
.agenda-hoy li.es-siguiente { background: var(--brand-suave); }
.agenda-hoy li.pasada .agenda-paciente, .agenda-hoy li.pasada .agenda-hora { color: var(--muted); }
.agenda-hora { font-weight: 700; }
.agenda-quien { display: grid; min-width: 0; }
.agenda-quien a { display: inline-flex; align-items: center; min-height: 44px; justify-self: start; }
.agenda-paciente { font-weight: 700; }
.numero-grande { font-family: var(--titulos); font-size: 2.6rem; font-weight: 700; line-height: 1; margin: 0 0 .4rem; }
details.pasos-config { padding: 0; }
details.pasos-config > summary { padding: 1rem 1.35rem; color: var(--ink); min-height: 64px; }
.pasos-titulo { display: grid; flex: 1; min-width: 0; }
.pasos-titulo b { font-family: var(--titulos); font-size: 1.15rem; }
details.pasos-config .steps { padding: 0 1.35rem .8rem; }
.paso { display: flex; gap: .6rem; align-items: center; min-width: 0; }
.paso-icono { display: inline-flex; color: var(--muted); }
.paso-icono.ok { color: var(--ok); }
.codigo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin: 0 0 .75rem;
          padding: .6rem .8rem; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line); }
.codigo > span { min-width: 0; }
@media (min-width: 860px) { .hoy-cuerpo { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); } }
@media (max-width: 560px) {
  .indicadores { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .indicador:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .agenda-hoy li { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .agenda-hoy li .badge { grid-column: 2; justify-self: start; }
  .codigo .btn { width: 100%; }
}

/* Al pasar el cursor (19 oct): solo con mouse o trackpad, nunca en pantallas táctiles; solo adorno (no es la única
   forma de ver nada). Se usa la propiedad "scale" (equivale a transform: scale y no choca con las animaciones de
   entrada). Tarjetas +2 %, botones +4 %, 180 ms; el elemento sube con z-index. No crece: lo que borra o cancela (solo
   cambia de color), los botones dentro de tablas, las filas de listas, los textos y las tarjetas con formularios o
   tablas (las tarjetas no reciben foco; los botones sí: el mismo efecto con :focus-visible). */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .rejilla > .card:not(:has(form, table, input, textarea, select)), .indicador, .siguiente,
  .btn:not(.danger) { position: relative; transition: scale .18s ease-out, background-color .15s ease; }
  .rejilla > .card:not(:has(form, table, input, textarea, select)):hover, .indicador:hover, .siguiente:hover {
    scale: 1.02; z-index: 2; }
  .btn:not(.danger):hover, .btn:not(.danger):focus-visible { scale: 1.04; z-index: 3; }
  table .btn:not(.danger):hover, table .btn:not(.danger):focus-visible { scale: none; }
}

/* Entrar y Crear cuenta (19 oct): misma familia que la bienvenida (título con la clase .titulo-serif de
   app/static/titulos.css, que solo enlazan estas dos pantallas, y botón principal de 52 px); el resto del panel no cambia. */
body.acceso form > .btn[type=submit] { min-height: 52px; border-radius: 14px; padding-inline: 1.5rem;
  background: color-mix(in srgb, var(--brand) 86%, #003d36); border-color: color-mix(in srgb, var(--brand) 86%, #003d36);
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand) 70%, transparent); }
@media (max-width: 599px) { body.acceso form > .btn[type=submit] { width: 100%; } }

/* Buzón de quejas y sugerencias (20 oct): aviso visible sobre el campo y mensajes en /admin tal cual (sin HTML) */
.aviso-datos { display: flex; align-items: center; gap: .6rem; margin: .25rem 0 .5rem; padding: .6rem .75rem;
               border-radius: var(--radius); background: var(--warn-bg); color: var(--warn); font-weight: 700; }
.aviso-datos .ic { width: 28px; height: 28px; background: transparent; color: var(--warn); }
.mensaje-buzon { margin: .5rem 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Cierres pendientes en /admin (24 oct): los comandos largos se parten para no desbordar en celular */
.cierre-pendiente code { overflow-wrap: anywhere; }

/* Segunda clave de /admin (22 oct) */
.card.angosta { max-width: 420px; }
.codigos-respaldo { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .4rem;
                    padding: 0; list-style: none; font-size: 1.1rem; }
.qr-segunda-clave { display: block; width: 240px; height: 240px; image-rendering: pixelated; }

/* 22 oct: clases que reemplazan los atributos style="" (la política de seguridad ya no permite estilos en línea) */
.u-w-auto { width: auto; } .u-peso-normal { font-weight: 400; } .u-m-0 { margin: 0; } .u-max-420 { max-width: 420px; }
.u-mt-0 { margin-top: 0; } .u-mt-04 { margin-top: .4rem; } .u-mt-05 { margin-top: .5rem; } .u-mt-075 { margin-top: .75rem; }
.u-mt-1 { margin-top: 1rem; } .u-mb-025 { margin-bottom: .25rem; } .u-ml-05 { margin-left: .5rem; } .u-mr-1 { margin-right: 1rem; }
.u-m-075-025 { margin: .75rem 0 .25rem; } .u-m-05-025 { margin: .5rem 0 .25rem; } .u-color-heredado { color: inherit; }
.u-w-15 { width: 15rem; } .u-min-h-60 { min-height: 60px; } .u-max-80 { max-width: 80px; } .u-max-120 { max-width: 120px; }
.u-max-180 { max-width: 180px; } .u-max-260 { max-width: 260px; } .u-entre { justify-content: space-between; }
.u-texto-08 { font-size: .8rem; } .u-texto-085 { font-size: .85rem; } .u-inline { display: inline; } .u-flex-1 { flex: 1; }
.u-codigo-grande { font-size: 1.6rem; letter-spacing: .08em; }
.u-nota-azul { margin: .25rem 0 1rem; padding: .6rem .8rem; background: #eff6ff; border-radius: 10px; }
/* Barras de avance: el valor va como clase v-0 … v-100 (antes, style="--v: …") */
.barra .v-0 { --v: 0; }
.barra .v-1 { --v: 0.01; }
.barra .v-2 { --v: 0.02; }
.barra .v-3 { --v: 0.03; }
.barra .v-4 { --v: 0.04; }
.barra .v-5 { --v: 0.05; }
.barra .v-6 { --v: 0.06; }
.barra .v-7 { --v: 0.07; }
.barra .v-8 { --v: 0.08; }
.barra .v-9 { --v: 0.09; }
.barra .v-10 { --v: 0.1; }
.barra .v-11 { --v: 0.11; }
.barra .v-12 { --v: 0.12; }
.barra .v-13 { --v: 0.13; }
.barra .v-14 { --v: 0.14; }
.barra .v-15 { --v: 0.15; }
.barra .v-16 { --v: 0.16; }
.barra .v-17 { --v: 0.17; }
.barra .v-18 { --v: 0.18; }
.barra .v-19 { --v: 0.19; }
.barra .v-20 { --v: 0.2; }
.barra .v-21 { --v: 0.21; }
.barra .v-22 { --v: 0.22; }
.barra .v-23 { --v: 0.23; }
.barra .v-24 { --v: 0.24; }
.barra .v-25 { --v: 0.25; }
.barra .v-26 { --v: 0.26; }
.barra .v-27 { --v: 0.27; }
.barra .v-28 { --v: 0.28; }
.barra .v-29 { --v: 0.29; }
.barra .v-30 { --v: 0.3; }
.barra .v-31 { --v: 0.31; }
.barra .v-32 { --v: 0.32; }
.barra .v-33 { --v: 0.33; }
.barra .v-34 { --v: 0.34; }
.barra .v-35 { --v: 0.35; }
.barra .v-36 { --v: 0.36; }
.barra .v-37 { --v: 0.37; }
.barra .v-38 { --v: 0.38; }
.barra .v-39 { --v: 0.39; }
.barra .v-40 { --v: 0.4; }
.barra .v-41 { --v: 0.41; }
.barra .v-42 { --v: 0.42; }
.barra .v-43 { --v: 0.43; }
.barra .v-44 { --v: 0.44; }
.barra .v-45 { --v: 0.45; }
.barra .v-46 { --v: 0.46; }
.barra .v-47 { --v: 0.47; }
.barra .v-48 { --v: 0.48; }
.barra .v-49 { --v: 0.49; }
.barra .v-50 { --v: 0.5; }
.barra .v-51 { --v: 0.51; }
.barra .v-52 { --v: 0.52; }
.barra .v-53 { --v: 0.53; }
.barra .v-54 { --v: 0.54; }
.barra .v-55 { --v: 0.55; }
.barra .v-56 { --v: 0.56; }
.barra .v-57 { --v: 0.57; }
.barra .v-58 { --v: 0.58; }
.barra .v-59 { --v: 0.59; }
.barra .v-60 { --v: 0.6; }
.barra .v-61 { --v: 0.61; }
.barra .v-62 { --v: 0.62; }
.barra .v-63 { --v: 0.63; }
.barra .v-64 { --v: 0.64; }
.barra .v-65 { --v: 0.65; }
.barra .v-66 { --v: 0.66; }
.barra .v-67 { --v: 0.67; }
.barra .v-68 { --v: 0.68; }
.barra .v-69 { --v: 0.69; }
.barra .v-70 { --v: 0.7; }
.barra .v-71 { --v: 0.71; }
.barra .v-72 { --v: 0.72; }
.barra .v-73 { --v: 0.73; }
.barra .v-74 { --v: 0.74; }
.barra .v-75 { --v: 0.75; }
.barra .v-76 { --v: 0.76; }
.barra .v-77 { --v: 0.77; }
.barra .v-78 { --v: 0.78; }
.barra .v-79 { --v: 0.79; }
.barra .v-80 { --v: 0.8; }
.barra .v-81 { --v: 0.81; }
.barra .v-82 { --v: 0.82; }
.barra .v-83 { --v: 0.83; }
.barra .v-84 { --v: 0.84; }
.barra .v-85 { --v: 0.85; }
.barra .v-86 { --v: 0.86; }
.barra .v-87 { --v: 0.87; }
.barra .v-88 { --v: 0.88; }
.barra .v-89 { --v: 0.89; }
.barra .v-90 { --v: 0.9; }
.barra .v-91 { --v: 0.91; }
.barra .v-92 { --v: 0.92; }
.barra .v-93 { --v: 0.93; }
.barra .v-94 { --v: 0.94; }
.barra .v-95 { --v: 0.95; }
.barra .v-96 { --v: 0.96; }
.barra .v-97 { --v: 0.97; }
.barra .v-98 { --v: 0.98; }
.barra .v-99 { --v: 0.99; }
.barra .v-100 { --v: 1; }
