/* ============================================================
   «ЖИДКОЕ СТЕКЛО» v505–v508 (24.10.2026) — вариант А из макетов, утверждён
   владельцем. Полупрозрачные карточки с размытием на фоне мягких пятен
   фирменных цветов — на главной; меню слева и шапка — во всех разделах.
   Разделы внутри пока прежние.

   Слой подключается последним. Всё стекло — под html:not(.no-glass):
   переключатель «Прозрачность» в профиле (настройка устройства) ставит
   .no-glass, и портал выглядит как до v505. Новые блоки главной (hx-*,
   home-crew) свёрстаны и без стекла.

   v512 (25.10.2026) — тот же вид, но легче для слабых компьютеров (на
   моноблоках главная подтормаживала, на телефонах и MacBook — нет):
   - пятна фона — радиальные градиенты вместо фильтра blur(90–110px);
   - размытие под собой (backdrop-filter) — только там, где под стеклом
     проезжает содержимое: шапка, окна, уведомления, меню на телефоне.
     За карточками и меню на ПК — только неподвижный мягкий фон, размывать
     его незачем: вид дают полупрозрачность, светлая кромка и тень;
   - тихий фон разделов — отдельным неподвижным слоем, а не background
     fixed (тот перерисовывает весь экран при каждой прокрутке);
   - точка «Идёт сейчас» пульсирует масштабом и прозрачностью, без
     перерисовки на каждом кадре.
   ============================================================ */

html:not(.no-glass) {
  --glass-blur: 22px;
  --glass-card: rgba(255, 255, 255, .51);   /* v512: было .54 с размытием */
  --glass-strong: rgba(255, 255, 255, .63);  /* было .66 */
  --glass-chip: rgba(255, 255, 255, .6);
  --glass-line: rgba(255, 255, 255, .78);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 12px 32px rgba(28, 44, 80, .10);
  --glass-nav: rgba(19, 37, 64, .93);
  --glass-top: rgba(255, 255, 255, .64);
  --glass-blob1: rgba(160, 30, 72, .32);
  --glass-blob2: rgba(66, 110, 214, .30);
  --glass-blob3: rgba(244, 170, 104, .34);
}
html[data-theme=dark]:not(.no-glass) {
  --glass-card: rgba(28, 38, 60, .48);
  --glass-strong: rgba(34, 46, 72, .6);
  --glass-chip: rgba(255, 255, 255, .06);
  --glass-line: rgba(255, 255, 255, .12);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 16px 40px rgba(0, 0, 0, .38);
  --glass-nav: rgba(10, 18, 34, .66);
  --glass-top: rgba(14, 24, 40, .62);
  --glass-blob1: rgba(170, 32, 80, .42);
  --glass-blob2: rgba(48, 88, 196, .40);
  --glass-blob3: rgba(196, 110, 50, .22);
}

/* ---- Фон главной: три размытых пятна за карточками ---- */
.glass-bg { display: none; }
html:not(.no-glass) .glass-bg {
  display: block; position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  transform: translateZ(0);
}
/* Размытый круг — это круг с плавным краем: тот же вид градиентом, без
   фильтра. Края — как у blur(90px): элемент шире на 2σ с каждой стороны,
   спад по форме размытия (полная яркость до 39 % радиуса, половина — к 69 %). */
html:not(.no-glass) .glass-bg i {
  position: absolute; display: block;
  background: radial-gradient(closest-side, var(--c) 39%, color-mix(in srgb, var(--c) 93%, transparent) 50%,
    color-mix(in srgb, var(--c) 70%, transparent) 60%, color-mix(in srgb, var(--c) 50%, transparent) 69%,
    color-mix(in srgb, var(--c) 28%, transparent) 78%, color-mix(in srgb, var(--c) 8%, transparent) 88%, transparent 100%);
}
html:not(.no-glass) .glass-bg i:nth-child(1) { --c: var(--glass-blob1); width: calc(62vw + 360px); height: calc(62vw + 360px); max-width: 1180px; max-height: 1180px; left: calc(6% - 180px); top: calc(-26vh - 180px); }
html:not(.no-glass) .glass-bg i:nth-child(2) { --c: var(--glass-blob2); width: calc(52vw + 360px); height: calc(52vw + 360px); max-width: 1080px; max-height: 1080px; right: calc(-10vw - 180px); top: calc(18vh - 180px); }
html:not(.no-glass) .glass-bg i:nth-child(3) { --c: var(--glass-blob3); width: calc(60vw + 440px); height: calc(44vw + 440px); max-width: 1300px; max-height: 1060px; left: calc(32% - 220px); bottom: calc(-24vh - 220px); }
html:not(.no-glass) .home4 { position: relative; z-index: 1; }

