/* МАСПКП — дизайн-система v4: официальный минимализм (ориентиры: Apple / Google).
   Белый фон, нейтральные серые плитки-секции, один сдержанный синий акцент,
   типографика Onest 600/700 без украшений, пилюльные кнопки, мягкие радиусы.
   Формы: кнопки pill, карточки и панели 18px, поля 12px. Тени почти не используются:
   иерархию несут серые заливки и воздух. */

:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.966 0.002 255);      /* спокойный серый, как у системных сайтов */
  --surface-2: oklch(0.936 0.003 255);
  --ink: oklch(0.23 0.012 258);
  --muted: oklch(0.46 0.014 258);
  --border: oklch(0.905 0.005 255);
  --primary: oklch(0.54 0.175 258);        /* институциональный синий */
  --primary-strong: oklch(0.47 0.165 258);
  --primary-text: oklch(0.995 0.002 258);
  --primary-tint: oklch(0.952 0.022 258);
  --gold: oklch(0.72 0.11 80);             /* только печать сертификата */
  --gold-deep: oklch(0.55 0.10 75);
  --danger: oklch(0.52 0.16 25);
  --ok: oklch(0.52 0.12 160);
  --shadow-sm: 0 1px 2px oklch(0.3 0.02 258 / 0.07), 0 4px 14px oklch(0.3 0.02 258 / 0.06);
  --shadow: 0 10px 30px oklch(0.3 0.02 258 / 0.12);
  --font: "Onest", "Segoe UI", system-ui, sans-serif;
  --r-btn: 999px;
  --r-card: 18px;
  --r-field: 12px;
  --z-sticky: 50;
  --z-overlay: 100;
  --z-toast: 200;
}
/* Тема одна, светлая: сайт всегда белый, независимо от темы системы.
   color-scheme: light закрепляет светлые системные контролы и скроллбары. */
:root { color-scheme: light; }

* { box-sizing: border-box; }
/* Атрибут hidden сильнее любого display у класса (.card, .empty и т.п.) */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.03125rem; /* 16.5px при корне 16px; на широких экранах корень растёт (см. блок «Широкие экраны») */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Футер прижат к низу даже на коротких страницах (результат теста, проверка сертификата) */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > .site-footer { margin-top: auto; }
img { max-width: 100%; }

