.ayuda { position: fixed; top: 4.75rem; right: clamp(1rem, 4vw, 2.5rem); z-index: 21; width: min(21rem, calc(100% - 2rem)); display: flex; flex-direction: column; gap: .5rem; padding: 1rem 1.15rem 1.1rem; background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; box-shadow: 0 12px 32px rgb(31 35 64 / 12%); }
.ayuda-cabecera { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.ayuda h2 { font-size: 1.05rem; }
.ayuda ul { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .35rem; color: var(--tenue); }
dialog { padding: 0; color: var(--tinta); background: var(--superficie); border: 1px solid var(--borde); border-radius: 12px; box-shadow: 0 16px 40px rgb(31 35 64 / 14%); }
dialog::backdrop { background: rgb(31 35 64 / 40%); }
.dialogo-matriz[open] { width: min(52rem, calc(100% - 2rem)); max-height: min(42rem, 90vh); display: flex; flex-direction: column; overflow: hidden; }
.dialogo-cabecera { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--linea); }
.dialogo-cabecera h2 { font-size: 1.3rem; }
.dialogo-cabecera p { margin-top: .2rem; color: var(--tenue); font-size: .95rem; }
.contenedor-matriz { flex: 1; min-height: 0; overflow: auto; padding: .5rem; }
.matriz { width: 100%; min-width: 30rem; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.matriz th { position: sticky; padding: .4rem .1rem; background: var(--suave); font-weight: 700; }
.matriz thead th { top: 0; z-index: 2; border-bottom: 1px solid var(--borde); }
.matriz tbody th, .matriz .esquina { left: 0; width: 3.25rem; border-right: 1px solid var(--borde); }
.matriz tbody th { z-index: 1; border-bottom: 1px solid #efeae0; }
.matriz .esquina { z-index: 3; font-size: .8rem; color: var(--tenue); white-space: nowrap; }
.matriz td { padding: 2px; text-align: center; border-bottom: 1px solid #efeae0; }
.matriz td.diagonal { background: #f7f4ee; color: #8a8699; }
.matriz input { width: 100%; min-width: 0; height: 2.1rem; padding: 0; text-align: center; border-radius: 5px; border: 1px solid var(--control); background: var(--superficie); font-size: .9rem; }
.matriz input[aria-invalid="true"] { border-color: var(--error); background: #fdecea; }
.dialogo-pie { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .85rem 1.25rem; border-top: 1px solid var(--linea); }
#mensaje-matriz { font-weight: 700; color: var(--tenue); }
#mensaje-matriz.con-error { color: var(--error); }
.dialogo-confirmar[open] { width: min(28rem, calc(100% - 2rem)); display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; }
.dialogo-confirmar h2 { font-size: 1.4rem; }
.dialogo-confirmar p { color: var(--tenue); }
