:root {
  --navy: #020933;
  --bg: #030b2e;
  --card: #0c1742;
  --card-2: #101e52;
  --line: #1f2d66;
  --ink: #eef2ff;
  --ink-2: #b4bfe6;
  --muted: #8592c4;
  --accent: #36a3ff;
  --water: #2a8cff;
  --good: #0ca30c;
  --good-ink: #4bd36b;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --crit-ink: #ff7b7b;
  --s1: #3987e5;   /* série 1: caixa elétrica */
  --s2: #d95926;   /* série 2: ambiente */
  --dry: #c98a3a;
  --wet: #2fbf8f;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Lexend', system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 85% -10%, #12307a55, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #0b5fd122, transparent 60%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
button { font: inherit; cursor: pointer; }

/* ---------- botões ---------- */
.btn { border: 0; border-radius: 12px; padding: .7rem 1.1rem; font-weight: 500; color: var(--ink); background: var(--card-2); transition: transform .15s, filter .15s; }
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, #2a8cff, #1757d6); }
.btn.danger { background: linear-gradient(135deg, #e04848, #a82424); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; fill: var(--ink-2); }
.icon-btn:hover svg { fill: var(--ink); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(400px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 32px 28px; text-align: center; box-shadow: 0 30px 80px #0008; animation: rise .5s ease-out; }
.login-logo { width: 72px; height: 72px; margin-bottom: 8px; }
.login-card h1 { font-size: 1.6rem; }
.login-card form { display: grid; gap: 14px; margin-top: 22px; text-align: left; }
label { display: grid; gap: 6px; font-size: .85rem; color: var(--ink-2); }
input { font: inherit; color: var(--ink); background: #071039; border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.form-error { color: var(--crit-ink); min-height: 1.2em; margin: 0; font-size: .85rem; }
.by { margin-top: 22px; font-size: .75rem; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- topo ---------- */
#app { max-width: 1440px; margin: 0 auto; padding: 16px 16px 32px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { width: 44px; height: 44px; }
.brand strong { display: block; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand span { font-size: .72rem; color: var(--muted); letter-spacing: .04em; }
.top-right { display: flex; align-items: center; gap: 8px; }
.conn { display: flex; align-items: center; gap: 8px; padding: .45rem .8rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .82rem; white-space: nowrap; }
.conn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.conn.on .dot { background: var(--good-ink); box-shadow: 0 0 0 0 #4bd36b88; animation: pulse 2s infinite; }
.conn.off .dot { background: var(--critical); }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px #4bd36b00; } 100% { box-shadow: 0 0 0 0 #4bd36b00; } }
.rssi { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.rssi i { width: 3px; background: var(--line); border-radius: 1px; }
.rssi i.on { background: var(--ink-2); }

/* ---------- alertas ---------- */
.alerts { display: grid; gap: 8px; margin-bottom: 14px; }
.alert { display: flex; align-items: center; gap: 10px; padding: .75rem 1rem; border-radius: 14px; font-weight: 500; animation: rise .3s ease-out; }
.alert svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.alert.critical { background: #d03b3b26; border: 1px solid #d03b3b; color: #ffb3b3; animation: rise .3s, blink 1.6s infinite; }
.alert.warning { background: #fab21920; border: 1px solid #fab21999; color: #ffd98a; }
@keyframes blink { 50% { background: #d03b3b40; } }

/* ---------- cartões ---------- */
.card { background: linear-gradient(180deg, var(--card), #0a143b); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h h2 { font-size: 1rem; letter-spacing: .01em; }
.chip { font-size: .75rem; padding: .25rem .65rem; border-radius: 999px; background: var(--card-2); color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.chip.good { background: #0ca30c22; color: var(--good-ink); }
.chip.warning { background: #fab21922; color: #ffd98a; }
.chip.critical { background: #d03b3b2a; color: var(--crit-ink); }
.chip.info { background: #2a8cff22; color: #8cc6ff; }
.grid-top { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-bottom { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 1100px) { .grid-top { grid-template-columns: 1fr 1fr; } .tank-card { grid-row: span 2; } }
@media (max-width: 760px) { .grid-top, .grid-bottom { grid-template-columns: 1fr; } .tank-card { grid-row: auto; } }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.kv div { background: #071039; border-radius: 12px; padding: .55rem .7rem; }
.kv dt { font-size: .7rem; color: var(--muted); }
.kv dd { margin: 2px 0 0; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- tanque ---------- */
.tank-wrap { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tank-svg { width: 100%; max-height: 330px; }
.tank-body { fill: #06123d; stroke: #2b4aa8; stroke-width: 3; }
.tank-outline { stroke: #5b7fe6; stroke-width: 2; }
.water { transform: translateY(270px); transition: transform 1.6s cubic-bezier(.2,.8,.2,1); }
.wave path { fill: url(#waterGrad); }
.wave-back path { opacity: .5; }
.wave-back { animation: waveMove 7s linear infinite; }
.wave-front { animation: waveMove 4.5s linear infinite reverse; }
@keyframes waveMove { from { transform: translateX(0); } to { transform: translateX(-120px); } }
.bubbles circle { fill: #ffffff55; animation: bubble 5s ease-in infinite; }
.bubbles circle:nth-child(2) { animation-delay: 1.2s; animation-duration: 6s; }
.bubbles circle:nth-child(3) { animation-delay: 2.4s; }
.bubbles circle:nth-child(4) { animation-delay: 3.1s; animation-duration: 4.2s; }
.bubbles circle:nth-child(5) { animation-delay: .6s; animation-duration: 7s; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-200px); opacity: 0; } }
.tank-svg.empty .tank-body { stroke: var(--critical); animation: emptyPulse 1.2s infinite; }
@keyframes emptyPulse { 50% { stroke-width: 6; } }
.tank-pct { fill: #fff; font-size: 38px; font-weight: 700; text-anchor: middle; paint-order: stroke; stroke: #02093388; stroke-width: 4; font-variant-numeric: tabular-nums; }
.tank-l { fill: #dbe6ff; font-size: 15px; text-anchor: middle; paint-order: stroke; stroke: #02093388; stroke-width: 3; }
.ticks line { stroke: #3b55a8; stroke-width: 2; }
.ticks text { fill: var(--muted); font-size: 10px; }
.sensor-box { fill: #1a2a66; stroke: #5b7fe6; stroke-width: 1.5; }
.sensor-eye { fill: #9fb4ff; }
.ping path { fill: none; stroke: #8cc6ff; stroke-width: 2; opacity: 0; }
.ping.on path { animation: ping 1.8s ease-out infinite; }
.ping.on path:nth-child(2) { animation-delay: .25s; }
.ping.on path:nth-child(3) { animation-delay: .5s; }
@keyframes ping { 0% { opacity: 0; transform: translateY(-6px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(14px); } }
.float line { stroke: #5b7fe6; stroke-width: 2; }
.float circle { fill: var(--card-2); stroke: var(--muted); stroke-width: 2; transition: fill .4s; }
.float text { fill: var(--muted); font-size: 9px; text-anchor: middle; }
.float.ok circle { fill: var(--good); stroke: var(--good-ink); }
.float.alarm circle { fill: var(--critical); stroke: var(--crit-ink); animation: emptyPulse 1s infinite; }
.float.limit circle { fill: var(--warning); stroke: #ffd98a; }

/* canos e fluxo */
.pipe { stroke: #22336f; stroke-width: 10; stroke-linecap: round; fill: none; }
.pipe-flow { stroke: #4fb3ff; stroke-width: 4; stroke-linecap: round; fill: none; stroke-dasharray: 6 10; opacity: 0; transition: opacity .4s; }
.pipe-flow.on { opacity: 1; animation: flow .6s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -16; } }

/* ---------- bomba ---------- */
.pump-stage { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 8px; }
.pump-svg { width: 100%; }
.pump-body { fill: #0a1850; stroke: #2b4aa8; stroke-width: 4; }
.impeller { transform-origin: 110px 90px; fill: #5b7fe6; }
.impeller.on { fill: #4fb3ff; animation: spin .5s linear infinite; }
.impeller.rest { fill: #fab219aa; }
@keyframes spin { to { transform: rotate(360deg); } }
.pump-ring { fill: none; stroke: transparent; stroke-width: 3; }
.pump-ring.on { stroke: #4fb3ff; animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { stroke-width: 8; stroke: #4fb3ff55; } }
.ring-wrap { position: relative; width: 100%; max-width: 150px; justify-self: center; }
.ring { width: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #16245c; stroke-width: 10; }
.ring-fg { fill: none; stroke: url(#none); stroke: var(--accent); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray 1s linear; }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-text strong { font-size: 1.05rem; }
.ring-text span { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mode-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--ink); font-size: .9rem; }
.switch input { position: absolute; opacity: 0; }
.slider { width: 46px; height: 26px; border-radius: 999px; background: #1a2766; position: relative; transition: background .25s; }
.slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s; }
.switch input:checked + .slider { background: var(--good); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); }
.pending { display: grid; gap: 6px; margin-top: 8px; }
.pending div { font-size: .78rem; color: #8cc6ff; display: flex; gap: 8px; align-items: center; }
.pending div::before { content: ''; width: 12px; height: 12px; border: 2px solid #8cc6ff; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- ambiente ---------- */
.temps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.temp { display: flex; gap: 10px; align-items: center; background: #071039; border-radius: 14px; padding: .7rem; }
.thermo { width: 22px; height: 48px; flex: none; }
.thermo rect:first-child, .thermo circle { fill: #1a2766; }
.thermo .merc { transition: y 1s, height 1s, fill .6s; fill: var(--s1); }
#tAmbCard .merc { fill: var(--s2); }
#tAmbCard .thermo circle { fill: var(--s2); }
#tBoxCard .thermo circle { fill: var(--s1); }
.temp .label { display: block; font-size: .7rem; color: var(--muted); }
.temp strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.temp .sub { display: block; font-size: .72rem; color: var(--ink-2); }
.temp.hot strong { color: var(--crit-ink); }
.security { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.sec { background: #071039; border-radius: 14px; padding: .7rem .5rem; display: grid; justify-items: center; gap: 4px; text-align: center; }
.sec svg { width: 34px; height: 34px; }
.sec span { font-size: .7rem; color: var(--muted); }
.sec b { font-size: .8rem; font-weight: 600; }
.door-frame { fill: none; stroke: #5b7fe6; stroke-width: 1.5; }
.door-leaf { fill: #2b4aa8; transform-origin: 5px 12px; transition: transform .6s; }
.sec circle { fill: #fff; }
.sec.open .door-leaf { transform: perspective(40px) rotateY(55deg); fill: var(--warning); }
.sec.open b { color: #ffd98a; }
.sec.closed b { color: var(--good-ink); }
.radar { width: 34px; height: 34px; position: relative; border-radius: 50%; background: #1a2766; }
.radar i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; }
.sec.motion .radar { background: #fab21944; }
.sec.motion .radar i { border-color: var(--warning); animation: radar 1.5s ease-out infinite; }
.sec.motion .radar i:nth-child(2) { animation-delay: .5s; }
.sec.motion .radar i:nth-child(3) { animation-delay: 1s; }
.sec.motion b { color: #ffd98a; }
@keyframes radar { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* ---------- zonas ---------- */
.legend-inline { display: flex; gap: 12px; flex-wrap: wrap; font-size: .75rem; color: var(--ink-2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.lg-dry { background: var(--dry); } .lg-wet { background: var(--wet); } .lg-on { background: var(--water); } .lg-off { background: #3a4677; }
.main-pipe { height: 10px; border-radius: 6px; background: #16245c; margin: 0 6px 12px; position: relative; overflow: hidden; }
.main-pipe-flow { position: absolute; inset: 2px 0; opacity: 0; background: repeating-linear-gradient(90deg, #4fb3ff 0 10px, transparent 10px 22px); background-size: 22px 100%; transition: opacity .4s; }
.main-pipe-flow.on { opacity: 1; animation: pipeFlow .5s linear infinite; }
@keyframes pipeFlow { to { background-position: 22px 0; } }
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.zone { position: relative; border-radius: 16px; background: #071039; border: 1px solid var(--line); overflow: hidden; min-height: 168px; display: flex; flex-direction: column; transition: border-color .4s, transform .2s, box-shadow .4s; }
.zone:hover { transform: translateY(-2px); }
.zone .soil { position: absolute; inset: auto 0 0 0; height: 0; transition: height 1.4s cubic-bezier(.2,.8,.2,1), background .8s; background: linear-gradient(180deg, #2fbf8f66, #2fbf8f22); }
.zone.dry .soil { background: linear-gradient(180deg, #c98a3a66, #c98a3a1c); }
.zone .soil::before { content: ''; position: absolute; left: 0; right: 0; top: -6px; height: 12px; background: radial-gradient(circle at 10px -2px, transparent 8px, currentColor 9px) repeat-x; background-size: 20px 12px; color: inherit; opacity: .0; }
.zone .z-body { position: relative; padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.zone .z-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.zone .z-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone .z-num { font-size: .68rem; color: var(--muted); }
.zone .z-pct { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.zone .z-pct small { font-size: .8rem; font-weight: 400; color: var(--ink-2); }
.zone .z-mv { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.zone .z-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.zone .z-btn { border: 1px solid #2a8cff66; background: #2a8cff1a; color: #8cc6ff; border-radius: 10px; padding: .3rem .6rem; font-size: .75rem; }
.zone .z-btn:hover { background: #2a8cff33; }
.zone .z-btn:disabled { opacity: .35; cursor: not-allowed; }
.zone .plant { position: absolute; right: 8px; top: 34px; width: 38px; height: 38px; opacity: .9; transform-origin: bottom center; }
.zone.dry .plant { animation: wilt 3s ease-in-out infinite; }
.zone.wet .plant, .zone.on .plant { animation: sway 4s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(4deg); } }
@keyframes wilt { 50% { transform: rotate(-6deg) scaleY(.94); } }
.zone.on { border-color: var(--water); box-shadow: 0 0 0 1px var(--water), 0 0 30px #2a8cff44; }
.zone.off { opacity: .55; }
.zone.off .soil { height: 0 !important; }
.zone .feed { position: absolute; top: 0; left: 50%; width: 4px; height: 12px; background: #16245c; transform: translateX(-50%); }
.zone.on .feed { background: repeating-linear-gradient(180deg, #4fb3ff 0 4px, transparent 4px 8px); animation: feed .4s linear infinite; }
@keyframes feed { to { background-position: 0 8px; } }
.rain { position: absolute; inset: 0; pointer-events: none; overflow: hidden; display: none; }
.zone.on .rain { display: block; }
.rain i { position: absolute; top: -12px; width: 2px; height: 12px; border-radius: 2px; background: linear-gradient(180deg, transparent, #8cc6ff); animation: drop 1s linear infinite; }
@keyframes drop { to { transform: translateY(200px); } }
.z-status { font-size: .68rem; padding: .18rem .5rem; border-radius: 999px; font-weight: 600; letter-spacing: .02em; }
.z-status.dry { background: #c98a3a33; color: #f0bd7a; }
.z-status.wet { background: #2fbf8f2a; color: #6be0b6; }
.z-status.on { background: #2a8cff33; color: #9dd0ff; }
.z-status.wait { background: #6250d633; color: #b9b0ff; }
.z-status.off { background: #3a467755; color: var(--muted); }

/* ---------- gráficos ---------- */
.seg { display: inline-flex; background: #071039; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: .3rem .65rem; border-radius: 8px; font-size: .78rem; }
.seg button.on { background: var(--card-2); color: var(--ink); }
.chart-block { margin-top: 6px; }
.chart-block h3 { font-size: .8rem; color: var(--ink-2); font-weight: 500; margin: 6px 0; }
.chart { position: relative; height: 170px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid line { stroke: #1b2963; stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 10px; font-family: Lexend, sans-serif; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .18; }
.chart .cross { stroke: #8592c4; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--card); stroke-width: 2; }
.chart .end-label { font-size: 11px; fill: var(--ink-2); font-family: Lexend, sans-serif; }
.chart .empty { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.chart-legend { display: flex; gap: 14px; font-size: .75rem; color: var(--ink-2); margin-bottom: 4px; }
.chart-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tip { position: absolute; pointer-events: none; background: #020933ee; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .6rem; font-size: .75rem; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; }
.tip b { font-variant-numeric: tabular-nums; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.table-view { margin-top: 10px; font-size: .8rem; }
.table-view summary { cursor: pointer; color: var(--ink-2); }
.table-view table { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { text-align: left; padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.table-view th { color: var(--muted); font-weight: 500; }
.table-view > div { max-height: 260px; overflow: auto; }

/* ---------- eventos ---------- */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 470px; overflow: auto; }
.events li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: .5rem .55rem; border-radius: 12px; background: #071039; animation: rise .35s ease-out; }
.events .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .8rem; }
.events .ic svg { width: 15px; height: 15px; fill: currentColor; }
.events .ok .ic { background: #0ca30c22; color: var(--good-ink); }
.events .info .ic { background: #2a8cff22; color: #8cc6ff; }
.events .warning .ic { background: #fab21922; color: #ffd98a; }
.events .critical .ic { background: #d03b3b2a; color: var(--crit-ink); }
.events p { margin: 0; font-size: .84rem; }
.events time { font-size: .7rem; color: var(--muted); }

/* ---------- diálogos ---------- */
.dlg { border: 1px solid var(--line); border-radius: 20px; background: var(--card); color: var(--ink); padding: 22px; width: min(420px, calc(100vw - 32px)); }
.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.dlg::backdrop { background: #020933cc; backdrop-filter: blur(3px); }
.dlg h3 { margin-bottom: 6px; }
.dlg form { display: grid; gap: 12px; }
.dur { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.dur button { border: 1px solid #2a8cff66; background: #2a8cff1a; color: #cfe6ff; border-radius: 12px; padding: .8rem; font-weight: 600; }
.dur button:hover { background: #2a8cff40; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0; }
legend { padding: 0 6px; color: var(--ink-2); font-size: .85rem; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) { .row3 { grid-template-columns: 1fr; } }
.zone-names { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); visibility: hidden; background: #0f1d55; border: 1px solid var(--line); padding: .7rem 1rem; border-radius: 12px; transition: transform .3s; z-index: 10; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }
.toast.err { border-color: var(--critical); }
.foot { text-align: center; font-size: .72rem; color: var(--muted); margin-top: 24px; }

@media (max-width: 520px) {
  .conn #connText { display: none; }
  .pump-stage { grid-template-columns: 1fr 1fr; }
  .temps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
