/* Стиль kl!ck (макет Dmitriy Medvedev): тема «Графит», зелёный акцент, карточки 20px,
   плавающая нижняя панель, шторки снизу. Светлая тема — когда светлый Telegram. */
:root {
  --page: #101012;
  --win: #1a1a1d;
  --card: #222226;
  --cardHover: #26262b;
  --hover: #2a2a2f;
  --elem: #2e2e33;
  --elemHover: #36363c;
  --line: #2c2c31;
  --raised: #3a3a40;
  --text: #f2f2f4;
  --text2: #c7c7cc;
  --text3: #a1a1a8;
  --dim: #8e8e93;
  --dim2: #6e6e73;
  --dots: #3c3c42;
  --onText: #111111;
  --accent: #30d158;
  --onAccent: #0b0b0c;
  --red: #ff6961;
  --orange: #ffb340;
  --shadow: rgba(0, 0, 0, 0.6);
  --navShadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --top: max(env(safe-area-inset-top), var(--tg-content-safe-area-inset-top, 0px));
  --bottom: max(env(safe-area-inset-bottom), var(--tg-content-safe-area-inset-bottom, 0px));
  color-scheme: dark;
}
:root.light {
  --page: #e7e7eb;
  --win: #f5f5f7;
  --card: #ffffff;
  --cardHover: #f7f7f9;
  --hover: #efeff2;
  --elem: #ededf1;
  --elemHover: #e3e3e8;
  --line: #e4e4e9;
  --raised: #e3e3e8;
  --text: #1c1c1e;
  --text2: #3a3a3c;
  --text3: #5f5f66;
  --dim: #7c7c83;
  --dim2: #a0a0a7;
  --dots: #d2d2d8;
  --onText: #ffffff;
  --accent: #1fa34a;
  --onAccent: #ffffff;
  --red: #e5484d;
  --orange: #d97706;
  --shadow: rgba(0, 0, 0, 0.14);
  --navShadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--win);
  color: var(--text);
  font-family: 'Segoe UI Variable Text', 'Segoe UI', -apple-system, system-ui, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
button { -webkit-user-select: none; user-select: none; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes screenin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pagein { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes sheetin { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes snackin { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  100% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); }
}
@keyframes bigpulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 35%, transparent); }
  100% { box-shadow: 0 0 0 22px color-mix(in srgb, var(--accent) 0%, transparent); }
}
@keyframes wave {
  0% { mask-size: 0% 0%, 100% 100%; opacity: 1; }
  55% { mask-size: 340% 340%, 100% 100%; opacity: 1; }
  62% { opacity: 0; }
  100% { mask-size: 340% 340%, 100% 100%; opacity: 0; }
}
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

.ico { display: block; flex: none; width: 18px; height: 18px; }
.boot { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--elem); border-top-color: var(--accent); animation: spin 0.9s linear infinite; display: inline-block; }

