:root {
  --azul: #1f4e79;
  --amarillo: #fff2cc;
  --borde: #d0d7de;
  --texto: #1b1f24;
  --ok: #1a7f37;
  --alerta: #9a6700;
}
* { box-sizing: border-box; }
/* `hidden` siempre gana (si no, `label { display:flex }` lo anulaba y se veían campos escondidos) */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: #f6f8fa;
}
header {
  background: var(--azul);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
}
header h1 { font-size: 1.05rem; margin: 0; }
.pill {
  font-size: .72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .2);
}
.pill.online { background: var(--ok); }
.pill.offline { background: #cf222e; }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; font-size: .85rem; gap: 4px; font-weight: 600; }
.req { color: #cf222e; }
input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: 10px;
  border: 1px solid var(--borde);
  border-radius: 8px;
  background: #fff;
  font-weight: 400;
}
.fila { display: flex; gap: 12px; }
/* min-width:0 → los 2 campos se reparten el ancho; sin esto el input no se achica y la
   página queda más ancha que el celular (se arrastraba hacia el lado). */
.fila label { flex: 1; min-width: 0; }
input, select { min-width: 0; width: 100%; }
button {
  font-size: 1rem;
  font-weight: 600;
  padding: 13px;
  border: 0;
  border-radius: 8px;
  background: var(--azul);
  color: #fff;
}
button:active { opacity: .85; }
.mensaje { margin-top: 14px; padding: 12px; border-radius: 8px; font-size: .9rem; }
.mensaje.ok { background: #dafbe1; color: var(--ok); }
.mensaje.alerta { background: var(--amarillo); color: var(--alerta); }
.mensaje.error { background: #ffebe9; color: #cf222e; }
#pendientes-box { margin-top: 20px; padding: 12px; background: #fff; border: 1px solid var(--borde); border-radius: 8px; }
#pendientes-box h2 { font-size: .9rem; margin: 0 0 8px; }

/* ===================== Terreno: simple a propósito =====================
   Lo usan operadores en faena (sol, guantes, apuro). Reglas:
   - una columna, botones grandes (>= 56 px), palabras simples;
   - lo que el sistema ya sabe se completa solo; lo opcional va en "Más datos";
   - al terminar, una pantalla clara de "Listo" que vuelve a la máquina. */
:root { --rojo: #cf222e; --verde-claro: #dafbe1; }
.maquina { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 16px; margin-bottom: 16px; }
.maquina .nom { font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.maquina .pat { color: #57606a; font-size: .95rem; margin-top: 2px; }
.maquina .cambiar { font-size: .85rem; margin-top: 6px; display: inline-block; }
.estado { margin-top: 12px; padding: 12px; border-radius: 10px; font-weight: 600; font-size: .95rem; line-height: 1.35; }
.estado.no_apta { background: #ffebe9; color: var(--rojo); }
.estado.observaciones { background: var(--amarillo); color: var(--alerta); }
.estado.apta { background: var(--verde-claro); color: var(--ok); }
.estado small { display: block; font-weight: 400; margin-top: 4px; }
.opciones { display: flex; flex-direction: column; gap: 12px; }
.opcion { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 14px 18px; border-radius: 14px;
  background: #fff; border: 2px solid var(--borde); color: var(--texto); text-decoration: none; font-size: 1.15rem; font-weight: 700; }
.opcion .ico { font-size: 1.9rem; width: 40px; text-align: center; }
.opcion small { display: block; font-size: .85rem; font-weight: 400; color: #57606a; margin-top: 2px; }
.opcion.principal { border-color: var(--azul); }
.opcion:active { background: #eef3f8; }
.secundario { text-align: center; margin-top: 18px; font-size: .9rem; }
.grande input, input.grande { font-size: 1.6rem; padding: 14px; text-align: center; font-weight: 600; }
button.enviar-grande { min-height: 58px; font-size: 1.15rem; }
.sino { display: flex; gap: 12px; }
.sino button { flex: 1; min-height: 64px; font-size: 1.05rem; background: #fff; color: var(--texto); border: 2px solid var(--borde); }
.sino button[aria-pressed="true"].si { border-color: var(--ok); background: var(--verde-claro); color: var(--ok); }
.sino button[aria-pressed="true"].no { border-color: var(--rojo); background: #ffebe9; color: var(--rojo); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { background: #fff; color: var(--texto); border: 2px solid var(--borde); padding: 10px 14px; font-weight: 600; font-size: .95rem; }
.chips button[aria-pressed="true"] { border-color: var(--azul); background: #eef3f8; color: var(--azul); }
details.mas { background: #fff; border: 1px solid var(--borde); border-radius: 10px; padding: 0 12px; }
details.mas summary { padding: 14px 0; font-weight: 600; color: var(--azul); cursor: pointer; list-style: none; }
details.mas summary::before { content: "＋ "; }
details.mas[open] summary::before { content: "－ "; }
details.mas > div { display: flex; flex-direction: column; gap: 12px; padding-bottom: 14px; }
#quien { margin: 10px auto 0; max-width: 560px; color: #57606a; font-size: .9rem; }
textarea { resize: vertical; min-height: 64px; }
.foto-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 2px dashed var(--borde);
  border-radius: 10px; background: #fff; font-weight: 600; color: var(--azul); }
.foto-btn input { display: none; }
.foto-btn.lista { border-style: solid; border-color: var(--ok); color: var(--ok); }
.listo { text-align: center; padding: 28px 12px; }
.listo .gran-ico { font-size: 4rem; line-height: 1; }
.listo h2 { margin: 12px 0 6px; font-size: 1.4rem; }
.listo p { margin: 0 0 22px; color: #57606a; line-height: 1.4; white-space: pre-line; }
.listo .acciones { display: flex; flex-direction: column; gap: 10px; }
.listo .acciones a { display: block; padding: 15px; border-radius: 10px; background: var(--azul); color: #fff; font-weight: 700; text-decoration: none; }
.listo .acciones a.sec { background: #fff; color: var(--azul); border: 1px solid var(--azul); }
.volver { display: inline-block; margin-bottom: 12px; font-size: .95rem; text-decoration: none; font-weight: 600; }
