/* «Пульт» — интерфейс в духе iOS: системные цвета и шрифт, таб-бар, большие заголовки, листы снизу, тёмная тема по
   настройке телефона. На широком экране (Мак, iPad) — боковое меню вместо таб-бара. */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7; --card: #ffffff; --card2: #f2f2f7; --elev: #ffffff;
  --fill: rgba(120, 120, 128, .2); --fill2: rgba(120, 120, 128, .16); --fill3: rgba(118, 118, 128, .12); --fill4: rgba(116, 116, 128, .08);
  --label: #000000; --label2: rgba(60, 60, 67, .6); --label3: rgba(60, 60, 67, .3); --label4: rgba(60, 60, 67, .18);
  --sep: rgba(60, 60, 67, .29); --hl: #d1d1d6;
  --blue: #007aff; --green: #34c759; --red: #ff3b30; --orange: #ff9500; --yellow: #ffcc00; --indigo: #5856d6;
  --purple: #af52de; --pink: #ff2d55; --teal: #30b0c7; --gray: #8e8e93; --mint: #00c7be; --brown: #a2845e;
  --green-t: #248a3d; --red-t: #d70015; --orange-t: #b45309;
  --tint: var(--blue); --brand: #d7263d;
  --bar: rgba(249, 249, 249, .94); --sheet: #f2f2f7; --alert: rgba(242, 242, 242, .9); --thumb: #ffffff;
  --shadow: 0 10px 30px rgba(0, 0, 0, .12); --ring: #ffffff;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --tabh: 49px; --navh: 44px; --side: 300px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --card2: #2c2c2e; --elev: #2c2c2e;
    --fill: rgba(120, 120, 128, .36); --fill2: rgba(120, 120, 128, .32); --fill3: rgba(118, 118, 128, .24); --fill4: rgba(118, 118, 128, .18);
    --label: #ffffff; --label2: rgba(235, 235, 245, .6); --label3: rgba(235, 235, 245, .3); --label4: rgba(235, 235, 245, .16);
    --sep: rgba(84, 84, 88, .65); --hl: #3a3a3c;
    --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a; --indigo: #5e5ce6;
    --purple: #bf5af2; --pink: #ff375f; --teal: #40c8e0; --mint: #63e6e2; --brown: #ac8e68;
    --green-t: #30d158; --red-t: #ff453a; --orange-t: #ff9f0a;
    --bar: rgba(22, 22, 24, .92); --sheet: #1c1c1e; --alert: rgba(44, 44, 46, .92); --thumb: #636366;
    --shadow: 0 10px 30px rgba(0, 0, 0, .55); --ring: #1c1c1e;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--label);
  font: 17px/1.29 var(--font); letter-spacing: -.41px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; margin: 0; touch-action: manipulation; text-align: inherit; }
