:root {
  color-scheme: light;
  --caliche: #f3efe7; --piedra: #e8e1d3; --basalto: #16181b; --cobre: #c4622d; --cobre-profundo: #9a4a1f;
  --patina: #2e8f7c; --patina-profunda: #1f6f60; --borde: #c6c1b6; --borde-campo: #7a7468; --suave: #41423f;
  font: 100%/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--caliche); color: var(--basalto);
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0 }
a { color: var(--cobre-profundo); text-underline-offset: .2em }
header { border-bottom: 1px solid var(--borde) }
.franja, main, footer { width: min(74rem, calc(100% - 2rem)); margin: auto }
.franja { display: flex; justify-content: space-between; align-items: center; min-height: 4.5rem; gap: 1rem }
.marca { font-size: 1.5rem; font-weight: 650; letter-spacing: -.04em }
.marca span { font-size: .9rem; letter-spacing: .06em; border-left: 1px solid var(--borde); padding-left: .5rem }
main { padding: clamp(1.5rem, 5vw, 3rem) 0; min-height: 75vh }
footer { border-top: 1px solid var(--borde); padding: 1.5rem 0; font-size: .9rem }
h1, h2, h3, h4, p { margin: 0 0 .75rem; overflow-wrap: anywhere }
h1, h2, h3, h4 { letter-spacing: -.02em; line-height: 1.2 }
h1 { font-size: clamp(2rem, 4vw, 2.75rem) } h2 { font-size: 1.4rem } h3 { font-size: 1.15rem } h4 { font-size: 1.05rem }
.salto { position: absolute; transform: translateY(-120%); background: white; padding: .75rem }
.salto:focus { transform: none }
:focus-visible { outline: 3px solid var(--patina-profunda); outline-offset: 3px }
.oculto, .cuadro thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

button, select, input, textarea { font: inherit; color: inherit; border: 1px solid var(--borde-campo); border-radius: .75rem; min-height: 44px; padding: .6rem .9rem; max-width: 100% }
button { cursor: pointer; background: white; font-weight: 550; overflow-wrap: anywhere }
button:hover:enabled { border-color: var(--basalto); background: var(--piedra) }
button:disabled { cursor: default; opacity: .58 }
button.principal, a.boton.principal { color: white; background: var(--basalto); border: 1px solid var(--basalto); box-shadow: inset 0 -3px 0 var(--cobre) }
button.principal:hover:enabled, a.boton.principal:hover { background: #373737 }
button.secundario { font-weight: 500 }
a.boton { display: inline-flex; align-items: center; min-height: 44px; padding: .6rem 1.1rem; border-radius: .75rem; text-decoration: none; font-weight: 550; margin: .25rem 0 1rem }
.volver { display: inline-block; margin-bottom: 1rem }
input, select, textarea { background: white; width: min(100%, 32rem); display: block }
textarea { width: min(100%, 42rem); resize: vertical }
label { display: grid; gap: .25rem; margin: .75rem 0; font-weight: 550 }
label small { font-weight: 400; color: var(--suave) }
fieldset { border: 1px solid var(--piedra); border-radius: 1rem; padding: .5rem 1rem 1rem; margin: 1rem 0; min-width: 0; background: white }
fieldset.capa { background: transparent }
legend { font-size: 1.1rem; font-weight: 600; padding: 0 .5rem }

#aviso:not(:empty), .nota { padding: .75rem 1rem; border-inline-start: .25rem solid var(--patina); background: white; color: var(--suave) }
.nota-fija { padding: .75rem 1rem; border-inline-start: .25rem solid var(--basalto); background: white; margin: .75rem 0 1rem }
.error { color: var(--cobre-profundo); font-weight: 600 }
.error:empty { display: none }
.intro, .detalle { color: var(--suave) }
.detalle { font-size: .95rem; display: block }
.rotulo { font-weight: 600; margin: .75rem 0 .25rem }
.cifra { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em }
.alerta { color: var(--cobre-profundo); font-weight: 600 }
code { background: var(--piedra); border-radius: .4rem; padding: .1rem .4rem; font-size: .92em; overflow-wrap: anywhere }

.panel, .bloque { background: white; border: 1px solid var(--piedra); border-radius: 1rem; padding: clamp(1rem, 3vw, 1.5rem); margin: 1rem 0 }
.acceso { max-width: 32rem }
.control { min-height: 4rem; margin: .75rem 0 }
img.qr { width: min(15rem, 100%); background: white }
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem }
.rejilla .bloque { margin: 0 }
.lista-simple { list-style: none; margin: 0 0 1rem; padding: 0 }
.lista-simple li { display: grid; gap: .15rem; padding: .65rem 0; border-bottom: 1px solid var(--piedra) }
.lista-simple li:last-child { border-bottom: 0 }
.lista-simple strong { overflow-wrap: anywhere }