/* ---- Меню слева: стекло во всех разделах ---- */
html:not(.no-glass) .sidebar {
  /* Подписи светлее прежних: сквозь полупрозрачную панель фон чуть светлее. */
  --nav-ink: #c2cee0;
  --nav-group-title: #9fb1cb;
  --nav-me-sub: #a9b8cd;
  background: var(--glass-nav);
  border-right-color: rgba(255, 255, 255, .08);
  /* Базовые стили размывали меню и в классическом виде; на ПК под ним только
     неподвижный фон. На телефоне размытие включается ниже. */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
@media (min-width: 721px) {
  /* Плавающая панель в прежней полосе: ширина колонки и отступ содержимого
     не меняются, поэтому разделы не сдвигаются ни на пиксель. */
  html:not(.no-glass) .sidebar {
    top: 10px; bottom: 10px; left: 10px; width: 226px; height: auto;
    border: 1px solid rgba(255, 255, 255, .14); border-radius: 24px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 18px 44px rgba(16, 26, 46, .22);
  }
  /* Свёрнутое меню уже на 10 px: отступы внутри меньше, вложенные пункты
     без сдвига и без стрелки группы — иначе значки уезжают вправо. */
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar { width: 56px; padding-left: 6px; padding-right: 6px; }
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar nav { padding-right: 0; }
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar nav * { min-width: 0; }
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar nav button,
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar-bottom > button { width: 100%; margin-left: 0; margin-right: 0; }
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar .nav-cat-body { margin-left: 0; padding-left: 0; border-left: 0; }
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar .nav-cat-body button { justify-content: center; padding-left: 0; padding-right: 0; }
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar .nav-chev,
  html:not(.no-glass) body[data-nav="collapsed"] .sidebar .nav-pin { display: none; }
}
html:not(.no-glass) .sidebar button.active {
  background: rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 0 0 1px rgba(255, 255, 255, .12);
  border-radius: 13px;
}
html:not(.no-glass) .sidebar nav button,
html:not(.no-glass) .sidebar-bottom > button { border-radius: 13px; }
html:not(.no-glass) .sidebar .sidebar-me { border-radius: 16px; background: rgba(255, 255, 255, .08); }
@media (max-width: 720px) {
  html:not(.no-glass) .sidebar .brand { background: transparent; }
  html:not(.no-glass) .sidebar {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(160%);
    backdrop-filter: blur(var(--glass-blur)) saturate(160%);
  }
}


/* ---- Шапка раздела: матовое стекло, содержимое уходит под неё ---- */
html:not(.no-glass) .top {
  background: var(--glass-top);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-bottom-color: color-mix(in srgb, var(--glass-line) 70%, transparent);
}

/* ---- Главная: цвета внутри карточек — под стекло ---- */
html:not(.no-glass) .home4 {
  --surface-card: var(--glass-chip);
  --surface-card-2: var(--glass-chip);
  --surface-hover: rgba(255, 255, 255, .72);
  --line: var(--glass-line);
  --muted: #55627a;
}
html[data-theme=dark]:not(.no-glass) .home4 {
  --surface-hover: rgba(255, 255, 255, .1);
  --muted: #a9b4c7;
}
html:not(.no-glass) .home4 .home-w,
html:not(.no-glass) .home4 .home-tune,
html:not(.no-glass) .home4 .home-gallery {
  background: var(--glass-card);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
}
html:not(.no-glass) .home4 .home-w { border-radius: 24px; padding: 16px 18px; }
html:not(.no-glass) .home4 .home-w[data-h="0.5"] { padding: 11px 16px; }
html:not(.no-glass) .home4 .home-w:hover { box-shadow: var(--glass-shadow), 0 16px 36px rgba(28, 44, 80, .12); }
html:not(.no-glass) .home4 .home-w-ico { border-radius: 12px; }
html:not(.no-glass) .home4 .home-tune, html:not(.no-glass) .home4 .home-gallery { border-radius: 22px; }

/* Приветствие — самое плотное стекло на странице. */
html:not(.no-glass) .home-greet {
  padding: 24px 28px; border-radius: 30px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
}
html:not(.no-glass) .home-greet h1 { font-size: 30px; }
html:not(.no-glass) .hg-chip { background: var(--glass-chip); border-color: var(--glass-line); }
html:not(.no-glass) .hg-weather,
html:not(.no-glass) .hg-tune { background: var(--glass-chip); border: 1px solid var(--glass-line); }
html:not(.no-glass) .hg-weather { padding: 8px 12px; border-radius: 18px; }
html:not(.no-glass) .hg-tune { border-radius: 14px; }
html:not(.no-glass) .home4 .htl-track { border-radius: 12px; }
html:not(.no-glass) .home4 .htl-bar { border-radius: 9px; border-left-width: 0; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 38%, transparent); }
html:not(.no-glass) .home4 .htl-tabs button { background: var(--glass-chip); }
html:not(.no-glass) .home4 .htl-tabs button.is-on { background: var(--home3-wine); box-shadow: 0 6px 16px color-mix(in srgb, var(--home3-wine) 30%, transparent); }

