:root {
  --verde: #1e3a2b; --verde2: #2f5d3a; --claro: #eef4ec; --fondo: #f6f8f5; --texto: #1f2a22; --suave: #66736a;
  --rojo: #b3261e; --ambar: #a86b00; --borde: #d8e2d4; --blanco: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto); font-size: 16px; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.barra { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--verde); color: #fff; }
.marca { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; flex: 1; }
.marca img { border-radius: 50%; }
#selLite { background: var(--verde2); color: #fff; border: 0; border-radius: 8px; padding: 6px 8px; font-size: 15px; }
.punto { width: 10px; height: 10px; border-radius: 50%; background: #bbb; }
.punto.on { background: #7ddc8a; } .punto.off { background: #e06c63; }
main { max-width: 640px; margin: 0 auto; padding: 12px 12px 40px; }
h1 { font-size: 22px; margin: 4px 0 10px; } h2 { font-size: 17px; margin: 18px 4px 8px; } h3 { font-size: 16px; margin: 0 0 8px; }
p { line-height: 1.45; }
.suave { color: var(--suave); } .pequeño { font-size: 13px; } .centro { text-align: center; } .grande { font-size: 19px; font-weight: 600; }
.tarjeta { background: var(--blanco); border: 1px solid var(--borde); border-radius: 14px; padding: 14px; margin: 10px 0; }
.form { display: grid; gap: 10px; text-align: left; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--suave); }
input, select { font: inherit; padding: 10px; border: 1px solid var(--borde); border-radius: 10px; background: #fff; color: var(--texto); width: 100%; }
.boton { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 11px 14px; background: var(--verde); color: #fff; cursor: pointer; }
.boton.secundario { background: var(--claro); color: var(--verde); } .boton.peligro { background: var(--rojo); }
.boton:disabled { opacity: .5; }
.error { color: var(--rojo); font-size: 14px; }
.pestañas { position: sticky; top: 50px; z-index: 4; display: flex; gap: 4px; overflow-x: auto; background: var(--fondo); padding: 6px 0; scrollbar-width: none; }
.pestañas button { flex: 1 1 0; min-width: 0; font: inherit; font-size: 13px; border: 1px solid var(--borde); background: #fff; color: var(--texto); padding: 8px 2px; border-radius: 20px; white-space: nowrap; }
.pestañas button.activa { background: var(--verde); color: #fff; border-color: var(--verde); }
.cabecera { display: flex; justify-content: space-between; align-items: center; margin: 8px 4px 4px; gap: 10px; }
.etiqueta { font-size: 13px; padding: 4px 10px; border-radius: 12px; background: #ddd; white-space: nowrap; }
.etiqueta.on { background: #d6f0d9; color: #1e6b2b; } .etiqueta.off { background: #f8dcd9; color: var(--rojo); }
.rejilla { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.medida { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 12px; }
.medida .n { color: var(--suave); font-size: 13px; } .medida .v { font-size: 30px; font-weight: 700; margin-top: 2px; } .medida .u { font-size: 15px; color: var(--suave); font-weight: 400; }
.medida.mal { border-color: var(--rojo); background: #fff6f5; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; } .acciones .boton { flex: 1 1 140px; }
.banda { background: #fff4e0; color: var(--ambar); border: 1px solid #f0d49a; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 6px 0; }
.alerta { background: #fdeceb; color: var(--rojo); border: 1px solid #f2c4bf; border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-weight: 600; font-size: 15px; }
.ok { background: var(--claro); color: var(--verde); border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-size: 15px; }
.enchufe { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.enchufe .num { width: 34px; height: 34px; border-radius: 50%; background: var(--claro); color: var(--verde); font-weight: 700; display: grid; place-items: center; }
.enchufe .num.on { background: var(--verde); color: #fff; }
.enchufe.mal { border-color: var(--rojo); background: #fff6f5; }
.enchufe.mal small { color: var(--rojo); font-weight: 600; }
.enchufe .w { font-weight: 600; text-align: right; min-width: 64px; } .enchufe .w small { display: block; font-weight: 400; color: var(--suave); font-size: 12px; }
.lista { list-style: none; padding: 0; margin: 0; } .lista li { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 10px 12px; margin: 6px 0; font-size: 15px; }
.lista li time { display: block; color: var(--suave); font-size: 12px; margin-bottom: 2px; }
.fila { display: flex; gap: 8px; margin: 8px 0; } .fila > * { flex: 1; }
.grafica { background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 8px; min-height: 240px; }
.grafica svg { width: 100%; height: auto; display: block; }
.grafica .eje { stroke: #d8e2d4; stroke-width: 1; } .grafica .linea { fill: none; stroke: var(--verde); stroke-width: 2; }
.grafica text { font-size: 11px; fill: var(--suave); }
details.seccion { background: #fff; border: 1px solid var(--borde); border-radius: 14px; margin: 8px 0; }
details.seccion > summary { padding: 13px 14px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.seccion > summary::after { content: "›"; transform: rotate(90deg); color: var(--suave); }
details.seccion[open] > summary::after { transform: rotate(-90deg); }
.ajuste { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--borde); }
.ajuste .nom { font-size: 15px; } .ajuste .lim { font-size: 12px; color: var(--suave); }
.ajuste input[type=number] { width: 96px; text-align: right; } .ajuste select { max-width: 190px; }
.ajuste.botonera { grid-template-columns: 1fr; }
.interruptor { position: relative; width: 50px; height: 30px; } .interruptor input { opacity: 0; width: 0; height: 0; }
.interruptor span { position: absolute; inset: 0; background: #c9d3c6; border-radius: 15px; transition: .2s; }
.interruptor span::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.interruptor input:checked + span { background: var(--verde2); } .interruptor input:checked + span::before { transform: translateX(20px); }
.guardar { font-size: 13px; padding: 6px 10px; }
.tostada { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #233; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: 14px; z-index: 10; max-width: 90vw; }
.grupo select { margin-top: 2px; }
.ajuste input.ip { width: 150px; }
/* v1.1 · Plantas */
.planta { background: #fff; border: 1px solid var(--borde); border-radius: 14px; margin: 8px 0; }
.planta.mia { border-color: var(--verde2); box-shadow: inset 4px 0 0 var(--verde2); }
.planta > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.planta > summary::-webkit-details-marker { display: none; }
.planta .pn { font-weight: 600; } .planta .pc { font-size: 12px; color: var(--suave); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--claro); color: var(--verde); white-space: nowrap; }
.chip.d3 { background: #fbe9d0; color: #8a4b00; } .chip.co2 { background: #e3ecfb; color: #234f9c; }
.tengo { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--verde2); color: var(--verde2); background: #fff; border-radius: 18px; padding: 6px 10px; white-space: nowrap; }
.tengo.si { background: var(--verde2); color: #fff; }
.ficha { padding: 0 12px 12px; font-size: 14px; }
.ficha dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; }
.ficha dt { color: var(--suave); } .ficha dd { margin: 0; }
.ficha p { margin: 6px 0; }
.ficha a { color: var(--verde2); font-weight: 600; }
.plan .linea { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--borde); font-size: 15px; }
.plan .linea:first-of-type { border-top: 0; } .plan .linea b { text-align: right; }
.plan .cambia { color: var(--ambar); }
.nota { background: #fff4e0; color: var(--ambar); border-radius: 10px; padding: 8px 10px; margin: 8px 0; font-size: 14px; }
.botones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; } .botones .boton { flex: 1 1 150px; font-size: 14px; }
/* v1.2 · Fauna */
.chip.enc.n0 { background: #d6f0d9; color: #1e6b2b; font-weight: 600; } .chip.enc.n1 { background: #fbe9d0; color: #8a4b00; font-weight: 600; } .chip.enc.n2 { background: #fdeceb; color: var(--rojo); font-weight: 600; }
.alerta.peq, .ok.peq { font-size: 14px; font-weight: 400; padding: 8px 10px; margin: 6px 0; }
.casilla { display: flex; gap: 8px; align-items: center; font-size: 14px; margin: 4px 2px 8px; color: var(--texto); }
.casilla input { width: auto; }
.pestañas button { flex: 1 0 auto; padding: 8px 11px; font-size: 13px; }