a { color: var(--tint); text-decoration: none; }
img, video, svg { display: block; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.boot img { border-radius: 18px; animation: boot 1.2s ease-in-out infinite alternate; }
@keyframes boot { from { opacity: .55; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- оболочка: таб-бар (телефон) и боковое меню (широкий экран) */
.main { min-height: 100vh; min-height: 100dvh; padding-left: var(--sl); padding-right: var(--sr); }
.screen { padding-top: calc(var(--st) + var(--navh)); padding-bottom: calc(var(--tabh) + var(--sb) + 28px); max-width: 760px; margin: 0 auto; }
.has-mini .screen { padding-bottom: calc(var(--tabh) + var(--sb) + 96px); }
.screen.enter { animation: push .38s cubic-bezier(.32, .72, 0, 1); }
.screen.enter-back { animation: pop .32s cubic-bezier(.32, .72, 0, 1); }
.screen.fade { animation: fadein .22s ease-out; }
@keyframes push { from { transform: translateX(32%); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: translateX(-18%); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 30; height: calc(var(--st) + var(--navh)); padding: var(--st) calc(8px + var(--sr)) 0 calc(8px + var(--sl));
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; transition: background .2s, box-shadow .2s; }
.nav.solid { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 .5px 0 var(--sep); }
.nav .ttl { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; text-align: center; }
.nav.tshow .ttl { opacity: 1; }
.nav .l, .nav .r { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nav .r { justify-content: flex-end; }
.navbtn { display: inline-flex; align-items: center; gap: 2px; height: 44px; min-width: 44px; padding: 0 8px; color: var(--tint); font-size: 17px; border-radius: 10px; }
.navbtn:active { opacity: .35; }
.navbtn .i { width: 22px; height: 22px; stroke-width: 2.1; }
.navbtn.back .i { width: 13px; height: 22px; stroke-width: 2.6; margin-right: 4px; }
.navbtn.busy .i { animation: rot .9s linear infinite; }

.large { padding: 4px 16px 10px; }
.large h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; }
.large .subtitle { margin-top: 2px; color: var(--label2); font-size: 15px; letter-spacing: -.24px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: calc(var(--tabh) + var(--sb)); padding: 0 var(--sr) var(--sb) var(--sl);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 -.5px 0 var(--sep); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding-top: 6px;
  color: #999999; font-size: 10px; font-weight: 500; letter-spacing: .1px; }
@media (prefers-color-scheme: dark) { .tab { color: #757575; } }
.tab .i { width: 26px; height: 26px; stroke-width: 1.8; }
.tab.on { color: var(--tint); }
.tab.on .i { stroke-width: 2.2; }
.tab:active .i { transform: scale(.92); }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red);
  color: #ffffff; font: 600 13px/18px var(--font); letter-spacing: 0; text-align: center; }
.badge:empty { display: none; }

.side { display: none; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .side { display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--side); z-index: 35; background: var(--bar);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: .5px 0 0 var(--sep);
    padding: calc(var(--st) + 14px) 10px 16px; overflow-y: auto; }
  .main { padding-left: var(--side); }
  .nav { left: var(--side); }
  .screen { padding-bottom: 48px; }
  .has-mini .screen { padding-bottom: 110px; }
  .large h1 { font-size: 30px; line-height: 36px; }
}
.side .brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; }
.side .brand img { width: 40px; height: 40px; border-radius: 10px; }
.side .brand b { display: block; font-size: 17px; font-weight: 700; }
.side .brand small { color: var(--label2); font-size: 13px; }
.side .grp { margin-bottom: 18px; }
.side .grp-h { padding: 0 12px 6px; color: var(--label2); font-size: 13px; font-weight: 600; }
.sitem { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 10px; font-size: 16px; color: var(--label); }
.sitem:hover { background: var(--fill4); }
.sitem.on { background: var(--tint); color: #ffffff; }
.sitem.on .sq { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55); }
.sitem .cnt { margin-left: auto; color: var(--label2); font-size: 15px; }
.sitem.on .cnt { color: rgba(255, 255, 255, .85); }
.sitem .cnt.red { background: var(--red); color: #ffffff; border-radius: 10px; padding: 0 7px; font-size: 13px; font-weight: 600; line-height: 20px; }
.side .clock { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 6px 0; }
.side .clock div { background: var(--card); border-radius: 12px; padding: 10px 12px; }
.side .clock small { display: block; color: var(--label2); font-size: 12px; }
.side .clock b { font: 600 22px/1.15 var(--round); }

/* ---------- списки (inset grouped) */
.sec { margin: 0 16px 30px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 16px 7px; color: var(--label2); font-size: 13px; line-height: 18px; text-transform: uppercase; letter-spacing: -.08px; }
.sec-h .act { text-transform: none; color: var(--tint); font-size: 15px; letter-spacing: -.24px; }
.sec-hh { padding: 0 4px 10px; font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: .35px; display: flex; align-items: baseline; justify-content: space-between; }
.sec-hh .act { font-size: 17px; font-weight: 400; color: var(--tint); letter-spacing: -.41px; }
.sec-f { padding: 7px 16px 0; color: var(--label2); font-size: 13px; line-height: 18px; letter-spacing: -.08px; }
.list { background: var(--card); border-radius: 12px; overflow: hidden; }
.cell { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 11px 16px; background: var(--card); color: var(--label); text-align: left; }
.cell + .cell::before, .cell + .cellx::before, .cellx + .cell::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--sep); }
.list.icons > .cell + .cell::before { left: 58px; }
.list.thumbs > .cell + .cell::before { left: 84px; }
button.cell:active, a.cell:active, .cell.tap:active { background: var(--hl); transition: none; }
button.cell, a.cell, .cell.tap { transition: background .35s; cursor: pointer; }
.cell .tx { flex: 1; min-width: 0; }
.cell .tx > b { display: block; font-weight: 400; overflow-wrap: anywhere; }
.cell .tx > b.clamp2 { display: -webkit-box; }
.cell .tx > b.semi { font-weight: 600; }
.cell .sub { display: block; margin-top: 2px; color: var(--label2); font-size: 15px; line-height: 20px; letter-spacing: -.24px; overflow-wrap: anywhere; }
.cell .sub.clamp2, .clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cell .val { color: var(--label2); text-align: right; white-space: nowrap; font-size: 17px; }
.cell .val.num { font-variant-numeric: tabular-nums; }
.cell .chev { width: 9px; height: 15px; stroke: var(--label3); stroke-width: 2.4; flex: none; margin-left: -2px; }
.cell.danger { color: var(--red); justify-content: center; }
.cell.action { color: var(--tint); }
.cell.center { justify-content: center; text-align: center; }
.cell.disabled { opacity: .45; pointer-events: none; }
.sq { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #ffffff; flex: none; }
.sq .i { width: 19px; height: 19px; stroke-width: 2.1; }
.th { width: 56px; height: 56px; border-radius: 9px; object-fit: cover; background: var(--fill3); flex: none; }
.th.ph { display: grid; place-items: center; color: var(--label3); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }

/* ---------- кнопки, поля, переключатели */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 0 18px; border-radius: 14px;
  background: var(--tint); color: #ffffff; font-size: 17px; font-weight: 600; transition: opacity .15s, transform .15s; }
.btn:active { opacity: .7; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.gray { background: var(--fill3); color: var(--tint); }
.btn.red { background: var(--fill3); color: var(--red); }
.btn.green { background: var(--green); color: #ffffff; }
.btn.sm { width: auto; min-height: 34px; padding: 0 14px; border-radius: 17px; font-size: 15px; }
.btn.md { min-height: 44px; border-radius: 12px; }
.btn .i { width: 20px; height: 20px; stroke-width: 2.2; }
.btns { display: flex; gap: 10px; }
.btns > .btn { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.link { color: var(--tint); font-size: 17px; }
.link:active { opacity: .35; }
.field { width: 100%; min-height: 44px; padding: 11px 16px; border: 0; background: var(--card); color: var(--label); font-size: 17px; border-radius: 12px; resize: none; display: block; }
.field::placeholder { color: var(--label3); }
textarea.field { min-height: 120px; line-height: 1.35; }
.count { text-align: right; color: var(--label2); font-size: 13px; padding: 6px 16px 0; font-variant-numeric: tabular-nums; }
.count.over { color: var(--red-t); }
.switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .25s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .25s cubic-bezier(.32, .72, 0, 1); }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
.switch input:disabled + span { opacity: .5; }
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 9px; background: var(--fill3); margin: 0 16px 18px; }
.seg button { position: relative; z-index: 1; height: 30px; border-radius: 7px; font-size: 14px; font-weight: 500; letter-spacing: -.15px; text-align: center; transition: color .2s; }
.seg button.on { font-weight: 600; }
.seg .knob { position: absolute; top: 2px; bottom: 2px; left: 2px; border-radius: 7px; background: var(--thumb);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); transition: transform .3s cubic-bezier(.32, .72, 0, 1); }
.seg.in-sheet { margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 18px; background: var(--card); color: var(--label);
  font-size: 15px; font-weight: 500; border: 1px solid transparent; }
.chip.on { background: var(--tint); color: #ffffff; }
.chip small { color: inherit; opacity: .7; font-weight: 400; }
.chip:active { opacity: .7; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0;
  background: var(--fill3); color: var(--label2); white-space: nowrap; }
.tag.blue { background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--tint); }
.tag.green { background: color-mix(in srgb, var(--green) 18%, transparent); color: var(--green-t); }
.tag.orange { background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange-t); }
.tag.red { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red-t); }
.muted { color: var(--label2); }
.small { font-size: 13px; line-height: 18px; letter-spacing: -.08px; }
.up { color: var(--green-t); }
.down { color: var(--red-t); }
.warn-t { color: var(--orange-t); }

/* ---------- «Сегодня»: виджеты и карточки */
.widgets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 16px 26px; }
.widget { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 108px; padding: 13px 14px 14px;
  border-radius: 18px; background: var(--card); text-align: left; color: var(--label); }
button.widget:active { transform: scale(.97); transition: transform .12s; }
.widget .w-h { display: flex; align-items: center; gap: 6px; color: var(--label2); font-size: 13px; font-weight: 600; letter-spacing: -.08px; }
.widget .w-h .i { width: 17px; height: 17px; stroke-width: 2.2; }
.widget .w-v { font: 600 30px/1.05 var(--round); letter-spacing: -.3px; }
.widget .w-v.ok { color: var(--green-t); font-size: 22px; }
.widget .w-s { color: var(--label2); font-size: 13px; line-height: 17px; letter-spacing: -.08px; }
.meter { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--tint) 16%, transparent); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--tint); }
.meter.warn i { background: var(--orange); }
.meter.warn { background: color-mix(in srgb, var(--orange) 16%, transparent); }
.card { margin: 0 16px 26px; background: var(--card); border-radius: 18px; overflow: hidden; }
.card.pad { padding: 16px; }
button.card { display: block; width: calc(100% - 32px); text-align: left; color: var(--label); }
button.card:active { transform: scale(.985); transition: transform .12s; }
.live { padding: 14px 16px 12px; }
.live .lv-top { display: flex; gap: 12px; align-items: flex-start; }
.live .lv-top .th { width: 52px; height: 52px; border-radius: 10px; }
.live .lv-t { font-weight: 600; font-size: 16px; line-height: 21px; letter-spacing: -.3px; }
.live .lv-m { color: var(--label2); font-size: 13px; margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.livedot { display: inline-flex; align-items: center; gap: 5px; color: var(--brand); font-weight: 700; font-size: 11px; letter-spacing: .6px; }
.livedot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 14px 0 2px; }
.hero b { font: 600 48px/1 var(--round); letter-spacing: -.6px; transition: color .6s; }
.hero b.bump { color: var(--green-t); }
.hero span { color: var(--label2); font-size: 15px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 14px; }
.kpi { background: var(--fill4); border-radius: 10px; padding: 8px 10px; }
.sheet .kpi { background: var(--card); }
.kpi small { display: block; color: var(--label2); font-size: 12px; letter-spacing: 0; }
.kpi b { font: 600 18px/1.25 var(--round); }
.note { margin-top: 10px; font-size: 14px; line-height: 19px; color: var(--label2); }
.note b { color: var(--label); font-weight: 600; }
.chart { position: relative; margin-top: 12px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--label4); stroke-width: 1; }
.chart .axis { fill: var(--label2); font-size: 11px; font-family: var(--font); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.chart .ln { fill: none; stroke: var(--tint); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .ln.ref { stroke: var(--gray); }
.chart .ar { fill: var(--tint); opacity: .1; }
.chart .end { fill: var(--tint); stroke: var(--ring); stroke-width: 2; }
.chart .end.ref { fill: var(--gray); }
.chart .lbl { fill: var(--label2); font-size: 11px; font-family: var(--font); letter-spacing: 0; }
.chart .lbl.strong { fill: var(--label); font-weight: 600; }
.chart .xh { stroke: var(--label3); stroke-width: 1; }
.chart .tip { position: absolute; top: 0; pointer-events: none; background: var(--elev); color: var(--label); border-radius: 10px; padding: 7px 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16); font-size: 13px; line-height: 17px; white-space: nowrap; transform: translateX(-50%); z-index: 2; }
.chart .tip b { font-size: 15px; font-weight: 600; }
.chart .tip .k { display: inline-block; width: 12px; height: 2px; border-radius: 1px; vertical-align: middle; margin-right: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; color: var(--label2); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 2px; border-radius: 1px; background: var(--tint); display: inline-block; }
.legend i.ref { background: var(--gray); }
.spark { width: 100%; height: 30px; overflow: visible; }
.spark path { fill: none; stroke: var(--gray); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--tint); stroke: var(--ring); stroke-width: 2; }
.qa { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 16px 28px; }
.qa button { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 12px; color: var(--label); text-align: center; line-height: 15px; }
.qa .sq { width: 56px; height: 56px; border-radius: 16px; }
.qa .sq .i { width: 26px; height: 26px; }
.qa button:active .sq { transform: scale(.94); transition: transform .1s; }
.banner-in { display: flex; gap: 12px; align-items: center; margin: 0 16px 16px; padding: 12px 14px; border-radius: 14px; background: var(--card); }
.banner-in .tx { flex: 1; min-width: 0; font-size: 15px; line-height: 20px; }
.banner-in .tx b { display: block; font-weight: 600; }
.banner-in.warn { background: color-mix(in srgb, var(--orange) 14%, var(--card)); }
.banner-in.bad { background: color-mix(in srgb, var(--red) 12%, var(--card)); }
.banner-in.info { background: color-mix(in srgb, var(--blue) 10%, var(--card)); }

