/* Оболочка сайта и общие элементы (задача 1). Классы без префикса объявляются только здесь.
   Размеры и цвета — из макетов Claude Design: шапка desktop-01, навигация phone-01, шторки и окна слоёв. */

/* ---------- Каркас ---------- */
.skip {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: var(--r-12);
  background: var(--c-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--gutter); }
.app-body { width: 100%; max-width: var(--col); margin: 0 auto; }
html.has-nav .app-body { padding-bottom: calc(var(--nav-h) + 34px); }
/* «Показать мастеру» над меню: зазор 8 + плашка 70 px */
html.has-nav:has(.nav-dock) .app-body { padding-bottom: calc(var(--nav-h) + 112px); }
/* Под слоем страница не прокручивается; отступ на ширину убранной полосы прокрутки, чтобы страница не прыгала */
html.has-layer { overflow: hidden; padding-right: var(--scrollbar-gap, 0px); }

@media (min-width: 1024px) {
  .app-body { max-width: 1440px; padding: 0 var(--gutter); }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  :root { --gutter: 24px; }
}

/* ---------- Логотип ---------- */
/* Знак 34–36 px, а ссылка нажимается полосой 44 px: строка шапки выше, знак стоит там же */
.logo { display: inline-flex; flex: none; align-items: center; gap: 10px; min-height: 44px; color: var(--c-text); }
.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-10);
  background: var(--c-primary);
  color: #fff;
}
.logo-mark .ic { width: 18px; height: 18px; }
.logo-text { font-size: 18px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
@media (min-width: 1024px) {
  .logo-mark { width: 36px; height: 36px; border-radius: 11px; }
  .logo-mark .ic { width: 19px; height: 19px; }
  .logo-text { font-size: 19px; }
}

/* ---------- Шапка компьютера: строка 68 px и разделы 46 px, прилипают к верху ---------- */
.hdr { position: sticky; top: 0; z-index: 30; background: #fff; }
.hdr-bar { display: flex; align-items: center; gap: 20px; height: 68px; }
.hdr-search { position: relative; flex: 1; min-width: 0; max-width: 560px; margin-left: 28px; }
.hdr-field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 8px 0 14px;
  border-radius: var(--r-14);
  background: var(--c-surface);
  color: var(--c-text-2);
  cursor: text;
}
.hdr-search:focus-within .hdr-field,
.hdr-search.is-open .hdr-field { box-shadow: inset 0 0 0 2px var(--c-dark); }
.hdr-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 15px;
  color: var(--c-text);
}
.hdr-input:focus-visible { outline: none; }
.hdr-scope {
  display: flex;
  flex: none;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted-4);
}
.hdr-drop {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  z-index: 40;
  padding: 8px;
  border-radius: var(--r-18);
  background: #fff;
  box-shadow: 0 18px 44px rgba(17, 20, 24, .18);
}
.hdr-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.hdr-city {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-22);
  background: var(--c-surface);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.hdr-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-surface);
}
.hdr-line { border-bottom: 1px solid var(--c-border); }
.hdr-tabs { display: flex; align-items: center; gap: 4px; height: 46px; white-space: nowrap; }
/* Вкладка — «пилюля», как вкладки разделов телефона (.home-tab): текущая подсвечена фоном, рамкой и свечением
   основного цвета. Прозрачная рамка держит размер вкладки одинаковым с подсветкой и без неё */