h1, h2 {
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.4rem, 4.8vw, 3.7rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
h3, h4 { font-weight: 600; line-height: 1.3; text-wrap: balance; margin: 0 0 0.4em; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; max-width: 72ch; text-wrap: pretty; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.section { padding-block: clamp(44px, 6vw, 68px); }
.section-tight { padding-block: clamp(32px, 4.5vw, 48px); }
.section-head { max-width: 640px; margin-bottom: clamp(32px, 4vw, 52px); }
.section-head p { color: var(--muted); font-size: 1.03rem; }
/* Строка заголовка секции с действием справа */
.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head-row .section-head { margin-bottom: 0; }
.section-head-row .section-head p { margin-bottom: 0; }
.section-head-row .btn { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: var(--z-sticky);
  background: color-mix(in oklch, var(--bg) 85%, transparent);
  backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: calc(var(--z-sticky) + 1);
  background: var(--bg);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  flex: none; /* логотип с названием не сжимается — меню не может его перекрыть */
}
.logo:hover { text-decoration: none; }
.logo-img { height: 38px; width: auto; display: block; flex: none; }
.logo-img-lg { height: 50px; }
/* Название в 3 фиксированные строки (переносы заданы <br>), заглавными, в цвет логотипа.
   Высота: 3 x 1.4 x 0.64rem = 44px при шапке 68px, вылезти не может. */
.logo-caption {
  white-space: nowrap;
  font-size: 0.6rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-transform: uppercase;
  color: var(--ink);
  border-left: 1px solid var(--border);
  padding-left: 12px;
}
/* 1024-1219px: полное меню, CTA и трёхстрочное название не помещаются вместе — название уступает */
@media (min-width: 1024px) and (max-width: 1219px) { .site-header .logo-caption { display: none; } }
@media (max-width: 480px) {
  .logo-img { height: 30px; }
  .logo-caption { font-size: 0.5rem; letter-spacing: 0.01em; padding-left: 9px; }
}
.main-nav { display: flex; gap: 2px; margin-left: auto; }
.main-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 11px;
  border-radius: var(--r-btn);
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.main-nav a:hover { color: var(--ink); background: var(--surface); text-decoration: none; }
.main-nav a.active { color: var(--ink); background: var(--surface-2); }
.main-nav .nav-cabinet { display: none; } /* показывается только в мобильном меню */
/* Переключатель языка (вставляется assets/i18n.js перед кнопкой «Личный кабинет») */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface); margin-left: auto; }
.lang-switch button { border: 0; background: transparent; font: inherit; font-size: 0.78rem; font-weight: 600; color: var(--muted); padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.lang-switch button:hover { color: var(--ink); }
.lang-switch button.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }
.header-inner .lang-switch + .header-cta { margin-left: 0; }
/* Казахские названия длиннее: на средних экранах прячем подпись логотипа, чтобы шапка не ломалась */
/* Семь пунктов меню и переключатель языка: на экранах уже 1760px подпись логотипа прячем */
@media (min-width: 1024px) and (max-width: 1760px) { .site-header .logo-caption { display: none; } }
.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--surface);
  border: 0;
  border-radius: var(--r-btn);
  padding: 9px 18px;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 1023px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 10px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav .nav-cabinet { display: block; }
  .main-nav a { padding: 12px 16px; }
  .main-nav .nav-cabinet { margin-top: 8px; background: var(--primary); color: var(--primary-text); text-align: center; font-weight: 600; }
  .main-nav .nav-cabinet:hover { background: var(--primary); color: var(--primary-text); }
  .nav-toggle { display: block; margin-left: 0; padding: 9px 12px; }
  .site-header .header-cta { display: none; } /* .btn задаёт display позже в файле, поэтому нужна специфичность выше */
  .lang-switch { margin-left: auto; }
  .lang-switch button { padding: 4px 7px; font-size: 0.72rem; }
}
/* На телефоне в шапке остаются логотип, переключатель языка и кнопка меню */
@media (max-width: 560px) { .site-header .logo-caption { display: none; } .header-inner { gap: 10px; } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.18s ease,
              transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-secondary:hover { background: color-mix(in oklch, var(--surface-2) 80%, var(--muted) 20%); }
.btn-soft { background: var(--primary-tint); color: color-mix(in oklch, var(--primary) 80%, var(--ink) 20%); }
.btn-soft:hover { background: color-mix(in oklch, var(--primary-tint) 78%, var(--primary) 22%); }
.btn-sm { padding: 8px 18px; font-size: 0.875rem; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { border-color: var(--danger); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ---------- Герой: белый, воздух, одна мысль ---------- */
.hero {
  padding-block: clamp(44px, 6vw, 72px) clamp(40px, 5.5vw, 64px);
  background:
    linear-gradient(90deg,
      var(--bg) 0%,
      var(--bg) 40%,
      color-mix(in oklch, var(--bg) 80%, transparent) 62%,
      color-mix(in oklch, var(--bg) 22%, transparent) 100%),
    url("img/hero-doctor.jpg") right center / cover no-repeat;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 860px) {
  .hero {
    background:
      linear-gradient(color-mix(in oklch, var(--bg) 93%, transparent), color-mix(in oklch, var(--bg) 93%, transparent)),
      url("img/hero-doctor.jpg") right center / cover no-repeat;
  }
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: center;
}
.hero h1 { margin-bottom: 20px; }
.hero-sub {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 34px;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions .btn { padding: 14px 30px; font-size: 1rem; }

/* Панель события: серая системная плитка */
.hero-panel {
  background: color-mix(in oklch, var(--bg) 84%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 30px;
  box-shadow: var(--shadow-sm);
}
.hero-panel .event-date {
  display: inline-block;
  background: var(--primary-tint);
  color: color-mix(in oklch, var(--primary) 80%, var(--ink) 20%);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: var(--r-btn);
  margin-bottom: 16px;
}
.hero-panel h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.hero-panel p { color: var(--muted); }
.hero-panel ul {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
  font-size: 0.93rem;
  color: var(--muted);
}
.hero-panel li { padding: 9px 0; border-bottom: 1px solid var(--border); }
.hero-panel li:last-child { border-bottom: 0; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  .hero h1 { animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero-sub { animation: rise 0.6s 0.07s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero-actions { animation: rise 0.6s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .hero-panel { animation: rise 0.7s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both; }
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
}

/* ---------- Полоса фактов ---------- */
.facts { border-block: 1px solid var(--border); }
.facts-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(20px, 3vw, 44px);
  padding-block: clamp(36px, 5vw, 56px);
}
.fact strong {
  display: block;
  font-size: clamp(2.2rem, 3.4vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}
.fact span { color: var(--muted); font-size: 0.9rem; line-height: 1.45; display: block; max-width: 24ch; }
@media (max-width: 760px) { .facts-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Сетки ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 960px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Карточка: серая системная плитка без рамок */
.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  transition: background 0.2s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.card h3 { margin-bottom: 2px; }
.card p { color: var(--muted); font-size: 0.93rem; margin: 0; }
.card .card-foot { margin-top: auto; padding-top: 14px; }

/* ---------- Направления ---------- */
.directions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(32px, 5vw, 72px); }
.direction-row {
  display: flex;
  align-items: center; /* иконка по центру блока заголовок+описание */
  gap: 18px;
  padding: 26px 0;
  border-bottom: 1px solid var(--border);
}
.direction-row:nth-last-child(-n+2) { border-bottom: 0; }
.direction-num {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: color-mix(in oklch, var(--primary) 80%, var(--ink) 20%);
  display: grid;
  place-items: center;
}
.direction-row h3 { font-weight: 600; font-size: 1.12rem; margin-bottom: 5px; }
.direction-row p { color: var(--muted); font-size: 0.93rem; margin: 0; }
@media (max-width: 760px) {
  .directions { grid-template-columns: 1fr; }
  .direction-row:nth-last-child(2) { border-bottom: 1px solid var(--border); }
}

/* ---------- Специалисты ---------- */
.avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 1rem;
  color: oklch(0.99 0.002 258);
  flex: none;
}
.spec-card { gap: 0; background: var(--bg); border: 1px solid var(--border); }
.spec-card:hover { box-shadow: var(--shadow-sm); }
.spec-top { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.spec-top h3 { margin: 0; font-size: 1.05rem; }
.spec-top .muted { font-size: 0.85rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.tag {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  padding: 4px 12px;
  border-radius: var(--r-btn);
}
.spec-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: auto;
}
.spec-price { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05rem; }

/* ---------- Фильтры ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
  border: 0;
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--r-btn);
  padding: 9px 18px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip.active { background: var(--ink); color: var(--bg); }

/* ---------- Шаги записи ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  counter-reset: step;
}
.step {
  counter-increment: step;
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 26px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto 1fr; /* третья строка (демо) забирает остаток высоты карточки */
  gap: 6px 16px;
  align-content: start;
}
.step::before {
  content: counter(step);
  grid-row: 1 / 3;
  align-self: stretch;
  display: grid;
  place-items: center;
  width: 48px;
  border-radius: var(--r-field);
  background: var(--bg);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step h3 { font-size: 1.05rem; margin: 0; align-self: center; }
.step p { grid-column: 2; color: var(--muted); font-size: 0.92rem; margin: 0; }
.step::before { grid-row: 1 / 3; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Мини-демо шагов записи ----------
   Зацикленные CSS-виньетки вместо видео: выбор в списке, барабан времени, подтверждение.
   По умолчанию (и при reduced-motion) показан финальный кадр; анимация только как улучшение. */
.step-demo {
  grid-column: 1 / -1;
  align-self: end; /* демо прижато к низу: во всех трёх карточках на одной линии */
  position: relative;
  height: 122px;
  margin-top: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  overflow: hidden;
}

/* Шаг 1: список специалистов */
.demo-list { padding-top: 43px; transform: translateY(-72px); }
.demo-row { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 12px; }
.demo-row i {
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  font-style: normal;
  display: grid;
  place-items: center;
  flex: none;
}
.demo-row span { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.demo-row b { height: 7px; width: 70%; border-radius: 4px; background: var(--surface-2); }
.demo-row u { height: 5px; width: 46%; border-radius: 4px; background: var(--surface-2); text-decoration: none; }
.demo-ring {
  position: absolute;
  left: 7px; right: 7px; top: 43px;
  height: 36px;
  border: 2px solid var(--primary);
  border-radius: 10px;
  pointer-events: none;
}
.demo-pick-check {
  position: absolute;
  right: 16px; top: 51px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: grid;
  place-items: center;
}

/* Шаг 2: барабан времени */
.demo-wheel { display: grid; justify-items: center; }
.demo-times {
  padding-block: 46px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--muted);
  transform: translateY(-120px);
  mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 32%, #000 68%, transparent);
}
.demo-time { height: 30px; line-height: 30px; font-size: 0.88rem; }
.demo-pill {
  position: absolute;
  left: 50%; top: 46px;
  transform: translateX(-50%);
  width: 92px; height: 30px;
  background: var(--primary-tint);
  border-radius: 8px;
  pointer-events: none;
}

/* Шаг 3: подтверждение */
.demo-approve { display: grid; place-items: center; }
.approve-circle { stroke: var(--ok); }
.approve-check {
  stroke: var(--ok);
  stroke-dasharray: 36;
  stroke-dashoffset: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .demo-list { animation: demo-pick 7s ease-in-out infinite; }
  @keyframes demo-pick {
    0%, 14%   { transform: translateY(0); }
    30%, 44%  { transform: translateY(-36px); }
    60%, 100% { transform: translateY(-72px); }
  }
  .demo-pick-check { opacity: 0; animation: demo-check-pop 7s ease infinite; }
  @keyframes demo-check-pop {
    0%, 63%  { opacity: 0; transform: scale(0.4); }
    70%, 100% { opacity: 1; transform: scale(1); }
  }
  .demo-times { animation: demo-drum 7s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
  @keyframes demo-drum {
    0%, 12%   { transform: translateY(0); }
    52%       { transform: translateY(-134px); }
    64%, 100% { transform: translateY(-120px); }
  }
  .approve-mark { animation: approve-pop 4.5s ease infinite; transform-origin: center; }
  @keyframes approve-pop {
    0%        { transform: scale(0.55); opacity: 0; }
    16%       { transform: scale(1.06); opacity: 1; }
    24%, 86%  { transform: scale(1); opacity: 1; }
    100%      { transform: scale(1); opacity: 0; }
  }
  .approve-check { animation: approve-draw 4.5s ease infinite; }
  @keyframes approve-draw {
    0%, 18%   { stroke-dashoffset: 36; }
    44%, 100% { stroke-dashoffset: 0; }
  }
}

/* ---------- Руководство ---------- */
.people { display: flex; flex-direction: column; }
.person-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.8fr);
  gap: 22px;
  align-items: center;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.person-row:first-child { border-top: 1px solid var(--border); }
.person-row .avatar {
  width: 104px;
  height: 104px;
  border-radius: var(--r-field);
}
@media (max-width: 760px) { .person-row .avatar { width: 84px; height: 84px; } }
.person-row h3 { margin: 0 0 2px; font-weight: 600; font-size: 1.1rem; }
.person-row .role { color: var(--primary); font-size: 0.86rem; font-weight: 600; }
.person-row .bio { color: var(--muted); font-size: 0.9rem; margin: 0; }
@media (max-width: 760px) {
  .person-row { grid-template-columns: auto 1fr; }
  .person-row .bio { grid-column: 1 / -1; }
}

/* ---------- Акцентная секция: крупная серая плитка ---------- */
.band {
  background: var(--surface);
  color: var(--ink);
  border-radius: calc(var(--r-card) + 8px);
  padding: clamp(36px, 5vw, 64px);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
/* Вариант с фоновым фото: тёмная вуаль держит контраст текста */
.band.band-photo {
  background:
    linear-gradient(95deg, oklch(0.21 0.03 250 / 0.92) 0%, oklch(0.24 0.03 250 / 0.72) 55%, oklch(0.28 0.03 250 / 0.5) 100%),
    url("img/cert-sign.jpg") center 40% / cover no-repeat;
  color: oklch(0.98 0.002 258);
}
.band.band-photo p { color: oklch(0.88 0.008 258); }
.band h2 { color: inherit; margin-bottom: 12px; }
.band p { color: var(--muted); margin: 0; }
.band .btn { background: var(--primary); color: var(--primary-text); justify-self: start; padding: 14px 30px; font-size: 1rem; }
.band .btn:hover { background: var(--primary-strong); }
@media (max-width: 760px) { .band { grid-template-columns: 1fr; } .band .btn { justify-self: stretch; } }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field .hint { color: var(--muted); font-size: 0.82rem; }
.field .error { color: var(--danger); font-size: 0.82rem; display: none; }
.field.invalid .error { display: block; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--danger); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid color-mix(in oklch, var(--ink) 24%, transparent);
  border-radius: var(--r-field);
  padding: 11px 15px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in oklch, var(--ink) 45%, transparent); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--primary) 20%, transparent);
}
textarea { min-height: 110px; resize: vertical; }
input::placeholder, textarea::placeholder { color: color-mix(in oklch, var(--muted) 85%, var(--bg)); }

/* ---------- Слоты ---------- */
.slot-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--r-btn);
  padding: 9px 17px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.slot:hover { border-color: var(--primary); }
.slot.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.slot.taken { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

/* ---------- Переключатель ---------- */
.seg {
  display: inline-flex;
  border: 0;
  border-radius: var(--r-btn);
  padding: 4px;
  background: var(--surface-2);
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 19px;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: color 0.15s ease;
}
.seg button.active { background: var(--bg); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Модальное окно ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0.2 0.01 258 / 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 24px max(16px, env(safe-area-inset-left, 0px)) 24px max(16px, env(safe-area-inset-right, 0px));
  z-index: var(--z-overlay);
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg);
  border-radius: calc(var(--r-card) + 4px);
  max-width: 560px;
  width: 100%;
  padding: 30px;
  margin-block: auto;
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: no-preference) {
  .modal-overlay.open .modal { animation: rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
}
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.modal-head h3 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.modal-close {
  border: 0;
  background: var(--surface);
  color: var(--muted);
  width: 36px; height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  flex: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.modal-close:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- Тост ---------- */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: var(--bg);
  padding: 13px 26px;
  border-radius: var(--r-btn);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Тесты ---------- */
.quiz-progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--r-btn);
  overflow: hidden;
  margin-bottom: 26px;
}
.quiz-progress i { display: block; height: 100%; background: var(--primary); border-radius: var(--r-btn); transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--r-field);
  padding: 15px 17px;
  width: 100%;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option:hover { border-color: var(--primary); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-tint); }
.quiz-option .dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-option.selected .dot { border-color: var(--primary); background: var(--primary); }

/* ---------- Сертификат ---------- */
.certificate {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: clamp(32px, 5vw, 52px);
  padding-bottom: 96px; /* полоса под золотую печать, чтобы она не наезжала на дату */
  text-align: center;
  position: relative;
  overflow: hidden;
  max-width: 660px;
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
}
.certificate::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid color-mix(in oklch, var(--gold-deep) 35%, transparent);
  border-radius: calc(var(--r-card) - 6px);
  pointer-events: none;
}
.certificate::after {
  content: "";
  position: absolute;
  right: 36px; bottom: 26px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, color-mix(in oklch, var(--gold) 85%, oklch(1 0 0)), var(--gold-deep));
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px color-mix(in oklch, var(--gold-deep) 50%, transparent);
  pointer-events: none;
}
.certificate .cert-org {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 22px;
}
.certificate .cert-title { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.certificate .cert-name { font-size: 1.4rem; font-weight: 700; color: var(--primary); margin: 20px 0 8px; }
.certificate .cert-course { color: var(--muted); max-width: 46ch; margin: 0 auto 24px; }
.certificate .cert-meta {
  display: flex;
  justify-content: center;
  gap: 32px;
  font-size: 0.86rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 20px;
  flex-wrap: wrap;
}
.certificate .cert-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Статьи ---------- */
.article-row {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.article-row:first-child { border-top: 1px solid var(--border); }
.article-cover {
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--r-card);
  background:
    radial-gradient(140px 120px at 75% 25%, color-mix(in oklch, var(--primary) 18%, transparent), transparent 70%),
    linear-gradient(150deg, var(--surface), var(--surface-2));
}
.article-cover.has-photo { background-size: cover; background-position: center; }
.article-photo { display: block; width: 100%; max-height: 440px; object-fit: cover; border-radius: var(--r-card); margin: 20px 0 4px; }
.article-row h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 6px; }
.article-row h3 a { color: inherit; }
.article-row p { color: var(--muted); font-size: 0.94rem; margin: 0 0 10px; }
.article-body { max-width: 68ch; font-size: 1.06rem; }
.article-body p { margin-bottom: 1.15em; }
@media (max-width: 640px) { .article-row { grid-template-columns: 1fr; } .article-cover { max-width: 260px; } }

/* ---------- Лекции ---------- */
.lecture-card { padding: 0; overflow: hidden; background: var(--bg); border: 1px solid var(--border); }
.lecture-poster {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(220px 150px at 80% 20%, color-mix(in oklch, var(--primary) 20%, transparent), transparent 65%),
    linear-gradient(160deg, var(--surface), var(--surface-2));
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--border);
}
.play-badge {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  display: grid;
  place-items: center;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.lecture-poster:hover .play-badge { transform: scale(1.08); }
.lecture-card .lecture-info { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; }
.lecture-card .lecture-info h3 { margin: 0; font-size: 1rem; }
.video-shell {
  background: oklch(0.15 0.008 258);
  border-radius: var(--r-card);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  color: oklch(0.72 0.01 258);
}
.video-shell video { width: 100%; height: 100%; object-fit: contain; }

/* ---------- Админка ---------- */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(28px, 4vw, 48px); align-items: start; }
.admin-menu { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 92px; }
.admin-menu button {
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  font-size: 0.94rem;
  padding: 10px 16px;
  border-radius: var(--r-btn);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-menu button:hover { background: var(--surface); color: var(--ink); }
.admin-menu button.active { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.admin-panel { min-width: 0; }
.admin-panel h2 { font-size: 1.5rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
}
td { font-variant-numeric: tabular-nums; }
td.td-wrap { white-space: normal; min-width: 180px; max-width: 360px; line-height: 1.45; }
/* Таблица заявок самая широкая: ужимаем боковые отступы ячеек, чтобы кнопки решения помещались на Full HD */
#memberWrap table, #bookingsWrap table, #myWrap table, #testsWrap table, #articlesWrap table, #lecturesWrap table, #usersWrap table { font-size: 0.82rem; }
#memberWrap th, #memberWrap td, #bookingsWrap th, #bookingsWrap td, #myWrap th, #myWrap td, #testsWrap th, #testsWrap td, #articlesWrap th, #articlesWrap td, #lecturesWrap th, #lecturesWrap td, #usersWrap th, #usersWrap td { padding: 11px 8px; }
#memberWrap td.td-wrap, #bookingsWrap td.td-wrap, #myWrap td.td-wrap, #testsWrap td.td-wrap, #articlesWrap td.td-wrap, #lecturesWrap td.td-wrap { min-width: 130px; }
#memberWrap .status-pill, #bookingsWrap .status-pill, #myWrap .status-pill, #testsWrap .status-pill { font-size: 0.72rem; padding: 2px 10px; }
#memberWrap .btn-sm, #bookingsWrap .btn-sm, #myWrap .btn-sm, #testsWrap .btn-sm, #articlesWrap .btn-sm, #lecturesWrap .btn-sm, #usersWrap .btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.status-pill {
  display: inline-block;
  padding: 3px 13px;
  border-radius: var(--r-btn);
  font-size: 0.78rem;
  font-weight: 600;
}
.status-pill.online { background: var(--primary-tint); color: color-mix(in oklch, var(--primary) 80%, var(--ink) 20%); }
.status-pill.offline { background: var(--surface-2); color: var(--muted); }
/* Статусы заявок и обращений в кабинете */
.status-pill.new { background: var(--primary-tint); color: color-mix(in oklch, var(--primary) 80%, var(--ink) 20%); }
/* Светлые тона заданы явно: color-mix с var(--bg) (oklch, hue 0) уводит зелёный в розовый */
.status-pill.done { background: oklch(0.94 0.055 160); color: oklch(0.42 0.11 160); }
.status-pill.rejected { background: oklch(0.94 0.04 25); color: var(--danger); }
.status-pill.awaiting { background: oklch(0.94 0.08 88); color: oklch(0.45 0.11 75); }
.status-pill.planned { background: var(--surface-2); color: var(--muted); }
/* Прошедший приём без отметки: жёлтая строка */
tr.is-awaiting td { background: oklch(0.97 0.05 92); }
/* Исполненные обращения и принятые заявки: вся строка зелёная; отклонённые заявки — красная */
tr.is-done td, tr.is-accepted td { background: oklch(0.962 0.038 160); }
tr.is-rejected td { background: oklch(0.962 0.028 25); }
tr.is-rejected td, tr.is-rejected td b { color: color-mix(in oklch, var(--danger) 70%, var(--ink) 30%); }
.req-actions { display: flex; gap: 6px; white-space: nowrap; } /* две кнопки в ряд, без переноса */
/* ---------- Обзор: графики ----------
   Серии: #2a78d6 (синий), #eb6834 (оранжевый), #1baf7a (аква) — проверены валидатором палитры.
   Статусы приёмов: зелёный / красный / жёлтый + нейтральный серый, всегда с подписью в легенде. */
.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.kpi { background: var(--bg); border-radius: 14px; padding: 14px 20px 14px 10px; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 6px; }
.kpi-ring { flex: none; width: 132px; height: 132px; }
.kpi-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.kpi-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-sub { color: var(--muted); font-size: 0.78rem; }
.meter { height: 8px; border-radius: 999px; background: var(--primary-tint); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.4s ease; }
.chart-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.chart-card { margin: 0; min-width: 0; }
.chart-card.wide { grid-column: span 2; }
.chart-card.full { grid-column: 1 / -1; }
.chart-body { min-height: 120px; }
/* ApexCharts: шрифт и подписи в тонах интерфейса */
.apexcharts-canvas text { font-family: inherit; }
.apexcharts-tooltip { box-shadow: var(--shadow) !important; border: 0 !important; border-radius: 10px !important; }
.apexcharts-tooltip-title { background: var(--surface) !important; border-bottom: 1px solid var(--border) !important; font-weight: 600; }
.apexcharts-legend-text { color: var(--muted) !important; }
.viz-title { font-size: 1rem; font-weight: 600; margin: 0; }
.viz-sub { color: var(--muted); font-size: 0.8rem; margin: 2px 0 14px; max-width: none; }
.stack-bar { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; }
.stack-bar i { display: block; min-width: 4px; }
.viz-legend { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.82rem; color: var(--muted); }
.viz-legend li { display: flex; align-items: center; gap: 7px; }
.viz-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none; }
.viz-legend b { color: var(--ink); font-weight: 600; }
.hbars { display: grid; gap: 10px; }
.hbar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 32px; gap: 12px; align-items: center; font-size: 0.85rem; }
.hbar-label { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; }
.hbar-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; }
.viz-mark { transition: filter 0.15s ease; }
.viz-mark:hover { filter: brightness(1.1); }
.viz-svg { display: block; width: 100%; height: auto; }
.viz-grid { stroke: var(--border); stroke-width: 1; }
.viz-axis { font-size: 11px; fill: var(--muted); }
.viz-end { font-size: 12px; fill: var(--ink); font-weight: 600; }
.viz-cap { font-size: 11px; fill: var(--ink); font-weight: 600; }
.viz-hit { fill: transparent; }
.viz-cross { stroke: var(--muted); stroke-width: 1; opacity: 0; pointer-events: none; }
.viz-table { margin-top: 12px; font-size: 0.82rem; }
.viz-table summary { cursor: pointer; color: var(--muted); }
.viz-table table { margin-top: 8px; font-size: 0.82rem; width: auto; min-width: 50%; }
.viz-table th, .viz-table td { padding: 6px 12px; }
.viz-tip {
  position: fixed; z-index: var(--z-toast);
  background: var(--ink); color: #fff;
  font-size: 0.8rem; padding: 6px 10px; border-radius: 8px;
  pointer-events: none; white-space: nowrap; box-shadow: var(--shadow);
}
@media (max-width: 1400px) { .chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chart-card.wide { grid-column: span 2; } .chart-card:not(.wide):not(.full) { grid-column: span 1; } }
@media (max-width: 1100px) { .chart-grid, .kpi-grid { grid-template-columns: 1fr; } .chart-card.wide, .chart-card.full { grid-column: auto; } }

