/* =========================================================================
   Онлайн-запись пациента — утверждённый макет ELISA mobile booking v5.

   Исходник: пакет ELISA_mobile_booking_v5_developer_handoff, интерактивный
   прототип v5 (SHA-256 04A73656…22C9), утверждён владельцем продукта
   24.08.2026. Правила из прототипа перенесены дословно: композиция, порядок
   экранов, цвета, размеры и пиктограммы менять нельзя без отдельного
   согласования — так записано в README пакета.

   Порядок файла:
     1. шрифт Manrope — свои файлы, без fonts.gstatic.com;
     2. CSS утверждённого прототипа целиком, без правок;
     3. добавления под настоящие MAX, SMS и кабинет;
     4. раскладка под компьютер — вся внутри @media (min-width: 900px).

   Правка внутри блока 2 — это правка утверждённого макета. Если она правда
   нужна, ей место в блоке 3 или 4, а не здесь.
   ========================================================================= */

/* Manrope — шрифт утверждённого макета онлайн-записи.
   Файлы лежат рядом, а не на fonts.gstatic.com: виджет открывают с сайта
   клиники, и он обязан отрисоваться, когда до Google не достучаться.
   Шрифт переменный, один файл на подмножество покрывает веса 200–800. */

/* cyrillic */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* latin-ext */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/assets/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Левая колонка — только на компьютере: там панель врачей с поиском. На
   телефоне её место занимает экран выбора врача из макета. Панель фильтров
   тоже компьютерная: на телефоне фильтры остаются шторкой снизу, как в
   утверждённом v5. */
.desk-aside,
.filters-panel {
  display: none;
}

/* Обёртка двух колонок компьютерной раскладки. На телефоне её нет вовсе:
   display: contents вынимает её из раскладки, и .screen-content остаётся
   прямым ребёнком .app — ровно так, как собран утверждённый макет. */
.booking-grid {
  display: contents;
}

/* ========================= 2. МАКЕТ v5 — БЕЗ ПРАВОК ===================== */

:root {
  --board: #EEF5F4;
  --surface: #FFFFFF;
  --alt: #F5F9FA;
  --teal: #007A78;
  --teal-dark: #006664;
  --selection: #E8F7F6;
  --ink: #12213A;
  --muted: #5A6980;
  --line: #D9E1E8;
  --disabled: #F0F4F5;
  --disabled-text: #A2ADB7;
  --error: #B5473C;
  --error-bg: #FFF5F3;
  --error-line: #ECCFCB;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--board);
}