/* ── Экран ── */
/* Анимация появления — только при переходе на другой экран, не при каждом обновлении данных. */
.screen { padding: var(--top) 16px calc(120px + var(--bottom)); max-width: 560px; margin: 0 auto; }
.screen.enter { animation: screenin 0.3s cubic-bezier(0.2, 0.7, 0.2, 1); }
.screen.page { padding-bottom: calc(40px + var(--bottom)); }
.screen.page.enter { animation: pagein 0.28s cubic-bezier(0.2, 0.7, 0.2, 1); }
.topbar { display: flex; align-items: center; gap: 8px; height: 52px; }
.wordmark { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.wordmark i { font-style: normal; color: var(--accent); }
.wordmark span { color: var(--dim); font-weight: 500; margin-left: 6px; }
.topbar .grow { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border: 0; border-radius: 18px; background: transparent; color: var(--dim);
  display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.icon-btn:active { background: var(--elem); color: var(--text); transform: scale(0.94); }
.icon-btn.spinning .ico { animation: spin 0.9s linear infinite; }
.back-btn { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 10px 0 2px; margin-left: -6px; border: 0; border-radius: 18px; background: transparent; color: var(--accent); font-size: 15px; cursor: pointer; }
.back-btn .ico { transform: rotate(180deg); }
.screen-title { font-size: 28px; font-weight: 600; margin: 4px 0 0; letter-spacing: -0.4px; }
.screen-sub { font-size: 13px; color: var(--dim); margin-top: 4px; }
.caps { font-size: 12px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.6px; margin: 24px 2px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.caps button { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }

/* ── Статус сервера (как кнопка питания kl!ck) ── */
.hero { position: relative; text-align: center; padding: 22px 0 4px; }
.hero .wave { position: absolute; left: -16px; right: -16px; top: -50px; height: 270px; pointer-events: none; }
.hero .dots { position: absolute; inset: 0; background-image: radial-gradient(circle, var(--dots) 1.1px, transparent 1.6px); background-size: 14px 14px; background-position: center; mask-image: radial-gradient(ellipse at center, #000 15%, transparent 66%); }
.hero .lit { position: absolute; inset: 0; background-image: radial-gradient(circle, var(--accent) 1.3px, transparent 1.9px); background-size: 14px 14px; background-position: center;
  mask-image: radial-gradient(circle at center, transparent 0 24%, #000 30%, #000 40%, transparent 48%), radial-gradient(ellipse at center, #000 15%, transparent 66%);
  mask-composite: intersect; mask-repeat: no-repeat; mask-position: center; animation: wave 5.2s cubic-bezier(0.3, 0.6, 0.4, 1) infinite; }
.hero.bad .lit { display: none; }
.core { position: relative; z-index: 1; width: 92px; height: 92px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--onAccent); animation: bigpulse 2.4s ease-out infinite; }
.core .ico { width: 38px; height: 38px; }
.hero.bad .core { background: var(--card); color: var(--red); border: 1px solid var(--red); animation: none; }
.hero-title { position: relative; z-index: 1; font-size: 20px; font-weight: 600; margin-top: 16px; text-shadow: 0 0 4px var(--win), 0 0 10px var(--win); }
.hero-sub { position: relative; z-index: 1; font-size: 13px; color: var(--dim); margin-top: 4px; text-shadow: 0 0 4px var(--win), 0 0 10px var(--win); }

/* ── Плитки ── */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.tile { padding: 14px 16px; border-radius: 20px; background: var(--card); min-width: 0; border: 0; color: inherit; text-align: left; font: inherit; }
button.tile { cursor: pointer; }
button.tile:active { background: var(--cardHover); }
.tile-head { display: flex; align-items: center; gap: 7px; color: var(--dim); font-size: 13px; }
.tile-head .ico { width: 16px; height: 16px; }
.tile-val { font-size: 22px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-val small { font-size: 14px; color: var(--dim); font-weight: 500; }
.tile-sub { font-size: 12px; color: var(--dim2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 4px; border-radius: 2px; background: var(--elem); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.4s; }
.meter i.warn { background: var(--orange); }
.meter i.bad { background: var(--red); }

/* ── График ── */
.chart { padding: 16px; border-radius: 20px; background: var(--card); }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chart-head b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart-head span { font-size: 12px; color: var(--dim); }
.chart svg { display: block; width: 100%; height: 110px; margin-top: 14px; overflow: visible; }
.chart rect.col { fill: color-mix(in srgb, var(--accent) 40%, var(--elem)); transform-origin: bottom; transform-box: fill-box; }
.chart.grow rect.col { animation: grow 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.chart rect.col.today { fill: var(--accent); }
.chart rect.col.sel { fill: var(--text); }
.chart rect.hit { fill: transparent; cursor: pointer; }
.chart line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim2); margin-top: 6px; }
.chart-pick { font-size: 12px; color: var(--text2); margin-top: 8px; min-height: 16px; text-align: center; }

/* ── Списки ── */
.list { border-radius: 20px; background: var(--card); overflow: hidden; }
.row {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 0; background: transparent;
  color: inherit; text-align: left; font: inherit; font-size: 15px; min-height: 56px;
}
button.row { cursor: pointer; transition: background 0.2s ease; }
.row + .row { border-top: 1px solid var(--line); }
button.row:active { background: var(--cardHover); }
.row-icon {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 13px; background: var(--elem); color: var(--dim);
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600;
}
.row-icon .ico { width: 21px; height: 21px; }
.row-icon.sm { width: 34px; height: 34px; border-radius: 10px; }
.row-icon.sm .ico { width: 17px; height: 17px; }
.row-icon.ok { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--elem)); }
.row-icon.bad { color: var(--red); background: color-mix(in srgb, var(--red) 14%, var(--elem)); }
.row-icon.warn { color: var(--orange); background: color-mix(in srgb, var(--orange) 14%, var(--elem)); }
.row-icon .live { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--card); animation: pulse 2.2s ease-out infinite; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-title.wrap { white-space: normal; font-weight: 500; line-height: 1.35; }
.row-sub { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; }
.row-sub .on { color: var(--accent); }
.row-sub .warn, .kv b .warn { color: var(--orange); }
.row-end { flex: none; font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.row .chev { color: var(--dim2); }
.row.off .row-title, .row.off .row-icon { opacity: 0.45; }
.sep { flex: none; width: 3px; height: 3px; border-radius: 50%; background: var(--dim2); display: inline-block; }
.num { font-variant-numeric: tabular-nums; }
.bar { height: 4px; border-radius: 2px; background: var(--elem); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.4s; }
.bar i.warn { background: var(--orange); }
.bar i.bad { background: var(--red); }

.chip-state { flex: none; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.chip-state.off { background: var(--elem); color: var(--dim); }
.chip-state.bad { background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); }

.kv { border-radius: 20px; background: var(--card); overflow: hidden; }
.kv > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; font-size: 14px; }
.kv > div + div { border-top: 1px solid var(--line); }
.kv > div > span:first-child { color: var(--dim); flex: none; }
.kv b { font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; min-width: 0; }
.kv b small { color: var(--dim); font-weight: 400; font-size: 12px; }

/* ── Люди ── */
.person { margin-top: 22px; }
.person-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 10px; width: 100%; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 10px; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.avatar.lg { width: 64px; height: 64px; border-radius: 20px; font-size: 26px; }
.person-name { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-sub { font-size: 12px; color: var(--dim); }
.person-head .grow { flex: 1; min-width: 0; }

/* ── Поиск ── */
.search { position: relative; margin-top: 14px; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--dim2); width: 17px; height: 17px; }
.search input { width: 100%; height: 42px; padding: 0 14px 0 38px; border-radius: 12px; border: 0; background: var(--card); color: var(--text); font-size: 15px; outline: none; }
.search input::placeholder { color: var(--dim2); }

/* ── Шапка страницы ── */
.page-head { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.page-head .row-icon { width: 64px; height: 64px; border-radius: 20px; }
.page-head .row-icon .ico { width: 30px; height: 30px; }
.page-head .row-icon .live { width: 15px; height: 15px; border-color: var(--win); }
.page-head h1 { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -0.3px; word-break: break-word; }
.page-head .sub { font-size: 13px; color: var(--dim); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.page-head .sub .on { color: var(--accent); }
.page-head .sub .warn { color: var(--orange); }
.tabs { display: flex; padding: 3px; border-radius: 12px; background: var(--card); margin-top: 18px; position: sticky; top: calc(var(--top) + 6px); z-index: 4; box-shadow: 0 0 0 6px var(--win); }
.tabs button { flex: 1; height: 36px; border: 0; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer; background: transparent; color: var(--dim); transition: background 0.2s ease, color 0.2s ease; white-space: nowrap; padding: 0 4px; }
.tabs button.on { background: var(--raised); color: var(--text); }

/* ── Кнопки ── */
.btn-primary {
  width: 100%; height: 50px; border: 0; border-radius: 14px; background: var(--text); color: var(--onText);
  font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { background: var(--elem); color: var(--dim); cursor: default; transform: none; }
.btn-primary.danger { background: var(--red); color: #fff; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn {
  flex: 1; height: 44px; border: 0; border-radius: 12px; background: var(--elem); color: var(--text); text-decoration: none;
  font-size: 14px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease; padding: 0 12px;
}
.btn:active { transform: scale(0.97); background: var(--elemHover); }
.btn .ico { width: 17px; height: 17px; }
.btn.danger { color: var(--red); }
.btn.armed { background: color-mix(in srgb, var(--red) 18%, var(--elem)); color: var(--red); }
.btn:disabled { color: var(--dim); }
.btn-elem {
  flex: none; height: 30px; padding: 0 12px; border-radius: 15px; border: 0; background: var(--elem); color: var(--text);
  font-size: 12px; font-weight: 500; cursor: pointer; transition: background 0.2s ease, transform 0.15s ease;
}
.btn-elem:active { transform: scale(0.96); background: var(--elemHover); }
.btn-elem.armed { background: color-mix(in srgb, var(--red) 18%, var(--elem)); color: var(--red); }

.fab { position: fixed; right: max(16px, calc(50% - 264px)); bottom: calc(90px + var(--bottom)); z-index: 8; }
.fab button { height: 50px; padding: 0 20px 0 16px; border: 0; border-radius: 25px; background: var(--text); color: var(--onText); font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; box-shadow: var(--navShadow); cursor: pointer; transition: transform 0.15s ease; }
.fab button:active { transform: scale(0.95); }

/* ── Нижняя панель (как в kl!ck) ── */
.nav-fade { position: fixed; left: 0; right: 0; bottom: 0; height: calc(110px + var(--bottom)); background: linear-gradient(transparent, var(--win) 55%); pointer-events: none; z-index: 5; }
.nav { position: fixed; left: 0; right: 0; bottom: calc(16px + var(--bottom)); display: flex; justify-content: center; pointer-events: none; z-index: 7; }
.nav-inner { display: flex; gap: 4px; padding: 5px; border-radius: 28px; background: var(--card); box-shadow: var(--navShadow); pointer-events: auto; border: 1px solid var(--line); }
.nav-btn { height: 48px; min-width: 76px; padding: 0 14px; border: 0; border-radius: 23px; background: transparent; color: var(--dim); font-size: 11px; font-weight: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; position: relative; transition: background 0.2s ease, color 0.2s ease; }
.nav-btn .ico { width: 20px; height: 20px; }
.nav-btn.on { background: var(--raised); color: var(--text); }
.nav-btn .badge { position: absolute; top: 6px; right: 22px; width: 8px; height: 8px; border-radius: 4px; background: var(--accent); }

/* ── Подключение ── */
.qr-card { margin-top: 16px; padding: 18px; border-radius: 20px; background: var(--card); text-align: center; }
.qr { margin: 0 auto; width: min(210px, 60vw); aspect-ratio: 1; padding: 12px; border-radius: 16px; background: #fff; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr-card p { font-size: 13px; color: var(--text3); margin: 12px 0 0; line-height: 1.45; }
.link {
  margin-top: 12px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; height: 44px; border-radius: 12px;
  background: var(--elem); font-size: 13px; color: var(--text2); text-align: left;
}
.link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.apps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.app-btn { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; border: 0; background: var(--card); color: var(--text); cursor: pointer; text-align: left; font: inherit; transition: transform 0.15s ease, background 0.2s ease; min-width: 0; }
.app-btn:active { transform: scale(0.97); background: var(--cardHover); }
.app-logo { flex: none; width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.app-btn b { display: block; font-size: 14px; font-weight: 600; }
.app-btn small { display: block; font-size: 11px; color: var(--dim); margin-top: 1px; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; gap: 12px; padding: 14px; border-radius: 16px; background: var(--card); }
.step-n { flex: none; width: 26px; height: 26px; border-radius: 13px; background: var(--elem); color: var(--text2); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.step-title { display: block; font-size: 14px; font-weight: 600; }
.step span b { font-weight: 600; color: var(--text2); }
.step span { display: block; font-size: 13px; color: var(--text3); margin-top: 3px; line-height: 1.45; }
.step a { color: var(--accent); }

/* ── События и списки ── */
.day-head { font-size: 13px; font-weight: 600; color: var(--text2); margin: 22px 2px 8px; }
.ev-time { font-size: 12px; color: var(--dim2); font-variant-numeric: tabular-nums; flex: none; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 14px -16px 0; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: transparent; color: var(--text2);
  font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.chip.on { background: var(--raised); border-color: var(--raised); color: var(--text); }
.chip:active { transform: scale(0.96); }
.chip .ico { width: 15px; height: 15px; }

/* ── Формы ── */
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--card); }
.seg button {
  flex: 1; height: 36px; border: 0; border-radius: 9px; font-size: 13px; font-weight: 500; cursor: pointer;
  background: transparent; color: var(--dim); transition: background 0.2s ease, color 0.2s ease; white-space: nowrap; padding: 0 4px;
}
.seg button.on { background: var(--raised); color: var(--text); }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font-size: 16px; outline: none; transition: border-color 0.2s ease;
}
.input:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.input::placeholder { color: var(--dim2); }
.input + .chips { margin-top: 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-radius: 20px; background: var(--card); cursor: pointer; }
.toggle-row b { display: block; font-size: 15px; font-weight: 500; }
.toggle-row small { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.toggle { flex: none; width: 50px; height: 30px; border-radius: 15px; background: var(--raised); position: relative; transition: background 0.2s ease; border: 0; padding: 0; cursor: pointer; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.toggle.on { background: var(--accent); }
.toggle.on i { transform: translateX(20px); }
.hint { font-size: 12px; color: var(--dim); margin: 8px 2px 0; line-height: 1.5; text-wrap: pretty; }
.note { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--card); font-size: 13px; color: var(--text3); line-height: 1.5; display: flex; gap: 10px; }
.note .ico { color: var(--dim); margin-top: 1px; }
.note.warn { background: color-mix(in srgb, var(--orange) 12%, var(--card)); color: var(--text2); }
.note.warn .ico { color: var(--orange); }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.more { width: 100%; height: 40px; margin-top: 8px; border: 0; border-radius: 12px; background: transparent; color: var(--text2); font-size: 13px; cursor: pointer; }

/* ── Пусто ── */
.empty { margin-top: 40px; text-align: center; padding: 0 12px; }
.empty-ico { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; background: var(--card); color: var(--dim); display: flex; align-items: center; justify-content: center; }
.empty-ico .ico { width: 28px; height: 28px; }
.empty h2 { font-size: 19px; font-weight: 600; margin: 18px 0 0; }
.empty p { font-size: 14px; color: var(--text3); margin: 8px 0 0; line-height: 1.5; text-wrap: pretty; }

/* ── Шторка ── */
.sheet-root { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-shade { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); animation: fadein 0.2s ease; }
.sheet {
  position: relative; max-height: 92vh; overflow-y: auto; background: var(--win); border-radius: 22px 22px 0 0;
  padding: 0 16px calc(20px + var(--bottom)); animation: sheetin 0.34s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-width: 560px; width: 100%; margin: 0 auto; box-shadow: 0 -10px 40px var(--shadow);
}
.sheet-grip { width: 36px; height: 4px; border-radius: 2px; background: var(--raised); margin: 8px auto 0; }
.sheet h3 { font-size: 21px; font-weight: 600; margin: 14px 0 0; text-wrap: pretty; }
.sheet p { font-size: 14px; color: var(--text3); line-height: 1.5; margin: 8px 0 0; text-wrap: pretty; }

/* ── Сообщения ── */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(96px + var(--bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; padding: 0 16px; }
.toast { max-width: 420px; padding: 11px 16px; border-radius: 14px; background: var(--raised); color: var(--text); font-size: 14px; box-shadow: 0 10px 30px var(--shadow); animation: snackin 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
.toast.bad { background: color-mix(in srgb, var(--red) 30%, var(--raised)); }
.actions .btn { flex: none; }

/* Серверы */
.chip-state.warn { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); gap: 4px; }
.chip-state .ico { width: 12px; height: 12px; }
.row-sub .bad, .page-head .sub .bad { color: var(--red); }
.row-title small { color: var(--dim); font-weight: 400; font-size: 12px; margin-left: 4px; }
.row-chev { flex: none; color: var(--dim); display: flex; }
.row-chev .ico { width: 16px; height: 16px; }
.hero.warn .core { background: var(--card); color: var(--orange); border: 1px solid var(--orange); animation: none; }

/* Заявки на устройства */
.req-row { align-items: flex-start; }
.req-row .row-title small { color: var(--dim); font-weight: 400; font-size: 13px; }
.req-row .btn-row { margin-top: 10px; }
.req-row .btn { height: 38px; font-size: 14px; }
.btn.go { background: var(--accent); color: var(--onAccent); }
.row-sub .ico.inline { width: 14px; height: 14px; margin-right: -2px; }
.nav-btn .badge { right: calc(50% - 20px); background: var(--red); }

/* Защита сервера: столбики попыток и отбитых подключений по дням */
.cbars { display: flex; align-items: flex-end; gap: 2px; height: 28px; margin-top: 10px; }
.cbars i { flex: 1; min-height: 2px; border-radius: 2px; background: var(--dim); opacity: .55; }
.cbars i:last-child { background: var(--accent); opacity: 1; }