/* ---- Строка «Сегодня: …» и погода на три дня (приветствие) ---- */
.hg-sentence { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.hg-sentence b { color: var(--text); font-weight: 750; }
.hg-days { display: flex; gap: 4px; margin-left: 6px; }
.hg-days span { display: grid; justify-items: center; min-width: 36px; padding: 3px 4px; border-radius: 9px; background: color-mix(in srgb, var(--line) 50%, transparent); }
.hg-days small { color: var(--muted); font-size: 10px; text-transform: lowercase; }
.hg-days b { font-size: 12px !important; font-weight: 800; }
@media (max-width: 1100px) { .hg-days { display: none; } }

/* ---- «На смене сегодня» ---- */
.home-crew-list { display: grid; gap: 10px; min-height: 0; overflow: auto; }
.home-crew { display: grid; gap: 6px; }
.home-crew-head {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface-card);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.home-crew-head:hover { background: var(--surface-hover); }
.home-crew-name { flex: 1 1 auto; min-width: 0; display: grid; }
.home-crew-name b { font-size: 13px; }
.home-crew-name small { overflow: hidden; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.home-crew-go { color: var(--muted); }
.home-crew.is-open .home3-center-dot { background: #1f9d6b; box-shadow: 0 0 0 3px rgba(31, 157, 107, .16); }
.home-crew.is-warn .home3-center-dot { background: #d08a1e; }
.home-crew-people { display: grid; gap: 4px; padding: 0 4px; }
.home-crew-person { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 3px 4px; }
.home-crew-person .home3-avatar { width: 30px; height: 30px; font-size: 11px; }
.home-crew-copy { display: grid; min-width: 0; }
.home-crew-copy b { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.home-crew-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.home-crew-time { padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--line) 55%, transparent); font-size: 11.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.home-crew-person.is-active .home-crew-time { background: rgba(31, 157, 107, .16); color: #16603f; }
.home-crew-person.is-ended { opacity: .55; }
.home-crew-person.is-duty .home-crew-copy small { color: var(--home3-gold); }
[data-theme=dark] .home-crew-person.is-active .home-crew-time { color: #7fdcae; }

/* ---- Новые виджеты (38-home-widgets.js) ---- */
.hx-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--line) 60%, transparent); color: var(--muted); font-size: 11px; font-style: normal; font-weight: 800; white-space: nowrap; }
.hx-chip.is-ok { background: rgba(31, 157, 107, .16); color: #16603f; }
.hx-chip.is-warn { background: rgba(214, 150, 40, .2); color: #7d4f08; }
.hx-chip.is-bad { background: color-mix(in srgb, var(--home3-wine) 12%, transparent); color: var(--home3-wine); }
[data-theme=dark] .hx-chip.is-ok { color: #7fdcae; }
[data-theme=dark] .hx-chip.is-warn { color: #f3c46b; }
.hx-faint { color: var(--muted); font-size: 11.5px; }
.hx-more { padding: 0; border: 0; background: none; color: var(--home3-wine); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; text-align: left; }
.hx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; }
.hx-actions .home-ico { width: 15px; height: 15px; flex: none; }

.hx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; height: 100%; }
.hx-stat {
  display: grid; align-content: space-between; gap: 4px; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface-card);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.hx-stat:hover:not(:disabled) { background: var(--surface-hover); }
.hx-stat:disabled { cursor: default; }
.hx-stat-label { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.hx-stat-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.hx-stat-row b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.hx-stat small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.hx-crm { display: grid; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.hx-crm-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hx-crm-head > b { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.hx-crm-head > span { color: var(--muted); font-size: 12px; }
.hx-crm-centers { display: flex; flex-wrap: wrap; gap: 5px; }
.hx-bars { display: grid; gap: 5px; }
.hx-bar { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 26px; align-items: center; gap: 8px; font-size: 11.5px; }
.hx-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-bar > b { text-align: right; font-variant-numeric: tabular-nums; }
.hx-bar-track { position: relative; display: block; height: 8px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--line) 70%, transparent); }
.hx-bar-track i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--home3-wine); }

.hx-kis { display: grid; gap: 8px; height: 100%; align-content: start; }
.hx-kis-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hx-kis-top > span { display: grid; }
.hx-kis-top > span b { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.hx-kis-top > span small { color: var(--muted); font-size: 11.5px; }
.hx-kis-centers { display: grid; gap: 3px; font-size: 11.5px; color: var(--muted); }

.hx-list { display: grid; gap: 6px; align-content: start; height: 100%; }
.hx-li {
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-card); color: var(--text); font: inherit; font-size: 12.5px; text-align: left;
}
button.hx-li { cursor: pointer; }
button.hx-li:hover { background: var(--surface-hover); }
.hx-li > i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.hx-li > i.is-bad { background: #c2365f; } .hx-li > i.is-warn { background: #d08a1e; } .hx-li > i.is-ok { background: #1f9d6b; } .hx-li > i.is-info { background: #3b6fd8; }
.hx-li > b { overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.hx-li > small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.hx-li.is-thanks, .hx-li.is-ack { grid-template-columns: 8px minmax(0, 1fr); }
.hx-li.is-thanks > small { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-li.is-ack { grid-template-columns: 8px minmax(0, 1fr) auto; }
.hx-li-title { min-width: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hx-li-title b { display: block; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.hx-bus { display: grid; gap: 10px; height: 100%; align-content: start; }
.hx-bus-top { display: flex; align-items: center; gap: 12px; }
.hx-date { display: grid; place-items: center; flex: none; width: 50px; height: 54px; border-radius: 15px; background: var(--home3-wine-soft); color: var(--home3-wine); }
.hx-date b { font-size: 20px; line-height: 1; }
.hx-date small { font-size: 10px; font-weight: 700; }
.hx-bus-copy { display: grid; min-width: 0; }
.hx-bus-copy b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.hx-bus-copy small { color: var(--muted); font-size: 11.5px; }
.hx-occ { display: grid; gap: 4px; }
.hx-occ small { color: var(--muted); font-size: 11.5px; }
.hx-occ b { color: var(--text); }

.hx-month { display: grid; gap: 10px; height: 100%; align-content: start; }
.hx-month-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hx-month-nums span { display: grid; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-card); }
.hx-month-nums b { font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hx-month-nums small { color: var(--muted); font-size: 11px; }
.hx-weeks { display: flex; align-items: flex-end; gap: 8px; height: 64px; }
.hx-weeks span { flex: 1 1 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 3px; height: 100%; }
.hx-weeks i { align-self: end; width: 100%; max-width: 46px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, #3b6fd8 45%, transparent); }
.hx-weeks span.is-now i { background: #3b6fd8; }
.hx-weeks small { color: var(--muted); font-size: 10px; }

.hx-ask { display: flex; gap: 8px; }
.hx-ask-field { flex: 1 1 auto; display: block; min-width: 0; }
.hx-ask input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-card); color: var(--text); font: inherit; font-size: 13px; }
.hx-answer { margin-top: 10px; padding: 10px 12px; max-height: 150px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-card); font-size: 12.5px; line-height: 1.5; }
.home4 .home-w[data-id="assistant"] .home-w-body > .hx-faint { margin: 10px 0 0; }

@media (max-width: 760px) {
  .hx-month-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   v506 — ВЕСЬ ПОРТАЛ, ЭТАП 1: ОБЩИЙ КАРКАС (решение владельца 24.10.2026)
   Тихий фон с пятнами на всех страницах (ярче — только главная), стеклянные
   панели разделов, полупрозрачные вкладки и поиск, окна и уведомления.
   Логика не меняется — только оформление.
   Плотные разделы (График, Календарь, таблица CRM, история КИС) — этап 2:
   там стекло будет только рамкой, ячейки останутся плотными; до тех пор
   их панели не трогаем. Поля ввода плотные — видно, куда печатать.
   ============================================================ */

html:not(.no-glass) {
  --gl-panel: rgba(255, 255, 255, .58);
  --gl-panel-line: rgba(255, 255, 255, .8);
  --gl-panel-shadow: inset 0 1px 0 rgba(255, 255, 255, .92), 0 10px 28px rgba(28, 44, 80, .08);
  --gl-inner: rgba(255, 255, 255, .58);
  --gl-ctrl: rgba(255, 255, 255, .66);
  --gl-quiet1: rgba(160, 30, 72, .2);
  --gl-quiet2: rgba(66, 110, 214, .18);
  --gl-quiet3: rgba(244, 170, 104, .22);
}
html[data-theme=dark]:not(.no-glass) {
  --gl-panel: rgba(26, 36, 58, .6);
  --gl-panel-line: rgba(255, 255, 255, .1);
  --gl-panel-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 14px 34px rgba(0, 0, 0, .32);
  --gl-inner: rgba(255, 255, 255, .05);
  --gl-ctrl: rgba(255, 255, 255, .06);
  --gl-quiet1: rgba(170, 32, 80, .26);
  --gl-quiet2: rgba(48, 88, 196, .26);
  --gl-quiet3: rgba(196, 110, 50, .13);
}

/* ---- Тихий фон на всех страницах: пятна неподвижны при прокрутке ---- */
html:not(.no-glass) body,
html[data-theme=dark]:not(.no-glass) body { background: var(--bg); isolation: isolate; }
html:not(.no-glass) body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; transform: translateZ(0);
  background:
    radial-gradient(48vw 48vw at 8% -6%, var(--gl-quiet1), transparent 70%),
    radial-gradient(44vw 44vw at 100% 38%, var(--gl-quiet2), transparent 70%),
    radial-gradient(52vw 40vw at 46% 108%, var(--gl-quiet3), transparent 70%);
}
html[data-theme=dark]:not(.no-glass) { background: var(--bg); }

/* ---- Панели разделов ----
   Карточки, списки, плитки и цифры-итоги. Внутри панели вторичные подложки
   тоже полупрозрачные — иначе на стекле остаются белые «заплатки». */
html:not(.no-glass) :is(
  .card, .pl-card, .pl-counter, .lo-kpi, .cmdai-history, .cmdai-chat, .fm-summary,
  .crm-tile, .sup-stat, .sup-list, .ah-kpi, .ah-list, .tc-card, .tc-bus, .tc-thx-form,
  .kb-ask, .kb-tile, .bs-summary, .bs-day, .lk-tile, .adm-tile, .nw-list, .n2-push, .n2-list,
  .pf-fact, .idea-card, .kis-task
) {
  --surface-card-2: var(--gl-inner);
  --surface-hover: color-mix(in srgb, var(--gl-inner) 60%, rgba(255, 255, 255, .5));
  background: var(--gl-panel);
  border: 1px solid var(--gl-panel-line);
  box-shadow: var(--gl-panel-shadow);
}
html:not(.no-glass) :is(.card, .ah-list, .nw-list, .n2-list, .sup-list, .bs-day, .cmdai-chat, .cmdai-history) { border-radius: 22px; }

/* ---- v507, этап 2: плотные разделы (решение владельца 24.10.2026) ----
   График, редактор графика, календарь, заявки CRM, курсы ФМБА: стекло —
   только рамка вокруг таблицы (отступ 6 px), сама таблица на плотном фоне,
   цвета ячеек прежние. Внутренние подложки этих карточек не трогаем
   (inherit, не initial: initial делает var() недействительным). */
html:not(.no-glass) { --gl-solid: #ffffff; }
html[data-theme=dark]:not(.no-glass) { --gl-solid: #152234; }
html:not(.no-glass) :is(.schedule-page, .sed-page, .calendar-page, .crm-page, .fm-page) .card,
html:not(.no-glass) :is(.crm-table-wrap, .calendar-sidebar-inner, .sg-me, .sed-who) {
  --surface-card-2: inherit;
  --surface-hover: inherit;
  background: var(--gl-panel);
  border: 1px solid var(--gl-panel-line);
  box-shadow: var(--gl-panel-shadow);
  border-radius: 22px;
}
html:not(.no-glass) :is(.card.sg-month, .card.calendar-board, .crm-table-wrap) { padding: 6px; }
html:not(.no-glass) :is(.sg-scroll, .calendar-time-grid, .calendar-month-view, .sed-cal) { background: var(--gl-solid); border-radius: 16px; }
html:not(.no-glass) .crm-table { background: var(--gl-solid); clip-path: inset(0 round 16px); }

/* ---- Вкладки, переключатели, поиск — полупрозрачные, без размытия ---- */
html:not(.no-glass) :is(
  .tk-search, .tk-seg, .tabs, .sup-tabs, .bus-tabs, .tc-tabs, .tc-seg, .schedule-section-tabs,
  .schedule-mode-tabs, .schedule-period-control, .schedule-desktop-centers, .calendar-toolbar,
  .calendar-mode-tabs, .bs-filters, .seg, .filter
) {
  background: var(--gl-ctrl);
  border-color: var(--gl-panel-line);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--gl-panel-line) 70%, transparent);
}

/* ---- Окна: матовое стекло над притушенной страницей ---- */
html:not(.no-glass) dialog {
  /* Плотнее карточек: в окне чаще всего форма, поля должны читаться. */
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid var(--gl-panel-line);
  border-radius: 24px;
  box-shadow: var(--gl-panel-shadow), 0 30px 70px rgba(15, 27, 43, .28);
}
html[data-theme=dark]:not(.no-glass) dialog { background: rgba(20, 30, 48, .86); }
html:not(.no-glass) dialog::backdrop {
  background: rgba(15, 27, 43, .3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* ---- Всплывающие уведомления ---- */
html:not(.no-glass) #toast {
  background: rgba(19, 37, 64, .84);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 14px;
}

/* ============================================================
   v508 — ЭТАП 3: «ЗАПЛАТКИ» (24.10.2026)
   Найдены обходом всех разделов на копии — и вложенных страниц: задача,
   заявка, объявление, документ, сотрудник, памятка, идея, забытая вещь,
   вкладки профиля, команды и администрирования, — в светлой и тёмной теме:
   блоки, оставшиеся сплошными поверх стекла.
   Сознательно остаются плотными: поля ввода и строка ввода CMD AI,
   таблица истории выгрузок КИС, предпросмотр документа («бумага»),
   пьедестал «Активности», выбранные вкладки и чипы.
   ============================================================ */

/* Отдельные панели на фоне страницы — стекло с размытием (их по несколько). */
html:not(.no-glass) :is(.employee-stat, .lo-card, .adm-menu, .lk-stat) {
  background: var(--gl-panel);
  border: 1px solid var(--gl-panel-line);
  box-shadow: var(--gl-panel-shadow);
}

/* Карточки длинных списков — полупрозрачные без размытия: описаний
   экскурсий на странице больше сотни, размывать каждую тяжело. */
html:not(.no-glass) :is(.lo-row, .kb-card, .exc-card) {
  background: var(--gl-panel);
  border: 1px solid var(--gl-panel-line);
  box-shadow: 0 6px 18px rgba(28, 44, 80, .06);
}

/* Второстепенные кнопки, вкладки и чипы — как остальные переключатели.
   Выбранные (is-on, бордовые) не трогаем. */
html:not(.no-glass) :is(
  .tk-btn, .employee-btn, .pf-small-btn, .lk-chip:not(.is-on), .pf-tabs > button:not(.is-on),
  .n2-chips > button:not(.is-on), .notif-page .acts > button, .crm-page .is-ghost, .tc-ghost
) {
  background: var(--gl-ctrl);
  border-color: var(--gl-panel-line);
}
/* У причин благодарности фон задан с !important в team-v466.css. */
html:not(.no-glass) .tc-reason:not(.is-on) { background: var(--gl-ctrl) !important; }
html[data-theme=dark]:not(.no-glass) .schedule-mode-tabs.schedule-desktop-view-toggle { background: var(--gl-ctrl); }

/* Подложки внутри стеклянных панелей — полупрозрачные. */
html:not(.no-glass) :is(.pf-cal-detail, .pf-seg, .pf-layout, .nd-line, .tc-pchip, .bs-day h3, .pf-devices > li) {
  background: var(--gl-inner);
}

/* ---- v512: «Идёт сейчас» — пульс без перерисовки (оба оформления) ----
   Раньше пульсировала тень точки: браузер перерисовывал её каждый кадр,
   а вместе с ней — размытое стекло карточки. Теперь расходится кольцо —
   масштаб и прозрачность считает видеокарта. */
.htl-sum .is-live i { position: relative; animation: none; }
.htl-sum .is-live i::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--h4-now);
  animation: v512-live 1.8s ease-out infinite; will-change: transform, opacity;
}
@keyframes v512-live { 0% { transform: scale(1); opacity: .45; } 70%, 100% { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .htl-sum .is-live i::after { animation: none; } }