/* Конструктор тестов: карточка вопроса, строки вариантов */
.q-item { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.q-num { font-weight: 600; font-size: 0.9rem; }
.q-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.q-opt-row { display: flex; align-items: center; gap: 10px; }
.q-opt-row input[type=radio] { width: auto; flex: none; }
.q-opt-del { flex: none; width: 34px; height: 34px; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; color: var(--muted); cursor: pointer; font: inherit; }
.q-opt-del:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.q-opt-del:disabled { opacity: 0.35; cursor: not-allowed; }
/* Фото статьи в редакторе и миниатюра в списке */
.photo-pick { display: flex; gap: 16px; align-items: center; flex-wrap: nowrap; } /* поле выбора справа от превью */
.photo-preview { width: 180px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-field); border: 1px solid var(--border); }
.photo-pick-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: 1; min-width: 0; }
@media (max-width: 480px) { .photo-pick { flex-wrap: wrap; } }
.photo-pick-actions input[type=file] { padding: 8px; font-size: 0.9rem; }
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; display: block; margin: 0 auto; }
.td-photo { text-align: center; width: 80px; }
/* Проверка подлинности сертификата */
.verify-row { display: flex; gap: 10px; flex-wrap: wrap; max-width: 560px; }
.verify-row input { flex: 1; min-width: 220px; font-variant-numeric: tabular-nums; }
.verify-result { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-field); font-size: 0.92rem; line-height: 1.55; max-width: 720px; }
.verify-result.ok { background: oklch(0.962 0.038 160); color: oklch(0.32 0.09 160); }
.verify-result.bad { background: oklch(0.962 0.028 25); color: color-mix(in oklch, var(--danger) 80%, var(--ink) 20%); }
/* Шапка карточки кабинета: заголовок слева, действие справа */
.crm-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.crm-card-head h3 { margin: 0; }
/* Бейдж «новые записи» на вкладке кабинета */
.crm-nav button { position: relative; }
.nav-badge { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #d03b3b; color: #fff; font-size: 0.72rem; font-weight: 700; display: grid; place-items: center; line-height: 1; }
/* Отменённые записи */
.status-pill.cancelled { background: var(--surface-2); color: var(--muted); text-decoration: line-through; }
tr.is-cancelled td { color: var(--muted); }
tr.is-cancelled td b { font-weight: 500; }
/* Переключатель языка в кабинете: под логотипом боковой панели и в карточке входа */
.crm-tools { display: flex; flex-direction: column; gap: 12px; }
.crm-lang { display: flex; justify-content: center; }
.crm-lang .lang-switch { margin-left: 0; }
.login-lang { display: flex; justify-content: center; margin: -6px 0 16px; }
.login-lang .lang-switch { margin-left: 0; }
/* Настройка приёма: профиль и график в две колонки */
.reception-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1300px) { .reception-grid { grid-template-columns: 1fr; } }
/* Редактор графика */
.sched-day, .sched-exc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sched-day:last-child { border-bottom: 0; }
.sched-name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 150px; }
.sched-name input, .sched-exc input[type=date] { width: auto; }
.sched-exc input[type=date] { padding: 7px 10px; }
.sched-exc select { width: auto; padding: 7px 10px; }
.sched-ivs { display: flex; flex-wrap: wrap; gap: 8px; }
.sched-iv { display: inline-flex; align-items: center; gap: 6px; }
.sched-iv input[type=time] { width: 106px; padding: 7px 8px; }
.sched-name { min-width: 130px; }
.sched-day.is-off .sched-ivs, .sched-day.is-off [data-iv-add], .sched-exc.is-off .sched-ivs, .sched-exc.is-off [data-iv-add] { display: none; }
.sched-day.is-off .sched-name { color: var(--muted); }
/* Таблицы кабинета на телефоне: строка превращается в карточку с подписями колонок */
@media (max-width: 760px) {
  .crm-main .table-wrap { border: 0; background: transparent; overflow: visible; }
  .crm-main table, .crm-main tbody, .crm-main tr, .crm-main td { display: block; width: 100%; }
  .crm-main thead { display: none; }
  .crm-main tr { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 8px 14px; margin-bottom: 10px; }
  .crm-main td { border: 0; padding: 6px 0; white-space: normal; max-width: none; min-width: 0 !important; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right; }
  .crm-main td::before { content: attr(data-label); color: var(--muted); font-size: 0.78rem; font-weight: 600; text-align: left; flex: none; }
  .crm-main td.td-noLabel, .crm-main td:not([data-label]) { justify-content: flex-end; } /* кнопки действий прижаты к правому краю карточки */
  .crm-main td .req-actions { flex-wrap: wrap; justify-content: flex-end; white-space: normal; }
  .crm-main td.td-photo { width: auto; }
  .crm-filters .field { min-width: 0; flex: 1 1 45%; }
  .chart-grid { grid-template-columns: 1fr; }
  .kpi { flex-direction: column; align-items: center; text-align: center; }
}
/* Панель фильтров над таблицей кабинета */
.crm-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start; margin-bottom: 14px; }
.crm-filters .field { margin: 0; gap: 4px; min-width: 150px; flex: 0 1 auto; }
.crm-filters .field label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.crm-filters .field .hint { font-size: 0.72rem; }
.crm-filters input, .crm-filters select { padding: 8px 11px; font-size: 0.88rem; }
.crm-filters .btn { align-self: flex-start; margin-top: 22px; }
.crm-filters .small { align-self: flex-start; margin-top: 30px; }
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-menu { flex-direction: row; flex-wrap: wrap; position: static; }
}