.etiqueta-estado { display: inline-block; width: fit-content; padding: .1rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--piedra); border: 1px solid var(--borde); color: var(--basalto) }
.etiqueta-estado.bueno, .etiqueta-estado.riesgo-bajo { background: #ddefea; color: var(--patina-profunda); border-color: #b7dcd3 }
.etiqueta-estado.atrasado, .etiqueta-estado.riesgo-alto { background: #f6e6db; color: var(--cobre-profundo); border-color: #e6c3ac }

progress { appearance: none; -webkit-appearance: none; width: 100%; max-width: 24rem; height: .75rem; border: 0; border-radius: 999px; background: var(--piedra); overflow: hidden; display: block; margin: .5rem 0 }
progress::-webkit-progress-bar { background: var(--piedra); border-radius: 999px }
progress::-webkit-progress-value { background: var(--patina-profunda); border-radius: 999px }
progress::-moz-progress-bar { background: var(--patina-profunda); border-radius: 999px }

.secciones { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0 0 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--borde) }
.secciones a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border: 1px solid transparent; border-radius: .75rem; color: var(--basalto); text-decoration: none; font-weight: 550 }
.secciones a:hover { border-color: var(--borde-campo) }
.secciones a[aria-current="page"] { background: var(--piedra); border-color: var(--basalto); font-weight: 650 }

.columnas { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; align-items: start }
.columna { background: var(--piedra); border-radius: 1rem; padding: .75rem; min-width: 0 }
.columna h2 { font-size: 1rem; margin-bottom: .6rem }
.tarjeta { display: grid; gap: .3rem; background: white; border: 1px solid var(--borde); border-radius: .75rem; padding: .75rem; margin: 0 0 .6rem; color: inherit; text-decoration: none; overflow-wrap: anywhere }
.tarjeta:hover { border-color: var(--basalto) }
.selector-etapa { display: none }

.formulario { max-width: 44rem }
.lista-editable ul { list-style: none; padding: 0; margin: 0 0 .5rem }
.lista-editable li { display: flex; gap: .5rem; align-items: center; margin: .4rem 0 }
.lista-editable li input { flex: 1; width: auto; min-width: 0 }
.resultado { background: var(--caliche); border-radius: .75rem; padding: .75rem 1rem; margin-top: .75rem }
.ficha { background: white; border: 1px solid var(--piedra); border-radius: 1rem; padding: .75rem 1.25rem; margin: .75rem 0 }
.ficha > summary { cursor: pointer; display: grid; gap: .15rem; min-height: 44px; align-content: center }
.ficha[open] > summary { margin-bottom: .75rem }

.instrucciones { background: var(--caliche); border-radius: .75rem; padding: .75rem 1rem }
.instrucciones ol { margin: 0 0 .5rem; padding-left: 1.3rem }
.barra-empresa { display: grid; gap: .25rem; margin-bottom: 1rem }
.sala-grupo { border-top: 1px solid var(--piedra); padding: .5rem 0 }
.sala-grupo > .interruptor { font-weight: 650 }
.agentes-grupo { display: flex; flex-wrap: wrap; gap: 0 1.5rem; padding-left: 3.5rem }
.interruptor { display: flex; align-items: center; gap: .75rem; min-height: 44px; margin: 0; cursor: pointer }
.interruptor input { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 2.75rem; min-height: 0; height: 1.6rem; padding: 0; border-radius: 999px; background: #d9d3c6; cursor: pointer; transition: background .15s }
.interruptor input::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: white; border: 1px solid var(--borde-campo); transition: transform .15s }
.interruptor input:checked { background: var(--patina-profunda); border-color: var(--patina-profunda) }
.interruptor input:checked::after { transform: translateX(1.15rem); border-color: white }

.capa > h2 { margin-top: 1.5rem }
.sala { margin: 0 0 1rem }
.agente { background: white; border: 1px solid var(--piedra); border-radius: 1rem; padding: 1rem 1.25rem; margin: .75rem 0 }
.agente .encabezado { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem }
.agente .encabezado h4 { margin: 0 .5rem 0 0 }
.agente ul { margin: 0 0 .5rem; padding-left: 1.2rem }
.subtitulo { margin-top: .5rem }

table.cuadro { width: 100%; border-collapse: collapse; text-align: left; background: white; border: 1px solid var(--piedra); border-radius: 1rem }
.cuadro th, .cuadro td { padding: .65rem; border-bottom: 1px solid var(--piedra); vertical-align: top; font-variant-numeric: tabular-nums }

@media (max-width: 719.98px) {
  main { padding-bottom: 7rem }
  .secciones { position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin: 0; padding: 0 0 env(safe-area-inset-bottom); background: var(--caliche); border-top: 1px solid var(--borde); border-bottom: 0 }
  .secciones a { justify-content: center; text-align: center; min-height: 56px; padding: .25rem .1rem; border-radius: 0; font-size: clamp(.68rem, 2.9vw, .8rem); letter-spacing: -.01em; overflow-wrap: anywhere }
  .secciones a[aria-current="page"] { border: 0; border-top: 3px solid var(--basalto) }
  .selector-etapa { display: grid }
  .columna[data-activa="no"] { display: none }
  .agentes-grupo { padding-left: 0 }
  .lista-editable li { flex-wrap: wrap }
  table.cuadro, .cuadro tbody, .cuadro tr, .cuadro th, .cuadro td { display: block }
  table.cuadro { border: 0; background: transparent }
  .cuadro tr { background: white; border: 1px solid var(--piedra); border-radius: 1rem; padding: .75rem 1rem; margin: 0 0 .75rem }
  .cuadro th[scope="row"] { padding: 0 0 .4rem; border: 0; font-size: 1.05rem }
  .cuadro td { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: right }
  .cuadro td::before { content: attr(data-etiqueta); font-weight: 600; color: var(--suave); text-align: left }
}