/* ---------- «Решения»: карточки с видео и слайдами */
.item { margin: 0 16px 22px; background: var(--card); border-radius: 18px; overflow: hidden; }
.item .it-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; flex-wrap: wrap; }
.item .it-t { padding: 8px 16px 0; font-size: 19px; line-height: 24px; font-weight: 700; letter-spacing: -.2px; overflow-wrap: anywhere; }
.item .it-s { padding: 4px 16px 0; color: var(--label2); font-size: 14px; }
.item .it-cap { padding: 10px 16px 0; font-size: 15px; line-height: 21px; color: var(--label); white-space: pre-wrap; overflow-wrap: anywhere; }
.item .it-more { padding: 2px 16px 0; color: var(--tint); font-size: 15px; }
.item .it-act { padding: 14px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.item .it-act .link { justify-self: center; padding: 6px 12px; font-size: 16px; }
.red-t { color: var(--red); }
.btn { text-align: center; line-height: 1.15; }
.btns > .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media { position: relative; margin: 12px 16px 0; border-radius: 14px; overflow: hidden; background: #000000; }
.vid { position: relative; display: block; width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 9 / 16; background: #111111; }
.vid img, .vid video { width: 100%; height: 100%; object-fit: cover; }
.vid .play { position: absolute; inset: 0; display: grid; place-items: center; }
.vid .play span { width: 64px; height: 64px; border-radius: 50%; background: rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: grid; place-items: center; color: #ffffff; }
.vid .play .i { width: 30px; height: 30px; fill: #ffffff; stroke: none; margin-left: 4px; }
.vid .len { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .55); color: #ffffff; border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; background: #000000; }
.slides::-webkit-scrollbar { display: none; }
.slides img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; scroll-snap-align: center; background: #111111; }
.pager { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.pager i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: background .2s; }
.pager i.on { background: #ffffff; }
.variants { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; scrollbar-width: none; }
.variants::-webkit-scrollbar { display: none; }
.empty { display: grid; justify-items: center; gap: 8px; padding: 70px 32px; text-align: center; color: var(--label2); }
.empty .i { width: 56px; height: 56px; stroke-width: 1.3; color: var(--label3); margin-bottom: 6px; }
.empty b { color: var(--label); font-size: 20px; font-weight: 600; }
.empty p { margin: 0; font-size: 15px; line-height: 20px; max-width: 340px; }

/* ---------- скелет загрузки */
.sk { background: linear-gradient(90deg, var(--fill4) 25%, var(--fill3) 37%, var(--fill4) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 14px; margin: 8px 0; }
.sk-card { height: 120px; border-radius: 18px; margin: 0 16px 16px; }

/* ---------- листы, оповещения, баннеры */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .3s; }
.scrim.in { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; display: flex; flex-direction: column; max-height: calc(100vh - var(--st) - 12px);
  max-height: calc(100dvh - var(--st) - 12px); background: var(--sheet); border-radius: 14px 14px 0 0; transform: translateY(105%);
  transition: transform .44s cubic-bezier(.32, .72, 0, 1); box-shadow: 0 -2px 30px rgba(0, 0, 0, .15); padding-left: var(--sl); padding-right: var(--sr); }
.sheet.in { transform: none; }
.sheet.full { height: calc(100vh - var(--st) - 12px); height: calc(100dvh - var(--st) - 12px); }
.sheet.drag { transition: none; }
.sheet .grab { flex: none; width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 6px auto 0; }
.sheet .sh-h { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; min-height: 50px; padding: 2px 8px 4px; touch-action: none; }
.sheet .sh-t { font-weight: 600; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62vw; }
.sheet .sh-b { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px 0 calc(var(--sb) + 20px); }
.sheet .sh-b > .pad { padding: 0 16px; }
.closex { width: 30px; height: 30px; border-radius: 50%; background: var(--fill3); color: var(--label2); display: grid; place-items: center; margin-left: auto; }
.closex .i { width: 14px; height: 14px; stroke-width: 3; }
@media (min-width: 900px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 600px; max-height: 88vh; border-radius: 16px; padding: 0;
    transform: translate(-50%, -47%) scale(.98); opacity: 0; transition: transform .26s cubic-bezier(.32, .72, 0, 1), opacity .2s; }
  .sheet.in { transform: translate(-50%, -50%); opacity: 1; }
  .sheet.full { height: 86vh; }
  .sheet .grab { display: none; }
  .sheet .sh-b { padding-bottom: 24px; }
}
.alert { position: fixed; left: 50%; top: 50%; z-index: 61; width: 280px; max-width: calc(100vw - 40px); border-radius: 14px; overflow: hidden; text-align: center;
  background: var(--alert); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  transform: translate(-50%, -50%) scale(1.12); opacity: 0; transition: transform .22s cubic-bezier(.32, .72, 0, 1), opacity .18s; }
.alert.in { transform: translate(-50%, -50%); opacity: 1; }
.alert .a-b { padding: 19px 16px 18px; }
.alert h3 { margin: 0 0 4px; font-size: 17px; line-height: 22px; font-weight: 600; letter-spacing: -.41px; }
.alert p { margin: 0; font-size: 13px; line-height: 17px; letter-spacing: -.08px; overflow-wrap: anywhere; max-height: 40vh; overflow-y: auto; }
.alert .a-btns { display: flex; box-shadow: 0 -.5px 0 var(--sep); }
.alert .a-btns button { flex: 1; min-height: 44px; padding: 0 8px; color: var(--tint); font-size: 17px; }
.alert .a-btns button + button { box-shadow: -.5px 0 0 var(--sep); }
.alert .a-btns button:active { background: var(--fill4); }
.alert .a-btns button.pri { font-weight: 600; }
.alert .a-btns button.red { color: var(--red); }
.alert .a-btns.v { flex-direction: column; }
.alert .a-btns.v button + button { box-shadow: 0 -.5px 0 var(--sep); }
.asheet { position: fixed; left: 8px; right: 8px; bottom: calc(8px + var(--sb)); z-index: 61; max-width: 560px; margin: 0 auto;
  transform: translateY(115%); transition: transform .4s cubic-bezier(.32, .72, 0, 1); }
.asheet.in { transform: none; }
.asheet .g { background: var(--alert); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); border-radius: 14px; overflow: hidden; }
.asheet .g + .g { margin-top: 8px; }
.asheet .as-t { padding: 14px 18px 13px; text-align: center; color: var(--label2); font-size: 13px; line-height: 17px; }
.asheet .as-t b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.asheet .as-t .clamp3 { overflow-wrap: anywhere; }
.asheet button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 57px; padding: 6px 16px; color: var(--tint);
  font-size: 19px; letter-spacing: -.3px; box-shadow: 0 -.5px 0 var(--sep); text-align: center; line-height: 1.2; }
.asheet button small { display: block; color: var(--label2); font-size: 13px; letter-spacing: -.08px; }
.asheet button .st { display: flex; flex-direction: column; align-items: center; }
.asheet .g > button:first-child { box-shadow: none; }
.asheet button:active { background: var(--fill4); }
.asheet button.red { color: var(--red); }
.asheet .cancel { font-weight: 600; background: var(--elev); border-radius: 14px; box-shadow: none; }
@media (min-width: 900px) { .asheet { bottom: auto; top: 50%; transform: translateY(-46%) scale(.98); opacity: 0; transition: transform .22s, opacity .2s; }
  .asheet.in { transform: translateY(-50%); opacity: 1; } }
.banner { position: fixed; left: 8px; right: 8px; top: calc(var(--st) + 8px); z-index: 70; max-width: 500px; margin: 0 auto; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 20px; background: var(--alert); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: var(--shadow); transform: translateY(calc(-100% - var(--st) - 20px)); transition: transform .45s cubic-bezier(.32, .72, 0, 1); }
.banner.in { transform: none; }
.banner .sq { width: 34px; height: 34px; border-radius: 9px; }
.banner .tx { flex: 1; min-width: 0; font-size: 15px; line-height: 20px; letter-spacing: -.24px; }
.banner .tx b { display: block; font-weight: 600; }
.banner .tx span { color: var(--label2); overflow-wrap: anywhere; }
.banner .btn.sm { flex: none; }
.hud { position: fixed; left: 50%; top: 45%; z-index: 72; width: 160px; min-height: 150px; padding: 20px 14px; border-radius: 18px; display: grid; place-items: center;
  gap: 10px; text-align: center; color: var(--label2); font-size: 15px; font-weight: 600; background: var(--alert);
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); transform: translate(-50%, -50%) scale(.85); opacity: 0;
  transition: transform .25s cubic-bezier(.32, .72, 0, 1), opacity .2s; pointer-events: none; }
.hud.in { transform: translate(-50%, -50%); opacity: 1; }
.hud .i { width: 54px; height: 54px; stroke-width: 2.4; }
.offline { position: fixed; left: 0; right: 0; top: 0; z-index: 69; padding: calc(var(--st) + 6px) 16px 8px; background: var(--red); color: #ffffff; font-size: 14px;
  font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; transform: translateY(-100%); transition: transform .35s; }
.offline.in { transform: none; }
.offline button { color: #ffffff; text-decoration: underline; font-size: 14px; }
.mini { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabh) + var(--sb) + 8px); z-index: 39; max-width: 560px; margin: 0 auto; display: flex; align-items: center;
  gap: 12px; min-height: 58px; padding: 8px 14px; border-radius: 16px; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 6px 24px rgba(0, 0, 0, .16), 0 0 0 .5px var(--sep); text-align: left; color: var(--label);
  transform: translateY(150%); transition: transform .45s cubic-bezier(.32, .72, 0, 1); }
.mini.in { transform: none; }
.mini .tx { flex: 1; min-width: 0; font-size: 15px; line-height: 19px; }
.mini .tx b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .tx span { color: var(--label2); font-size: 13px; }
@media (min-width: 900px) { .mini { left: calc(var(--side) + 16px); bottom: 16px; } }
.spin { width: 22px; height: 22px; color: var(--label2); animation: rot .9s steps(8) infinite; flex: none; }
.spin.lg { width: 34px; height: 34px; }
@keyframes rot { to { transform: rotate(360deg); } }
.ptr { position: fixed; left: 0; right: 0; top: calc(var(--st) + var(--navh) + 4px); z-index: 29; display: flex; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .15s; }
.ptr.on { opacity: 1; }

/* ---------- вход с нового устройства */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center;
  padding: calc(var(--st) + 30px) 28px calc(var(--sb) + 30px); max-width: 460px; margin: 0 auto; }