/* ---------- Онлайн-кабинет ---------- */
.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: stretch; }
.room-stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.video-tile {
  background: oklch(0.16 0.008 258);
  border-radius: var(--r-card);
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: oklch(0.72 0.01 258);
  font-size: 0.9rem;
  text-align: center;
  padding: 16px;
}
.video-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-tile .tile-label {
  position: absolute;
  left: 12px; bottom: 12px;
  background: oklch(0.1 0.005 258 / 0.7);
  backdrop-filter: blur(6px);
  color: oklch(0.95 0.002 258);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 13px;
  border-radius: var(--r-btn);
  z-index: 2;
}
.room-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 0;
  border-radius: var(--r-btn);
  padding: 10px;
  flex-wrap: wrap;
}
.room-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--bg);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.15s ease;
}
.room-btn:hover { transform: translateY(-1px); }
.room-btn.off { background: var(--danger); color: oklch(0.99 0.002 258); }
.room-btn.end {
  background: var(--danger);
  color: oklch(0.99 0.002 258);
  width: auto;
  border-radius: var(--r-btn);
  padding: 0 26px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  height: 48px;
}
.chat-panel {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
  display: flex;
  flex-direction: column;
  min-height: 420px;
}
.chat-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { max-width: 85%; padding: 9px 15px; border-radius: 16px; font-size: 0.88rem; }
.chat-msg.them { background: var(--bg); align-self: flex-start; border-bottom-left-radius: 6px; }
.chat-msg.me { background: var(--primary-tint); color: var(--ink); align-self: flex-end; border-bottom-right-radius: 6px; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }
@media (max-width: 960px) {
  .room-layout { grid-template-columns: 1fr; }
  .video-grid { grid-template-columns: 1fr; }
  .video-tile { aspect-ratio: 16 / 10; }
}