.hdr-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: 15px;
  color: var(--c-muted-3);
  transition: color .18s, background-color .18s, border-color .18s;
}
.hdr-tab.is-active {
  border-color: var(--glow-pill-border);
  background: var(--glow-pill);
  box-shadow: var(--glow-pill-shadow);
  font-weight: 700;
  color: var(--c-primary-ink);
}
.hdr-tab.is-active .soon { background: #fff; }
/* «Пилюля» 34 px высотой, а нажимать нужно на 44 px. Область отсчитывается от края полей, внутри рамки (32 px),
   поэтому выступает на 6 px сверху и снизу. По ширине вкладка и так не уже 60 px («Авто» с полями 12 px) */
a.hdr-tab { position: relative; }
a.hdr-tab::after { content: ''; position: absolute; inset: -6px 0; }
.soon {
  padding: 2px 6px;
  border-radius: var(--r-6);
  background: var(--c-surface);
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  color: var(--c-text-2);
}

/* ---------- Режим примера: плашка над видом (app.mjs, demoBar) и чип «Пример» на карточке проверки ---------- */
/* Текст стоит по краям колонки вида: 560 px телефона, как .nav-dock, и 1440 px компьютера, как .wrap.
   Плашка не ниже 44 px, чтобы полоса нажатия «Выйти» помещалась в ней целиком: выше плашки край страницы или
   липкая шапка, ниже — липкая шапка шага проверки, и выступ за плашку не нажимался бы */
.demo-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 max(16px, calc((100% - var(--col)) / 2 + 16px));
  background: var(--c-warn-bg);
  color: var(--c-warn-text);
  font-size: 13px;
  line-height: 18px;
}
.demo-text { flex: 1; min-width: 0; padding: 8px 0; }
/* Поля 8 px расширяют полосу нажатия, отрицательный отступ возвращает слово к краю колонки */
.demo-exit {
  display: flex;
  flex: none;
  align-items: center;
  min-height: 44px;
  margin-right: -8px;
  padding: 0 8px;
  font-weight: 600;
  text-decoration: underline;
}
@media (min-width: 1024px) {
  .demo-bar { padding: 0 max(var(--gutter), calc((100% - 1440px) / 2 + var(--gutter))); }
}
/* Карточка проверки серая, как и чип: на ней чип белый, как «Пример» в отчёте телефона. Два класса — потому что
   общее правило .chip стоит ниже в этом файле и иначе вернуло бы серый фон */
.hist-card .hist-card-demo { flex: none; background: #fff; }

/* ---------- Нижнее меню телефона ---------- */
/* Парящая стеклянная плашка 64 px: по 10 px от краёв экрана, снизу — 10 px или полоса «домой» iPhone (--nav-h).
   Сквозь неё видна размытая страница. Пять пунктов делят плашку поровну: на 320 px каждый по 57 px */
.nav {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: calc(var(--col) - 20px);
  height: 64px;
  margin: 0 auto;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-28);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
}
/* Поля плашки — 6 px от её края: рамка 1 px и поля 5 px. Пункты и подсветка — по 52 px */
.nav-row { position: relative; display: flex; height: 100%; padding: 5px; }
/* «Пилюля» под пунктом открытого вида. Ширину и сдвиг ставит app.mjs (drawNav) по пункту и переводит её с пункта
   на пункт; нет активного пункта (раздел, отчёт) — подсветка гаснет. При «меньше движения» переходы выключает
   tokens.css */
.nav-glow {
  position: absolute;
  left: 0;
  top: 5px;
  width: 0;
  height: 52px;
  border: 1px solid var(--glow-pill-border);
  border-radius: var(--r-pill);
  background: var(--glow-pill);
  box-shadow: var(--glow-pill-shadow);
  opacity: 0;
  pointer-events: none;
  transition: transform .22s cubic-bezier(.22, 1, .36, 1), width .22s cubic-bezier(.22, 1, .36, 1), opacity .18s;
}
.nav-glow.is-shown { opacity: 1; }
/* Пункты стоят над подсветкой: она раньше в разметке, а пункты тоже позиционированы */
.nav-item {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 52px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  white-space: nowrap;
  color: var(--c-muted-3);
  transition: color .18s;
}
.nav-item.is-active { font-weight: 600; color: var(--c-primary-ink); }
/* «Проверить» — главное действие, своей подсветки нет: на /check меню не показывается */
.nav-check { font-weight: 600; color: var(--c-primary); }
.nav-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 34px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary));
  box-shadow: var(--glow-btn-shadow);
  color: #fff;
}
/* Действие вида над меню («Показать мастеру» в отчёте) — своя парящая плашка той же ширины, с зазором 8 px.
   Высота 70 px: поля 8 px, кнопка 52 px и рамка; радиус 24 — радиус кнопки 16 плюс поля */
.nav-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(var(--nav-h) + 8px);
  z-index: 21;
  max-width: calc(var(--col) - 20px);
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-24);
  background: var(--glass);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
}
/* Без размытия полупрозрачная плашка смешала бы пункты с текстом страницы: тогда она белая */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav, .nav-dock { background: #fff; }
}

