/* Вилла Нирвана — приложение (PWA). Тёмная тема по макету 1B / 2E / «Давление». */

@font-face{font-family:Onest;font-weight:400;font-display:swap;src:url(fonts/onest-cyrillic-400-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Onest;font-weight:400;font-display:swap;src:url(fonts/onest-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Onest;font-weight:500;font-display:swap;src:url(fonts/onest-cyrillic-500-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Onest;font-weight:500;font-display:swap;src:url(fonts/onest-latin-500-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Onest;font-weight:600;font-display:swap;src:url(fonts/onest-cyrillic-600-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Onest;font-weight:600;font-display:swap;src:url(fonts/onest-latin-600-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Onest;font-weight:700;font-display:swap;src:url(fonts/onest-cyrillic-700-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Onest;font-weight:700;font-display:swap;src:url(fonts/onest-latin-700-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Cormorant Garamond";font-weight:600;font-display:swap;src:url(fonts/cormorant-garamond-cyrillic-600-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Cormorant Garamond";font-weight:600;font-display:swap;src:url(fonts/cormorant-garamond-latin-600-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root{
  --bg:#0D1110; --ink:#FFFFFF; --ink2:#D7DDD9; --ink3:#AEB6B2;
  --accent:#E2B672; --ok:#5CC48D; --warn:#F0A64B; --warn-deep:#C26A00; --crit:#E0483B; --crit-deep:#8C1A13; --off:#8A938F;
  --hot:#F07A45; --cold:#4F8FD6;
  --st:env(safe-area-inset-top,0px); --sb:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);font-family:Onest,system-ui,-apple-system,sans-serif;font-variant-numeric:tabular-nums;-webkit-font-smoothing:antialiased;overscroll-behavior:none}
button{font-family:inherit;color:inherit;cursor:pointer}
a{color:inherit;text-decoration:none}
.serif{font-family:"Cormorant Garamond",Georgia,serif;font-weight:600}
.ico-inline{width:16px;height:16px;vertical-align:-3px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

#app{position:relative;max-width:480px;min-height:100%;height:100dvh;margin:0 auto;overflow:hidden}
.screen{position:absolute;inset:0;overflow:hidden}
.screen.scroll{overflow-y:auto;-webkit-overflow-scrolling:touch}
.fade-in{animation:fade .25s ease-out}
@keyframes fade{from{opacity:0}to{opacity:1}}

/* Стекло. Слабые Android без backdrop-filter получают непрозрачные плашки. */
.glass{background:rgba(18,22,21,.42);-webkit-backdrop-filter:blur(24px) saturate(160%);backdrop-filter:blur(24px) saturate(160%);border:1px solid rgba(255,255,255,.15);box-shadow:inset 0 1px 0 rgba(255,255,255,.12)}
.sheet{background:rgba(22,27,25,.78);-webkit-backdrop-filter:blur(30px) saturate(160%);backdrop-filter:blur(30px) saturate(160%);border:1px solid rgba(255,255,255,.16)}
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .glass{background:rgba(24,30,28,.92)} .sheet{background:#1A201E}
}
html.lite .glass{background:rgba(24,30,28,.92);backdrop-filter:none;-webkit-backdrop-filter:none}

/* Фон */
.bg-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.bg-blur{filter:blur(28px) saturate(120%);transform:scale(1.25)}
.dim{position:absolute;inset:0;background:rgba(8,11,10,.64)}
.grad-top{position:absolute;inset:0;background:linear-gradient(180deg,rgba(8,11,10,.72) 0%,rgba(8,11,10,0) 34%)}
.grad-bot{position:absolute;inset:0;background:linear-gradient(180deg,rgba(8,11,10,0) 42%,rgba(8,11,10,.85) 100%)}

/* Главный */
.head{position:absolute;left:20px;right:20px;top:calc(var(--st) + 16px);display:flex;align-items:flex-start;justify-content:space-between}
.brand{font-size:12px;font-weight:600;letter-spacing:1.6px;color:var(--accent)}
.title{font-size:42px;line-height:1;margin-top:4px}
.pill{display:inline-flex;align-items:center;gap:8px;height:30px;padding:0 12px;border-radius:15px;font-size:13px;color:#E8ECE9;margin-top:10px}
.dot{width:8px;height:8px;border-radius:4px;flex-shrink:0}
.dot.ok{background:var(--ok)} .dot.warn{background:var(--warn)} .dot.crit{background:var(--crit)} .dot.offline,.dot.none{background:var(--off)}
.live{animation:pulse 2.4s ease-out infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(92,196,141,.55)}70%{box-shadow:0 0 0 10px rgba(92,196,141,0)}100%{box-shadow:0 0 0 0 rgba(92,196,141,0)}}
.round-btn{width:44px;height:44px;border-radius:22px;display:flex;align-items:center;justify-content:center;padding:0}
.round-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.main-bottom{position:absolute;left:16px;right:16px;bottom:calc(var(--sb) + 104px);display:flex;flex-direction:column;gap:10px}
.status-card{border-radius:26px;padding:16px 18px;display:flex;flex-direction:column;gap:12px;text-align:left;width:100%}
.status-row{display:flex;align-items:center;gap:12px}
.status-badge{width:40px;height:40px;border-radius:13px;display:flex;align-items:center;justify-content:center;color:#0D1110;flex-shrink:0}
.status-badge svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.st-ok .status-badge{background:var(--ok)}
.st-warn .status-badge{background:var(--warn)}
.st-crit .status-badge{background:var(--crit);color:#fff}
.st-offline .status-badge{background:var(--off)}
.st-crit.status-card{background:rgba(140,26,19,.62);border-color:rgba(255,140,120,.4)}
.st-warn.status-card{background:rgba(120,70,10,.45);border-color:rgba(240,166,75,.4)}
.status-main{flex:1;display:flex;flex-direction:column;gap:1px;min-width:0}
.status-title{font-size:24px;font-weight:700;letter-spacing:-.4px;line-height:1.1}
.status-sub{font-size:13px;color:var(--ink2)}
.chev{width:18px;height:18px;fill:none;stroke:var(--ink2);stroke-width:2;stroke-linecap:round;flex-shrink:0}
.chips{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding-top:12px;border-top:1px solid rgba(255,255,255,.14)}
.chip{display:flex;align-items:center;gap:6px;font-size:12px;color:#E8ECE9;white-space:nowrap}
.chip .dot{width:7px;height:7px}
.tiles2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.tile{border-radius:22px;padding:14px 16px;display:flex;flex-direction:column;gap:4px}
.tile-label{font-size:13px;color:var(--ink2)}
.tile-value{font-size:34px;font-weight:600;letter-spacing:-.8px;line-height:1}
.tile-note{font-size:11px;color:var(--ink3)}

/* Нижнее меню-капсула */
.nav{position:absolute;left:20px;right:20px;bottom:calc(var(--sb) + 24px);height:64px;border-radius:32px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding:6px;gap:4px;z-index:5}
.nav button{border:0;border-radius:26px;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;font-weight:500;color:var(--ink2)}
.nav button[aria-current="page"]{background:rgba(255,255,255,.16);color:#fff;font-weight:600}
.nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* Внутренние экраны */
.topbar{position:absolute;left:0;right:0;top:calc(var(--st) + 12px);display:flex;align-items:center;justify-content:space-between;padding:0 12px 0 8px;z-index:3}
.back{display:flex;align-items:center;gap:2px;height:44px;padding:0 8px;font-size:16px;font-weight:500;color:var(--accent);background:none;border:0}
.back svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.state-pill{display:flex;align-items:center;gap:6px;height:32px;padding:0 12px;border-radius:16px;font-size:13px;font-weight:600}
.state-pill.ok{color:#CFF1DD} .state-pill.warn{color:#FFD9A8} .state-pill.crit{color:#FFC4BC} .state-pill.offline,.state-pill.none{color:#D7DDD9}
.h1{position:absolute;left:20px;top:calc(var(--st) + 64px);font-size:38px;line-height:1}
.hint{position:absolute;left:20px;top:calc(var(--st) + 106px);font-size:13px;color:var(--ink3)}

.iso{position:absolute;left:50%;top:calc(var(--st) + 150px);width:358px;height:440px;margin-left:-179px;transform-origin:top center}
.iso svg{position:absolute;left:0;top:0}
.lbl{position:absolute;display:flex;flex-direction:column;gap:2px}
.lbl-n{font-size:13px;color:#D2D8D4}
.lbl-v{font-size:24px;font-weight:600;line-height:1}
.lbl-v small{font-size:14px;color:var(--ink3);font-weight:600}
.hit{position:absolute;border:0;padding:0;background:transparent;border-radius:14px}
.hit:active,.hit:focus-visible{background:rgba(255,255,255,.07);outline:1.5px solid rgba(255,255,255,.35)}
.flow{stroke-dasharray:3 9;animation:dash 1.2s linear infinite}
@keyframes dash{to{stroke-dashoffset:-24}}
.pulse-o{animation:po 3s ease-in-out infinite}
@keyframes po{0%,100%{opacity:.45}50%{opacity:.85}}
.sh{filter:blur(6px)} .glow{filter:blur(5px)}

.tiles3{position:absolute;left:16px;right:16px;bottom:calc(var(--sb) + 100px);display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:10px}
.tiles3 .tile{border-radius:22px;padding:12px 14px}
.tiles3 .tile-value{font-size:26px;letter-spacing:-.6px}
.spark{display:block;width:100%;height:22px}

.bsheet{position:absolute;left:8px;right:8px;bottom:calc(var(--sb) + 8px);border-radius:32px;padding:10px 20px 26px;display:flex;flex-direction:column;gap:14px;z-index:6;animation:up .28s ease-out}
@keyframes up{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
.grab{display:flex;justify-content:center}.grab span{width:40px;height:5px;border-radius:3px;background:rgba(255,255,255,.3)}
.sheet-head{display:flex;align-items:center;justify-content:space-between}
.sheet-title{font-size:20px;font-weight:700}
.x{width:36px;height:36px;border-radius:18px;border:0;background:rgba(255,255,255,.12);display:flex;align-items:center;justify-content:center;padding:0}
.x svg{width:16px;height:16px;stroke:#fff;stroke-width:2.4;stroke-linecap:round;fill:none}
.kv3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.kv-n{font-size:12px;color:var(--ink3)} .kv-v{font-size:24px;font-weight:600}
.para{font-size:14px;line-height:1.45;color:#D2D8D4}
.bar-floor{flex:1;height:8px;border-radius:4px;background:linear-gradient(90deg,#F0A06A,#7FA8D9)}

/* Давление */
.page{padding:calc(var(--st) + 64px) 0 calc(var(--sb) + 110px)}
.big{display:flex;align-items:baseline;gap:10px;margin-top:8px}
.big-v{font-size:64px;font-weight:700;letter-spacing:-1.5px;line-height:1}
.big-u{font-size:22px;font-weight:500;color:#D2D8D4}
.card{margin:12px 16px 0;border-radius:24px;padding:16px 18px;display:flex;flex-direction:column;gap:8px}
.seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;border-radius:14px;background:rgba(0,0,0,.28)}
.seg button{height:36px;border:0;border-radius:10px;font-size:14px;font-weight:600;background:transparent;color:#C3CAC6}
.seg button[aria-pressed="true"]{background:rgba(255,255,255,.18);color:#fff}
.chart{display:block;width:100%;height:auto}
.ticks{display:flex;justify-content:space-between;font-size:12px;color:#C3CAC6}
.ev{display:flex;gap:12px;padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.12)}
.ev:last-child{border-bottom:0}
.ev-t{width:62px;font-size:13px;color:var(--ink3);flex-shrink:0}
.ev-x{font-size:14px;line-height:1.4}
.empty{padding:18px;font-size:14px;color:var(--ink3)}

/* Заставка */
.splash{position:fixed;inset:0;z-index:50;background:var(--bg);display:flex;align-items:center;justify-content:center;transition:opacity .4s}
.splash img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;animation:reveal 1.4s cubic-bezier(.2,.7,.2,1) both}
@keyframes reveal{0%{filter:blur(22px) brightness(.45);transform:scale(1.12)}100%{filter:none;transform:scale(1)}}
.splash .sp-title{position:absolute;left:22px;right:22px;top:calc(var(--st) + 40px);animation:rise .6s .45s ease-out both}
.splash .sp-ok{position:absolute;left:16px;right:16px;bottom:calc(var(--sb) + 28px);border-radius:24px;padding:14px 16px;display:flex;align-items:center;gap:12px;animation:rise .6s .8s ease-out both}
@keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.splash.out{opacity:0;pointer-events:none}

/* Подсказка установки */
.install{position:fixed;left:0;right:0;bottom:0;padding:12px 12px calc(var(--sb) + 12px);z-index:40}
.install-card{max-width:456px;margin:0 auto;border-radius:22px;padding:16px 18px;display:flex;flex-direction:column;gap:8px}
.install-title{font-size:16px;font-weight:700}
.install-text{font-size:14px;line-height:1.45;color:var(--ink2)}
.btn-text{align-self:flex-end;border:0;background:none;color:var(--accent);font-size:15px;font-weight:600;height:40px;padding:0 6px}

@media (prefers-reduced-motion:reduce){.flow,.pulse-o,.live,.bsheet,.splash img,.sp-title,.sp-ok,.fade-in{animation:none}}
@media (max-height:700px){.title{font-size:34px}.tile-value{font-size:28px}.main-bottom{bottom:calc(var(--sb) + 96px)}}

/* Планшет и компьютер: телефонная колонка по центру на размытом фото виллы */
@media (min-width:600px){
  body::before{content:"";position:fixed;inset:-60px;background:url(img/house.jpg) center/cover;filter:blur(36px) brightness(.4) saturate(110%);z-index:-1}
  body{background:transparent}
  #app{box-shadow:0 0 0 1px rgba(255,255,255,.08),0 30px 90px rgba(0,0,0,.65)}
  .install{display:none}
}
/* Метка тестового стенда */
.stage-badge{position:fixed;top:calc(var(--st) + 4px);left:50%;transform:translateX(-50%);z-index:60;background:#C26A00;color:#fff;font-size:11px;font-weight:700;letter-spacing:1px;padding:3px 10px;border-radius:10px;pointer-events:none}