/* ---------- Карточки уставных целей: крупная иконка слева ---------- */
.goal-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 18px;
  align-items: start;
}
.goal-card .direction-num {
  grid-row: 1 / 3;
  align-self: center;
  width: 64px;
  height: 64px;
}
.goal-card .direction-num svg { width: 28px; height: 28px; }
.goal-card h3 { align-self: center; margin: 0; }
.goal-card p { grid-column: 2; }

/* ---------- Структура управления: схема органов ---------- */
.org-chart { margin-top: 28px; }
.org-node h3 { margin-bottom: 6px; }
.org-node p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.org-role {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-strong);
  background: var(--primary-tint);
  padding: 5px 12px;
  border-radius: var(--r-btn);
  margin-bottom: 12px;
}
.org-top { max-width: 640px; margin: 0 auto; text-align: center; }
.org-top p { margin-inline: auto; }
.org-stem { width: 2px; height: 36px; margin: 0 auto; background: color-mix(in oklch, var(--primary) 30%, transparent); }
.org-branches {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 36px;
}
.org-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: color-mix(in oklch, var(--primary) 30%, transparent);
}
.org-branches .org-node { position: relative; text-align: center; }
.org-branches .org-node p { margin-inline: auto; }
.org-branches .org-node::before {
  content: "";
  position: absolute;
  top: -36px;
  left: 50%;
  width: 2px;
  height: 36px;
  background: color-mix(in oklch, var(--primary) 30%, transparent);
}
.org-level-label {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  padding: 6px 16px;
}
.org-committees {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-top: 36px;
}
.org-committees::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: color-mix(in oklch, var(--primary) 30%, transparent);
}
.org-committees .committee-card { position: relative; }
.org-committees .committee-card::before {
  content: "";
  position: absolute;
  top: -36px;
  left: 50%;
  width: 2px;
  height: 36px;
  background: color-mix(in oklch, var(--primary) 30%, transparent);
}
@media (max-width: 1080px) {
  .org-committees { grid-template-columns: 1fr 1fr; }
  .org-committees::before { left: 25%; right: 25%; }
  .org-committees .committee-card:nth-child(n+3)::before { display: none; }
}
@media (max-width: 720px) {
  .org-branches { grid-template-columns: 1fr; gap: 14px; padding-top: 14px; }
  .org-committees { grid-template-columns: 1fr; gap: 14px; padding-top: 14px; }
  .org-branches::before, .org-branches .org-node::before,
  .org-committees::before, .org-committees .committee-card::before { display: none; }
  .org-stem { height: 14px; }
}