/* ---------- Кнопки: 46 / 52 / 60 px ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: var(--r-16);
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  transition: background-color .15s;
}
.btn-sm { min-height: 46px; border-radius: var(--r-14); font-size: 15px; }
.btn-lg { min-height: 60px; padding: 0 24px; border-radius: var(--r-20); font-size: 18px; }
.btn-wide { display: flex; width: 100%; }
/* Главная кнопка светится: градиент основного цвета, тёмная рамка, цветная тень и блик сверху */
.btn-primary {
  border: 1px solid var(--glow-btn-border);
  background: linear-gradient(135deg, var(--c-primary-2), var(--c-primary));
  box-shadow: var(--glow-btn-shadow);
  color: #fff;
}
.btn-dark { background: var(--c-dark); color: #fff; }
.btn-soft { background: var(--c-surface); color: var(--c-text); }
.btn-light { background: #fff; color: var(--c-text); }
.btn-ghost-dark { background: rgba(255, 255, 255, .12); color: #fff; }
.btn:disabled { border-color: transparent; background: #E3E6EA; box-shadow: none; color: var(--c-muted-3); }

/* ---------- Чипы и плашки статусов ---------- */
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 16px;
  border-radius: var(--r-22);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}
.chip-count { color: var(--c-text-2); }
.chip-active { background: var(--c-dark); color: #fff; font-weight: 600; }
.chip-active .chip-count { color: var(--c-muted-2); }
.chip-soon { color: var(--c-muted-3); }
.chip-sm { height: 36px; padding: 0 12px; border-radius: var(--r-18); }
.chip-sm::after { content: ''; position: absolute; inset: -4px 0; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-14);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-ok { background: var(--c-ok-bg); color: var(--c-ok-text); }
.badge-ask { background: var(--c-ask-bg); color: var(--c-ask-text); }
.badge-no { background: var(--c-no-bg); color: var(--c-no-text); }
.dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; }
.dot-ok { background: var(--c-ok); }
.dot-ask { background: var(--c-ask); }
.dot-no { background: var(--c-no); }

@media (hover: hover) {
  .btn-primary:hover { background: linear-gradient(135deg, var(--c-primary), var(--c-primary-hover)); }
  .btn-soft:hover, .btn-light:hover { background: var(--c-surface-hover); }
  .btn:disabled:hover { background: #E3E6EA; }
  button.chip:hover, .hdr-city:hover, .hdr-profile:hover { background: var(--c-surface-hover); }
  button.chip-active:hover { background: var(--c-dark); }
}

/* ---------- Карточки, сноски, доли, правила ---------- */
.card { padding: 16px; border-radius: var(--r-24); background: var(--c-surface); }
.card-dark { padding: 20px; border-radius: var(--r-24); background: var(--c-dark); color: #fff; }
/* Кольцо основного цвета на тёмной карточке почти не видно (#0D5B50 на #111418 — 2,3:1, а нужно 3:1):
   здесь оно светлое, #43D69B — цвет полосы распознавания макета (около 10:1) */
.card-dark :focus-visible { outline-color: #43D69B; }
@media (min-width: 1024px) {
  .card { padding: 22px; }
  .card-dark { padding: 36px; border-radius: var(--r-28); }
}

.note { display: flex; align-items: flex-start; gap: 8px; }
.note-warn {
  padding: 10px 12px;
  border-radius: var(--r-14);
  background: var(--c-warn-bg);
  color: var(--c-warn-text);
  font-size: 13px;
  line-height: 18px;
}
.note-warn .ic { margin-top: 1px; }
.note-info {
  padding: 14px 16px;
  border-radius: var(--r-18);
  background: var(--c-surface);
  color: var(--c-muted-4);
  font-size: 14px;
  line-height: 20px;
}

/* Высоту доли задаёт --bar3-h (8 px по умолчанию), скругление — половина высоты */
.bar3 { display: flex; gap: 3px; height: var(--bar3-h, 8px); }
.bar3 > span { flex: none; border-radius: calc(var(--bar3-h, 8px) / 2); }
.bar3 > span:last-child { flex: 1; }
.bar3-ok { background: var(--c-ok); }
.bar3-ask { background: var(--c-ask); }
.bar3-no { background: #C9CED5; }

.rules { padding: 4px 16px; border-radius: var(--r-20); background: var(--c-surface); font-size: 15px; line-height: 21px; }
.rules > li { padding: 12px 0; }
.rules > li + li { border-top: 1px solid var(--c-border-2); }
.rules b { font-weight: 600; }
.rules-white { background: #fff; }
.rules-white > li + li { border-top-color: var(--c-border-3); }
.rules-sm { font-size: 14px; line-height: 20px; }
.rules-sm > li { padding: 10px 0; }

/* ---------- Слои: шторка и экран телефона, окно 480 и широкое окно 960 × 640 компьютера ---------- */
.layer { position: fixed; inset: 0; z-index: 100; display: flex; }
.layer-scrim { position: absolute; inset: 0; background: rgba(17, 20, 24, .45); animation: np-fade .2s ease-out; }
.layer-box { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.layer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.layer-close {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.layer-close-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-surface);
}

.layer-sheet { align-items: flex-end; justify-content: center; }
.layer-sheet .layer-box {
  width: 100%;
  max-width: var(--col);
  max-height: 88dvh;
  border-radius: var(--r-28) var(--r-28) 0 0;
  box-shadow: 0 -20px 40px rgba(17, 20, 24, .18);
  animation: np-sheet .34s var(--ease);
}
.layer-grab { display: flex; flex: none; justify-content: center; height: 30px; }
.layer-handle { width: 40px; height: 5px; margin-top: 8px; border-radius: 3px; background: #D3D7DC; }
.layer-sheet .layer-body { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); }

.layer-full .layer-box { width: 100%; height: 100%; padding-top: env(safe-area-inset-top); animation: np-sheet .34s var(--ease); }
.layer-full .layer-body { padding-bottom: env(safe-area-inset-bottom); }

.layer-modal, .layer-wide { align-items: center; justify-content: center; padding: 24px; }
.layer-modal .layer-box {
  width: 480px;
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-28);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .25);
  animation: np-pop .2s var(--ease);
}
.layer-modal .layer-body { padding: 28px; }
.layer-modal .layer-close { top: 14px; right: 14px; }
.layer-wide .layer-scrim { background: rgba(17, 20, 24, .55); }
.layer-wide .layer-box {
  width: 960px;
  height: 640px;
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-32);
  box-shadow: 0 40px 80px rgba(0, 0, 0, .3);
  animation: np-pop .2s var(--ease);
}
.layer-wide .layer-body { padding: 36px 48px 40px; }

@media (hover: hover) {
  .layer-close:hover .layer-close-ring { background: var(--c-surface-hover); }
}

@keyframes np-fade { from { opacity: 0; } }
@keyframes np-sheet { from { transform: translateY(105%); } }
@keyframes np-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Слой «Дата визита» (views/check.mjs): чипы, поле и подсказки — классы шага .chk- из check.css ---------- */
/* Зазор 14 px, как у шага: на него рассчитаны отступы подсказок под полем */
.vis { display: flex; flex-direction: column; gap: 14px; }
/* Справа место под крестик оболочки, как у заголовков шторок «Город» и «Согласия и данные» */
.vis-title { padding-right: 40px; font-size: 24px; font-weight: 700; line-height: 30px; letter-spacing: -.02em; }
.vis-done { margin-top: 6px; }

/* ---------- Всплывающее сообщение ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 200;
  width: max-content;
  max-width: min(calc(100vw - 32px), 480px);
  padding: 12px 18px;
  border-radius: var(--r-22);
  background: var(--c-dark);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s, transform .2s;
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }
html.has-nav .toast { bottom: calc(var(--nav-h) + 12px); }
html.has-nav:has(.nav-dock) .toast { bottom: calc(var(--nav-h) + 90px); }

/* ---------- Страница не найдена ---------- */
.nf { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 72px 24px 48px; text-align: center; }
.nf-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
  border-radius: var(--r-24);
  background: var(--c-surface);
  color: var(--c-muted-4);
}
.nf-title { font-size: 21px; font-weight: 700; line-height: 26px; }
.nf-text { max-width: 320px; font-size: 15px; line-height: 21px; color: var(--c-text-2); }
.nf .btn { min-width: 220px; margin-top: 12px; }