body,
button,
input {
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

/* Окно ровно по экрану, каким бы он ни был.

   Высота была min(100dvh, 844px) при min-height: 680px — то есть на экране
   ниже 680 px окно оставалось 680-м, а `overflow: hidden` у body отрезал
   всё, что не влезло. Отрезалась нижняя панель с кнопкой «Продолжить»: на
   телефоне 375×667 — на 17 px, в альбомной ориентации — целиком, и достать
   её было нечем, страница не прокручивается. Потолок в 844 px делал обратное
   — на высоком телефоне под окном оставалась полоса фона.

   Ни пола, ни потолка теперь нет: раскладка внутри — колонка на flex, шапка
   и панель держат свою высоту, а забирает и отдаёт место прокручиваемая
   середина. */
.app {
  position: fixed;
  top: 0;
  left: 50%;
  display: flex;
  width: min(100vw, 390px);
  height: 100dvh;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  transform: translateX(-50%);
  flex-direction: column;
  background: var(--surface);
  box-shadow: 0 22px 54px rgba(18, 33, 58, .11);
}

/* На телефоне колонка занимает всю ширину. Ширина макета — 390 px, и на
   экране пошире (Pixel — 412, большие iPhone — 430) по краям оставалась
   полоса фона в полтора десятка пикселей: с виду недоделка.

   Потолок оставляем для того, что заведомо не телефон, — узкого окна на
   компьютере: «телефонная» страница, растянутая на 800 px, выглядела бы
   недоразумением. */
@media (max-width: 520px) {
  .app {
    width: 100vw;
  }
}

.app-header {
  z-index: 3;
  display: flex;
  min-height: 72px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  /* На 320 px марка вплотную подходила к кнопке звонка и они читались как
     одно пятно: space-between сводит соседей вплотную, когда свободного
     места не осталось. */
  gap: 10px;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #E1E7EC;
  background: rgba(255, 255, 255, .98);
}

.brand-lockup {
  /* Всё остальное прижато вправо вплотную друг к другу: иначе space-between
     растаскивал «Мои записи» и «Мои анализы» по разным краям шапки. */
  margin-right: auto;
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  line-height: 1.05;
  text-align: left;
}

/* Знак векторный: шапка живёт и на телефоне с плотным экраном, и на
   компьютере, а исходник логотипа — растровое превью 105 px по содержимому,
   которое поплыло бы уже на двойной плотности. Высоту задаём, ширину
   отпускаем — пропорции знака держит сам viewBox. */
/* Утверждённый логотип — единая марка: знак и слово «elisa» набраны в одном
   файле, рядом с ним ничего не подписываем. Высота задана по шапке, а не по
   ширине: 46 px — это её внутренняя высота (72 − 14 − 12), и 40 px внутри неё
   оставляют воздух сверху и снизу. Ширину логотип берёт сам из viewBox
   (170.079 × 123.693), поэтому пропорция не поедет ни на одной раскладке. */
.brand-logo {
  height: 40px;
  flex: none;
  width: auto;
}

.records-action {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: #fff;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.records-action iconify-icon {
  font-size: 18px;
}

/* Позвонить в клинику — с любого экрана.

   Живёт в шапке, а не внутри экрана: шапка одна на все восемь шагов и не
   перерисовывается вместе с содержимым, поэтому кнопка не может потеряться
   ни на одном из них. Оба действия прижаты вправо — марка остаётся слева. */
.call-action {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  margin-left: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: #fff;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.call-action[hidden] {
  display: none;
}

.call-action iconify-icon {
  font-size: 18px;
}

/* Подпись на телефоне не помещается: в колонке 390 px на неё остаётся 83 px,
   а нужно 154. Значок телефона понятен и сам, полное название — в заголовке
   шторки, которую он открывает, и в подсказке для читалок. На компьютере
   места вдоволь, там подпись возвращается. */
.call-action span {
  display: none;
}

.records-action {
  margin-left: 8px;
}

.profile-action[hidden] {
  display: none;
}

/* На телефоне профиль — значком, как звонок: третья подпись в шапку
   шириной 390 px не помещается. На компьютере подпись возвращается. */
.profile-action {
  padding: 0 11px;
}

.profile-action span {
  display: none;
}

/* «Мои анализы» рядом с «Мои записи». С подписью кнопка на 390 и 360 px
   вылезала за край шапки, поэтому на телефоне — значком, как звонок и
   профиль; название — в подсказке и для читалок. На компьютере подпись
   возвращается (правило ниже, в блоке рабочего пространства). */
.labs-action {
  margin-left: 0;
  padding: 0 11px;
}

.labs-action span {
  display: none;
}

/* Телефон до 400 px (390 — iPhone, 360 — самый частый у Android): четыре
   элемента шапки после входа не помещались, и подпись «Мои записи» сжималась
   в две строки. Поля и зазоры чуть уже. На 340
   и меньше «Мои записи» тоже значком — без этого не хватает больше 50 px. */
@media (max-width: 400px) {
  .app-header {
    gap: 6px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .records-action {
    margin-left: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

  .labs-action,
  .profile-action {
    padding-right: 11px;
    padding-left: 11px;
  }
}

@media (max-width: 340px) {
  .records-action[data-action="open-records"] span {
    display: none;
  }

  .records-action[data-action="open-records"] {
    padding-right: 11px;
    padding-left: 11px;
  }
}

.progress-area {
  min-height: 52px;
  flex: 0 0 auto;
  padding: 9px 20px 7px;
  background: #fff;
}

.progress-area.is-success {
  display: none;
}

.progress-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.progress-caption strong {
  color: var(--teal);
}

.progress-segments {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  margin-top: 9px;
}

.progress-segments span {
  height: 4px;
  border-radius: 99px;
  background: #E2E7EC;
}

.progress-segments span.is-active {
  background: var(--teal);
}

.screen-content {
  --pad-x: 20px;
  --pad-y: 7px;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--pad-y) var(--pad-x) 18px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.screen-content::-webkit-scrollbar {
  display: none;
}

.action-footer {
  z-index: 3;
  display: flex;
  min-height: 74px;
  flex: 0 0 auto;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(217, 225, 232, .78);
  background: linear-gradient(180deg, rgba(255,255,255,.94), #fff 28%);
}

.action-footer:empty {
  display: none;
}

.screen-enter {
  /* backwards, а не both: both оставляет на элементе transform: translateY(0)
     навсегда, а ненулевой transform ломает position: sticky у заголовка
     внутри. Задержки у анимации нет, и на глаз разницы никакой. */
  animation: screen-in .18s ease-out backwards;
}

@keyframes screen-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Тот же экран, нарисованный заново: выбрали вариант, пришёл ответ сервера.
   Содержимое меняется на месте — проявлять его второй раз незачем, глаз
   читает это как мигание. Класс ставит renderContent. */
.screen-enter.is-instant {
  animation: none;
}

.back-link,
.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.back-link iconify-icon {
  font-size: 18px;
}

.screen-title {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 27px;
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.045em;
}

/* Заголовок списка остаётся на виду. В списке врачей он уезжает за первые
   же три карточки, и дальше человек листает экран, на котором не написано,
   что он выбирает. */
.screen-title.is-sticky {
  position: sticky;
  z-index: 2;
  /* Прилипает под верхний отступ экрана, а не к нему: при top: 0 в эти
     семь пикселей пролезала полоска уезжающей карточки. */
  top: calc(var(--pad-y) * -1);
  margin-right: calc(var(--pad-x) * -1);
  margin-left: calc(var(--pad-x) * -1);
  padding: 8px var(--pad-x);
  background: #fff;
}

.screen-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.field-shell {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.field-shell:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 149, 149, .08);
}

.field-shell.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(181, 71, 60, .07);
}

.field-shell iconify-icon {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 21px;
}

.field-shell input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.field-shell input::placeholder {
  color: #667483;   /* 4,8:1 на белом; было #8B97A7 — 3,0:1 (аудит 114) */
}

/* Образец в ФИО («Иванов», «Алексей») — светлый и не жирный: у самого поля
   начертание 600, и тёмная подсказка читалась как уже набранная фамилия. */
#surnameInput::placeholder,
#firstNameInput::placeholder,
#patronymicInput::placeholder {
  color: #6b7787;   /* 4,55:1 на белом; было #C5CCD6 — 1,6:1. От набранного текста образец отличает начертание 400 против 600 */
  font-weight: 400;
  opacity: 1;
}

.form-label {
  display: block;
  margin: 15px 0 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.error-text {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 2px 0;
  color: var(--error);
  font-size: 10px;
  font-weight: 700;
}

.search-wrap {
  margin-top: 16px;
}

.filter-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.filter-button > span:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-button iconify-icon {
  color: var(--teal);
  font-size: 19px;
}

.filter-count,
.small-tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #CBE8E4;
  border-radius: 999px;
  background: var(--selection);
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 800;
}

.list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 1px 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.letter-label {
  margin: 11px 1px 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.doctor-card,
.choice-card,
.branch-card,
.channel-card {
  display: flex;
  width: 100%;
  min-height: 82px;
  align-items: center;
  gap: 11px;
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(18, 33, 58, .03);
  text-align: left;
}

.doctor-card:active,
.choice-card:active,
.branch-card:active,
.channel-card:active {
  transform: translateY(1px);
}

.doctor-copy,
.choice-copy,
.branch-copy,
.channel-copy {
  min-width: 0;
  flex: 1;
}

.doctor-name,
.choice-name,
.branch-name,
.channel-name {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.doctor-specialty,
.choice-note,
.branch-address,
.channel-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}

.doctor-next {
  display: block;
  margin-top: 5px;
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 800;
}

.doctor-card > iconify-icon {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 22px;
}

.demo-portrait {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border: 1px solid #E1E7EC;
  border-radius: 15px;
  background-color: var(--alt);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23A2ADB7' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 55%;
}

/* Фотография врача, когда она есть: адрес подставляется в разметке, потому
   что он свой у каждого. Силуэт под ней остаётся фоном — на время загрузки
   и на случай битой ссылки. */
.demo-portrait.has-photo {
  background-size: cover;
  background-position: center;
}

.doctor-summary,
.appointment-summary,
.info-band,
.error-band {
  margin-top: 14px;
  padding: 12px 13px;
  border: 1px solid #DDEAE7;
  border-radius: 14px;
  background: linear-gradient(90deg, #F4F9FA 0%, #ECF8F7 100%);
}

.doctor-summary {
  display: flex;
  align-items: center;
  gap: 11px;
}

.doctor-summary .demo-portrait {
  width: 49px;
  height: 49px;
}

.doctor-summary strong,
.appointment-summary strong,
.info-band strong,
.error-band strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.doctor-summary span,
.appointment-summary span,
.info-band span,
.error-band span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.error-band {
  border-color: var(--error-line);
  background: var(--error-bg);
}

.error-band strong,
.error-band > iconify-icon {
  color: var(--error);
}

.info-row,
.error-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.info-row > iconify-icon,
.error-row > iconify-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--teal);
  font-size: 20px;
}

.error-row > iconify-icon {
  color: var(--error);
}

.section-label {
  margin: 18px 1px 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.radio-control {
  display: flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #B8C3CD;
  border-radius: 50%;
  background: #fff;
}

.radio-control.is-active {
  border: 2px solid var(--teal);
}

.radio-control.is-active::after {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.choice-card.is-selected,
.branch-card.is-selected,
.channel-card.is-selected {
  border-color: var(--teal);
  background: linear-gradient(90deg, #F1FAFA 0%, #E5F5F4 100%);
  box-shadow: 0 7px 18px rgba(0, 149, 149, .08);
}

.choice-price {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.icon-tile,
.channel-icon {
  display: flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #F2FAFA 0%, #E1F4F2 100%);
  color: var(--teal);
  font-size: 21px;
}

.branch-card {
  min-height: 78px;
}

.month-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.month-row strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.month-button {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--teal);
  font-size: 20px;
}

.date-scroll {
  display: flex;
  gap: 9px;
  margin: 11px -20px 0;
  padding: 2px 20px 8px;
  overflow-x: auto;
  /* scroll-snap здесь был и мешал: точки притяжения останавливают инерцию
     после первого же ряда карточек, и шестьдесят дат приходилось листать
     короткими рывками. */
  scrollbar-width: none;
}

.date-scroll::-webkit-scrollbar { display: none; }

.date-card {
  display: flex;
  width: 68px;
  min-width: 68px;
  height: 78px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  flex-direction: column;
}

.date-card span {
  color: inherit;
  font-size: 10px;
  font-weight: 700;
}

.date-card strong {
  margin-top: 4px;
  color: inherit;
  font-size: 20px;
  font-weight: 800;
}

.date-card.is-disabled,
.slot-card.is-disabled,
.channel-card.is-disabled {
  border-color: var(--disabled);
  background: var(--disabled);
  color: var(--disabled-text);
  box-shadow: none;
}

.date-card.is-disabled span,
.date-card.is-disabled strong,
.slot-card.is-disabled,
.channel-card.is-disabled .channel-name,
.channel-card.is-disabled .channel-note {
  color: var(--disabled-text);
}

.date-card.is-selected,
.slot-card.is-selected {
  border: 1.5px solid var(--teal);
  background: linear-gradient(135deg, #F2FAFA 0%, #DFF4F2 100%);
  color: var(--teal-dark);
}

.loading-block {
  padding-top: 15px;
}

.loading-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
}

.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid #BEE2DF;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.skeleton-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid #E5EBEF;
  border-radius: 15px;
  background: #fff;
}

.skeleton-circle,
.skeleton-line,
.slot-skeleton {
  background: linear-gradient(90deg, #E9EFF1 0%, #F7F9FA 50%, #E9EFF1 100%);
}

.skeleton-circle {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 14px;
}

.skeleton-copy { flex: 1; }

.skeleton-line {
  height: 10px;
  border-radius: 99px;
}

.skeleton-line + .skeleton-line {
  width: 68%;
  margin-top: 8px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 13px;
}

.slot-card,
.slot-skeleton {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.slot-card.is-conflict {
  border-color: var(--disabled);
  background: var(--disabled);
  color: var(--disabled-text);
  text-decoration: none;
}

.legend-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--disabled);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.summary-item {
  min-width: 0;
}

.summary-item small {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.summary-item strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.consent-row {
  display: flex;
  min-height: 48px;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

.consent-check {
  display: flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border: 1.5px solid #B8C3CD;
  border-radius: 6px;
  background: #fff;
  color: #fff;
}

.consent-check.is-active {
  border-color: var(--teal);
  background: var(--teal);
}

.consent-check iconify-icon {
  font-size: 15px;
}

.consent-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-helper {
  margin: -2px 0 0 32px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.channel-card {
  min-height: 70px;
}

.channel-card.is-disabled {
  cursor: not-allowed;
}

.channel-card.is-disabled .channel-icon {
  background: #E7ECEE;
  color: var(--disabled-text);
}

.code-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

.code-wrap {
  position: relative;
  margin-top: 18px;
}

.code-cells {
  display: grid;
  /* Длину кода задаёт сервер (code_len), страница подставляет её в --code-len.
     Зашитая шестёрка держалась ровно до тех пор, пока длина не менялась. */
  grid-template-columns: repeat(var(--code-len, 6), 1fr);
  gap: 7px;
}

.code-cell {
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.code-cells.is-error .code-cell {
  border-color: var(--error);
  background: var(--error-bg);
  color: var(--error);
}

.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 54px;
  opacity: .001;
  border: 0;
  color: transparent;
  caret-color: transparent;
}

.code-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
}

.quiet-action {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.quiet-action[disabled] {
  color: var(--disabled-text);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid #008C89;
  border-radius: 14px;
  background: linear-gradient(105deg, #00A6A1 0%, #008C89 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 9px 19px rgba(0, 149, 149, .18);
}

.secondary-button {
  border-color: var(--teal);
  background: #fff;
  color: var(--teal);
  box-shadow: none;
}

.primary-button[disabled],
.secondary-button[disabled] {
  border-color: var(--disabled);
  background: var(--disabled);
  color: var(--disabled-text);
  box-shadow: none;
}

.back-footer-button {
  display: inline-flex;
  width: 54px;
  min-width: 54px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--teal);
  font-size: 22px;
}

.empty-state {
  padding: 35px 12px 8px;
  text-align: center;
}

.empty-icon,
.success-mark {
  display: inline-flex;
  width: 70px;
  height: 70px;
  align-items: center;
  justify-content: center;
  border: 1px solid #CDEBE8;
  border-radius: 50%;
  background: linear-gradient(135deg, #F0FAF9, #DDF4F2);
  color: var(--teal);
  font-size: 34px;
  box-shadow: 0 0 0 10px #F3FAFA, 0 12px 24px rgba(0,149,149,.08);
}

.empty-state h2 {
  margin: 23px 0 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.empty-state p {
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.inline-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.inline-actions .primary-button,
.inline-actions .secondary-button {
  min-height: 46px;
  font-size: 11px;
}

.success-screen {
  padding-top: 16px;
  text-align: center;
}

.success-screen .eyebrow {
  margin: 22px 0 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.success-screen .screen-title {
  margin-top: 7px;
}

.success-screen .screen-subtitle {
  margin-right: auto;
  margin-left: auto;
  max-width: 310px;
}

.ticket-card {
  margin-top: 18px;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 15px;
  background: #fff;
  text-align: left;
}

.ticket-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.ticket-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

.ticket-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #E1E7EC;
}

.ticket-date strong {
  color: var(--teal-dark);
  font-size: 18px;
  font-weight: 800;
}

.ticket-date span {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.toast {
  z-index: 20;
  position: absolute;
  right: 18px;
  bottom: 92px;
  left: 18px;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(8px);
  border: 1px solid #CFEAE8;
  border-radius: 13px;
  background: #F1FAF9;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.overlay {
  z-index: 30;
  position: absolute;
  inset: 0;
  display: none;
  align-items: flex-end;
}

.overlay.is-open {
  display: flex;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(18, 33, 58, .34);
  transition: opacity .2s ease;
}

.bottom-sheet {
  z-index: 1;
  position: relative;
  width: 100%;
  max-height: 82%;
  padding: 13px 20px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -16px 40px rgba(18, 33, 58, .13);
  animation: sheet-in .2s ease-out both;
}

@keyframes sheet-in {
  from { transform: translateY(18px); opacity: .5; }
  to { transform: translateY(0); opacity: 1; }
}

/* Шторку тянут пальцем вниз, чтобы закрыть. Пока палец на экране, ею правит
   только inline-transform: анимация появления перебила бы его, а переход
   отставал бы от пальца. Отпустили — либо назад на место, либо до низа. */
.bottom-sheet.is-dragging {
  animation: none;
  transition: none;
  will-change: transform;
}

.bottom-sheet.is-settling {
  animation: none;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1);
}

.bottom-sheet.is-closing {
  animation: none;
  transition: transform .2s ease-in;
}

.sheet-handle {
  position: relative;
  width: 42px;
  height: 4px;
  margin: 0 auto 13px;
  border-radius: 99px;
  background: #D7DEE4;
}

/* Сама полоска — четыре пикселя высотой, пальцем в неё не попасть: область
   захвата расширена в стороны и вверх, оставаясь невидимой.
   Не шире, чем есть места до края: у шторки прокрутка по вертикали, и
   вылезший вбок блок добавил бы ей вторую, горизонтальную. */
.sheet-handle::before {
  content: "";
  position: absolute;
  inset: -13px -60px -9px;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheet-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.035em;
}

.sheet-close {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--muted);
  font-size: 20px;
}

.filter-group {
  margin-top: 18px;
}

.filter-group h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
}

.filter-chip.is-active {
  border-color: var(--teal);
  background: var(--selection);
  color: var(--teal-dark);
}

/* Version 3: approved compact search/filter pattern. */
.search-field {
  padding-right: 6px;
}

.search-filter-action {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #EEF9F8, #DDF3F1);
  color: var(--teal-dark);
  font-size: 20px;
}

.search-filter-action .filter-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 19px;
  min-height: 19px;
  justify-content: center;
  padding: 0 5px;
  border-color: #fff;
  background: var(--teal);
  color: #fff;
  font-size: 8px;
}

.doctor-price {
  display: inline-flex;
  margin-top: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.doctor-address-list {
  display: grid;
  gap: 2px;
  margin-top: 5px;
}

.doctor-address {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
}

.doctor-address iconify-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--teal);
  font-size: 11px;
}

.branch-next {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 800;
}

.branch-next.is-empty {
  color: var(--muted);
}

.required-mark {
  color: var(--error);
}

.optional-mark {
  color: var(--muted);
  font-weight: 600;
}

.form-hint {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.45;
}

.patient-match {
  margin-top: 15px;
  border-color: #D6E8E5;
}

.channel-card.is-max {
  position: relative;
  min-height: 88px;
  overflow: hidden;
  border-color: #CFD0FA;
  background: linear-gradient(135deg, #F8F7FF 0%, #EEF0FF 52%, #F4FBFF 100%);
  box-shadow: 0 9px 24px rgba(92, 75, 205, .10);
}

.channel-card.is-max.is-selected {
  border-color: #6D64DC;
  background: linear-gradient(135deg, #F3F0FF 0%, #E8EAFF 58%, #ECF8FF 100%);
  box-shadow: 0 11px 26px rgba(92, 75, 205, .16);
}

.max-logo-shell {
  display: flex;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 5px 14px rgba(74, 67, 166, .12);
}

.max-logo {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

/* Telegram — второй мессенджер на том же экране. Стили зеркалят МАКС, а не
   наследуют его: у карточек разный фирменный цвет, и общий класс пришлось бы
   всё равно перекрашивать в двух местах. Голубой взят из самого знака, чтобы
   карточка и кнопка читались как один канал. */
.channel-card.is-telegram {
  position: relative;
  min-height: 88px;
  overflow: hidden;
  border-color: #BFE2F5;
  background: linear-gradient(135deg, #F5FBFF 0%, #E8F4FD 52%, #F2FAFF 100%);
  box-shadow: 0 9px 24px rgba(34, 158, 217, .10);
}

.channel-card.is-telegram.is-selected {
  border-color: #229ED9;
  background: linear-gradient(135deg, #EFF8FF 0%, #DFEFFB 58%, #EDF8FF 100%);
  box-shadow: 0 11px 26px rgba(34, 158, 217, .16);
}

.tg-logo-shell {
  display: flex;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 5px 14px rgba(28, 128, 176, .12);
}

.tg-logo {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.tg-primary {
  border-color: #1E93CC;
  background: linear-gradient(105deg, #2AABEE 0%, #1E90C9 100%);
  box-shadow: 0 10px 22px rgba(30, 144, 201, .24);
}

.tg-primary .tg-logo {
  width: 25px;
  height: 25px;
  padding: 3px;
  border-radius: 8px;
  background: #fff;
}

.channel-card.fidelity-channel.is-telegram {
  position: relative;
  min-height: 82px;
}

.recommended-tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  margin-top: 5px;
  padding: 0 8px;
  border: 1px solid rgba(92, 75, 205, .18);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: #5C4FCA;
  font-size: 8px;
  font-weight: 800;
}

.max-primary {
  border-color: #6155D1;
  background: linear-gradient(105deg, #7868EB 0%, #584BC8 100%);
  box-shadow: 0 10px 22px rgba(88, 75, 200, .24);
}

.max-primary .max-logo {
  width: 25px;
  height: 25px;
  padding: 3px;
  border-radius: 8px;
  background: #fff;
}

.filter-nav-list,
.filter-radio-list {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}

.filter-nav-card,
.filter-radio-row {
  display: flex;
  width: 100%;
  min-height: 66px;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  text-align: left;
}

.filter-nav-card {
  background: linear-gradient(100deg, #FFFFFF 0%, #F5FAFA 100%);
  box-shadow: 0 4px 13px rgba(18, 33, 58, .04);
}

.filter-nav-icon {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--selection);
  color: var(--teal);
  font-size: 20px;
}

.filter-nav-copy,
.filter-radio-copy {
  min-width: 0;
  flex: 1;
}

.filter-nav-copy strong,
.filter-radio-copy strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.filter-nav-copy span,
.filter-radio-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-nav-card > iconify-icon {
  color: var(--teal);
  font-size: 20px;
}

.filter-radio-row {
  min-height: 58px;
}

.filter-radio-row.is-active {
  border-color: var(--teal);
  background: linear-gradient(90deg, #F2FAFA, #E8F7F6);
}

.filter-radio-icon {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: var(--selection);
  color: var(--teal);
  font-size: 19px;
}

.demo-state-link {
  display: flex;
  width: fit-content;
  min-height: 34px;
  align-items: center;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet-actions {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}

.sheet-actions .primary-button,
.sheet-actions .secondary-button {
  min-height: 48px;
  font-size: 12px;
}

.records-sheet-list {
  margin-top: 16px;
}

.records-sheet-list .ticket-card {
  margin-top: 0;
}

/* Текст согласия в шторке. Читают его редко, но прочитать он должен
   давать: сплошной абзац в девять пикселей — это отказ в чтении. */
.policy-text {
  max-height: 46vh;
  margin-top: 12px;
  overflow-y: auto;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
}

.policy-text p { margin: 0 0 10px; }
.policy-link a { color: var(--teal); font-weight: 700; }

/* Вкладки «Записи / Заключения» в шторке кабинета (29.09.2026). */
.sheet-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 12px;
  padding: 4px;
  border-radius: 14px;
  background: var(--alt);
}

.sheet-tab {
  flex: 1 1 0;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--type-meta);
  font-weight: 800;
}

.sheet-tab.is-active {
  background: var(--surface);
  color: var(--teal-dark);
  box-shadow: 0 1px 3px rgba(18, 33, 58, .08);
}

/* «Мои заключения»: согласие и повторное подтверждение номера. */
.reports-lead {
  margin: 0;
  color: var(--ink);
  font-size: var(--type-meta);
  font-weight: 700;
  line-height: 1.45;
}

.reports-policy {
  max-height: 34vh;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--alt);
}

.reports-gate .consent-row {
  font-size: 12px;
}

.reports-sub {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 800;
}

.reports-sub:first-of-type {
  margin-top: 8px;
}

.reports-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

/* «Мои анализы»: показатель слева, значение справа, норма строкой ниже.
   «Вне нормы» несёт слово, цвет только усиливает. */
.lab-table {
  border-top: 1px solid var(--line);
}

.lab-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--type-meta);
}

.lab-name {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.lab-value {
  text-align: right;
  font-weight: 800;
  white-space: nowrap;
}

.lab-name small,
.lab-value small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: normal;
}

.lab-ref {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.lab-row.is-out .lab-value,
.lab-row.is-out .lab-value small {
  color: var(--error);
}

.lab-row.is-error .lab-value {
  color: var(--muted);
  font-weight: 600;
  white-space: normal;
}

@media (max-height: 740px) {
  .app-header { min-height: 64px; padding-top: 10px; padding-bottom: 9px; }
  .brand-logo { height: 36px; }
  .progress-area { min-height: 47px; padding-top: 7px; }
  .screen-title { font-size: 24px; }
  .action-footer { min-height: 68px; padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Fidelity pass v4: approved UX map v10 is the visual source of truth. */

.screen-content {
  padding: var(--pad-y) var(--pad-x) 18px;
}

.back-link {
  min-height: 44px;
  margin: 0 0 2px;
}

.screen-title {
  margin-top: 2px;
  font-size: 25px;
  line-height: 1.18;
}

.screen-subtitle {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border-radius: 14px;
  font-size: 14px;
}

.primary-button .button-arrow {
  margin-left: 4px;
  font-size: 18px;
}

.search-wrap {
  margin-top: 15px;
}

.field-shell.search-field {
  min-height: 48px;
  padding-left: 14px;
}

.field-shell.search-field input {
  height: 46px;
  font-size: 14px;
}

.search-filter-action {
  width: 42px;
  height: 42px;
  border-left: 1px solid var(--line);
  border-radius: 0 11px 11px 0;
  background: #fff;
}

.list-meta {
  display: none;
}

.letter-label {
  margin: 10px 1px 6px;
  font-size: 11px;
}

.doctor-card {
  position: relative;
  height: 122px;
  min-height: 122px;
  align-items: flex-start;
  gap: 10px;
  margin-top: 0;
  padding: 10px;
  border-radius: 16px;
}

.doctor-card .demo-portrait {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}

.doctor-card .demo-portrait.has-photo { background-size: cover; }

.doctor-card .doctor-copy {
  position: relative;
  display: block;
  height: 100%;
  padding-right: 20px;
}

.doctor-card .doctor-name {
  font-size: 13px;
  line-height: 1.35;
}

.doctor-specialty-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.doctor-specialty-line .doctor-specialty {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doctor-specialty-line .doctor-price {
  flex: 0 0 auto;
  margin: 0;
  font-size: 10px;
  white-space: nowrap;
}

.doctor-address-list {
  gap: 1px;
  margin-top: 4px;
}

.doctor-address {
  font-size: 8px;
  line-height: 1.3;
}

.doctor-address iconify-icon {
  font-size: 10px;
}

.doctor-next {
  position: absolute;
  right: 20px;
  bottom: 0;
  margin: 0;
  font-size: 9px;
}

.doctor-card > iconify-icon {
  position: absolute;
  top: 50%;
  right: 9px;
  font-size: 20px;
  transform: translateY(-50%);
}

.fidelity-doctor-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #DDEAE7;
  border-radius: 16px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
}

.fidelity-doctor-summary .demo-portrait {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.fidelity-doctor-summary strong {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

.fidelity-doctor-summary span span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.fidelity-title-after-summary {
  margin-top: 24px;
}

.choice-card.fidelity-choice {
  min-height: 76px;
  margin-top: 12px;
  padding: 10px 12px;
}

.fidelity-choice .icon-tile {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.fidelity-choice .choice-name {
  font-size: 13px;
}

.fidelity-choice .choice-price {
  font-size: 12px;
}

.fidelity-context {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #DDEAE7;
  border-radius: 16px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
}

.fidelity-context strong,
.fidelity-context span {
  display: block;
}

.fidelity-context strong {
  font-size: 12px;
  line-height: 1.4;
}

.fidelity-context span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.fidelity-context b {
  display: block;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.branch-card.fidelity-branch {
  min-height: 80px;
  margin-top: 12px;
  padding: 10px 12px;
}

.fidelity-branch .branch-name {
  font-size: 12px;
  line-height: 1.4;
}

.fidelity-branch .branch-next {
  margin-top: 5px;
}

.fidelity-helper {
  margin: 15px 1px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.month-row {
  margin-top: 20px;
}

.date-scroll.fidelity-dates {
  gap: 9px;
  margin-right: -20px;
  margin-left: 0;
  margin-top: 11px;
  padding-left: 0;
}

.date-scroll.fidelity-dates .date-card {
  width: 66px;
  min-width: 66px;
  height: 100px;
  border-radius: 14px;
}

.fidelity-date-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
}

.fidelity-date-meta .legend-note {
  margin-top: 0;
}

/* Подсказка, а не действие: фирменным цветом и жирным она читалась как
   кнопка, которую надо нажать. */
.fidelity-scroll-hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

/* «Записываем на ваше имя» — вплотную к кнопке записи. Вошедший пациент
   анкету больше не видит, и это единственное место, где он читает, на кого
   ляжет приём. */
.whoami {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid #DDEAE7;
  border-radius: 14px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
  color: var(--muted);
  font-size: 12px;
}

.whoami strong { color: var(--ink); font-weight: 800; }

.selection-summary {
  margin-top: 17px;
  padding: 13px 14px;
  border: 1px solid #DDEAE7;
  border-radius: 14px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
}

.selection-summary small,
.selection-summary strong {
  display: block;
}

.selection-summary small {
  color: var(--muted);
  font-size: 10px;
}

.selection-summary strong {
  margin-top: 4px;
  font-size: 12px;
}

.selected-date-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid #DDEAE7;
  border-radius: 14px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
}

.selected-date-summary small,
.selected-date-summary strong {
  display: block;
}

.selected-date-summary small {
  color: var(--muted);
  font-size: 10px;
}

.selected-date-summary strong {
  margin-top: 4px;
  font-size: 12px;
}

.fidelity-schedule-label {
  margin: 19px 1px 0;
  font-size: 12px;
  font-weight: 800;
}

.fidelity-time-summary {
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid #DDEAE7;
  border-radius: 14px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
  font-size: 10px;
}

.fidelity-time-summary strong {
  font-size: 11px;
}

.fidelity-patient-summary {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #DDEAE7;
  border-radius: 16px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
}

.fidelity-patient-summary > strong,
.fidelity-patient-summary > span {
  display: block;
}

.fidelity-patient-summary > strong {
  font-size: 12px;
}

.fidelity-patient-summary > span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.patient-summary-details {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.patient-summary-details p {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 9px;
  line-height: 1.4;
}

.patient-summary-details p + p {
  margin-top: 4px;
}

.patient-summary-details iconify-icon {
  color: var(--teal);
  font-size: 13px;
}

.patient-summary-details .patient-address {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 5px;
}

.patient-form .form-label {
  margin-top: 9px;
  margin-bottom: 4px;
  font-size: 10px;
}

.patient-form .field-shell {
  min-height: 40px;
  border-radius: 12px;
}

.patient-form .field-shell input {
  height: 38px;
  font-size: 12px;
}

.patient-form .field-shell > iconify-icon {
  font-size: 16px;
}

.patient-form .error-text {
  margin-top: 3px;
  font-size: 9px;
}

.patient-form .info-band {
  margin-top: 8px;
  padding: 8px 10px;
}

.patient-form .consent-row {
  min-height: 43px;
  margin-top: 8px;
  font-size: 9px;
}

.patient-form .consent-check {
  width: 20px;
  height: 20px;
}

.patient-form .consent-helper {
  margin-left: 30px;
  font-size: 8px;
}

.channel-card.fidelity-channel {
  min-height: 70px;
  margin-top: 12px;
  padding: 11px 13px;
}

.channel-card.fidelity-channel.is-max {
  position: relative;
  min-height: 82px;
}

.fidelity-channel.is-max .recommended-tag {
  position: absolute;
  top: -8px;
  right: 10px;
  min-height: 18px;
  margin: 0;
}

.fidelity-channel .channel-name {
  font-size: 12px;
}

.fidelity-channel .channel-note {
  margin-top: 2px;
  font-size: 9px;
}

.fidelity-channel-info {
  margin-top: 18px;
  padding: 13px;
  border: 1px solid #DDEAE7;
  border-radius: 14px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.fidelity-channel-info p {
  margin: 0;
}

.fidelity-channel-info p + p {
  margin-top: 4px;
}

.fidelity-channel-info strong {
  color: var(--ink);
}

.fidelity-channel-info .text-link {
  min-height: 28px;
  font-size: 10px;
}

.max-primary {
  border-color: #6E1AFF;
  background: linear-gradient(105deg, #5B1CFF 0%, #9C00FF 100%);
  box-shadow: 0 11px 24px rgba(91, 28, 255, .24);
}

.code-shield {
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  border: 1px solid #CDEBE8;
  border-radius: 13px;
  background: linear-gradient(135deg, #F0FAF9, #DDF4F2);
  color: var(--teal);
  font-size: 24px;
  box-shadow: 0 0 0 8px #F3FAFA;
}

.code-screen .screen-title {
  margin-top: 22px;
}

.code-screen .code-help {
  margin-top: 13px;
  font-size: 12px;
  line-height: 1.6;
}

.code-screen .code-wrap {
  margin-top: 23px;
}

.code-screen .code-actions {
  justify-content: center;
  margin-top: 18px;
  flex-direction: column;
}

.code-screen .quiet-action {
  min-height: 44px;
}

.success-screen {
  padding-top: 8px;
  text-align: center;
}

.success-screen .success-mark {
  width: 56px;
  height: 56px;
  margin: 1px auto 0;
  font-size: 28px;
}

.success-screen .eyebrow {
  margin-top: 24px;
  font-size: 11px;
}

.success-screen .screen-title {
  margin-top: 4px;
  font-size: 27px;
}

.success-screen .screen-subtitle {
  margin-top: 4px;
}

.success-ticket {
  display: flex;
  min-height: 143px;
  margin-top: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 16px;
  background: #fff;
  text-align: left;
}

.success-ticket-date {
  display: flex;
  width: 90px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  border-right: 1px solid var(--line);
  background: var(--selection);
  flex-direction: column;
  text-align: center;
}

.success-ticket-date strong {
  font-size: 12px;
  line-height: 1.3;
}

.success-ticket-date span {
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  background: #fff;
  color: var(--teal);
  font-size: 9px;
}

.success-ticket-date b {
  margin-top: 9px;
  color: var(--teal);
  font-size: 22px;
}

.success-ticket-copy {
  min-width: 0;
  flex: 1;
  padding: 12px;
}

.success-ticket-copy h3 {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.success-ticket-copy > span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.success-ticket-address {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.success-ticket-address iconify-icon {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 14px;
}

/* Где искать подробности записи. Стоит сразу под «Вы записаны»: человек,
   вошедший через мессенджер, иначе ждёт SMS, которой не будет. */
.success-sent {
  margin: 8px 0 0;
  color: var(--teal);
  font-size: var(--type-meta);
  font-weight: 700;
}

.success-ticket-price {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.success-info {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid #DDEAE7;
  border-radius: 13px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
  text-align: left;
}

.success-info .success-info-icon {
  display: flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #fff;
  color: var(--teal);
  font-size: 18px;
}

.success-info .success-info-icon .max-logo {
  width: 28px;
  height: 28px;
}

.success-info strong,
.success-info span {
  display: block;
}

.success-info strong {
  font-size: 10px;
}

.success-info span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.action-footer.is-success-footer {
  min-height: 125px;
  align-items: stretch;
  padding-top: 10px;
  flex-direction: column;
}

.action-footer.is-success-footer .primary-button,
.action-footer.is-success-footer .secondary-button {
  min-height: 48px;
  flex: 0 0 auto !important;
}

.bottom-sheet.fidelity-filter-root {
  display: flex;
  flex-direction: column;
  min-height: min(68%, 574px);
  padding-top: 11px;
}

.filter-eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
}

.fidelity-filter-root .sheet-header h2 {
  font-size: 22px;
}

.fidelity-filter-root .filter-nav-list {
  gap: 12px;
  margin-top: 20px;
}

.fidelity-filter-root .filter-nav-card {
  min-height: 82px;
  padding: 12px;
}

.filter-nav-side {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.filter-nav-count {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-root-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 11px;
  border: 1px solid #DDEAE7;
  border-radius: 12px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.filter-root-note iconify-icon {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 16px;
}

.fidelity-filter-root .sheet-actions {
  display: flex;
  margin-top: auto;
  padding-top: 18px;
  flex-direction: column-reverse;
}

.fidelity-filter-root .sheet-actions .secondary-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--teal);
  box-shadow: none;
}

@media (max-width: 350px) {
  .doctor-card {
    height: 120px;
    min-height: 120px;
  }

  .doctor-card .doctor-name {
    font-size: 12px;
  }

  .doctor-specialty-line .doctor-specialty,
  .doctor-specialty-line .doctor-price {
    font-size: 9px;
  }

  .date-scroll.fidelity-dates .date-card {
    width: 60px;
    min-width: 60px;
  }
}


  

/* Typography-only pass v5. Structure, composition, colors, icons, copy and behavior stay unchanged. */

:root {
  --type-display: 28px;
  --type-primary: 16px;
  --type-control: 16px;
  --type-secondary: 14px;
  --type-meta: 13px;
  --type-micro: 12px;
}
.records-action {
  font-size: var(--type-secondary);
}

.progress-caption {
  font-size: var(--type-micro);
}

.back-link,
.text-link {
  font-size: 15px;
}

.screen-title,
.success-screen .screen-title {
  font-size: var(--type-display);
  line-height: 1.2;
}

.screen-subtitle,
.code-screen .code-help {
  font-size: var(--type-secondary);
  line-height: 1.5;
}

.primary-button,
.secondary-button {
  font-size: var(--type-control);
}

.field-shell.search-field input {
  font-size: var(--type-control);
}

.letter-label {
  font-size: var(--type-meta);
}

.filter-count,
.small-tag {
  font-size: var(--type-micro);
}

.doctor-card {
  height: 166px;
  min-height: 166px;
}

.doctor-card .doctor-name {
  font-size: var(--type-primary);
  line-height: 1.38;
}

.doctor-specialty-line .doctor-specialty,
.doctor-specialty-line .doctor-price {
  font-size: var(--type-secondary);
  line-height: 1.35;
}

.doctor-address {
  font-size: var(--type-meta);
  line-height: 1.35;
}

.doctor-address iconify-icon {
  font-size: var(--type-meta);
}

.doctor-next {
  font-size: var(--type-meta);
  line-height: 1.35;
}

.fidelity-doctor-summary strong {
  font-size: var(--type-primary);
  line-height: 1.4;
}

.fidelity-doctor-summary span span {
  font-size: var(--type-secondary);
  line-height: 1.4;
}

.choice-card.fidelity-choice {
  min-height: 88px;
}

.fidelity-choice .choice-name {
  font-size: var(--type-primary);
  line-height: 1.4;
}

.fidelity-choice .choice-price {
  font-size: 15px;
}

.fidelity-context strong {
  font-size: 15px;
  line-height: 1.4;
}

.fidelity-context span {
  font-size: var(--type-secondary);
  line-height: 1.4;
}

.fidelity-context b {
  font-size: 15px;
}

.branch-card.fidelity-branch {
  min-height: 102px;
}

.fidelity-branch .branch-name {
  font-size: 15px;
  line-height: 1.4;
}

.fidelity-branch .branch-next {
  font-size: var(--type-meta);
  line-height: 1.4;
}

.fidelity-helper {
  font-size: var(--type-meta);
  line-height: 1.5;
}

.month-row strong {
  font-size: 18px;
}

.date-card span {
  font-size: var(--type-meta);
}

.date-card strong {
  font-size: 22px;
}

.legend-note,
.fidelity-scroll-hint {
  font-size: var(--type-meta);
  line-height: 1.4;
}

.selection-summary small,
.selected-date-summary small {
  font-size: var(--type-meta);
}

.selection-summary strong,
.selected-date-summary strong {
  font-size: 15px;
  line-height: 1.4;
}

.fidelity-schedule-label {
  font-size: 15px;
}

.slot-card,
.slot-skeleton {
  min-height: 52px;
  font-size: var(--type-control);
}

.fidelity-time-summary {
  font-size: var(--type-meta);
  line-height: 1.45;
}

.fidelity-time-summary strong {
  font-size: var(--type-secondary);
}

.doctor-summary strong,
.appointment-summary strong,
.info-band strong,
.error-band strong {
  font-size: var(--type-secondary);
  line-height: 1.45;
}

.doctor-summary span,
.appointment-summary span,
.info-band span,
.error-band span {
  font-size: var(--type-meta);
  line-height: 1.45;
}

.fidelity-patient-summary > strong {
  font-size: 15px;
  line-height: 1.4;
}

.fidelity-patient-summary > span,
.patient-summary-details p {
  font-size: var(--type-meta);
  line-height: 1.45;
}

.patient-summary-details iconify-icon {
  font-size: 15px;
}

.patient-form .form-label {
  font-size: var(--type-secondary);
}

.patient-form .field-shell {
  min-height: 50px;
}

.patient-form .field-shell input {
  height: 48px;
  font-size: var(--type-control);
}

.patient-form .error-text {
  font-size: var(--type-micro);
  line-height: 1.4;
}

.patient-form .consent-row {
  min-height: 52px;
  font-size: var(--type-meta);
  line-height: 1.5;
}

.patient-form .consent-helper {
  font-size: var(--type-micro);
  line-height: 1.4;
}

.channel-card.fidelity-channel {
  min-height: 84px;
}

.channel-card.fidelity-channel.is-max {
  min-height: 92px;
}

.fidelity-channel .channel-name {
  font-size: var(--type-primary);
  line-height: 1.4;
}

.fidelity-channel .channel-note {
  font-size: var(--type-meta);
  line-height: 1.4;
}

.recommended-tag,
.fidelity-channel.is-max .recommended-tag {
  min-height: 22px;
  font-size: 11px;
}

.fidelity-channel-info {
  font-size: var(--type-meta);
  line-height: 1.55;
}

.fidelity-channel-info .text-link {
  font-size: var(--type-meta);
}

.code-cell {
  font-size: 22px;
}

.quiet-action,
.code-screen .quiet-action {
  min-height: 44px;
  font-size: var(--type-meta);
}

.success-screen .eyebrow {
  font-size: var(--type-meta);
}

.success-ticket {
  min-height: 174px;
}

.success-ticket-date strong {
  font-size: var(--type-secondary);
  line-height: 1.35;
}

.success-ticket-date span {
  font-size: var(--type-micro);
}

.success-ticket-date b {
  font-size: 26px;
}

.success-ticket-copy h3 {
  font-size: 15px;
  line-height: 1.45;
}

.success-ticket-copy > span,
.success-ticket-address {
  font-size: var(--type-meta);
  line-height: 1.45;
}

.success-ticket-price {
  font-size: var(--type-secondary);
}

.success-info {
  min-height: 72px;
}

.success-info strong {
  font-size: var(--type-secondary);
  line-height: 1.4;
}

.success-info span {
  font-size: var(--type-meta);
  line-height: 1.4;
}

.filter-eyebrow {
  font-size: var(--type-micro);
}

.sheet-header h2,
.fidelity-filter-root .sheet-header h2 {
  font-size: 24px;
}

.filter-nav-card,
.fidelity-filter-root .filter-nav-card {
  min-height: 94px;
}

.filter-radio-row {
  min-height: 72px;
}

.filter-nav-copy strong,
.filter-radio-copy strong {
  font-size: 15px;
  line-height: 1.4;
}

.filter-nav-copy span,
.filter-radio-copy span {
  font-size: var(--type-meta);
  line-height: 1.4;
}

.filter-nav-count,
.filter-root-note {
  font-size: var(--type-micro);
  line-height: 1.45;
}

.empty-state p {
  font-size: var(--type-meta);
  line-height: 1.5;
}

.empty-state h2 {
  font-size: 21px;
}

.inline-actions .primary-button,
.inline-actions .secondary-button {
  font-size: var(--type-secondary);
}

.summary-item small {
  font-size: var(--type-micro);
}

.summary-item strong {
  font-size: var(--type-secondary);
}

@media (max-width: 350px) {
  .field-shell.search-field input {
    font-size: 14px;
  }

  .doctor-card {
    height: 188px;
    min-height: 188px;
  }

  .doctor-card .doctor-name {
    font-size: var(--type-primary);
  }

  .doctor-specialty-line .doctor-specialty,
  .doctor-specialty-line .doctor-price {
    font-size: var(--type-secondary);
  }

  .fidelity-choice .choice-name {
    font-size: 13px;
  }

  .fidelity-choice .choice-price {
    font-size: 12px;
  }

  .filter-nav-copy strong {
    font-size: 14px;
  }

  .filter-nav-count {
    font-size: 9px;
  }

  .filter-nav-side iconify-icon {
    font-size: 14px;
  }
}


/* ================= 3. ДОБАВЛЕНИЯ ПОД НАСТОЯЩИЕ ИНТЕГРАЦИИ ============== */

/* =========================================================================
   Добавления к утверждённому макету.

   Ниже — только то, чего в прототипе не было, потому что прототип не знал
   про настоящие MAX и SMS: шаг «откройте бота», ожидание подтверждения и
   список записей в кабинете. Всё собрано из тех же токенов и тех же
   деталей, что и остальной макет: своих цветов, радиусов и шрифтов здесь
   нет ни одного.

   Композицию утверждённых экранов эти правила не трогают.
   ========================================================================= */

/* Прототип обходился без этого класса: скрывать в нём было нечего, всё
   рисовалось заново. Здесь свёрнутый запасной путь к боту показывают и
   прячут без перерисовки — иначе поле ввода теряло бы фокус. */
.hidden {
  display: none !important;
}

/* ---- шаг «откройте бота»: MAX не может написать первым ---- */
.bot-step {
  margin-top: 14px;
  padding: 15px 14px;
  border: 1px solid #DDEAE7;
  border-radius: 16px;
  background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
}

.bot-step strong {
  display: block;
  font-size: var(--type-primary);
  font-weight: 800;
  letter-spacing: -.02em;
}

.bot-step p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.45;
}

.bot-step .primary-button {
  margin-top: 13px;
}

/* Запасной путь: тот же код сообщением боту. Свёрнут по умолчанию — на
   телефоне ссылка работает почти всегда, и разворачивать этот блок каждому
   значит шуметь ради меньшинства. */
.bot-fallback {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(217, 225, 232, .9);
}

.bot-fallback-open {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-size: var(--type-meta);
  font-weight: 700;
  text-align: left;
}

.bot-fallback-body {
  margin-top: 9px;
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.45;
}

.bot-code {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.bot-code code {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--alt);
  color: var(--ink);
  font-family: inherit;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .16em;
}


/* ---- QR к боту: дорога с компьютера на телефон ----

   Кнопка «Открыть MAX» ведёт в приложение, а на компьютере его обычно нет —
   путь обрывался совсем. Картинку наводят камерой телефона, и разговор с
   ботом продолжается там, где мессенджер установлен. Рисуется только в
   компьютерной раскладке: свой экран камерой не наведёшь. */
.bot-qr {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid #DDEAE7;
}

.bot-qr img {
  width: 168px;
  height: 168px;
  flex: 0 0 auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.bot-qr p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

/* ---- «позвоните нам»: выход, когда подтверждение не дошло ----

   Ни кнопка в мессенджере, ни SMS не гарантированы: оператор режет
   незнакомого отправителя, мессенджер не установлен, номер набран с
   опечаткой. До этой полосы у застрявшего пациента на экране был только
   таймер на пятнадцать минут — и уходил он вместе со своей записью. */
/* Телефон колл-центра строкой в шторке «Позвонить в клинику». Ссылка
   целиком, а не кнопка рядом: на телефоне попасть в строку проще, чем в
   кнопку, а на компьютере номер всё равно нужно прочитать глазами — tel:
   там обычно некому открыть. */
.call-place {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.call-place-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
}

.call-place-copy strong {
  font-size: var(--type-secondary);
  font-weight: 800;
  letter-spacing: -.01em;
}

.call-place-copy > span {
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.35;
}

.call-place-icon {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 99px;
  background: var(--teal);
  color: #fff;
  font-size: 19px;
}

.call-band {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #DDEAE7;
  border-radius: 16px;
  background: var(--alt);
}

.call-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.call-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.call-copy span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}

.call-address {
  display: block;
  color: var(--teal-dark);
  font-weight: 700;
}

.call-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  text-decoration: none;
  white-space: nowrap;
}

.call-button iconify-icon {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 18px;
}

/* ---- заявка «перезвоните мне» ----

   Звонить самому не всегда удобно: рабочее время, шумно, неловко. Кнопка
   рядом с номером делает то же самое наоборот — и время придерживает сразу,
   не дожидаясь, пока человек соберётся набрать. */
.call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.call-actions .call-button {
  flex: 1 1 auto;
}

.call-request {
  min-height: 46px;
  flex: 1 1 auto;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.callback-lead {
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.callback-lead strong {
  font-weight: 800;
}

/* Предварительная запись — не то же самое, что подтверждённая: знак другой
   и цвет спокойнее, чтобы экран не обещал больше, чем случилось. */
.success-mark.is-waiting {
  border-color: #DDE6EC;
  background: linear-gradient(135deg, #F7FAFB, #EDF3F5);
  color: var(--teal-dark);
  box-shadow: 0 0 0 10px #F6F9FA, 0 12px 24px rgba(18, 33, 58, .06);
}

/* ---- ожидание подтверждения ---- */
.wait-band {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #DDEAE7;
  border-radius: 16px;
  background: var(--alt);
}

.wait-band strong {
  display: block;
  font-size: var(--type-secondary);
  font-weight: 800;
}

.wait-band p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.45;
}

.wait-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
}

.wait-track {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 99px;
  background: #E2E7EC;
  overflow: hidden;
}

.wait-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--teal);
  transition: width 1s linear;
}

.wait-left {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--type-micro);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* ---- «Мои записи»: настоящие приёмы пациента ---- */
.records-list {
  margin-top: 4px;
}

.records-group {
  margin-top: 16px;
  color: var(--muted);
  font-size: var(--type-micro);
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.record-row {
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.record-row.is-past {
  background: var(--alt);
}

.record-when {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--teal);
  font-size: var(--type-primary);
  font-weight: 800;
  letter-spacing: -.02em;
}

.record-row.is-past .record-when {
  color: var(--disabled-text);
}

.record-when span {
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 700;
}

.record-row h4 {
  margin: 7px 0 0;
  font-size: var(--type-secondary);
  font-weight: 800;
  line-height: 1.35;
}

.record-row p {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.4;
}

.record-row p iconify-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 14px;
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 11px;
}

/* Кнопки переносятся, а не растягивают окно (ELISA-PL-034): «Заключение» и
   «Записаться ещё раз» вместе шире карточки на 320–360 px, и прежняя полоса
   без переноса выталкивала правую кнопку за границу шторки. База 140 px —
   две кнопки встают рядом там, где места хватает, и друг под друга там, где
   нет; min-width: 0 позволяет сжаться, а не раздвинуть строку. */
.record-actions .secondary-button {
  min-height: 40px;
  min-width: 0;
  margin: 0;
  padding-top: 6px;
  padding-bottom: 6px;
  flex: 1 1 140px;
  line-height: 1.25;
  text-align: center;
}

/* Кто вошёл и куда ему уходят сообщения — подвалом шторки «Мои записи».
   Отделён чертой: это не запись, а свойства входа. */
.records-account {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.records-account-who {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.records-account-who strong {
  font-size: var(--type-secondary);
  font-weight: 800;
}

.records-account-who span {
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 700;
}

.records-account-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
}

.records-account-note iconify-icon {
  flex: 0 0 auto;
  font-size: 15px;
}

/* Первая строка «Моих записей»: чьи записи и дверь в профиль. */
.records-who {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--ink);
  font-size: var(--type-meta);
  font-weight: 800;
}

/* В профиле блок «кто вошёл» стоит первым: черта и отступ сверху, нужные
   ему под списком записей, здесь лишние. */
.records-account.profile-who {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Дата рождения в профиле: поле и «Сохранить» в одну строку. */
.profile-birth {
  margin-top: 16px;
}

.profile-birth-value {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: var(--type-secondary);
  font-weight: 800;
}

.profile-birth-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.profile-birth-form .field-shell {
  flex: 1 1 auto;
  margin: 0;
}

.profile-birth-form .primary-button {
  width: auto;
  flex: 0 0 auto;
  margin: 0;
  padding: 0 18px;
}

/* Уведомления в профиле: заголовок тем же шрифтом, что «На этом номере». */
.profile-notify {
  margin-top: 16px;
}

/* Карточки каналов ниже карточек записи: подпись у них в одну строку, а
   четыре карточки по 82 px выталкивали «Выйти» за экран телефона. */
.profile-notify .choice-card {
  min-height: 58px;
}

.profile-notify .choice-grid {
  margin-top: 8px;
}

.profile-lead {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.4;
}

/* «Профиль и уведомления» — ссылкой, а не кнопкой: это переход, а не
   действие над записями. */
.records-account-change {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal-dark);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Канал, который сейчас выбрать нельзя: виден, но не нажимается. */
.choice-card:disabled {
  opacity: .55;
  cursor: default;
}

.choice-card:disabled:active {
  transform: none;
}

/* Карты на одном номере: мама и ребёнок. Выбор одной из двух фамилий
   — не список и не меню, а две кнопки рядом, где видно, кто сейчас открыт. */
.records-family {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.records-family-title {
  flex: 1 0 100%;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.family-card {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line, #E2E8F0);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.family-card.on {
  border-color: var(--accent, #29abd4);
  background: rgba(41, 171, 212, .08);
  cursor: default;
}

/* Закрытая карта: имя под маской, замок в надписи. Приглушаем, чтобы было
   видно — это ещё не ваш раздел, сюда нужно войти. */
.family-card.locked {
  color: var(--muted, #64748B);
  border-style: dashed;
}

.records-family .secondary-button {
  min-height: 38px;
  margin: 0;
}

.records-account-actions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}

.records-account-actions .secondary-button {
  min-height: 42px;
  margin: 0;
  flex: 1 1 auto;
}

/* «Выйти» — по содержимому: пополам подписи не помещаются, и «Получать по
   SMS» переносилось на вторую строку. Когда кнопка одна, делить нечего —
   она занимает всю ширину. */
.records-account-actions .secondary-button:last-child:not(:only-child) {
  /* width: auto обязателен: у кнопок общая ширина 100 %, и без сброса
     «по содержимому» превращается в «во всю панель». */
  width: auto;
  flex: 0 0 auto;
}

.record-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--disabled);
  color: var(--disabled-text);
  font-size: var(--type-micro);
  font-weight: 800;
}

/* Состоявшийся визит — не серым: это единственное, что осталось в прошлом
   списке, и читается он как история приёмов, а не как перечень неудач. */
.record-tag.is-done {
  background: var(--selection);
  color: var(--teal);
}

.record-tag iconify-icon {
  font-size: 13px;
}

/* ---- отказ сервера там, где нужен повтор на месте ---- */
.retry-block {
  margin-top: 14px;
  padding: 16px 14px;
  border: 1px solid var(--error-line);
  border-radius: 16px;
  background: var(--error-bg);
}

.retry-block strong {
  display: block;
  color: var(--error);
  font-size: var(--type-secondary);
  font-weight: 800;
}

.retry-block p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 600;
  line-height: 1.45;
}

.retry-block .primary-button {
  margin-top: 12px;
}

/* Выбор месяца на шкале дат. Прототип обещал, что кнопка календаря
   открывает выбор месяца, — здесь она его и открывает. */
.month-list {
  margin-top: 6px;
}

.month-row-btn {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  font-size: var(--type-control);
  font-weight: 700;
  text-align: left;
}

.month-row-btn.is-active {
  border-color: var(--teal);
  background: var(--selection);
}

.month-row-btn span {
  color: var(--muted);
  font-size: var(--type-meta);
  font-weight: 700;
}

/* Карточка врача на телефоне: цена ушла вниз, портрет стал крупнее.

   Цена стояла в одной строке со специальностью, у правого края, тем же
   мелким шрифтом — рядом с названием специальности число читалось как её
   продолжение, а не как стоимость приёма. Теперь у неё своя подпись, свой
   размер и место внизу карточки, а ближайшая запись встала под ценой.

   Заодно карточка перестала быть фиксированной по высоте. Раньше высота
   была жёсткой (166 px), а строка «Ближайшая запись» прижималась к низу
   абсолютом — так у врачей с разным числом адресов запись стояла на одной
   линии. С ценой в два ряда жёсткой высоты хватало бы только на худший
   случай (длинное имя в три строки плюс три адреса), а у большинства врачей
   один-два адреса — и под адресами зияла бы пустая полоса в полсотни
   пикселей. Поэтому низ карточки теперь в обычном потоке, а высота растёт
   по содержимому. */
.doctor-card .doctor-card-foot {
  display: flex;
  margin-top: 9px;
  flex-direction: column;
}

.doctor-card .doctor-price-label {
  color: var(--muted);
  font-size: var(--type-micro);
  font-weight: 600;
  line-height: 1.3;
}

.doctor-card .doctor-price {
  margin: 1px 0 0;
  font-size: var(--type-primary);
  line-height: 1.25;
}

.doctor-card .doctor-next {
  position: static;
  margin-top: 2px;
}

/* Портрет: 44 px — размер значка, а не фотографии; в списке врача узнают
   по лицу. Больше 64 px не берём: портрет отнимает ширину у колонки текста
   справа, и на 390 px под неё остаётся 235 px — ровно столько, чтобы
   «Ближайшая запись · 5 сентября» осталась одной строкой. На 72 px эта
   строка ломалась пополам у большинства врачей.

   На узких экранах портрет меньше: на 320 px колонка текста — 173 px,
   и 56 px это компромисс. Длинное имя вроде «Терсенов Харлампий
   Александрович» там всё равно ложится в три строки — чтобы обойтись
   двумя, портрет пришлось бы вернуть к 46 px, то есть не увеличивать
   вовсе. Ничего не обрезается: высота карточки больше не фиксирована,
   карточка просто становится выше. */
.doctor-card .demo-portrait {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

@media (max-width: 350px) {
  .doctor-card .demo-portrait {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }
}

/* Высота по содержимому вместо прежних 166/188 px. Колонка текста больше
   не тянется на всю карточку: `height: 100%` был нужен только затем, чтобы
   было от чего отсчитывать `bottom: 0` у строки записи. */
.doctor-card {
  height: auto;
  min-height: 0;
  padding: 12px;
}

.doctor-card .doctor-copy {
  height: auto;
}

@media (max-width: 350px) {
  .doctor-card {
    height: auto;
    min-height: 0;
  }
}

/* ======================= 4. РАСКЛАДКА ПОД КОМПЬЮТЕР ==================== */

/* =========================================================================
   Раскладка под компьютер — веб-прототип ELISA web booking.

   Всё, что ниже, живёт внутри @media (min-width: 900px) и не может задеть
   утверждённый макет: до 900 px страница остаётся ровно той, что согласована
   на 320–390 px, — телефонная колонка по центру экрана.

   На компьютере работает вторая согласованная композиция — веб-прототип:
   шапка во всю ширину, под ней рабочее пространство в две колонки. Слева
   панель «Врачи» с поиском и фильтрами, справа колонка приёма: карточка
   выбранного врача, филиал, дата, время, а под ними два раздела — «Ваши
   данные» и «Подтверждение». Разделы раскрываются сами: время выбрано —
   открылась анкета, анкета заполнена — открылось подтверждение.

   Прокрутка у каждой колонки своя: список врачей не уезжает, пока пациент
   листает расписание, и наоборот. Страница целиком не прокручивается вовсе —
   окно занимает монитор ровно один раз.

   Цвета, шрифт и пиктограммы у обоих прототипов одни и те же: это одна
   дизайн-система, и переменные из блока 2 здесь не переопределяются.
   ========================================================================= */
@media (min-width: 900px) {
  /* ------------------------------------------------------- 4.1 каркас */

  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  /* Окно занимает монитор целиком. Карточка с полями по краям была уместна,
     пока внутри жила телефонная колонка: она хоть как-то объясняла пустоту
     вокруг. Разложенному по ширине экрану объяснять нечего. */
  .app {
    position: static;
    left: auto;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
    transform: none;
    background: var(--board);
    box-shadow: none;
  }

  /* Полоска «шаг N из 8» — телефонная: в рабочем пространстве маршрут виден
     целиком, а считать нечего. */
  .progress-area {
    display: none;
  }

  /* ---- шапка во всю ширину ---- */
  .app-header {
    min-height: 66px;
    padding: 10px max(16px, calc((100% - 1760px) / 2));
    border-bottom: 1px solid #E1E7EC;
    background: var(--surface);
  }

  /* В шапке компьютера внутренней высоты 46 px (66 − 10 − 10), логотип
     занимает её почти целиком. */
  .brand-logo {
    height: 44px;
  }

  /* Места вдоволь — подпись у кнопок звонка и профиля возвращается. */
  .call-action span,
  .profile-action span,
  .labs-action span {
    display: inline;
  }

  .call-action,
  .records-action {
    min-height: 46px;
    padding: 0 18px;
    font-size: 15px;
  }

  .records-action iconify-icon,
  .call-action iconify-icon {
    font-size: 20px;
  }

  /* ---- две колонки рабочего пространства ---- */
  .booking-grid {
    display: grid;
    width: min(100% - 32px, 1760px);
    min-height: 0;
    margin: 0 auto;
    padding: 14px 0 16px;
    align-items: stretch;
    flex: 1 1 auto;
    gap: 16px;
    grid-template-columns: minmax(400px, 520px) minmax(0, 1fr);
  }

  /* Подтверждение номера и экран успеха рабочего пространства не образуют:
     там нечего раскладывать по колонкам, и страница становится одной
     карточкой по центру. */
  .app:not(.is-desk-book) .booking-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app:not(.is-desk-book) .desk-aside {
    display: none;
  }

  /* ------------------------------------------- 4.2 панель «Врачи» слева */

  .is-desk-book .desk-aside {
    display: grid;
    min-height: 0;
    padding: 20px 20px 14px;
    border: 1px solid rgba(217, 225, 232, .96);
    border-radius: 22px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(18, 33, 58, .08);
    grid-template-rows: auto auto auto minmax(0, 1fr);
  }

  .panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .panel-title-row h2 {
    margin: 0;
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.025em;
  }

  .search-shell {
    display: flex;
    min-height: 56px;
    align-items: center;
    gap: 10px;
    margin: 16px 0 13px;
    padding: 0 5px 0 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
  }

  .search-shell:focus-within {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 149, 149, .09);
  }

  .search-shell > iconify-icon {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 20px;
  }

  .search-shell input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
  }

  .search-shell .search-filter-action {
    position: relative;
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0 11px 11px 0;
    background: linear-gradient(135deg, #EEF9F8, #DDF3F1);
    color: var(--teal-dark);
    font-size: 20px;
  }

  /* Счётчик фильтров — точкой у кнопки, а не таблеткой в строке: в шапке
     поиска места на таблетку нет. */
  .search-shell .filter-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 19px;
    min-height: 19px;
    padding: 2px 5px;
    border: 2px solid var(--surface);
    border-radius: 99px;
    background: var(--teal);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.25;
  }

  .result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
  }

  /* Список — обычный блок, а не сетка. Карточка врача — кнопка, и внутри
     сетки Chrome берёт её высоту из min-height, не заглядывая в содержимое:
     у врача с тремя адресами «Ближайшая запись» вылезала за рамку. В обычном
     потоке кнопка растёт по содержимому, как ей и положено. */
  .is-desk-book #doctorResults {
    display: block;
    min-height: 0;
    padding: 0 7px 6px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .is-desk-book .letter-label {
    margin: 16px 2px 6px;
    font-size: 13px;
  }

  .is-desk-book .letter-label:first-child {
    margin-top: 0;
  }

  /* ---- карточка врача ---- */
  /* Высота — по содержимому: у врача может быть и один адрес, и три, а
     фиксированная высота телефонной карточки либо резала бы адреса, либо
     оставляла пустоту. Вместе с высотой снимаем и абсолюты внутри — они
     держались как раз на ней. */
  .is-desk-book .doctor-card {
    display: grid;
    height: auto;
    min-height: 150px;
    align-items: center;
    gap: 13px;
    margin: 0 0 10px;
    padding: 16px 14px;
    border-radius: 16px;
    grid-template-columns: 64px minmax(0, 1fr) auto 20px;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
  }

  .is-desk-book .doctor-card .doctor-copy {
    height: auto;
  }

  .is-desk-book .doctor-card > iconify-icon {
    position: static;
    transform: none;
  }

  .is-desk-book .doctor-card:hover {
    border-color: #A7CFCC;
    transform: translateY(-1px);
  }

  .is-desk-book .doctor-card.is-selected {
    border-color: var(--teal);
    background: var(--selection);
    box-shadow: inset 4px 0 0 var(--teal);
  }

  .is-desk-book .doctor-card .demo-portrait {
    width: 64px;
    height: 64px;
    border-radius: 17px;
  }

  .is-desk-book .doctor-name {
    font-size: 17px;
    line-height: 1.34;
  }

  .is-desk-book .doctor-specialty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 14px;
    font-weight: 650;
  }

  .mini-icon-tile {
    display: inline-grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 9px;
    background: linear-gradient(135deg, #F2FAFA, #E1F4F2);
    color: var(--teal);
    font-size: 18px;
  }

  .doctor-address-list {
    display: grid;
    gap: 2px;
    margin-top: 5px;
  }

  .doctor-address {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
  }

  .doctor-address iconify-icon {
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--teal);
    font-size: 15px;
  }

  /* На телефоне «Ближайшая запись» прижата к низу карточки абсолютом: там у
     карточки фиксированная высота. Здесь карточка растёт по содержимому — у
     врача может быть и три адреса, — и абсолют наехал бы на последний. */
  .is-desk-book .doctor-next {
    position: static;
    margin-top: 7px;
    font-size: 14px;
  }

  .is-desk-book .doctor-card .doctor-price {
    align-self: start;
    margin-top: 3px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
  }

  .card-chevron {
    color: var(--teal);
    font-size: 21px;
  }

  /* Пустой список и отказ загрузки — на всю ширину колонки. */
  .is-desk-book #doctorResults .empty-state,
  .is-desk-book #doctorResults .loading-block,
  .is-desk-book #doctorResults .retry-block {
    padding-top: 18px;
  }

  /* -------------------------------------------- 4.3 панель фильтров */

  /* Фильтры веб-прототипа: не шторка снизу, а окно у левого края рабочего
     пространства — рядом с кнопкой, которая его открыла. */
  .filters-panel:not([hidden]) {
    position: fixed;
    z-index: 45;
    top: 78px;
    left: max(16px, calc((100vw - 1760px) / 2));
    display: grid;
    width: min(820px, calc(100vw - 32px));
    max-height: calc(100dvh - 92px);
    padding: 20px;
    border: 1px solid rgba(217, 225, 232, .96);
    border-radius: 22px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(18, 33, 58, .18);
    grid-template-rows: auto minmax(0, 1fr);
    animation: filters-in .24s cubic-bezier(.22, 1, .36, 1);
    transform-origin: top left;
  }

  @keyframes filters-in {
    from { opacity: 0; transform: translateY(-10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .filter-panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .quiet-button {
    min-height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 800;
  }

  .filter-close {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--teal-dark);
    font-size: 20px;
  }

  /* Высота по содержимому, но не выше экрана: у веб-прототипа списки были в
     два десятка строк и коробка всегда стояла полной, у центра их бывает
     пять — и жёсткая высота оставляла бы под ними пустое поле. */
  .filter-content {
    display: grid;
    max-height: min(590px, calc(100dvh - 190px));
    margin-top: 16px;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-group {
    display: grid;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 10px;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .filter-group-title {
    display: flex;
    width: 100%;
    align-items: baseline;
    justify-content: space-between;
    margin: 0;
    padding: 0 4px;
    gap: 12px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
  }

  .filter-group-title small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  .filter-search-shell {
    position: relative;
    min-width: 0;
  }

  .filter-search-shell iconify-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    color: var(--muted);
    font-size: 18px;
    pointer-events: none;
    transform: translateY(-50%);
  }

  .filter-search-shell input {
    width: 100%;
    min-height: 46px;
    padding: 0 13px 0 40px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    outline: 0;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
  }

  .filter-search-shell input:focus {
    border-color: var(--teal);
  }

  .filter-scroll {
    display: grid;
    min-height: 0;
    align-content: start;
    gap: 6px;
    padding: 2px 8px 6px 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .filter-option {
    display: flex;
    width: 100%;
    min-height: 58px;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
  }

  .filter-option:hover {
    background: var(--alt);
  }

  .filter-option.is-active {
    border-color: var(--teal);
    background: linear-gradient(90deg, #F1FAFA, #E5F5F4);
    color: var(--ink);
  }

  .filter-option-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: linear-gradient(135deg, #F2FAFA, #E1F4F2);
    color: var(--teal);
    font-size: 21px;
  }

  .filter-option-copy {
    min-width: 0;
    flex: 1;
  }

  .filter-option-copy small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }

  .filter-empty {
    margin: 5px 2px;
    padding: 15px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--alt);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
  }

  /* ---- полосы прокрутки колонок ---- */
  .is-desk-book #doctorResults,
  .is-desk-book .screen-content,
  .filter-scroll {
    scrollbar-width: thin;
    scrollbar-color: #A7CFCC transparent;
  }

  .is-desk-book #doctorResults::-webkit-scrollbar,
  .is-desk-book .screen-content::-webkit-scrollbar,
  .filter-scroll::-webkit-scrollbar {
    display: block;
    width: 8px;
  }

  .is-desk-book #doctorResults::-webkit-scrollbar-thumb,
  .is-desk-book .screen-content::-webkit-scrollbar-thumb,
  .filter-scroll::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 99px;
    background: #A7CFCC;
    background-clip: padding-box;
  }

  /* ------------------------------------------ 4.4 колонка приёма справа */

  .is-desk-book .screen-content {
    display: flex;
    min-width: 0;
    min-height: 0;
    padding: 0 7px 0 0;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-top: 14px;
  }

  .is-desk-book .screen-content > * {
    min-width: 0;
    flex: 0 0 auto;
  }

  .panel,
  .stage-card {
    border: 1px solid rgba(217, 225, 232, .96);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(18, 33, 58, .08);
  }

  .appointment-panel {
    padding: 24px;
  }

  /* Пока врач не выбран, колонка не пустует, а объясняет, чего ждёт. */
  .is-desk-book .appointment-panel .empty-state {
    display: flex;
    min-height: 300px;
    padding: 24px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    border: 1px dashed var(--line);
    border-radius: 16px;
    color: var(--muted);
  }

  .is-desk-book .appointment-panel .empty-state h2 {
    margin: 18px 0 0;
    font-size: 21px;
  }

  .is-desk-book .appointment-panel .empty-state p {
    max-width: 340px;
    font-size: 14px;
  }

  /* ---- выбранный врач ---- */
  .selected-doctor {
    display: grid;
    align-items: center;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
    grid-template-columns: 104px minmax(0, 1fr) auto;
  }

  .selected-doctor .demo-portrait {
    width: 104px;
    height: 104px;
    border-radius: 26px;
  }

  .selected-context-label {
    display: block;
    margin-bottom: 6px;
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .09em;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .selected-doctor h2 {
    margin: 0;
    color: var(--ink);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.03em;
  }

  .selected-specialty-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
  }

  .specialty-icon-tile {
    display: inline-grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #F2FAFA, #E1F4F2);
    color: var(--teal);
    font-size: 22px;
  }

  .selected-doctor-info {
    display: grid;
    gap: 6px;
    margin-top: 12px;
  }

  .selected-doctor-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
  }

  .selected-doctor-info iconify-icon {
    flex: 0 0 auto;
    color: var(--teal);
    font-size: 17px;
  }

  .price-chip {
    align-self: start;
    padding: 11px 15px;
    border-radius: 12px;
    background: var(--selection);
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
    white-space: nowrap;
  }

  /* ---- блоки выбора внутри карточки приёма ---- */
  .appointment-block {
    margin-top: 20px;
  }

  .block-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 12px;
  }

  .block-title h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
  }

  .block-title span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
  }

  /* ---- образование выбранного врача ----
     Год отдельным столбцом: строки выстраиваются в хронику, и её видно
     одним взглядом, не вчитываясь. Список свёрнут до двух строк, остальные
     открывает кнопка под ним — см. deskEducationBlock в web/lk.js. */
  .education-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .education-list li {
    display: grid;
    align-items: baseline;
    gap: 12px;
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .education-year {
    color: var(--teal-dark);
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .education-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .education-copy strong {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
  }

  .education-copy small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.4;
  }

  .education-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--teal-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
  }

  .education-more:hover {
    border-color: var(--teal);
    background: var(--selection);
  }

  .education-more iconify-icon {
    font-size: 16px;
  }

  /* Специальность и филиал — карточки в два столбца. Разметка та же, что на
     телефоне: кнопка с кружком выбора, плиткой значка и подписью. */
  .choice-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .is-desk-book .choice-card,
  .is-desk-book .branch-card {
    min-height: 96px;
    align-items: center;
    gap: 11px;
    margin-top: 0;
    padding: 12px;
    border-radius: 16px;
  }

  .is-desk-book .choice-card .icon-tile,
  .is-desk-book .branch-card .icon-tile {
    width: 42px;
    height: 42px;
  }

  .is-desk-book .choice-name,
  .is-desk-book .branch-name {
    font-size: 15px;
  }

  .is-desk-book .branch-next {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 800;
  }

  .is-desk-book .branch-next.is-empty {
    color: var(--muted);
  }

  .is-desk-book .branch-next iconify-icon {
    font-size: 15px;
  }

  .is-desk-book .choice-price {
    font-size: 15px;
  }

  /* Единственный филиал — не выбор, а справка. */
  .single-branch-card {
    display: grid;
    min-height: 96px;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .single-branch-card .icon-tile {
    background: var(--surface);
  }

  .single-branch-card strong {
    display: block;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.4;
  }

  /* ---- дата: две недели сеткой, а не лентой ---- */
  .date-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 11px;
    gap: 14px;
  }

  .date-title-row h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
  }

  .date-window-tools {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .date-window-label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
  }

  .date-window-controls {
    display: flex;
    gap: 6px;
  }

  .date-window-controls button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--teal-dark);
    font-size: 20px;
  }

  .date-window-controls button:disabled {
    color: var(--disabled-text);
    background: var(--disabled);
    cursor: not-allowed;
  }

  .date-window-controls .month-button {
    width: 42px;
    height: 42px;
    color: var(--teal);
  }

  .date-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(7, minmax(58px, 1fr));
  }

  .is-desk-book .date-card {
    width: auto;
    min-width: 0;
    height: auto;
    min-height: 78px;
    padding: 8px 4px;
    border-radius: 14px;
  }

  .is-desk-book .date-card span {
    font-size: 13px;
  }

  .is-desk-book .date-card strong {
    font-size: 16px;
  }

  /* ---- время ---- */
  .time-grid {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(6, minmax(72px, 1fr));
  }

  .time-card {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
  }

  .time-card.is-disabled,
  .time-card.is-conflict {
    border-color: transparent;
    background: var(--disabled);
    color: var(--disabled-text);
    cursor: not-allowed;
  }

  .time-card.is-selected {
    border-color: var(--teal);
    background: var(--selection);
    color: var(--teal-dark);
    animation: calm-selection 420ms cubic-bezier(.22, 1, .36, 1);
  }

  @keyframes calm-selection {
    0% { transform: scale(.975); }
    55% { transform: scale(1.012); }
    100% { transform: scale(1); }
  }

  .is-desk-book .legend-note {
    font-size: 13px;
  }

  /* Полосы-подсказки внутри карточки приёма. */
  .is-desk-book .info-band,
  .is-desk-book .error-band,
  .placeholder-band,
  .selection-band {
    font-size: 14px;
    line-height: 1.5;
  }

  .placeholder-band,
  .selection-band {
    display: flex;
    min-height: 58px;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 13px 14px;
    border: 1px solid #DCE9E7;
    border-radius: 14px;
    background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
    color: var(--muted);
  }

  .placeholder-band iconify-icon,
  .selection-band iconify-icon {
    flex: 0 0 auto;
    color: var(--teal-dark);
    font-size: 20px;
  }

  .selection-band {
    color: var(--ink);
    animation: calm-reveal 360ms cubic-bezier(.22, 1, .36, 1);
  }

  @keyframes calm-reveal {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .is-desk-book .info-band strong,
  .is-desk-book .error-band strong {
    font-size: 15px;
  }

  .is-desk-book .info-band span,
  .is-desk-book .error-band span {
    font-size: 14px;
  }

  /* -------------------------------- 4.5 разделы «Данные» и «Подтверждение» */

  .stage-card {
    overflow: hidden;
    transition: border-color .38s ease, box-shadow .38s ease;
  }

  .stage-card.is-open {
    border-color: #C7E3E1;
    box-shadow: 0 14px 34px rgba(18, 33, 58, .08);
  }

  .stage-header {
    display: grid;
    min-height: 104px;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    grid-template-columns: 46px 1fr auto;
    transition: background-color .18s ease-out, background-image .18s ease-out;
  }

  .stage-card.is-open .stage-header {
    background: linear-gradient(90deg, rgba(239, 249, 248, .7), rgba(255, 255, 255, 0));
  }

  .stage-index {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: var(--selection);
    color: var(--teal-dark);
    font-size: 22px;
    transition: transform .18s ease-out;
  }

  .stage-card.is-open .stage-index {
    transform: scale(1.04);
  }

  .stage-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.03em;
  }

  .stage-header p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
  }

  .stage-state {
    padding: 7px 10px;
    border-radius: 99px;
    background: var(--disabled);
    color: var(--disabled-text);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: color .18s ease-out, background-color .18s ease-out;
  }

  .stage-card.is-open .stage-state {
    background: var(--selection);
    color: var(--teal-dark);
  }

  .stage-body {
    padding: 0 24px 24px;
    border-top: 1px solid var(--line);
    container: stage-body / inline-size;
  }

  .patient-layout,
  .confirmation-layout {
    display: grid;
    align-items: start;
    gap: 22px;
    padding-top: 22px;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
  }

  /* Рядом со сводкой способам нужно место, а считать его по ширине окна
     нельзя: виджет живёт и в iframe чужого сайта, где окно широкое, а
     колонка узкая. Меряем саму колонку — и если способам остаётся меньше
     ~420 px, сводка уходит под них. */
  @container stage-body (max-width: 660px) {
    .confirmation-layout {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  /* ---- анкета ---- */
  .form-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-intro {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
  }

  .field-group {
    display: grid;
    gap: 7px;
  }

  .field-group.is-wide {
    grid-column: 1 / -1;
  }

  .field-group > label {
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
  }

  .field-group .required {
    color: var(--error);
  }

  .field-group .optional-mark {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .field-input-shell {
    position: relative;
  }

  .field-input-shell > iconify-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 14px;
    color: var(--muted);
    font-size: 18px;
    pointer-events: none;
    transform: translateY(-50%);
  }

  .field-input-shell:focus-within > iconify-icon {
    color: var(--teal-dark);
  }

  .field-group input {
    width: 100%;
    min-height: 54px;
    padding: 0 14px 0 43px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    outline: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
  }

  .field-group input:focus {
    border-color: var(--teal);
  }

  .field-group.is-error input {
    border-color: var(--error);
    background: var(--error-bg);
  }

  .field-error-text {
    display: none;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--error);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
  }

  /* Подсказка про дату рождения — на обе колонки: она относится ко всей
     анкете, а не к соседнему полю. */
  .is-desk-book .patient-match-note {
    grid-column: 1 / -1;
  }

  .patient-clarification {
    display: grid;
    grid-column: 1 / -1;
    align-items: end;
    gap: 16px;
    padding: 16px;
    border: 1px solid #EAD7A7;
    border-radius: 14px;
    background: #FFFAF0;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .55fr);
  }

  .patient-clarification-copy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .patient-clarification-copy iconify-icon {
    flex: 0 0 auto;
    color: #9B6C10;
    font-size: 22px;
  }

  .patient-clarification-copy strong {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
  }

  .patient-clarification-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
  }

  .is-desk-book .consent-row {
    grid-column: 1 / -1;
    min-height: 52px;
    margin-top: 0;
    padding: 12px 13px;
    border-radius: 13px;
    background: var(--alt);
    font-size: 14px;
  }

  .is-desk-book .consent-helper {
    grid-column: 1 / -1;
    margin: -10px 0 0 32px;
    font-size: 13px;
  }

  .patient-status {
    min-height: 44px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
  }

  .patient-status.is-ready {
    color: var(--teal-dark);
    font-weight: 800;
  }

  .is-desk-book .whoami {
    margin-top: 0;
    font-size: 15px;
  }

  /* ---- врезка «Ваш приём» справа от анкеты ---- */
  .summary-card {
    padding: 18px;
    border: 1px solid #DCE9E7;
    border-radius: 16px;
    background: linear-gradient(145deg, #F4F9FA, #ECF8F7);
  }

  .summary-card h3 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
  }

  .summary-row {
    display: grid;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid rgba(217, 225, 232, .84);
    font-size: 14px;
    line-height: 1.45;
    grid-template-columns: 112px 1fr;
  }

  .summary-row:first-of-type {
    border-top: 0;
  }

  .summary-row > span {
    color: var(--muted);
  }

  .summary-row strong {
    color: var(--ink);
    font-weight: 800;
  }

  .summary-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 15px;
    border-top: 1px solid rgba(217, 225, 232, .92);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
  }

  .summary-section-heading:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .summary-section-heading iconify-icon {
    color: var(--teal);
    font-size: 18px;
  }

  .summary-section-heading + .summary-row {
    border-top: 0;
  }

  .summary-edit-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 0 11px;
    border: 1px solid #BCDEDB;
    border-radius: 11px;
    background: var(--surface);
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 800;
  }

  .summary-edit-button:hover {
    background: var(--selection);
  }

  .summary-edit-button iconify-icon {
    font-size: 16px;
  }

  /* ---- подтверждение ---- */
  .channel-list {
    display: grid;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 10px;
    /* Способы — по одному в строку на всю ширину: в две колонки подпись
       рядом с «Рекомендуем» рассыпалась по слову в строке. */
    grid-template-columns: minmax(0, 1fr);
  }

  .channel-list legend {
    grid-column: 1 / -1;
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 20px;
    font-weight: 800;
  }

  .channel-intro {
    grid-column: 1 / -1;
    margin: -5px 0 4px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
  }

  .is-desk-book .channel-card {
    position: relative;
    min-height: 98px;
    align-items: center;
    margin-top: 0;
    padding: 13px 15px;
    border-radius: 15px;
  }

  .is-desk-book .channel-card.is-max.is-selected {
    border-color: #7D65FF;
    background: linear-gradient(105deg, #F8F7FF, #EDF7FF);
    box-shadow: 0 7px 18px rgba(98, 45, 255, .1);
  }

  .is-desk-book .channel-name {
    font-size: 15px;
    line-height: 1.35;
  }

  .is-desk-book .channel-note {
    font-size: 13px;
  }

  .is-desk-book .max-logo-shell {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    background: var(--surface);
  }

  .is-desk-book .max-logo-shell .max-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
  }

  /* «Рекомендуем» висит в углу карточки — подпись обязана оставить ей место,
     иначе название переносится под неё. */
  .is-desk-book .channel-card.is-max .channel-copy {
    padding-right: 74px;
  }

  .is-desk-book .recommended-tag {
    position: absolute;
    top: 8px;
    right: 9px;
    padding: 5px 8px;
    border-radius: 99px;
    background: var(--surface);
    color: #6B52EF;
    font-size: 10px;
    font-weight: 800;
  }

  .confirmation-phone-band {
    display: grid;
    min-height: 64px;
    align-items: center;
    grid-column: 1 / -1;
    gap: 11px;
    margin-top: 4px;
    padding: 11px 13px;
    border: 1px solid #DCE9E7;
    border-radius: 14px;
    background: linear-gradient(90deg, #F4F9FA, #ECF8F7);
    grid-template-columns: 36px minmax(0, 1fr) auto;
  }

  .confirmation-phone-band > iconify-icon {
    color: var(--teal-dark);
    font-size: 22px;
  }

  .confirmation-phone-copy strong,
  .confirmation-phone-copy span {
    display: block;
  }

  .confirmation-phone-copy strong {
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
  }

  .confirmation-phone-copy span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
  }

  .channel-phone {
    grid-column: 1 / -1;
  }

  .confirmation-action {
    width: 100%;
    margin-top: 14px;
    font-size: 16px;
  }

  .confirmation-action.max-primary {
    border-color: #6B52EF;
    background: linear-gradient(135deg, #5B35FF, #B000FF);
    box-shadow: 0 10px 22px rgba(98, 45, 255, .2);
  }

  .confirmation-tail {
    margin-top: 14px;
  }

  .confirmation-tail .inline-actions {
    margin-top: 12px;
  }

  /* ---- код из SMS ---- */
  .sms-code-panel {
    margin-top: 4px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: var(--alt);
  }

  .sms-code-panel h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 800;
  }

  .sms-code-panel p {
    margin: 6px 0 13px;
    color: var(--muted);
    font-size: 14px;
  }

  .is-desk-book .code-cells {
    grid-template-columns: repeat(var(--code-len, 6), minmax(42px, 1fr));
  }

  /* ------------------------------------------- 4.6 отдельные страницы */

  /* Вход в кабинет по номеру и экран успеха: одна карточка по центру. */
  .app:not(.is-desk-book) .screen-content {
    --pad-x: 24px;
    --pad-y: 26px;
    padding: var(--pad-y) var(--pad-x) 32px;
    background: var(--board);
    scrollbar-width: thin;
  }

  .app:not(.is-desk-book) .screen-enter {
    max-width: 620px;
    margin-inline: auto;
    padding: 30px 32px 34px;
    border: 1px solid rgba(217, 225, 232, .96);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(18, 33, 58, .08);
  }

  .app:not(.is-desk-book) .screen-title {
    font-size: 32px;
  }

  .app:not(.is-desk-book) .success-screen {
    max-width: 900px;
    padding: 44px;
    border-radius: 26px;
    text-align: center;
  }

  .success-screen .success-mark {
    margin: 0 auto 18px;
  }

  .app:not(.is-desk-book) .success-screen .screen-title {
    font-size: 36px;
  }

  .app:not(.is-desk-book) .success-ticket {
    text-align: left;
  }

  /* Две подсказки под билетом встают в ряд: на телефоне они шли колонкой,
     потому что там ширины на двоих нет, а здесь есть. */
  .app:not(.is-desk-book) .success-screen {
    display: grid;
    gap: 0 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app:not(.is-desk-book) .success-screen > *:not(.success-info) {
    grid-column: 1 / -1;
  }

  .app:not(.is-desk-book) .success-screen .success-info {
    text-align: left;
  }

  /* Кнопки экрана успеха: на телефоне они стоят колонкой во всю ширину —
     там это удобная мишень для пальца, на мониторе получалась бы полоса
     через весь экран. Здесь они встают парой по центру, как в макете. */
  .app:not(.is-desk-book) .action-footer,
  .app:not(.is-desk-book) .action-footer.is-success-footer {
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 14px 24px 20px;
    flex-direction: row;
  }

  .app:not(.is-desk-book) .action-footer .primary-button,
  .app:not(.is-desk-book) .action-footer .secondary-button,
  .app:not(.is-desk-book) .action-footer.is-success-footer .primary-button,
  .app:not(.is-desk-book) .action-footer.is-success-footer .secondary-button {
    width: auto;
    min-width: 220px;
    flex: 0 0 auto;
  }

  /* На одной странице нижней панели нет вовсе: каждое действие стоит рядом
     с тем, к чему относится, — как в веб-прототипе. */
  .is-desk-book .action-footer {
    display: none;
  }

  /* --------------------------------------------- 4.7 шторки и мелочи */

  /* Шторка снизу на мониторе становится обычным окном по центру. */
  .overlay {
    align-items: center;
    justify-content: center;
  }

  .bottom-sheet {
    width: min(560px, 100% - 64px);
    max-height: min(78%, 660px);
    padding: 22px 26px 24px;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(18, 33, 58, .22);
    animation-name: dialog-in;
  }

  .sheet-handle {
    display: none;
  }

  /* Окна кабинета — записи, заключения, анализы, профиль: места на мониторе
     вдоволь, а в узкое окно (560 × 660) список из пяти строк уходил под
     прокрутку. Мелкие вопросы остаются узкими. */
  .bottom-sheet.is-wide {
    width: min(880px, 100% - 64px);
    max-height: min(92%, 920px);
  }

  @keyframes dialog-in {
    from { transform: scale(.97); opacity: .4; }
    to { transform: none; opacity: 1; }
  }

  .toast {
    bottom: 26px;
  }

  /* Календарь месяца — окно веб-прототипа, шире обычной шторки. */
  .bottom-sheet.is-calendar {
    width: min(450px, 100% - 64px);
  }

  .calendar-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .calendar-dialog-head p {
    margin: 0 0 3px;
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .calendar-dialog-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
  }

  .calendar-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    gap: 12px;
  }

  .calendar-month-nav strong {
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
  }

  .calendar-month-nav button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--teal-dark);
    font-size: 20px;
  }

  .calendar-month-nav button:disabled {
    color: var(--disabled-text);
    background: var(--disabled);
    cursor: not-allowed;
  }

  .calendar-weekdays,
  .calendar-month-grid {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(7, 1fr);
  }

  .calendar-weekdays {
    margin-top: 13px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
  }

  .calendar-month-grid {
    margin-top: 6px;
  }

  .calendar-spacer {
    min-height: 44px;
  }

  .calendar-day {
    position: relative;
    min-width: 0;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: var(--disabled);
    color: var(--disabled-text);
    font-size: 13px;
    font-weight: 800;
  }

  .calendar-day.is-available {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
  }

  .calendar-day.is-available::after {
    position: absolute;
    right: 7px;
    bottom: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--teal);
    content: "";
  }

  .calendar-day.is-selected {
    border-color: var(--teal);
    background: var(--selection);
    color: var(--teal-dark);
  }

  .calendar-legend {
    display: flex;
    align-items: center;
    margin-top: 14px;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .calendar-legend i {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: var(--disabled);
  }

  .calendar-legend i.is-available {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: inset 0 -3px 0 var(--teal);
  }

  /* На телефоне кнопка звонка занимает всю ширину — это главная цель
     нажатия. На широком экране места хватает обоим, и полоса читается
     строкой: слева зачем звонить, справа куда. */
  .call-band {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .call-copy strong {
    font-size: 14px;
  }

  .call-copy span {
    font-size: 12px;
  }

  .call-actions .call-button,
  .call-request {
    flex: 0 0 auto;
  }

  /* Окно от 900 до 1200 px: колонки сужаются, врезки встают под содержимым. */
  @media (max-width: 1199px) {
    .booking-grid {
      grid-template-columns: minmax(350px, .82fr) minmax(500px, 1.18fr);
    }

    /* Панель врачей ужалась — карточке приходится ужиматься вместе с ней,
       иначе фамилия ломается на три строки. */
    .is-desk-book .doctor-card {
      min-height: 132px;
      gap: 10px;
      padding: 13px 12px;
      grid-template-columns: 52px minmax(0, 1fr) auto 16px;
    }

    .is-desk-book .doctor-card .demo-portrait {
      width: 52px;
      height: 52px;
      border-radius: 15px;
    }

    .is-desk-book .doctor-name {
      font-size: 16px;
    }

    .is-desk-book .doctor-specialty,
    .is-desk-book .doctor-address,
    .is-desk-book .doctor-next {
      font-size: 13px;
    }

    .is-desk-book .doctor-card .doctor-price {
      font-size: 16px;
    }

    .card-chevron {
      font-size: 18px;
    }

    .patient-layout,
    .confirmation-layout,
    .channel-list,
    .choice-grid {
      grid-template-columns: minmax(0, 1fr);
    }

    .selected-doctor {
      grid-template-columns: 88px minmax(0, 1fr) auto;
    }

    .selected-doctor .demo-portrait {
      width: 88px;
      height: 88px;
      border-radius: 22px;
    }

    .selected-doctor h2 {
      font-size: 24px;
    }

    .time-grid {
      grid-template-columns: repeat(5, minmax(72px, 1fr));
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .filters-panel:not([hidden]),
    .selection-band,
    .time-card.is-selected,
    .stage-card,
    .stage-index,
    .is-desk-book .doctor-card {
      transition-duration: .001ms;
      animation-duration: .001ms;
    }
  }
}

/* Шторка получает фокус при открытии, чтобы Tab начинался внутри неё;
   рамка вокруг всего окна при этом лишняя. */
.bottom-sheet:focus { outline: none; }
.screen-title:focus { outline: none; }

/* Кнопки и ссылки с клавиатуры: заметное кольцо, мышью оно не появляется. */
button:focus-visible,
a:focus-visible,
[tabindex]:not(.bottom-sheet):focus-visible {
  outline: 2px solid var(--accent, #29abd4);
  outline-offset: 2px;
}

/* Вопрос об отмене стоит под реквизитами визита, а не вместо них. */
.record-confirm {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Заказ отдан не весь: часть исследований ещё выполняется. */
.lab-partial {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff6e0;
  color: #6b4b00;
  font-size: 14px;
  line-height: 1.4;
}
.lab-partial iconify-icon { flex: none; margin-top: 2px; }