/* ---------- Комитеты ---------- */
.committee-card { display: flex; flex-direction: column; }
.committee-card > p { font-size: 0.95rem; }
.committee-lead {
  margin: auto 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--ink);
}
.lead-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

/* ---------- Личный кабинет: вход и CRM-оболочка ---------- */
.crm-body { background: var(--surface); }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  background: var(--bg);
  border-radius: var(--r-card);
  padding: 34px 32px;
  width: 100%;
  max-width: 410px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.login-logo { display: block; margin-bottom: 20px; }
.login-logo img { width: 100%; height: auto; display: block; }
.login-logo span { display: none; } /* название есть на самой картинке */

.crm { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100dvh; }
.crm-side {
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100dvh;
}
.crm-logo { display: block; font-weight: 700; color: var(--ink); padding: 4px 6px 0; }
.crm-logo:hover { text-decoration: none; }
.crm-logo img { width: 100%; max-width: 250px; height: auto; display: block; }
.crm-logo span { display: none; }
.crm-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.crm-nav button, .crm-nav a {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: none;
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
}
.crm-nav button:hover, .crm-nav a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.crm-nav .active { background: var(--primary-tint); color: var(--primary-strong); font-weight: 600; }
/* Явный возврат на публичный сайт (помимо клика по логотипу) */
.crm-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  flex: none;
}
.crm-back:hover { background: var(--surface-2); text-decoration: none; }
.crm-user { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding: 14px 6px 0; }
.crm-user b { display: block; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-user span { color: var(--muted); font-size: 0.74rem; }
.crm-avatar {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.78rem;
  overflow: hidden;
}
.crm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Аватары в кабинете: превью в настройках, миниатюра в таблице пользователей */
.avatar-preview { flex: none; }
.avatar.avatar-lg { width: 96px; height: 96px; font-size: 1.6rem; }
.avatar.avatar-sm { width: 30px; height: 30px; font-size: 0.72rem; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.crm-logout {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.crm-logout:hover { background: var(--surface); color: var(--danger); }
.crm-main { padding: 22px 28px 40px; min-width: 0; }
.crm-top { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.crm-top h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.015em; }
.crm-card { background: var(--bg); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow-sm); }
.crm-card .table-wrap { border-radius: var(--r-field); }
.crm-room-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; }
/* Плитка счётчика: --c задаёт акцентный цвет иконки и спарклайна */
.stat-card { background: var(--bg); border-radius: 14px; padding: 14px 16px 0; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow: hidden; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, white); flex: none; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-delta { font-size: 0.74rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.stat-delta.up { color: oklch(0.45 0.12 150); }
.stat-value { display: block; font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-label { color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.stat-sub { color: var(--muted); font-size: 0.74rem; margin-top: 2px; }
.stat-chip { align-self: flex-start; margin-top: 4px; font-size: 0.72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.stat-chip.warn { background: oklch(0.94 0.08 88); color: oklch(0.45 0.11 75); }
.stat-chip.info { background: var(--primary-tint); color: color-mix(in oklch, var(--primary) 80%, var(--ink) 20%); }
.stat-spark { margin: auto -16px 0; height: 42px; padding-top: 6px; }
.stat-card:not(:has(.stat-spark)) { padding-bottom: 14px; }
@media (max-width: 900px) {
  /* Лишнюю высоту на коротких вкладках отдаём основной области, а не боковой панели: иначе меню растягивалось */
  .crm { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  /* На телефоне панель закреплена сверху при прокрутке */
  .crm-side { position: sticky; top: 0; z-index: 20; height: auto; padding: 12px 16px 10px; gap: 10px; min-width: 0; border-right: 0; border-bottom: 1px solid var(--border); box-shadow: 0 6px 18px -12px rgba(0,0,0,0.25); }
  .crm-nav { flex: 0 0 auto; flex-direction: row; align-items: center; overflow-x: auto; padding-bottom: 4px; }
  .crm-logo { padding: 0; }
  .crm-logo img { max-width: none; } /* логотип на всю ширину панели */
  .crm-nav button, .crm-nav a { width: auto; white-space: nowrap; }
  .crm-user { border-top: 0; padding-top: 0; }
  /* Переключатель языка слева, «Вернуться на сайт» справа, в одну строку */
  .crm-tools { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .crm-back { align-self: center; }
  .crm-main { padding: 18px 16px 32px; }
}

/* ---------- Выбор роли при регистрации ---------- */
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-field); cursor: pointer; background: var(--bg); }
.role-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-tint); }
.role-opt input { width: auto; margin-top: 3px; }
.role-opt span { display: flex; flex-direction: column; gap: 2px; font-size: 0.9rem; }
.role-opt small { color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
@media (max-width: 480px) { .role-pick { grid-template-columns: 1fr; } }

/* ---------- Печатная страница сертификата ---------- */
.cert-verify { color: var(--muted); font-size: 0.78rem; margin: 22px 0 0; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; }
  .site-header, .site-footer, .no-print, .to-top, .toast { display: none !important; }
  .cert-print { box-shadow: none !important; margin: 0 auto !important; page-break-inside: avoid; }
}

/* ---------- Кнопка «наверх» ---------- */
.to-top {
  position: fixed;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  z-index: var(--z-sticky);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--shadow);
  display: grid; place-items: center;
  cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s, background 0.15s ease, color 0.15s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top:hover { background: var(--primary-strong); }
@media (min-width: 1440px) { .to-top { width: 54px; height: 54px; right: 32px; bottom: 32px; } }
@media print { .to-top { display: none; } }

/* ---------- Видеокабинет (Jitsi Meet во фрейме) ---------- */
.jitsi-wrap { border-radius: var(--r-card); overflow: hidden; background: #111; box-shadow: var(--shadow); }
.jitsi-wrap #jitsiContainer { height: min(72vh, 820px); min-height: 480px; }
.jitsi-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- Манифест: слоган крупно, «как на листе» ---------- */
.manifesto {
  position: relative;
  margin: 0;
  background:
    repeating-linear-gradient(transparent 0 38px, color-mix(in oklch, var(--primary) 8%, transparent) 38px 39px),
    var(--surface);
  border-radius: var(--r-card);
  padding: clamp(44px, 6vw, 76px) clamp(24px, 7vw, 90px);
  text-align: center;
  overflow: hidden;
}
.manifesto::before {
  content: "«";
  position: absolute;
  left: clamp(12px, 3vw, 36px);
  top: -14px;
  font-size: clamp(5rem, 10vw, 8.5rem);
  font-weight: 800;
  line-height: 1;
  color: color-mix(in oklch, var(--primary) 18%, transparent);
  pointer-events: none;
}
.manifesto blockquote {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-wrap: balance;
  color: var(--ink);
}
.manifesto blockquote span { color: var(--primary); }
.manifesto figcaption {
  margin-top: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

/* ---------- Фото, партнёры, события, документы ---------- */
img.avatar { object-fit: cover; }
.photo-band {
  border-radius: var(--r-card);
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: var(--surface);
}
.photo-band img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 640px) { .photo-band { aspect-ratio: 16 / 10; } }
/* Партнёры: бесконечная лента. Трек состоит из двух одинаковых наборов,
   сдвиг на -50% даёт бесшовный цикл; при наведении лента останавливается. */
.logo-marquee {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.logo-track { display: flex; width: max-content; }
.logo-set { display: flex; gap: 12px; margin-right: 12px; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .logo-track { animation: logo-marquee 85s linear infinite; }
  .logo-marquee:hover .logo-track { animation-play-state: paused; }
  @keyframes logo-marquee { to { transform: translateX(-50%); } }
}
@media (prefers-reduced-motion: reduce) {
  .logo-marquee { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
  .logo-set[aria-hidden] { display: none; }
}
.logo-tile {
  background: oklch(1 0 0);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  width: 250px;
  height: 160px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 20px;
}
.logo-tile img { max-height: 116px; max-width: 100%; object-fit: contain; }
@media (max-width: 640px) {
  .logo-tile { width: 190px; height: 124px; padding: 16px; }
  .logo-tile img { max-height: 88px; }
}
.events { display: flex; flex-direction: column; }
/* Закреплённое мероприятие и страница мероприятия */
.event-featured { padding: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.event-featured h2 { margin: 4px 0 2px; }
.event-featured p { margin: 0; }
.event-featured .event-date, .event-page .event-date { display: inline-block; background: var(--primary-tint); color: color-mix(in oklch, var(--primary) 80%, var(--ink) 20%); font-weight: 700; font-size: 0.82rem; padding: 6px 14px; border-radius: var(--r-btn); }
.event-page h1 { margin: 14px 0 18px; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.event-meta { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0 0 24px; padding: 18px 22px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); font-size: 0.95rem; }
.event-meta dt { color: var(--muted); font-weight: 600; }
.event-meta dd { margin: 0; }
.event-item {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.event-item:first-child { border-top: 1px solid var(--border); }
.event-when {
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  padding-top: 2px;
}
.event-item h3 { margin-bottom: 6px; }
.event-item p { margin: 0; font-size: 0.94rem; }
@media (max-width: 640px) { .event-item { grid-template-columns: 1fr; gap: 6px; } }
.doc-list { list-style: none; margin: 0 0 14px; padding: 0; max-width: 560px; }
.doc-list li {
  padding: 13px 0 13px 30px;
  border-bottom: 1px solid var(--border);
  position: relative;
  font-size: 0.95rem;
}
.doc-list li::before {
  content: "";
  position: absolute;
  left: 2px; top: 19px;
  width: 14px; height: 17px;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
}
.doc-list li:last-child { border-bottom: 0; }
/* Список документов внутри карточки: без лишних отступов сверху и снизу */
.card > .doc-list { margin: 0; }
.card > .doc-list li:first-child { padding-top: 0; }
.card > .doc-list li:first-child::before { top: 6px; }
.card > .doc-list li:last-child { padding-bottom: 0; }

/* ---------- Пустые состояния ---------- */
.empty {
  background: var(--surface);
  border: 0;
  border-radius: var(--r-card);
  padding: 44px 24px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Подвал: светлый системный ---------- */
.site-footer {
  background: var(--surface);
  color: var(--ink);
  margin-top: clamp(36px, 5vw, 56px);
  padding-block: clamp(36px, 5vw, 52px) 28px;
}
.site-footer .logo { color: var(--ink); }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-grid h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 600;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 0.92rem; }
.footer-grid a { color: var(--ink); }
.footer-grid .muted { color: var(--muted); }
.site-footer p { color: var(--muted); }
.footer-note {
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin: 0;
  max-width: none;
}
.footer-note a { color: var(--ink); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer .container > .footer-note:only-child { border-top: 0; padding-top: 0; }

/* ---------- Появление блоков при прокрутке ----------
   Скрытие действует только при работающем JS (html.js-reveal): без скриптов всё видно. */
@media (prefers-reduced-motion: no-preference) {
  .js-reveal .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1), transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .js-reveal .reveal.in { opacity: 1; transform: none; }
  /* лёгкий каскад для карточек внутри сеток */
  .js-reveal .grid-3.reveal > *, .js-reveal .steps.reveal > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .js-reveal .grid-3.reveal.in > *, .js-reveal .steps.reveal.in > * { opacity: 1; transform: none; }
  .js-reveal .reveal.in > *:nth-child(2) { transition-delay: 0.09s; }
  .js-reveal .reveal.in > *:nth-child(3) { transition-delay: 0.18s; }
}

/* ---------- Параллакс фоновых фото ----------
   Scroll-driven animations: фон смещается по мере прокрутки.
   Прогрессивное улучшение: без поддержки или при reduced-motion фон статичен. */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .hero {
      animation: hero-parallax linear both;
      animation-timeline: view();
      animation-range: exit;
    }
    @keyframes hero-parallax {
      from { background-position: 0 0, right 30%; }
      to   { background-position: 0 0, right 85%; }
    }
    .band.band-photo {
      animation: band-parallax linear both;
      animation-timeline: view();
      animation-range: cover;
    }
    @keyframes band-parallax {
      from { background-position: 0 0, center 10%; }
      to   { background-position: 0 0, center 80%; }
    }
  }
}

/* ---------- Широкие экраны: Full HD, 2K и шире ----------
   Макет собирался на ноутбуке (1366–1536px): контейнер 1180px, все размеры в rem от корня 16px.
   На 1920px+ контент сжимался в узкую колонку, а по бокам оставалась пустота.
   Здесь макет масштабируется целиком: корневой шрифт (за ним тянутся все rem-размеры),
   ширина контейнера, высота шапки и героя, фиксированные px-колонки CRM, админки и комнаты. */
@media (min-width: 1440px) {
  html { font-size: 17px; }
  .container {
    max-width: 1320px;
    padding-left: max(28px, env(safe-area-inset-left, 0px));
    padding-right: max(28px, env(safe-area-inset-right, 0px));
  }
  .section-head { max-width: 700px; }
  .header-inner { height: 74px; gap: 20px; }
  /* Шапка с семью пунктами меню и переключателем языка шире контента страницы: даём ей свой контейнер, по центру */
  .site-header .container { max-width: 1720px; }
  .logo-img { height: 42px; }
  .logo-img-lg { height: 54px; }
  .main-nav { gap: 4px; }
  .main-nav a { padding: 9px 13px; }
  .hero-grid { min-height: 520px; }
  .hero {
    background:
      linear-gradient(90deg,
        var(--bg) 0%,
        var(--bg) 44%,
        color-mix(in oklch, var(--bg) 80%, transparent) 64%,
        color-mix(in oklch, var(--bg) 22%, transparent) 100%),
      url("img/hero-doctor.jpg") right center / cover no-repeat;
  }
  .grid-3, .grid-2 { gap: 24px; }
  .logo-tile { width: 280px; height: 176px; }
  .logo-tile img { max-height: 128px; }
  .modal { max-width: 600px; }
  .login-card { max-width: 440px; }
  .admin-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .crm { grid-template-columns: 280px minmax(0, 1fr); }
  .crm-main { padding: 28px 36px 48px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
  .room-layout { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
  .video-grid { gap: 20px; }
}
@media (min-width: 1800px) {
  html { font-size: 18px; }
  .container { max-width: 1480px; }
  .header-inner { height: 80px; }
  .logo-img { height: 46px; }
  .logo-img-lg { height: 58px; }
  .main-nav a { padding: 10px 15px; }
  .hero-grid { min-height: 600px; gap: 96px; }
  .grid-3, .grid-2 { gap: 28px; }
  .logo-tile { width: 300px; height: 190px; }
  .logo-tile img { max-height: 138px; }
  .modal { max-width: 640px; }
  .admin-layout { grid-template-columns: 270px minmax(0, 1fr); }
  .crm { grid-template-columns: 300px minmax(0, 1fr); }
  .crm-main { padding: 32px 44px 56px; }
  .room-layout { grid-template-columns: minmax(0, 1fr) 400px; }
}
@media (min-width: 2200px) {
  html { font-size: 19px; }
  .container { max-width: 1680px; }
  .hero-grid { min-height: 680px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; }
}