.login .logo { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.login h1 { margin: 6px 0 0; font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: .3px; }
.login p { margin: 0; color: var(--label2); font-size: 16px; line-height: 22px; }
.login .code { font: 700 52px/1 var(--round); letter-spacing: 10px; padding: 18px 10px 16px 20px; border-radius: 18px; background: var(--card); }
.login .steps { text-align: left; background: var(--card); border-radius: 16px; padding: 14px 16px; width: 100%; display: grid; gap: 10px; font-size: 15px; line-height: 20px; }
.login .steps div { display: flex; gap: 10px; align-items: flex-start; }
.login .steps b { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--tint); color: #ffffff; font-size: 13px; display: grid; place-items: center; }
.login .btn { max-width: 340px; }
.login .ok { width: 84px; height: 84px; border-radius: 50%; background: var(--green); color: #ffffff; display: grid; place-items: center; animation: okpop .5s cubic-bezier(.32, 1.4, .5, 1); }
.login .ok .i { width: 46px; height: 46px; stroke-width: 3; }
@keyframes okpop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- мелочи */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; }
.kv dt { color: var(--label2); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.html-block { font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.html-block code { background: var(--fill3); padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.manual h3 { margin: 0 0 6px; font-size: 17px; font-weight: 600; }
.manual ol, .manual ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 15px; line-height: 21px; }
.manual p { margin: 0 0 6px; font-size: 15px; line-height: 21px; }
.k { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--fill3); font-weight: 600; white-space: nowrap; font-size: 14px; }
.player { position: fixed; inset: 0; z-index: 80; background: #000000; display: flex; flex-direction: column; opacity: 0; transition: opacity .25s; }
.player.in { opacity: 1; }
.player video { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000000; }
.player .pl-bar { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--st) + 6px) 12px 6px; }
.player .closex { background: rgba(255, 255, 255, .18); color: #ffffff; }
.player .pl-act { display: flex; gap: 10px; justify-content: center; padding: 10px 16px calc(var(--sb) + 14px); }
.player .pl-act .btn { background: rgba(255, 255, 255, .16); color: #ffffff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (hover: hover) { button.cell:hover, a.cell:hover { background: color-mix(in srgb, var(--hl) 45%, var(--card)); } }
.cell .sub.up { color: var(--green-t); }
.cell .sub.down { color: var(--red-t); }
.cell .sub.warn-t { color: var(--orange-t); }
