/* «Селадон» — дизайн-основа новой CRM клиники.
   Цвета, шрифты и базовые элементы. Экраны подключают этот файл
   и строятся на переменных отсюда, а не на своих цветах. */

:root {
  /* Цвета */
  --sl-ground: #EEF2EF;        /* фон приложения */
  --sl-surface: #FFFFFF;       /* карточки и панели */
  --sl-surface-2: #F6F8F6;     /* поля ввода, вторичные плашки */
  --sl-line: #DCE4DF;          /* границы */
  --sl-ink: #1D2622;           /* основной текст */
  --sl-ink-2: #4D5A54;         /* вторичный текст */
  --sl-muted: #66736D;         /* подписи */
  --sl-accent: #3E7262;        /* селадон: кнопки, активные элементы */
  --sl-accent-dark: #2C5547;   /* текст на светлых плашках, наведение */
  --sl-tint: #E6F0EB;          /* выделенная строка, активный пункт меню */
  --sl-tint-2: #DCEBE4;        /* исходящие сообщения */
  --sl-sand: #F6EBD7;          /* внимание, заметки для сотрудников */
  --sl-sand-ink: #6B4A1F;
  --sl-danger: #FBE9E6;
  --sl-danger-ink: #8E2F22;

  /* Шрифты */
  --sl-font-display: "Tenor Sans", Georgia, "Times New Roman", serif;
  --sl-font-body: "Onest", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* Форма */
  --sl-radius-s: 10px;
  --sl-radius: 14px;
  --sl-radius-l: 20px;
  --sl-shadow: 0 10px 30px rgba(29, 38, 34, 0.07);
  --sl-focus: 0 0 0 3px rgba(62, 114, 98, 0.22);

  /* Движение */
  --sl-ease: cubic-bezier(0.22, 1, 0.36, 1);          /* мягкое замедление */
  --sl-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);  /* с лёгким перелётом */
  --sl-dur-1: 140ms;
  --sl-dur-2: 240ms;
  --sl-dur-3: 380ms;
}

/* Плавные переходы между страницами новой версии (Chrome, Edge, Safari 18+) */
@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sl-ground);
  color: var(--sl-ink);
  font-family: var(--sl-font-body);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--sl-accent-dark); }

:focus-visible { outline: 2px solid var(--sl-accent); outline-offset: 2px; }

.sl-display { font-family: var(--sl-font-display); font-weight: 400; letter-spacing: 0.005em; }

/* Поля ввода */
.sl-field { display: flex; flex-direction: column; gap: 7px; }
.sl-label { font-size: 13px; font-weight: 500; color: var(--sl-ink-2); }
.sl-input,
.sl-field input[type="text"],
.sl-field input[type="password"],
.sl-field input[type="email"],
.sl-field input[type="search"] {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--sl-line);
  border-radius: var(--sl-radius);
  background: var(--sl-surface-2);
  color: var(--sl-ink);
  font: inherit;
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.sl-field input:focus,
.sl-input:focus {
  outline: none;
  border-color: var(--sl-accent);
  background: var(--sl-surface);
  box-shadow: var(--sl-focus);
}

/* Кнопки */
.sl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--sl-radius);
  background: var(--sl-accent);
  color: #FFFFFF;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
a.sl-btn { color: #FFFFFF; }
a.sl-btn--ghost { color: var(--sl-ink); }
.sl-btn:hover { background: var(--sl-accent-dark); }
.sl-btn:active { transform: translateY(1px); }
.sl-btn--block { width: 100%; }
.sl-btn--ghost { background: var(--sl-surface); color: var(--sl-ink); border: 1px solid var(--sl-line); }
.sl-btn--ghost:hover { background: var(--sl-surface-2); }

/* Сообщения */
.sl-alert {
  padding: 12px 14px;
  border-radius: var(--sl-radius);
  font-size: 14px;
  line-height: 1.45;
}
.sl-alert--error { background: var(--sl-danger); color: var(--sl-danger-ink); }
.sl-alert--warn { background: var(--sl-sand); color: var(--sl-sand-ink); }

.sl-alert--ok { background: var(--sl-tint); color: var(--sl-accent-dark); }

.sl-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.sl-only-mobile { display: none !important; }
@media (max-width: 860px) { .sl-only-mobile { display: inline-flex !important; } }

.sl-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--sl-sand);
  color: var(--sl-sand-ink);
}

/* ============ Каркас приложения: меню слева + содержимое ============ */

.sl-app { display: flex; min-height: 100vh; }

.sl-rail {
  flex: 0 0 76px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--sl-surface);
  border-right: 1px solid var(--sl-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 0 14px;
  z-index: 5;
}
.sl-rail__logo {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--sl-accent);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.sl-rail__logo::after { content: ""; width: 16px; height: 16px; border-radius: 50%; background: #CFE3D9; }
.sl-rail__item {
  width: 66px; min-height: 54px; padding: 6px 2px;
  border-radius: var(--sl-radius);
  color: var(--sl-ink-2);
  text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; text-align: center;
}
.sl-rail__item:hover { background: var(--sl-surface-2); color: var(--sl-ink); }
.sl-rail__item[aria-current="page"] { background: var(--sl-tint); color: var(--sl-accent-dark); font-weight: 600; }
.sl-rail__item svg { width: 21px; height: 21px; }
.sl-rail__spacer { flex: 1; }
.sl-rail__me {
  width: 36px; height: 36px; border-radius: 50%;
  background: #F1E7D8; color: #6B4A1F;
  border: 0; cursor: pointer;
  font-family: var(--sl-font-display); font-size: 15px;
}
.sl-rail__menu {
  position: fixed; left: 84px; bottom: 16px;
  min-width: 200px;
  background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: var(--sl-radius);
  box-shadow: var(--sl-shadow); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
}
.sl-rail__menu[hidden] { display: none; }
.sl-rail__menu a, .sl-rail__menu button {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--sl-radius-s);
  border: 0; background: transparent; color: var(--sl-ink);
  font: inherit; font-size: 14px; text-decoration: none; cursor: pointer;
}
.sl-rail__menu a:hover, .sl-rail__menu button:hover { background: var(--sl-surface-2); }
.sl-rail__menu-name { padding: 8px 12px 6px; font-size: 12px; color: var(--sl-muted); }
.sl-rail__me-label, .sl-rail__menu-more { display: none; }

/* Телефон: внизу пять главных разделов и «Ещё»; остальные разделы и профиль — в листе «Ещё».
   Иначе пункты не помещаются по ширине, страница становится шире экрана и меню уезжает. */
@media (max-width: 860px) {
  .sl-rail__item--more { display: none !important; }
  .sl-rail__item { min-width: 0; }
  .sl-rail__item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sl-rail__me {
    flex: 1; min-width: 0; width: auto; height: auto; min-height: 50px; padding: 6px 2px;
    border-radius: var(--sl-radius); background: transparent; color: var(--sl-ink-2);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-family: var(--sl-font-body); font-size: 10px;
  }
  .sl-rail__me[aria-expanded="true"] { background: var(--sl-tint); color: var(--sl-accent-dark); }
  .sl-rail__me-ava {
    width: 22px; height: 22px; border-radius: 50%; background: #F1E7D8; color: #6B4A1F;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--sl-font-display); font-size: 11px;
  }
  .sl-rail__me-label { display: block; }
  .sl-rail__menu {
    left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); min-width: 0;
    transform-origin: right bottom;
  }
  .sl-rail__menu-more { display: flex; flex-direction: column; gap: 2px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--sl-line); }
}

.sl-content { flex: 1; min-width: 0; display: flex; }

/* Небольшие кнопки-значки: шапки, поле ответа. Подпись — всплывающей подсказкой. */
.sl-icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--sl-line);
  background: var(--sl-surface); color: var(--sl-accent-dark);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
}
.sl-icon-btn svg { width: 18px; height: 18px; }
.sl-btn--sm { min-height: 36px; padding: 0 13px; border-radius: 10px; font-size: 14px; font-weight: 500; }

.sl-tool {
  position: relative; flex: 0 0 auto;
  width: 34px; height: 34px; border-radius: 10px; border: 0;
  background: transparent; color: var(--sl-ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
}
.sl-tool svg { width: 19px; height: 19px; }
.sl-tool:hover { background: var(--sl-surface-2); color: var(--sl-ink); }
.sl-tool[aria-expanded="true"] { background: var(--sl-tint); color: var(--sl-accent-dark); }
.sl-tool--accent { color: var(--sl-accent); }

@media (hover: hover) {
  .sl-tool[data-tip]::after, .sl-send[data-tip]::after {
    content: attr(data-tip);
    position: absolute; right: 0; top: calc(100% + 6px);
    padding: 5px 9px; border-radius: 8px;
    background: var(--sl-ink); color: #FFFFFF;
    font-family: var(--sl-font-body); font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap;
    pointer-events: none; opacity: 0; transform: translateY(-3px);
    transition: opacity var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
    z-index: 40;
  }
  .sl-tool--up[data-tip]::after { top: auto; bottom: calc(100% + 6px); transform: translateY(3px); }
  .sl-tool[data-tip]:hover::after, .sl-tool[data-tip]:focus-visible::after,
  .sl-send[data-tip]:hover::after, .sl-send[data-tip]:focus-visible::after { opacity: 1; transform: none; transition-delay: 300ms; }
  .sl-tool[aria-expanded="true"]::after { opacity: 0 !important; }
}

/* ============ Общение ============ */

.sl-list {
  flex: 0 0 320px;
  min-width: 0; /* длинное превью в одну строку не должно распирать список */
  height: 100vh;
  position: sticky; top: 0;
  background: var(--sl-surface);
  border-right: 1px solid var(--sl-line);
  display: flex; flex-direction: column;
}
.sl-list__head { padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.sl-list__titlebar { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 4px; }
.sl-list__title { margin: 0; font-family: var(--sl-font-display); font-weight: 400; font-size: 22px; }
.sl-list__sub { margin: 0; color: var(--sl-ink-2); font-size: 12px; white-space: nowrap; }
.sl-search { position: relative; }
.sl-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--sl-muted); }
.sl-search input { padding-left: 36px !important; min-height: 38px !important; border-radius: 12px !important; font-size: 14px !important; }
.sl-chips {
  display: flex; flex-wrap: nowrap; gap: 5px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -14px; padding: 0 14px 2px;
  /* Если фильтры не влезли, край растушёван — видно, что ряд листается */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent);
}
.sl-chips::-webkit-scrollbar { display: none; }
.sl-chip {
  flex: 0 0 auto;
  height: 28px; padding: 0 9px; border-radius: 999px;
  border: 1px solid #D3DDD7; background: var(--sl-surface); color: #33413B;
  font-size: 12px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; white-space: nowrap;
}
.sl-chip span { opacity: 0.75; }
.sl-chip[aria-current="true"] { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }
.sl-list__items { flex: 1; overflow-y: auto; padding: 2px 8px 12px; display: flex; flex-direction: column; gap: 1px; }
.sl-row {
  display: flex; gap: 10px; align-items: center;
  padding: 9px 8px; border-radius: 12px;
  color: inherit; text-decoration: none;
}
.sl-row:hover { background: var(--sl-surface-2); }
.sl-row[aria-current="true"] { background: var(--sl-tint); }
.sl-avatar {
  flex: 0 0 40px; height: 40px; border-radius: 50%;
  background: #E3EEE8; color: var(--sl-accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--sl-font-display); font-size: 14px;
}
.sl-avatar--l { flex-basis: 46px; height: 46px; font-size: 17px; }
.sl-avatar--xl { width: 64px; height: 64px; flex-basis: 64px; font-size: 22px; box-shadow: 0 0 0 5px #F3F8F5; }
.sl-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sl-row__top { display: flex; align-items: baseline; gap: 8px; }
.sl-row__name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-row__time { flex: 0 0 auto; font-size: 11.5px; color: var(--sl-muted); }
.sl-row__bottom { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sl-row__preview { flex: 1; min-width: 0; font-size: 13px; color: var(--sl-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-row__chan { color: var(--sl-accent-dark); font-weight: 500; }
.sl-row__chan::after { content: " · "; color: var(--sl-muted); font-weight: 400; }
.sl-row__flag, .sl-row__wait { flex: 0 0 auto; font-size: 11px; line-height: 18px; border-radius: 999px; padding: 0 7px; }
.sl-row__flag { color: var(--sl-ink-2); background: var(--sl-surface-2); border: 1px solid #E3E9E5; }
.sl-row__wait { color: #7A4E14; background: var(--sl-sand); font-weight: 600; }
.sl-tag { font-size: 11px; font-weight: 500; color: var(--sl-accent-dark); border: 1px solid #C9DCD2; border-radius: 999px; padding: 1px 8px; }
.sl-empty { margin: 32px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--sl-ink-2); }
.sl-empty__mark { width: 56px; height: 56px; border-radius: 50%; background: var(--sl-tint); display: flex; align-items: center; justify-content: center; }
.sl-empty__mark::after { content: ""; width: 24px; height: 24px; border-radius: 50%; background: var(--sl-accent); }
.sl-empty strong { font-family: var(--sl-font-display); font-weight: 400; font-size: 19px; color: var(--sl-ink); }

.sl-thread { flex: 999 1 420px; min-width: 0; height: 100vh; display: flex; flex-direction: column; background: var(--sl-ground); }
.sl-thread__head {
  position: relative; z-index: 3;
  background: var(--sl-surface); border-bottom: 1px solid var(--sl-line);
  padding: 8px 12px 8px 14px; display: flex; flex-direction: column; gap: 8px;
}
.sl-thread__bar { display: flex; align-items: center; gap: 6px; min-height: 40px; }
.sl-thread__title { flex: 1; min-width: 0; margin: 0; font: inherit; }
.sl-thread__id {
  display: flex; align-items: center; gap: 10px; max-width: 100%;
  margin-left: -4px; padding: 3px 10px 3px 4px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.sl-thread__id:hover { background: var(--sl-surface-2); }
.sl-thread__avatar { flex-basis: 36px; height: 36px; font-size: 13px; }
.sl-thread__who { min-width: 0; display: flex; flex-direction: column; }
.sl-thread__name { font-family: var(--sl-font-display); font-weight: 400; font-size: 18px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-thread__meta { font-size: 12px; color: var(--sl-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-thread__actions { display: flex; gap: 2px; align-items: center; }

.sl-handoff { background: var(--sl-surface-2); border: 1px solid var(--sl-line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.sl-handoff__row { display: flex; gap: 8px; }

/* Раскрывающаяся панель: высота анимируется через grid 0fr → 1fr */
.sl-collapse {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: -8px;
  transition: grid-template-rows var(--sl-dur-3) var(--sl-ease), opacity var(--sl-dur-2) var(--sl-ease), margin-top var(--sl-dur-3) var(--sl-ease);
}
.sl-collapse.is-open { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.sl-collapse__inner { overflow: hidden; min-height: 0; }
.sl-handoff select, .sl-handoff textarea {
  font: inherit; font-size: 14px; border: 1px solid var(--sl-line); border-radius: 10px; background: var(--sl-surface); padding: 8px 11px;
}
.sl-handoff textarea { resize: none; }

.sl-flash { margin: 12px 24px 0; }

/* Переписка и поле ответа — одной колонкой по центру, как в Telegram */
.sl-messages { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column-reverse; }
.sl-messages__inner { width: min(100% - 40px, 820px); margin: 0 auto; padding: 20px 0 10px; display: flex; flex-direction: column; gap: 10px; }
.sl-msg { max-width: 78%; display: flex; flex-direction: column; gap: 3px; }
.sl-msg--in { align-self: flex-start; }
.sl-msg--out { align-self: flex-end; align-items: flex-end; }
.sl-bubble { padding: 9px 13px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.sl-msg--in .sl-bubble { background: var(--sl-surface); border-radius: 16px 16px 16px 5px; box-shadow: 0 1px 2px rgba(29, 38, 34, 0.06); }
.sl-msg--out .sl-bubble { background: var(--sl-tint-2); color: #18302A; border-radius: 16px 16px 5px 16px; }
.sl-msg--queued .sl-bubble { background: #F6F8F6; border: 1px dashed #9DBDB0; }
.sl-msg--failed .sl-bubble { background: var(--sl-danger); color: var(--sl-danger-ink); }
.sl-msg__meta { font-size: 11.5px; color: var(--sl-muted); padding: 0 6px; }
.sl-note {
  align-self: stretch; display: flex; align-items: flex-start; gap: 9px;
  border: 1px dashed #C7B48F; background: #FBF6EC; border-radius: 12px; padding: 8px 12px;
  font-size: 13px; color: #5C4520;
}
.sl-note svg { flex: 0 0 15px; width: 15px; height: 15px; margin-top: 2px; }
.sl-thread__empty { margin: auto; text-align: center; color: var(--sl-ink-2); padding: 40px; }

.sl-composer {
  position: relative;
  width: min(100% - 40px, 820px);
  margin: 4px auto 16px;
  background: var(--sl-surface); border: 1px solid var(--sl-line);
  border-radius: 22px; padding: 6px;
  box-shadow: 0 6px 22px rgba(29, 38, 34, 0.06);
}
.sl-composer__bar { display: flex; align-items: flex-end; gap: 6px; }
.sl-chan { flex: 0 0 auto; display: inline-flex; }
.sl-chan select {
  appearance: none; -webkit-appearance: none;
  height: 34px; max-width: 140px;
  padding: 0 30px 0 12px;
  border: 1px solid #C9DCD2; border-radius: 999px;
  background: #F1F6F3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%232C5547' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 12px 12px;
  color: var(--sl-accent-dark);
  font: inherit; font-size: 13px; font-weight: 500;
  text-overflow: ellipsis; cursor: pointer;
}
.sl-chan select:focus-visible { outline: none; box-shadow: var(--sl-focus); }
.sl-chan--one {
  height: 34px; padding: 0 12px; align-items: center;
  border-radius: 999px; background: #F1F6F3; color: var(--sl-accent-dark);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.sl-composer textarea {
  flex: 1; min-width: 0; height: 34px; max-height: 200px;
  resize: none; border: 0; background: transparent;
  font: inherit; font-size: 15px; line-height: 22px; padding: 6px 4px; overflow-y: auto;
}
.sl-composer textarea:focus { outline: none; }
.sl-send {
  position: relative; flex: 0 0 34px; width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: var(--sl-accent); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.sl-send svg { width: 17px; height: 17px; margin-left: -1px; }
.sl-send:not(:disabled):hover { background: var(--sl-accent-dark); }
.sl-send:disabled { background: #B9CEC5; cursor: default; }

/* Шаблоны ответа: всплывают над полем */
.sl-tpls {
  position: absolute; right: 6px; bottom: calc(100% + 8px);
  width: min(440px, calc(100% - 12px)); max-height: 340px; overflow-y: auto;
  background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: 16px;
  box-shadow: 0 18px 44px rgba(29, 38, 34, 0.16);
  padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 10;
  transform-origin: right bottom;
}
.sl-tpls[hidden] { display: none; }
.sl-tpls__title { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sl-muted); }
.sl-tpl {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 8px 10px; border: 0; border-radius: 10px; background: transparent;
  font: inherit; text-align: left; color: var(--sl-ink); cursor: pointer;
}
.sl-tpl strong { font-size: 13px; font-weight: 600; }
.sl-tpl span { font-size: 12.5px; color: var(--sl-ink-2); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.sl-tpl:hover, .sl-tpl:focus-visible { background: var(--sl-surface-2); outline: none; }
.sl-composer__note { margin: 4px 6px; font-size: 13px; color: var(--sl-sand-ink); background: var(--sl-sand); border-radius: 14px; padding: 10px 12px; }
.sl-spacer { flex: 1; }

/* Карточка пациента: выдвигается по нажатию на имя или на значок справа */
.sl-card {
  flex: 0 0 0px; height: 100vh; position: sticky; top: 0; overflow: hidden;
  background: var(--sl-surface); border-left: 1px solid transparent;
  visibility: hidden;
  transition: flex-basis var(--sl-dur-3) var(--sl-ease), border-color var(--sl-dur-2), visibility 0s linear var(--sl-dur-3);
}
.sl-content.card-open .sl-card {
  flex-basis: 320px; border-left-color: var(--sl-line); visibility: visible;
  transition: flex-basis var(--sl-dur-3) var(--sl-ease), border-color var(--sl-dur-2), visibility 0s;
}
.sl-card__inner {
  width: 320px; height: 100%; overflow-y: auto;
  padding: 12px 20px 22px; display: flex; flex-direction: column; gap: 18px;
  opacity: 0; transform: translateX(24px);
  transition: opacity var(--sl-dur-2) var(--sl-ease), transform var(--sl-dur-3) var(--sl-ease);
}
.sl-content.card-open .sl-card__inner { opacity: 1; transform: none; transition-delay: 60ms; }
.sl-card__top { display: flex; align-items: center; justify-content: space-between; margin-right: -10px; }
.sl-card__label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sl-muted); }
.sl-card__who { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.sl-card__name { margin: 6px 0 0; font-family: var(--sl-font-display); font-weight: 400; font-size: 20px; }
.sl-card__phone { font-size: 13px; color: var(--sl-ink-2); }
.sl-card h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sl-ink-2); }
.sl-steps { margin: 0; padding: 0; list-style: none; }
.sl-steps li { display: flex; align-items: center; gap: 12px; height: 30px; font-size: 14px; }
.sl-step-dot { width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box; flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; }
.sl-step-dot--done { background: var(--sl-accent); }
.sl-step-dot--done::after { content: ""; width: 7px; height: 4px; border-left: 2px solid #FFF; border-bottom: 2px solid #FFF; transform: rotate(-45deg) translate(1px, -1px); }
.sl-step-dot--now { border: 5px solid var(--sl-accent); background: #FFF; }
.sl-step-dot--todo { border: 1.5px solid #B8C8C0; }
.sl-steps .is-done { color: var(--sl-ink-2); }
.sl-steps .is-now { font-weight: 600; }
.sl-steps .is-todo { color: var(--sl-muted); }
.sl-dl { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.sl-dl div { display: flex; flex-direction: column; gap: 2px; }
.sl-dl dt { font-size: 12px; color: var(--sl-ink-2); }
.sl-dl dd { margin: 0; font-size: 14px; }
.sl-dl .is-hl { background: #F1F6F3; border-radius: 12px; padding: 10px 12px; }
.sl-dl .is-hl dd { font-weight: 600; }
.sl-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.sl-pill { font-size: 12px; color: var(--sl-accent-dark); background: #F1F6F3; border-radius: 999px; padding: 3px 10px; }
.sl-visits { display: flex; flex-direction: column; gap: 4px; }
.sl-visits span { font-size: 13px; padding: 7px 10px; border-radius: 10px; border: 1px solid #E6ECE8; }
.sl-card__actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sl-card__actions a.sl-btn { text-decoration: none; }

/* Узкий экран: карточка не отнимает место у переписки, а выезжает поверх */
@media (max-width: 1280px) {
  .sl-list { flex-basis: 296px; }
  .sl-card {
    position: fixed; right: 0; top: 0; z-index: 25;
    width: 340px; flex: none;
    border-left-color: var(--sl-line);
    transform: translateX(100%);
    transition: transform var(--sl-dur-3) var(--sl-ease), box-shadow var(--sl-dur-3), visibility 0s linear var(--sl-dur-3);
  }
  .sl-content.card-open .sl-card {
    transform: none; box-shadow: -18px 0 44px rgba(29, 38, 34, 0.16);
    transition: transform var(--sl-dur-3) var(--sl-ease), box-shadow var(--sl-dur-3), visibility 0s;
  }
  .sl-card__inner { width: 100%; }
}
@media (max-width: 860px) {
  .sl-app { flex-direction: column; }
  .sl-rail { position: sticky; top: auto; bottom: 0; order: 2; height: auto; flex: 0 0 auto; flex-direction: row; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--sl-line); }
  .sl-rail__logo, .sl-rail__spacer { display: none; }
  .sl-rail__item { width: auto; flex: 1; min-height: 50px; }
  .sl-content { order: 1; flex-direction: column; }
  .sl-list, .sl-thread { position: static; height: auto; flex: 1 1 auto; }
  .sl-content.has-thread .sl-list { display: none; }
  .sl-content:not(.has-thread) .sl-thread { display: none; }
  .sl-list__head { padding: 14px 14px 8px; }
  .sl-list__title { font-size: 24px; }

  /* Внутри чата на телефоне: меню прячется, поле ответа закреплено внизу */
  .sl-app:has(.sl-content.has-thread) .sl-rail { display: none; }
  .sl-content.has-thread .sl-thread { height: 100dvh; flex: 0 0 auto; }
  .sl-thread__head { padding: 6px 6px 6px 4px; }
  .sl-thread__bar { gap: 2px; }
  .sl-thread__avatar { display: none; }
  .sl-thread__id { margin-left: 0; padding: 3px 6px; }
  .sl-thread__name { font-size: 17px; }
  .sl-messages__inner { width: calc(100% - 24px); padding: 12px 0 8px; }
  .sl-msg { max-width: 86%; }
  .sl-composer { width: calc(100% - 16px); margin: 4px auto calc(8px + env(safe-area-inset-bottom, 0px)); }
  .sl-composer textarea { font-size: 16px; }
  .sl-chan select { max-width: 108px; }
  .sl-card { width: 100%; z-index: 40; }
}

/* ============ Движение ============ */

/* Отклик на нажатия и наведение */
.sl-btn { transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease), box-shadow var(--sl-dur-2), opacity var(--sl-dur-2); }
.sl-btn:disabled { opacity: 0.45; cursor: default; }
.sl-btn:active:not(:disabled) { transform: scale(0.97); }
.sl-row { position: relative; transition: background var(--sl-dur-2) var(--sl-ease), transform var(--sl-dur-1) var(--sl-ease); }
.sl-row:active { transform: scale(0.985); }
.sl-chip { transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2) var(--sl-ease), border-color var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease); }
.sl-chip:active { transform: scale(0.95); }
.sl-tpl, .sl-icon-btn, .sl-tool, .sl-send, .sl-thread__id { transition: background var(--sl-dur-1), color var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease), border-color var(--sl-dur-2); }
.sl-icon-btn:active, .sl-tool:active, .sl-send:active:not(:disabled) { transform: scale(0.92); }
.sl-tpls:not([hidden]) { animation: sl-pop-in var(--sl-dur-2) var(--sl-ease) both; }
.sl-icon-btn:hover { background: var(--sl-surface-2); }
.sl-composer { transition: box-shadow var(--sl-dur-2) var(--sl-ease), border-color var(--sl-dur-2); }
.sl-composer:focus-within { border-color: #C9DCD2; box-shadow: var(--sl-shadow), 0 0 0 4px rgba(62, 114, 98, 0.10); }
.sl-composer textarea { transition: height var(--sl-dur-1) var(--sl-ease); }
.sl-avatar { transition: transform var(--sl-dur-2) var(--sl-ease-spring); }
.sl-row:hover .sl-avatar { transform: scale(1.05); }

/* Меню: подсветка активного пункта перетекает между разделами */
.sl-rail__item { position: relative; isolation: isolate; transition: color var(--sl-dur-2), background var(--sl-dur-2); }
.sl-rail__item[aria-current="page"] { background: transparent; }
.sl-rail__ind {
  position: absolute; inset: 0; z-index: -1;
  border-radius: var(--sl-radius);
  background: var(--sl-tint);
  view-transition-name: sl-rail-ind;
}
.sl-rail__item svg { transition: transform var(--sl-dur-2) var(--sl-ease-spring); }
.sl-rail__item:hover svg { transform: translateY(-2px); }
.sl-rail__menu:not([hidden]) { animation: sl-pop-in var(--sl-dur-2) var(--sl-ease) both; transform-origin: left bottom; }

/* Появление: строки списка, сообщения, карточки */
.sl-enter { animation: sl-rise var(--sl-dur-3) var(--sl-ease) both; animation-delay: calc(var(--i, 0) * 32ms); }
.sl-msg.is-new, .sl-note.is-new { animation: sl-rise 420ms var(--sl-ease) both; }
.sl-msg.is-sending { animation: sl-send 560ms var(--sl-ease-spring) both; transform-origin: right bottom; }
.sl-msg.is-leaving { animation: sl-leave var(--sl-dur-2) var(--sl-ease) both; }
.sl-row.is-moving {
  z-index: 2;
  background: var(--sl-surface);
  box-shadow: 0 10px 26px rgba(29, 38, 34, 0.12);
}
.sl-row.is-moving[aria-current="true"] { background: var(--sl-tint); }
/* Подсветка лежит под текстом строки, а не поверх него */
.sl-row.is-bumped { isolation: isolate; }
.sl-row.is-bumped::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--sl-tint-2);
  animation: sl-glow 1.4s var(--sl-ease) both;
}

/* Уведомления */
.sl-toasts {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 50; pointer-events: none;
}
.sl-toast {
  pointer-events: auto;
  max-width: min(92vw, 460px);
  background: var(--sl-ink); color: #FFFFFF;
  border-radius: 14px; padding: 11px 16px;
  font-size: 14px; line-height: 1.4;
  box-shadow: 0 14px 34px rgba(29, 38, 34, 0.25);
  animation: sl-toast-in 460ms var(--sl-ease-spring) both;
}
.sl-toast--error { background: var(--sl-danger-ink); }
.sl-toast--warn { background: #7A5418; }
.sl-toast.is-leaving { animation: sl-toast-out var(--sl-dur-2) var(--sl-ease) both; }
@media (max-width: 860px) { .sl-toasts { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); } }
/* В открытом чате на телефоне уведомления не закрывают поле ответа */
@media (max-width: 860px) { .sl-app:has(.sl-content.has-thread) .sl-toasts { bottom: auto; top: calc(76px + env(safe-area-inset-top, 0px)); } }

@keyframes sl-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes sl-send {
  0% { opacity: 0; transform: translateY(34px) scale(0.9); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes sl-leave { to { opacity: 0; transform: scale(0.96); } }
@keyframes sl-glow { from { opacity: 0.9; } to { opacity: 0; } }
@keyframes sl-pop-in { from { opacity: 0; transform: translateY(6px) scale(0.97); } }
@keyframes sl-toast-in { from { opacity: 0; transform: translateY(18px) scale(0.95); } }
@keyframes sl-toast-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }

/* View Transitions: смена переписки и переходы между страницами */
.sl-rail { view-transition-name: sl-rail; }
.sl-list { view-transition-name: sl-list; }
.sl-thread { view-transition-name: sl-thread; }
.sl-card { view-transition-name: sl-card; }

::view-transition-group(*) { animation-duration: var(--sl-dur-3); animation-timing-function: var(--sl-ease); }
::view-transition-old(root) { animation: 180ms ease-out both sl-vt-fade-out; }
::view-transition-new(root) { animation: 380ms var(--sl-ease) both sl-vt-rise-in; }
::view-transition-old(sl-thread) { animation: 150ms ease-out both sl-vt-fade-out; }
::view-transition-new(sl-thread) { animation: 380ms var(--sl-ease) both sl-vt-slide-in; }
::view-transition-old(sl-card) { animation: 150ms ease-out both sl-vt-fade-out; }
::view-transition-new(sl-card) { animation: 440ms var(--sl-ease) 60ms both sl-vt-rise-in; }
::view-transition-group(sl-avatar) { animation-duration: 460ms; animation-timing-function: var(--sl-ease); }
::view-transition-group(sl-rail-ind) { animation-duration: 460ms; animation-timing-function: var(--sl-ease-spring); }
::view-transition-old(sl-rail), ::view-transition-new(sl-rail),
::view-transition-old(sl-list), ::view-transition-new(sl-list) { animation-duration: 120ms; }

@keyframes sl-vt-fade-out { to { opacity: 0; } }
@keyframes sl-vt-slide-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes sl-vt-rise-in { from { opacity: 0; transform: translateY(12px); } }

/* Телефон: переписка въезжает справа и уезжает обратно, как в iOS */
@media (max-width: 860px) {
  .sl-list, .sl-thread, .sl-card { view-transition-name: none; }
}
html[data-vt="forward"]::view-transition-old(root) { animation: 360ms var(--sl-ease) both sl-vt-push-out; }
html[data-vt="forward"]::view-transition-new(root) { animation: 360ms var(--sl-ease) both sl-vt-push-in; }
html[data-vt="back"]::view-transition-old(root) { animation: 320ms var(--sl-ease) both sl-vt-pop-out; z-index: 2; }
html[data-vt="back"]::view-transition-new(root) { animation: 320ms var(--sl-ease) both sl-vt-pop-in; }
@keyframes sl-vt-push-out { to { transform: translateX(-28%); opacity: 0.55; } }
@keyframes sl-vt-push-in { from { transform: translateX(100%); } }
@keyframes sl-vt-pop-out { to { transform: translateX(100%); } }
@keyframes sl-vt-pop-in { from { transform: translateX(-28%); opacity: 0.55; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ======================================================================
   ============ Календарь записи ============
   Сетка дня по колонкам (врачи, процедурный кабинет), свободные окна,
   панель записи справа (на телефоне — лист снизу). Префикс .slcal-
   ====================================================================== */

.slcal { --slcal-drawer: 372px; --slcal-now: #C4553F; position: relative; }

/* Левая колонка: месяц, кто принимает, обозначения */
.slcal-side {
  flex: 0 0 272px; height: 100vh; position: sticky; top: 0; overflow-y: auto;
  background: var(--sl-surface); border-right: 1px solid var(--sl-line);
  padding: 26px 20px 20px; display: flex; flex-direction: column; gap: 26px;
}
.slcal-month { display: flex; flex-direction: column; gap: 10px; }
.slcal-month__head { display: flex; align-items: center; gap: 2px; }
.slcal-month__label { flex: 1; font-family: var(--sl-font-display); font-size: 20px; }
.slcal-mini {
  width: 30px; height: 30px; border-radius: 9px; color: var(--sl-accent-dark);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-mini:hover { background: var(--sl-surface-2); }
.slcal-mini:active { transform: scale(0.9); }
.slcal-mini svg { width: 16px; height: 16px; }
.slcal-month__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 0; text-align: center; font-size: 13px; }
.slcal-month__wd { color: var(--sl-muted); padding: 4px 0; font-size: 12px; }
.slcal-mday { position: relative; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--sl-ink); text-decoration: none; }
.slcal-mday span {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
  transition: background var(--sl-dur-1), color var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-mday:hover span { background: var(--sl-surface-2); }
.slcal-mday:active span { transform: scale(0.9); }
.slcal-mday.is-weekend { color: var(--sl-muted); }
.slcal-mday.is-today span { box-shadow: inset 0 0 0 1.5px var(--sl-accent); color: var(--sl-accent-dark); font-weight: 600; }
.slcal-mday[aria-current="date"] span { background: var(--sl-accent); color: #FFFFFF; font-weight: 600; box-shadow: none; view-transition-name: slcal-sel; }
.slcal-mday.has-appts::after {
  content: ""; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: #9DBDB0;
}
.slcal-mday[aria-current="date"].has-appts::after { background: var(--sl-accent); }

.slcal-side__sec { display: flex; flex-direction: column; gap: 8px; }
.slcal-cap { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sl-ink-2); }
.slcal-toggle {
  min-height: 40px; border-radius: 12px; border: 1px solid var(--sl-line); background: var(--sl-surface);
  padding: 0 12px; display: flex; align-items: center; gap: 10px;
  font: inherit; font-size: 14px; color: var(--sl-ink); text-align: left; cursor: pointer;
  transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-toggle:active { transform: scale(0.98); }
.slcal-toggle__box {
  flex: 0 0 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--sl-accent); background: var(--sl-accent); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; transition: background var(--sl-dur-2) var(--sl-ease);
}
.slcal-toggle__box svg { width: 11px; height: 11px; transition: transform var(--sl-dur-2) var(--sl-ease-spring), opacity var(--sl-dur-1); }
.slcal-toggle[aria-pressed="false"] { background: var(--sl-surface-2); color: var(--sl-ink-2); }
.slcal-toggle[aria-pressed="false"] .slcal-toggle__box { background: #FFFFFF; }
.slcal-toggle[aria-pressed="false"] .slcal-toggle__box svg { transform: scale(0); opacity: 0; }
.slcal-legend { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sl-ink); }
.slcal-legend i { flex: 0 0 22px; height: 14px; border-radius: 4px; }
.slcal-legend__ok { background: #DCEBE4; }
.slcal-legend__wait { background: #FFFFFF; border: 1.5px solid #9DBDB0; }
.slcal-legend__here { background: #CFE3D9; box-shadow: inset 3px 0 0 var(--sl-accent); }
.slcal-legend__free { border: 1.5px dashed #B8C8C0; }
.slcal-old { margin-top: auto; align-self: flex-start; font-size: 13px; color: var(--sl-muted); text-decoration: none; }
.slcal-old:hover { color: var(--sl-accent-dark); text-decoration: underline; }

/* Основная часть: шапка дня и сетка */
.slcal-main { flex: 1 1 auto; min-width: 0; height: 100vh; display: flex; flex-direction: column; transition: margin-right var(--sl-dur-3) var(--sl-ease); }
.slcal-head { padding: 14px 22px 10px; display: flex; align-items: center; gap: 10px; }
.slcal-arrows { display: flex; gap: 4px; }
.slcal-arrows .sl-icon-btn { width: 34px; height: 34px; }
.slcal-headtxt { flex: 1; min-width: 0; view-transition-name: slcal-title; }
.slcal-h { margin: 0; font-family: var(--sl-font-display); font-weight: 400; font-size: 24px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slcal-sub { margin: 3px 0 0; font-size: 13px; color: var(--sl-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slcal-h__short, .slcal-sub__short { display: none; }
.slcal-pick { display: none; }
.slcal-today[hidden] { display: none; }
.slcal-new { padding: 0 16px; }
.slcal-week, .slcal-seg, .slcal-agenda { display: none; }

.slcal-board { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 26px 22px; view-transition-name: slcal-board; }
.slcal-grid {
  flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: var(--sl-radius-l);
}
.slcal-cols { display: flex; border-bottom: 1px solid #E6ECE8; }
.slcal-gutter { flex: 0 0 60px; }
.slcal-colhead { flex: 1 1 0; min-width: 0; padding: 12px; display: flex; align-items: center; gap: 10px; border-left: 1px solid #E6ECE8; transition: opacity var(--sl-dur-3) var(--sl-ease); }
.slcal-mono {
  flex: 0 0 32px; height: 32px; border-radius: 50%; background: #E3EEE8; color: var(--sl-accent-dark);
  display: flex; align-items: center; justify-content: center; font-family: var(--sl-font-display); font-size: 13px;
}
.slcal-mono--proc { background: #F3EBDC; color: var(--sl-sand-ink); }
.slcal-mono--none { background: #ECEFED; color: var(--sl-muted); }
.slcal-colhead__txt { min-width: 0; display: flex; flex-direction: column; }
.slcal-colhead__txt b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slcal-colhead__txt small { font-size: 12px; color: var(--sl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slcal-col.is-hidden, .slcal-colhead.is-hidden { display: none; }

.slcal-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; display: flex; flex-direction: column; }
/* Холст растягивается на всю высоту окна, но не ниже 0,9 px на минуту */
.slcal-canvas { position: relative; flex: 1 0 auto; min-height: calc(var(--minutes) * 0.9px + 24px); }
.slcal-track { position: absolute; left: 0; right: 0; top: 10px; bottom: 14px; }
.slcal-hour { position: absolute; left: 60px; right: 0; top: calc(var(--top) * 1%); height: 1px; background: #E9EEEB; }
.slcal-hour em {
  position: absolute; right: calc(100% + 10px); top: 0; transform: translateY(-50%);
  font-style: normal; font-size: 12px; color: var(--sl-muted); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.slcal-half { position: absolute; left: 60px; right: 0; top: calc(var(--top) * 1%); border-top: 1px dashed #F0F3F1; }
.slcal-past {
  position: absolute; left: 60px; right: 0; top: 0; height: calc(var(--top) * 1%); pointer-events: none;
  background: linear-gradient(180deg, rgba(238, 242, 239, 0.35), rgba(238, 242, 239, 0.7));
  transition: height 600ms var(--sl-ease);
}
.slcal-colset { position: absolute; left: 60px; right: 0; top: 0; bottom: 0; display: flex; }
.slcal-col { flex: 1 1 0; min-width: 0; position: relative; border-left: 1px solid #E6ECE8; transition: opacity var(--sl-dur-3) var(--sl-ease), filter var(--sl-dur-3); }
.slcal-col.is-dim, .slcal-colhead.is-dim { opacity: 0.38; }
.slcal-col.is-dim { pointer-events: none; filter: saturate(0.4); }
.slcal-col__empty { position: absolute; top: 38%; left: 0; right: 0; text-align: center; font-size: 13px; color: var(--sl-muted); }

/* Свободное окно: приглашает нажать */
.slcal-free {
  position: absolute; left: 6px; right: 6px; z-index: 1;
  top: calc(var(--top) * 1% + 2px); height: calc(var(--h) * 1% - 4px); min-height: 14px;
  border: 1.5px dashed #B8C8C0; border-radius: 10px; color: var(--sl-accent-dark);
  font-size: 12px; font-weight: 500; line-height: 1.3; text-decoration: none;
  padding: 5px 10px; display: flex; align-items: flex-start; gap: 6px; overflow: hidden;
  transition: background var(--sl-dur-2) var(--sl-ease), border-color var(--sl-dur-2), opacity var(--sl-dur-2);
}
.slcal-free svg { flex: 0 0 13px; width: 13px; height: 13px; margin-top: 1px; transition: transform var(--sl-dur-3) var(--sl-ease-spring); }
.slcal-free span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slcal-free:hover { background: #F4F8F6; border-color: #8FB3A4; }
.slcal-free:hover svg { transform: rotate(90deg); }
.slcal-free.is-short { padding-top: 0; padding-bottom: 0; align-items: center; }
.slcal-free.is-short svg { margin-top: 0; }
.slcal-free.is-static { border-color: #DCE4DF; color: var(--sl-muted); }
.slcal.is-moving .slcal-free:not(:hover) { border-color: #8FB3A4; background: rgba(230, 240, 235, 0.45); }

/* Подсказка под курсором и блок будущей записи */
.slcal-ghost {
  position: absolute; left: 6px; right: 6px; z-index: 6; pointer-events: none;
  top: calc(var(--top) * 1% + 1px); height: calc(var(--h) * 1% - 2px); min-height: 20px;
  border-radius: 10px; background: var(--sl-accent); color: #FFFFFF;
  font-size: 12px; font-weight: 600; padding: 3px 10px; display: flex; align-items: flex-start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 10px 24px rgba(62, 114, 98, 0.3);
  transition: top 220ms var(--sl-ease), height 220ms var(--sl-ease), background var(--sl-dur-2);
}
.slcal-ghost--hover {
  background: rgba(230, 240, 235, 0.92); color: var(--sl-accent-dark); box-shadow: none;
  border: 1.5px solid var(--sl-accent); transition: top 90ms var(--sl-ease), height 90ms var(--sl-ease);
}
.slcal-ghost.is-saving { animation: slcal-saving 1s ease-in-out infinite alternate; }

/* Карточки записей */
.slcal-appt {
  position: absolute; z-index: 2;
  top: calc(var(--top) * 1% + 1px); height: calc(var(--h) * 1% - 2px); min-height: 18px;
  left: calc(6px + (100% - 12px) * var(--lane) / var(--lanes)); width: calc((100% - 12px) / var(--lanes));
  border-radius: 10px; border: 1.5px solid transparent; padding: 3px 10px;
  display: flex; flex-direction: column; overflow: hidden;
  color: var(--sl-ink); text-decoration: none; font-size: 12px; line-height: 1.35; text-align: left;
  box-shadow: 0 0 0 1.5px var(--sl-surface);
  transition: transform var(--sl-dur-2) var(--sl-ease), box-shadow var(--sl-dur-2) var(--sl-ease), background var(--sl-dur-3) var(--sl-ease), border-color var(--sl-dur-3), color var(--sl-dur-3), opacity var(--sl-dur-3);
}
.slcal-appt__t, .slcal-appt__s { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slcal-appt__t { font-weight: 600; }
.slcal-appt__t b { font-weight: 500; opacity: 0.72; margin-right: 3px; font-variant-numeric: tabular-nums; }
.slcal-appt__s { opacity: 0.86; }
.slcal-appt.is-short { flex-direction: row; align-items: center; gap: 8px; padding-top: 0; padding-bottom: 0; }
.slcal-appt.is-short .slcal-appt__t { flex: 0 1 auto; }
.slcal-appt.is-short .slcal-appt__s { flex: 1 1 0; min-width: 0; }
.slcal-appt__g { position: absolute; right: 7px; top: 5px; width: 12px; height: 12px; opacity: 0.55; }
.slcal-appt--ok { background: #DCEBE4; color: #18302A; }
.slcal-appt--wait { background: #FFFFFF; border-color: #9DBDB0; }
.slcal-appt--here { background: #CFE3D9; color: #15302A; box-shadow: inset 3px 0 0 var(--sl-accent), 0 0 0 1.5px var(--sl-surface); }
.slcal-appt--done { background: #EEF2EF; color: var(--sl-ink-2); }
.slcal-appt--miss { background: var(--sl-danger); color: var(--sl-danger-ink); }
.slcal-appt--busy { background: repeating-linear-gradient(135deg, #F4F7F5 0 6px, #ECF1EE 6px 12px); color: var(--sl-muted); cursor: default; }
.slcal-appt--echo { background: repeating-linear-gradient(135deg, #F8F3EA 0 6px, #F2EADC 6px 12px); color: var(--sl-sand-ink); border-color: transparent; }
a.slcal-appt:hover { transform: translateY(-1px); box-shadow: 0 0 0 1.5px var(--sl-surface), 0 10px 22px rgba(29, 38, 34, 0.12); z-index: 4; }
a.slcal-appt:active { transform: scale(0.98); }
.slcal-appt[aria-current="true"] { box-shadow: 0 0 0 2px var(--sl-ink), 0 10px 22px rgba(29, 38, 34, 0.12); z-index: 4; }
.slcal-appt.is-moving-src { opacity: 0.5; border-style: dashed; border-color: var(--sl-accent); }
.slcal-appt.is-flying, .slcal-line.is-flying { z-index: 7; box-shadow: 0 16px 34px rgba(29, 38, 34, 0.2); }
.slcal-appt.is-leaving, .slcal-litem.is-leaving { opacity: 0; transform: scale(0.94); }
.slcal-in { animation: slcal-in 460ms var(--sl-ease) both; animation-delay: calc(var(--i, 0) * 26ms); }
.is-flash { animation: slcal-pop 520ms var(--sl-ease-spring) both, slcal-ring 1.5s 120ms ease-out both; z-index: 5; }

/* Линия «сейчас» */
.slcal-now { position: absolute; left: 56px; right: 0; top: calc(var(--top) * 1%); height: 2px; margin-top: -1px; background: var(--slcal-now); z-index: 5; pointer-events: none; transition: top 600ms var(--sl-ease); }
.slcal-now::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 9px; height: 9px; border-radius: 50%;
  background: var(--slcal-now); transform: translate(-50%, -50%);
  animation: slcal-breathe 2.6s ease-in-out infinite;
}
.slcal-now em {
  position: absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%);
  font-style: normal; font-size: 11px; font-weight: 600; color: #FFFFFF; background: var(--slcal-now);
  border-radius: 6px; padding: 1px 5px; font-variant-numeric: tabular-nums;
}

/* Панель справа: новая запись, карточка записи, перенос */
.slcal-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
  width: var(--slcal-drawer); max-width: 100vw;
  background: var(--sl-surface); border-left: 1px solid var(--sl-line);
  box-shadow: -24px 0 48px rgba(29, 38, 34, 0.08);
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 48px)); visibility: hidden;
  transition: transform 380ms var(--sl-ease), visibility 0s linear 380ms;
  view-transition-name: slcal-drawer;
}
.slcal-drawer.is-open { transform: none; visibility: visible; transition: transform 540ms var(--sl-ease), visibility 0s; }
.slcal-grab { display: none; }
.slcal-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.slcal-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.slcal-panel__body { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 22px 20px; display: flex; flex-direction: column; gap: 20px; overscroll-behavior: contain; }
.slcal-panel__foot { flex: 0 0 auto; padding: 14px 22px 20px; border-top: 1px solid #E6ECE8; display: flex; gap: 8px; background: var(--sl-surface); }
.slcal-panel__foot--stack { flex-direction: column; }
.slcal-panel__foot a.sl-btn { text-decoration: none; }
.slcal-submit { flex: 1; }
.slcal-rise { animation: sl-rise 440ms var(--sl-ease) both; animation-delay: calc(90ms + var(--i, 0) * 45ms); }
.slcal-scrim {
  position: fixed; inset: 0; z-index: 25; background: rgba(29, 38, 34, 0.26);
  opacity: 0; pointer-events: none; transition: opacity var(--sl-dur-3) var(--sl-ease);
  view-transition-name: slcal-scrim;
}

/* Заголовок панели остаётся наверху при прокрутке */
.slcal-ph { display: flex; align-items: flex-start; gap: 10px; position: sticky; top: -24px; z-index: 3; margin: -24px -22px -8px; padding: 24px 22px 12px; background: var(--sl-surface); }
.slcal-ph__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.slcal-ph__title { margin: 0; font-family: var(--sl-font-display); font-weight: 400; font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.slcal-ph__sub { font-size: 13px; color: var(--sl-ink-2); }
.slcal-x {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--sl-line);
  background: var(--sl-surface); color: var(--sl-ink-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-x svg { width: 16px; height: 16px; }
.slcal-x:hover { background: var(--sl-surface-2); }
.slcal-x:active { transform: scale(0.9); }
.slcal-x--back { border-color: transparent; margin-left: -8px; color: var(--sl-accent-dark); }
.slcal-sec { display: flex; flex-direction: column; gap: 8px; }
.slcal-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.slcal-chip {
  min-height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid #D3DDD7;
  background: var(--sl-surface); color: #33413B; font: inherit; font-size: 13px; cursor: pointer;
  transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2), border-color var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-chip small { display: none; font-size: 12px; opacity: 0.85; }
.slcal-chip[aria-pressed="true"] small { display: inline; }
.slcal-chip:hover { background: var(--sl-surface-2); }
.slcal-chip:active { transform: scale(0.95); }
.slcal-chip[aria-pressed="true"] { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; font-weight: 500; }
.slcal-chip[aria-pressed="true"] small { opacity: 0.85; }

.slcal-find { display: flex; flex-direction: column; gap: 6px; }
.slcal-find .sl-input { min-height: 44px; font-size: 15px; }
.slcal-results { display: flex; flex-direction: column; gap: 2px; }
.slcal-res {
  width: 100%; min-height: 52px; padding: 6px 10px; border: 0; border-radius: 12px; background: transparent;
  display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  animation: sl-rise 300ms var(--sl-ease) both; animation-delay: calc(var(--i, 0) * 24ms);
  transition: background var(--sl-dur-1);
}
.slcal-res:hover, .slcal-res.is-active { background: var(--sl-surface-2); }
.slcal-res .sl-avatar { flex: 0 0 34px; height: 34px; font-size: 12px; }
.slcal-res__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slcal-res__txt b { font-size: 14px; font-weight: 500; }
.slcal-res__txt small { font-size: 12px; color: var(--sl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slcal-res__tag { flex: 0 0 auto; font-size: 11px; color: var(--sl-sand-ink); background: var(--sl-sand); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.slcal-res-empty { margin: 0; font-size: 13px; color: var(--sl-ink-2); padding: 8px 10px; }
.slcal-picked { display: flex; align-items: center; gap: 10px; background: #F1F6F3; border-radius: 14px; padding: 10px 12px; }
.slcal-picked .sl-avatar { flex: 0 0 38px; height: 38px; font-size: 13px; background: #FFFFFF; }
.slcal-picked__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slcal-picked__txt b { font-weight: 600; }
.slcal-picked__txt small { font-size: 12px; color: var(--sl-ink-2); overflow-wrap: anywhere; }
.slcal-link {
  border: 0; background: transparent; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  color: var(--sl-accent-dark); font: inherit; font-size: 13px; font-weight: 500; text-decoration: none;
  transition: background var(--sl-dur-1);
}
.slcal-link:hover { background: var(--sl-tint); }
.slcal-link--new { align-self: flex-start; }
.slcal-note { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--sl-sand-ink); background: var(--sl-sand); border-radius: 10px; padding: 8px 11px; animation: sl-rise 300ms var(--sl-ease) both; }
.slcal-note--soft { background: var(--sl-surface-2); color: var(--sl-ink-2); animation: none; }
.slcal-note[hidden] { display: none; }
.slcal-hint { margin: 0; font-size: 12.5px; color: var(--sl-ink-2); }
.slcal-service { min-height: 42px !important; font-size: 14px !important; }
.slcal-textarea {
  resize: none; border: 1px solid var(--sl-line); border-radius: 12px; background: var(--sl-surface-2);
  font: inherit; font-size: 14px; color: var(--sl-ink); padding: 10px 12px;
  transition: border-color var(--sl-dur-1), box-shadow var(--sl-dur-1), background var(--sl-dur-1);
}
.slcal-textarea:focus { outline: none; border-color: var(--sl-accent); background: var(--sl-surface); box-shadow: var(--sl-focus); }

.slcal-days { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.slcal-dayb {
  height: 54px; border-radius: 14px; border: 1px solid var(--sl-line); background: var(--sl-surface); color: var(--sl-ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; font: inherit; cursor: pointer;
  transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2), border-color var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-dayb span { font-size: 11px; color: var(--sl-muted); }
.slcal-dayb b { font-size: 16px; font-weight: 500; }
.slcal-dayb:hover { background: var(--sl-surface-2); }
.slcal-dayb[aria-pressed="true"] { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }
.slcal-dayb[aria-pressed="true"] span { color: #DDEBE4; }
.slcal-dayb[aria-pressed="true"] b { font-weight: 600; }
.slcal-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.slcal-slot {
  height: 36px; border-radius: 10px; border: 1px solid #C9DCD2; background: #F1F6F3; color: var(--sl-accent-dark);
  font: inherit; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2), border-color var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-slots.is-fresh .slcal-slot { animation: sl-rise 300ms var(--sl-ease) both; animation-delay: calc(var(--i, 0) * 14ms); }
.slcal-slot:hover { background: #E4EFE9; }
.slcal-slot[aria-pressed="true"] { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; font-weight: 600; }
.slcal-slots__empty { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--sl-ink-2); background: var(--sl-surface-2); border-radius: 12px; padding: 10px 12px; }
.slcal-dur { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 13px; color: var(--sl-ink-2); }
.slcal-dur__label { flex: 1; }
.slcal-dur b { min-width: 76px; text-align: center; color: var(--sl-ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.slcal-dur__btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--sl-line); background: var(--sl-surface);
  color: var(--sl-accent-dark); font: inherit; font-size: 18px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slcal-dur__btn:hover { background: var(--sl-surface-2); }
.slcal-dur__btn:active { transform: scale(0.9); }

.slcal-pill {
  align-self: flex-start; margin-bottom: 4px; padding: 2px 10px; border-radius: 999px; border: 1px solid transparent;
  font-size: 12px; font-weight: 600;
  transition: background var(--sl-dur-3) var(--sl-ease), color var(--sl-dur-3), border-color var(--sl-dur-3);
}
.slcal-pill--ok { background: #DCEBE4; color: #18302A; }
.slcal-pill--wait { background: #FFFFFF; border-color: #9DBDB0; color: var(--sl-ink); }
.slcal-pill--here { background: var(--sl-accent); color: #FFFFFF; }
.slcal-pill--done { background: #EEF2EF; color: var(--sl-ink-2); }
.slcal-pill--miss { background: var(--sl-danger); color: var(--sl-danger-ink); }
.slcal-pill--off { background: #ECEFED; color: var(--sl-muted); }
.slcal-gmark { margin: 0; display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--sl-ink-2); background: var(--sl-surface-2); border-radius: 12px; padding: 9px 11px; }
.slcal-gmark[hidden] { display: none; }
.slcal-gmark svg { flex: 0 0 15px; width: 15px; height: 15px; margin-top: 1px; color: var(--sl-accent); }
.slcal-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.slcal-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.slcal-act {
  min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid #C9DCD2; background: #F1F6F3;
  color: var(--sl-accent-dark); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease), opacity var(--sl-dur-2);
}
.slcal-act:hover { background: #E4EFE9; }
.slcal-act:active { transform: scale(0.95); }
.slcal-act--no_show { background: #FFFFFF; border-color: #EBC9C2; color: var(--sl-danger-ink); }
.slcal-act--no_show:hover { background: #FDF3F1; }
.slcal-act--cancel { background: #FFFFFF; border-color: #E8D9BF; color: var(--sl-sand-ink); }
.slcal-act--cancel:hover { background: #FBF6EC; }
.slcal-act--reopen { background: #FFFFFF; border-color: var(--sl-line); color: var(--sl-ink-2); }
.slcal-act.is-busy { opacity: 0.55; pointer-events: none; }
.slcal-sure { display: flex; flex-direction: column; gap: 8px; background: #FBF6EC; border: 1px dashed #C7B48F; border-radius: 14px; padding: 10px 12px; font-size: 13px; color: #5C4520; }
.slcal-sure[hidden] { display: none; }
.slcal-sure__btns { display: flex; gap: 6px; }
.slcal-danger { background: var(--sl-danger-ink); }
.slcal-danger:hover { background: #73261B; }
.slcal-links { margin: 2px 0 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--sl-muted); }
.slcal-links a { color: var(--sl-accent-dark); text-decoration: none; }
.slcal-links a:hover { text-decoration: underline; }
[data-slot][hidden] { display: none !important; }

.slcal.is-loading .slcal-board { cursor: progress; }

/* Панель на широком экране сдвигает сетку, на узком — ложится поверх */
@media (min-width: 1280px) {
  .slcal.has-drawer .slcal-main { margin-right: var(--slcal-drawer); }
}
@media (max-width: 1279px) {
  .slcal.has-drawer .slcal-scrim { opacity: 1; pointer-events: auto; }
  .slcal-side { display: none; }
  .slcal-pick { display: inline-flex; }
  .slcal-side.is-pop {
    display: flex; position: fixed; z-index: 40; top: 74px; left: 100px; width: 304px; height: auto; max-height: calc(100vh - 90px);
    border: 1px solid var(--sl-line); border-radius: 20px; box-shadow: 0 24px 60px rgba(29, 38, 34, 0.16);
    animation: sl-pop-in var(--sl-dur-2) var(--sl-ease) both; transform-origin: top left;
  }
}

/* Телефон: список дня, неделя сверху, лист записи снизу */
@media (max-width: 860px) {
  .slcal-main { height: auto; min-height: 0; }
  .slcal-head { padding: 18px 16px 12px; gap: 8px; }
  .slcal-arrows { display: none; }
  .slcal-h { font-size: 26px; }
  .slcal-h__long, .slcal-sub__long { display: none; }
  .slcal-h__short, .slcal-sub__short { display: inline; }
  .slcal-pick, .slcal-today, .slcal-new { flex: 0 0 auto; }
  .slcal-new { width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 12px; }
  .slcal-today { min-height: 36px; padding: 0 12px; }
  .slcal-side.is-pop { left: 12px; right: 12px; top: 70px; width: auto; transform-origin: top center; }

  .slcal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 0 16px 12px; }
  .slcal-wday {
    position: relative; height: 56px; border-radius: 14px; background: var(--sl-surface); color: var(--sl-ink);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-decoration: none;
    transition: background var(--sl-dur-2) var(--sl-ease), transform var(--sl-dur-1) var(--sl-ease);
  }
  .slcal-wday:active { transform: scale(0.94); }
  .slcal-wday span { font-size: 11px; color: var(--sl-muted); }
  .slcal-wday b { font-size: 15px; font-weight: 500; font-variant-numeric: tabular-nums; }
  .slcal-wday.is-off { background: transparent; }
  .slcal-wday.is-off b { color: var(--sl-ink-2); }
  .slcal-wday.is-today b { color: var(--sl-accent-dark); font-weight: 700; }
  .slcal-wday[aria-current="date"] { background: var(--sl-accent); view-transition-name: slcal-wsel; }
  .slcal-wday[aria-current="date"] span { color: #DDEBE4; }
  .slcal-wday[aria-current="date"] b { color: #FFFFFF; font-weight: 600; }
  .slcal-wday i { position: absolute; bottom: 6px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #9DBDB0; }
  .slcal-wday[aria-current="date"] i { background: #CFE3D9; }

  .slcal-board { padding: 0 16px 20px; flex: 0 0 auto; }
  .slcal-grid { display: none; }
  .slcal-agenda { display: block; }
  .slcal-seg {
    display: flex; gap: 4px; margin-bottom: 12px; padding: 3px; overflow-x: auto; scrollbar-width: none;
    background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: 12px;
  }
  .slcal-seg::-webkit-scrollbar { display: none; }
  .slcal-seg__btn {
    flex: 1 0 auto; height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent;
    font: inherit; font-size: 13px; color: var(--sl-ink-2); white-space: nowrap; cursor: pointer;
    transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2);
  }
  .slcal-seg__btn[aria-selected="true"] { background: var(--sl-tint); color: var(--sl-accent-dark); font-weight: 600; }

  .slcal-list { display: none; flex-direction: column; gap: 8px; }
  .slcal-list.is-on { display: flex; }
  .slcal-line { display: flex; gap: 12px; align-items: stretch; }
  .slcal-line__time { flex: 0 0 44px; padding-top: 11px; font-size: 13px; color: var(--sl-ink-2); font-variant-numeric: tabular-nums; }
  .slcal-line.is-next .slcal-line__time { color: var(--sl-ink); font-weight: 600; padding-top: 13px; }
  .slcal-lfree {
    flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px dashed #B8C8C0; border-radius: 14px;
    font-size: 13px; color: var(--sl-accent-dark); text-decoration: none; transition: background var(--sl-dur-1);
  }
  .slcal-lfree:active { background: #F1F6F3; }
  .slcal-lfree.is-static { color: var(--sl-muted); }
  .slcal-litem {
    flex: 1; min-width: 0; padding: 10px 12px; border-radius: 14px; border: 1.5px solid transparent;
    display: flex; flex-direction: column; color: var(--sl-ink); text-decoration: none;
    transition: transform var(--sl-dur-1) var(--sl-ease), background var(--sl-dur-3) var(--sl-ease), border-color var(--sl-dur-3), color var(--sl-dur-3), opacity var(--sl-dur-3);
  }
  .slcal-litem:active { transform: scale(0.98); }
  .slcal-litem b { font-weight: 600; }
  .slcal-litem span { font-size: 12px; }
  .slcal-litem em { font-style: normal; }
  .slcal-litem--ok { background: #DCEBE4; color: #18302A; }
  .slcal-litem--wait { background: #FFFFFF; border-color: #9DBDB0; }
  .slcal-litem--wait em { color: #8A5A1E; font-weight: 500; }
  .slcal-litem--here { background: #CFE3D9; color: #15302A; box-shadow: inset 4px 0 0 var(--sl-accent); }
  .slcal-litem--done { background: #E2E8E4; color: var(--sl-ink-2); }
  .slcal-litem--miss { background: var(--sl-danger); color: var(--sl-danger-ink); }
  .slcal-litem--busy { background: repeating-linear-gradient(135deg, #F4F7F5 0 6px, #ECF1EE 6px 12px); color: var(--sl-muted); }
  .slcal-litem[aria-current="true"] { box-shadow: 0 0 0 2px var(--sl-ink); }
  .slcal-next {
    flex: 1; min-width: 0; padding: 12px 14px; border-radius: 18px; background: var(--sl-accent); color: #FFFFFF;
    display: flex; flex-direction: column; gap: 6px; box-shadow: 0 10px 24px rgba(62, 114, 98, 0.25);
  }
  .slcal-next__cap { font-size: 12px; color: #CFE3D9; }
  .slcal-next__name { font-family: var(--sl-font-display); font-size: 21px; line-height: 1.2; color: #FFFFFF; text-decoration: none; }
  .slcal-next__what { font-size: 13px; }
  .slcal-next__acts { display: flex; gap: 6px; margin-top: 2px; }
  .slcal-next__btn {
    height: 36px; padding: 0 14px; border-radius: 10px; background: #FFFFFF; color: var(--sl-accent-dark);
    display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; text-decoration: none;
    transition: transform var(--sl-dur-1) var(--sl-ease);
  }
  .slcal-next__btn:active { transform: scale(0.95); }
  .slcal-next__btn--soft { background: rgba(255, 255, 255, 0.16); color: #FFFFFF; font-weight: 500; }
  .slcal-lempty { margin: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--sl-ink-2); }
  .slcal-lempty strong { font-family: var(--sl-font-display); font-weight: 400; font-size: 19px; color: var(--sl-ink); }

  /* Лист снизу */
  .slcal-drawer {
    top: auto; left: 0; right: 0; width: auto; height: calc(100dvh - 28px);
    border-left: 0; border-radius: 24px 24px 0 0; box-shadow: 0 -18px 48px rgba(29, 38, 34, 0.18);
    transform: translateY(calc(100% + 40px)); transition: transform 360ms var(--sl-ease), visibility 0s linear 360ms;
  }
  .slcal-drawer.is-open { transform: translateY(var(--drag, 0px)); transition: transform 560ms var(--sl-ease-spring), visibility 0s; }
  .slcal-drawer.is-dragging { transition: none; }
  .slcal-drawer::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 80px; background: var(--sl-surface); }
  .slcal-grab { display: flex; justify-content: center; padding: 8px 0 2px; touch-action: none; cursor: grab; }
  .slcal-grab span { width: 38px; height: 4px; border-radius: 2px; background: #D3DDD7; }
  .slcal-ph { touch-action: pan-x; }
  .slcal-panel__body { padding: 8px 18px 16px; gap: 18px; }
  .slcal-ph { top: -8px; margin: -8px -18px -6px; padding: 8px 18px 10px; }
  .slcal-panel__foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .slcal-submit { min-height: 52px; border-radius: 16px; font-size: 15px; box-shadow: 0 10px 24px rgba(62, 114, 98, 0.25); }
  .slcal-panel__foot .slcal-cancel { display: none; }
  .slcal-days { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .slcal-dayb:nth-child(n + 6) { display: none; }
  .slcal-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .slcal-slot { height: 44px; font-size: 15px; border-radius: 12px; }
  .slcal.has-drawer .slcal-scrim { opacity: 1; pointer-events: auto; }
  html.slcal-lock, html.slcal-lock body { overflow: hidden; }
  .sl-app:has(.slcal.has-drawer) .sl-toasts { bottom: auto; top: calc(14px + env(safe-area-inset-top, 0px)); }
}

/* Смена дня: сетка уезжает в сторону навигации */
html[data-vt^="day"] .sl-rail__ind { view-transition-name: none; }
html[data-vt^="day"]::view-transition-old(root),
html[data-vt^="day"]::view-transition-new(root) { animation: none; }
html[data-vt^="day"]::view-transition-old(slcal-drawer),
html[data-vt^="day"]::view-transition-new(slcal-drawer),
html[data-vt^="day"]::view-transition-old(slcal-scrim),
html[data-vt^="day"]::view-transition-new(slcal-scrim) { animation: none; }
html[data-vt="day-next"]::view-transition-old(slcal-board) { animation: 220ms var(--sl-ease) both slcal-out-left; }
html[data-vt="day-next"]::view-transition-new(slcal-board) { animation: 460ms var(--sl-ease) both slcal-in-right; }
html[data-vt="day-prev"]::view-transition-old(slcal-board) { animation: 220ms var(--sl-ease) both slcal-out-right; }
html[data-vt="day-prev"]::view-transition-new(slcal-board) { animation: 460ms var(--sl-ease) both slcal-in-left; }
html[data-vt="day-next"]::view-transition-old(slcal-title) { animation: 200ms var(--sl-ease) both slcal-title-out-left; }
html[data-vt="day-next"]::view-transition-new(slcal-title) { animation: 420ms var(--sl-ease) 40ms both slcal-title-in-right; }
html[data-vt="day-prev"]::view-transition-old(slcal-title) { animation: 200ms var(--sl-ease) both slcal-title-out-right; }
html[data-vt="day-prev"]::view-transition-new(slcal-title) { animation: 420ms var(--sl-ease) 40ms both slcal-title-in-left; }
::view-transition-group(slcal-sel), ::view-transition-group(slcal-wsel) { animation-duration: 480ms; animation-timing-function: var(--sl-ease-spring); }
::view-transition-group(slcal-board), ::view-transition-group(slcal-title) { animation-duration: 460ms; }

@keyframes slcal-out-left { to { opacity: 0; transform: translateX(-56px); } }
@keyframes slcal-out-right { to { opacity: 0; transform: translateX(56px); } }
@keyframes slcal-in-right { from { opacity: 0; transform: translateX(72px); } }
@keyframes slcal-in-left { from { opacity: 0; transform: translateX(-72px); } }
@keyframes slcal-title-out-left { to { opacity: 0; transform: translateX(-20px); } }
@keyframes slcal-title-out-right { to { opacity: 0; transform: translateX(20px); } }
@keyframes slcal-title-in-right { from { opacity: 0; transform: translateX(26px); } }
@keyframes slcal-title-in-left { from { opacity: 0; transform: translateX(-26px); } }
@keyframes slcal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes slcal-pop { 0% { transform: scale(0.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes slcal-ring { 0% { box-shadow: 0 0 0 0 rgba(62, 114, 98, 0.55); } 100% { box-shadow: 0 0 0 14px rgba(62, 114, 98, 0); } }
@keyframes slcal-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 85, 63, 0.35); } 50% { box-shadow: 0 0 0 6px rgba(196, 85, 63, 0); } }
@keyframes slcal-saving { from { opacity: 1; } to { opacity: 0.6; } }

@media (prefers-reduced-motion: reduce) {
  .slcal-drawer, .slcal-drawer.is-open, .slcal-main { transition: none !important; }
}

/* ======================================================================
   ============ Пациенты ============
   Список пациентов, карточка, сопровождение после операции, фото
   (галерея, просмотр, сравнение до/после). Префикс .slp-
   Кнопки компактные (34 px, подсказка при наведении) — больше места
   под содержимое.
   ====================================================================== */

.slp { overflow-x: clip; }
.slp-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.slp svg, .slp-lb svg, .slp-cmp svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.slp-muted { margin: 0; font-size: 13.5px; color: var(--sl-ink-2); }
.slp-break { overflow-wrap: anywhere; }

/* Компактные кнопки */
.slp-ibtn {
  position: relative; flex: 0 0 auto;
  height: 34px; min-width: 34px; padding: 0; border-radius: 10px;
  border: 1px solid var(--sl-line); background: var(--sl-surface); color: var(--sl-accent-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--sl-dur-1), border-color var(--sl-dur-2), color var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slp-ibtn svg { width: 17px; height: 17px; flex: 0 0 17px; }
.slp-ibtn:hover { background: var(--sl-surface-2); }
.slp-ibtn:active { transform: scale(0.94); }
.slp-ibtn--label { padding: 0 12px 0 10px; }
.slp-ibtn--primary, a.slp-ibtn--primary { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }
.slp-ibtn--primary:hover { background: var(--sl-accent-dark); }
.slp-ibtn--soft { background: #F1F6F3; border-color: #C9DCD2; }
.slp-ibtn--soft:hover { background: #E4EFE9; }
.slp-ibtn[aria-pressed="true"] { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }
.slp-ibtn__ph { display: none; }

.slp-tbtn {
  height: 30px; padding: 0 11px; border-radius: 9px; border: 1px solid #C9DCD2; background: #F1F6F3;
  color: var(--sl-accent-dark); font: inherit; font-size: 13px; font-weight: 500; line-height: 1;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--sl-dur-1), opacity var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease);
}
.slp-tbtn svg { width: 15px; height: 15px; }
.slp-tbtn:hover { background: #E4EFE9; }
.slp-tbtn:active { transform: scale(0.95); }
.slp-tbtn--quiet { background: transparent; border-color: transparent; }
.slp-tbtn--quiet:hover { background: var(--sl-tint); }
.slp-tbtn--solid { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }
.slp-tbtn--solid:hover { background: var(--sl-accent-dark); }
.slp-tbtn:disabled { opacity: 0.4; cursor: default; transform: none; }
.slp-link {
  border: 0; background: none; padding: 0; font: inherit; font-size: 13px; font-weight: 500;
  color: var(--sl-accent-dark); text-decoration: none; cursor: pointer; align-self: flex-start;
}
.slp-link:hover { text-decoration: underline; }

/* Подсказки к кнопкам: появляются с задержкой, на сенсорных экранах не показываются */
:is(.slp, .slp-lb, .slp-cmp) [data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 7px); left: 50%; z-index: 30;
  padding: 5px 9px; border-radius: 8px; background: var(--sl-ink); color: #FFFFFF;
  font-size: 12px; font-weight: 500; line-height: 1.3; letter-spacing: 0; text-transform: none; white-space: nowrap;
  pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, -3px);
  transition: opacity 120ms ease, transform 160ms var(--sl-ease), visibility 0s linear 160ms;
}
:is(.slp, .slp-lb, .slp-cmp) [data-tip-pos="end"]::after { left: auto; right: 0; transform: translateY(-3px); }
:is(.slp, .slp-lb, .slp-cmp) [data-tip]:is(:hover, :focus-visible)::after {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
  transition-delay: 380ms, 380ms, 380ms;
}
:is(.slp, .slp-lb, .slp-cmp) [data-tip-pos="end"]:is(:hover, :focus-visible)::after { transform: none; }
:is(.slp-lb, .slp-cmp) [data-tip]::after { background: #FFFFFF; color: var(--sl-ink); }
@media (hover: none) { :is(.slp, .slp-lb, .slp-cmp) [data-tip]::after { display: none; } }

/* Этап пути — маленькая пилюля */
.slp-stage {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap; background: #ECEFED; color: var(--sl-ink-2);
}
.slp-stage::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.75; }
.slp-stage--0 { background: #F6EEDF; color: var(--sl-sand-ink); }
.slp-stage--1 { background: #EAF2EE; color: var(--sl-accent-dark); }
.slp-stage--2 { background: #DCEBE4; color: #18302A; }
.slp-stage--3 { background: var(--sl-accent); color: #FFFFFF; }
.slp-stage--3::before { background: #CFE3D9; opacity: 1; }

/* ---------- Список ---------- */

.slp-list { flex: 1; width: 100%; min-width: 0; max-width: 1440px; margin: 0 auto; padding: 22px 28px 40px; display: flex; flex-direction: column; gap: 14px; }
.slp-list__head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.slp-list__titles { display: flex; align-items: baseline; gap: 12px; margin-right: 6px; min-width: 0; }
.slp-h1 { margin: 0; font-family: var(--sl-font-display); font-weight: 400; font-size: 27px; line-height: 1.15; }
.slp-sub { margin: 0; font-size: 13px; color: var(--sl-ink-2); white-space: nowrap; }
.slp-search { position: relative; flex: 1 1 260px; max-width: 460px; margin-left: auto; }
.slp-search svg { position: absolute; left: 12px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--sl-muted); pointer-events: none; }
.slp-search__input {
  width: 100%; height: 38px; padding: 0 34px 0 38px; border-radius: 11px;
  border: 1px solid var(--sl-line); background: var(--sl-surface); color: var(--sl-ink);
  font: inherit; font-size: 14px;
  transition: border-color var(--sl-dur-1), box-shadow var(--sl-dur-1);
}
.slp-search__input:focus { outline: none; border-color: var(--sl-accent); box-shadow: var(--sl-focus); }
.slp-search__input::placeholder { color: var(--sl-muted); }
.slp-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 500 11px/17px var(--sl-font-body); color: var(--sl-muted);
  border: 1px solid var(--sl-line); border-radius: 5px; padding: 0 6px; pointer-events: none;
  transition: opacity var(--sl-dur-1);
}
.slp-search__input:focus ~ .slp-kbd, .slp-search__input:not(:placeholder-shown) ~ .slp-kbd { opacity: 0; }

.slp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.slp-chip {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid #D3DDD7; background: var(--sl-surface);
  color: #33413B; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap;
  transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2), border-color var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease);
}
.slp-chip span { font-size: 12px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.slp-chip:hover { background: var(--sl-surface-2); }
.slp-chip:active { transform: scale(0.95); }
.slp-chip[aria-current="true"] { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }

.slp-table { background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: var(--sl-radius-l); overflow: hidden; }
.slp-thead, .slp-row {
  display: grid; align-items: center; gap: 16px; padding: 0 18px;
  grid-template-columns: minmax(210px, 2.2fr) minmax(118px, 0.9fr) minmax(150px, 1.2fr) minmax(170px, 1.7fr) 64px;
}
.slp-thead {
  height: 36px; border-bottom: 1px solid #E6ECE8;
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--sl-muted);
}
.slp-thead span:last-child { text-align: right; }
.slp-rows { display: flex; flex-direction: column; transition: opacity var(--sl-dur-2); }
.slp-rows.is-loading { opacity: 0.55; }
.slp-row {
  position: relative; min-height: 58px; padding-top: 9px; padding-bottom: 9px;
  border-bottom: 1px solid #EEF2EF; color: inherit; text-decoration: none;
  transition: background var(--sl-dur-2) var(--sl-ease);
}
.slp-row:last-child { border-bottom: 0; }
.slp-row:hover { background: #F7FAF8; }
.slp-row:active { background: var(--sl-tint); }
.slp-row:focus-visible { outline-offset: -2px; }
.slp-row__info { display: contents; }
.slp-row__who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.slp-row__avatar { flex: 0 0 38px; height: 38px; font-size: 14px; }
.slp-row:hover .slp-row__avatar { transform: scale(1.06); }
.slp-row__names { min-width: 0; display: flex; flex-direction: column; }
.slp-row__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slp-row__sub { font-size: 12.5px; color: var(--sl-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slp-row__sub:empty { display: none; }
.slp-row__stage, .slp-row__next, .slp-row__follow { min-width: 0; }
.slp-row__next { display: flex; flex-direction: column; font-size: 13px; }
.slp-row__when { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.slp-row__when.is-soon { color: var(--sl-accent-dark); font-weight: 600; }
.slp-row__what { font-size: 12.5px; color: var(--sl-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slp-row__none { color: #B8C8C0; }
.slp-row__follow { display: flex; align-items: center; gap: 8px; }
.slp-fday {
  flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; background: var(--sl-tint); color: var(--sl-accent-dark);
  font-size: 11.5px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.slp-fday--overdue { background: var(--sl-danger); color: var(--sl-danger-ink); }
.slp-fday--today { background: var(--sl-accent); color: #FFFFFF; }
.slp-ftext { min-width: 0; font-size: 12.5px; color: var(--sl-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slp-ftext--overdue { color: var(--sl-danger-ink); }
.slp-ftext--today { color: var(--sl-accent-dark); font-weight: 500; }
.slp-row__last { text-align: right; font-size: 12px; color: var(--sl-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.slp-empty { margin: 48px 12px; }
.slp-more {
  display: block; padding: 13px; border-top: 1px solid #EEF2EF; text-align: center;
  font-size: 13px; font-weight: 500; color: var(--sl-accent-dark); text-decoration: none;
}
.slp-more:hover { background: #F7FAF8; }
.slp-more.is-loading { color: var(--sl-muted); pointer-events: none; }
.slp-more.is-loading::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid #C9DCD2; border-top-color: var(--sl-accent); border-radius: 50%; animation: slp-spin 700ms linear infinite;
}

/* ---------- Карточка ---------- */

.slp-page { flex: 1; width: 100%; min-width: 0; max-width: 1320px; margin: 0 auto; padding: 16px 28px 48px; display: flex; flex-direction: column; gap: 14px; }
.slp-crumbs { display: flex; align-items: center; gap: 14px; font-size: 13px; min-height: 30px; }
.slp-crumbs__sp { flex: 1; }
.slp-back {
  display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 10px 0 4px; margin-left: -6px;
  border-radius: 9px; color: var(--sl-accent-dark); font-weight: 500; text-decoration: none;
  transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slp-back svg { width: 18px; height: 18px; stroke-width: 1.9; }
.slp-back:hover { background: var(--sl-tint); }
.slp-back:active { transform: scale(0.96); }
.slp-quiet { color: var(--sl-muted); text-decoration: none; white-space: nowrap; }
.slp-quiet:hover { color: var(--sl-accent-dark); text-decoration: underline; }

.slp-hero {
  background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: 22px;
  padding: 20px 22px 18px; display: flex; flex-direction: column; gap: 18px;
  box-shadow: 0 6px 20px rgba(29, 38, 34, 0.04);
}
.slp-hero__top { display: flex; align-items: center; gap: 18px; }
.slp-hero__avatar { flex: 0 0 64px; height: 64px; font-size: 23px; box-shadow: 0 0 0 6px #F3F8F5; view-transition-name: slp-avatar; }
.slp-hero__who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.slp-hero__name { margin: 0; font-family: var(--sl-font-display); font-weight: 400; font-size: 30px; line-height: 1.12; overflow-wrap: anywhere; }
.slp-hero__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; color: var(--sl-ink-2); }
.slp-hero__phone { color: var(--sl-ink); font-weight: 500; text-decoration: none; font-variant-numeric: tabular-nums; }
.slp-hero__phone:hover { color: var(--sl-accent-dark); }
.slp-tagline { font-size: 12.5px; font-weight: 600; color: var(--sl-accent-dark); }
.slp-actions { display: flex; align-items: center; gap: 6px; align-self: flex-start; }

.slp-journey { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.slp-journey__step { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.slp-journey__bar { height: 4px; border-radius: 999px; background: #E3EAE6; overflow: hidden; }
.slp-journey__bar span {
  display: block; height: 100%; width: var(--fill, 0%); border-radius: inherit; background: var(--sl-accent);
  transform-origin: left center; animation: slp-grow 900ms var(--sl-ease) 160ms both;
}
.slp-journey__name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.slp-journey__step.is-todo .slp-journey__name { font-weight: 500; color: var(--sl-muted); }
.slp-journey__step.is-now .sl-step-dot { animation: slp-breathe 2.8s ease-in-out infinite; }
.slp-journey__sub { padding-left: 26px; font-size: 12px; color: var(--sl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.slp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: 14px; align-items: start; }
.slp-main, .slp-side { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.slp-sec {
  position: relative; background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: 18px;
  padding: 15px 18px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0;
}
.slp-sec__head { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.slp-sec__sp { flex: 1; }
.slp-push { margin-left: auto; align-self: center; }
.slp-sec__aside { margin-left: auto; font-size: 12.5px; color: var(--sl-muted); text-align: right; }
.slp-cap {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sl-ink-2);
}
.slp-count {
  padding: 1px 7px; border-radius: 999px; background: var(--sl-tint); color: var(--sl-accent-dark);
  font-size: 11.5px; font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.slp-rise { animation: sl-rise 460ms var(--sl-ease) both; animation-delay: calc(40ms + var(--i, 0) * 45ms); }

/* Сопровождение после операции */
.slp-next { display: flex; align-items: center; gap: 12px; padding: 11px 12px 11px 14px; border-radius: 14px; background: #F1F6F3; }
.slp-next__mark { flex: 0 0 10px; height: 10px; border-radius: 50%; background: var(--sl-accent); box-shadow: 0 0 0 4px rgba(62, 114, 98, 0.14); }
.slp-next__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.slp-next__txt b { font-size: 14.5px; font-weight: 600; }
.slp-next__txt small { font-size: 12.5px; color: var(--sl-ink-2); }
.slp-next__acts { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
.slp-next--overdue { background: #FBF0ED; }
.slp-next--overdue .slp-next__mark { background: var(--sl-danger-ink); animation: slp-pulse-red 2.2s ease-out infinite; }
.slp-next--overdue .slp-next__txt b { color: var(--sl-danger-ink); }
.slp-next--today { background: var(--sl-tint); }
.slp-next--today .slp-next__mark { animation: slp-pulse 2.2s ease-out infinite; }
.slp-next--done .slp-next__mark { background: #9DBDB0; box-shadow: none; }

.slp-track { position: relative; margin: 2px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.slp-track__line { position: absolute; left: 6.25%; right: 6.25%; top: 10px; height: 3px; border-radius: 999px; background: #E3EAE6; }
.slp-track__line span {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--progress, 0%); border-radius: inherit; background: var(--sl-accent);
  transform-origin: left center; animation: slp-grow 1100ms var(--sl-ease) 260ms both;
}
.slp-ms {
  position: relative; z-index: 1; min-width: 0; padding: 0 3px;
  display: flex; flex-direction: column; align-items: center; gap: 1px; text-align: center;
  animation: sl-rise 420ms var(--sl-ease) both; animation-delay: calc(120ms + var(--i, 0) * 40ms);
}
.slp-ms.is-next::before {
  content: ""; position: absolute; z-index: -1; inset: -6px 1px -8px; border-radius: 12px; background: #F1F6F3;
}
.slp-ms__dot {
  width: 23px; height: 23px; margin-bottom: 7px; border-radius: 50%; border: 1.5px solid #B8C8C0; background: #FFFFFF;
  display: flex; align-items: center; justify-content: center; color: #FFFFFF; font-size: 13px; font-weight: 700;
}
.slp-ms__dot svg { width: 13px; height: 13px; stroke-width: 3; }
.slp-ms__title { font-size: 13px; font-weight: 600; white-space: nowrap; }
.slp-ms__what { font-size: 12px; line-height: 1.3; color: var(--sl-ink-2); }
.slp-ms__date { margin-top: 2px; font-size: 12px; color: var(--sl-muted); font-variant-numeric: tabular-nums; }
.slp-ms__state { font-size: 11.5px; line-height: 1.3; color: var(--sl-muted); }
.slp-ms--done .slp-ms__dot { background: var(--sl-accent); border-color: var(--sl-accent); }
.slp-ms--done .slp-ms__state { color: var(--sl-accent-dark); }
.slp-ms--today .slp-ms__dot { border: 6px solid var(--sl-accent); animation: slp-pulse 2.2s ease-out infinite; }
.slp-ms--today .slp-ms__state { color: var(--sl-accent-dark); font-weight: 600; }
.slp-ms--overdue .slp-ms__dot { background: var(--sl-danger-ink); border-color: var(--sl-danger-ink); animation: slp-pulse-red 2.2s ease-out infinite; }
.slp-ms--overdue .slp-ms__state { color: var(--sl-danger-ink); font-weight: 600; }
.slp-ms--missed .slp-ms__dot { border-style: dashed; background: var(--sl-surface-2); }
.slp-ms--missed :is(.slp-ms__title, .slp-ms__what, .slp-ms__date) { color: var(--sl-muted); }
.slp-ms.is-next .slp-ms__title { color: var(--sl-accent-dark); }
.slp-ms.is-next.slp-ms--overdue .slp-ms__title { color: var(--sl-danger-ink); }
.slp-ms__thumbs { display: flex; justify-content: center; margin-top: 7px; padding-left: 9px; }
.slp-ms__thumb {
  position: relative; width: 34px; height: 34px; margin-left: -9px; padding: 0; border: 2px solid #FFFFFF; border-radius: 10px; overflow: hidden;
  background: #E9EFEB; box-shadow: 0 2px 8px rgba(29, 38, 34, 0.14); cursor: zoom-in;
  transition: transform var(--sl-dur-2) var(--sl-ease-spring), box-shadow var(--sl-dur-2);
}
.slp-ms__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slp-ms__thumb:hover { transform: translateY(-2px) scale(1.08); z-index: 1; box-shadow: 0 6px 14px rgba(29, 38, 34, 0.2); }
.slp-follow__foot { display: flex; justify-content: flex-end; margin: -4px 0 -6px; }

.slp-presteps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.slp-prestep { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: 14px; background: var(--sl-surface-2); min-width: 0; }
.slp-prestep .sl-step-dot { margin-top: 1px; }
.slp-prestep.is-now { background: #F1F6F3; box-shadow: inset 0 0 0 1px #C9DCD2; }
.slp-prestep__txt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.slp-prestep__txt b { font-size: 14px; font-weight: 600; }
.slp-prestep__txt small { font-size: 12.5px; color: var(--sl-ink-2); overflow-wrap: anywhere; }
.slp-prestep.is-todo b { color: var(--sl-ink-2); font-weight: 500; }

/* Фото */
.slp-upload { display: flex; align-items: center; gap: 6px; }
.slp-upload input[type="file"] { pointer-events: none; }
html.slp-js .slp-upload__go { display: none; }
.slp-pick-hint { margin: 0; padding: 7px 11px; border-radius: 10px; background: var(--sl-tint); color: var(--sl-accent-dark); font-size: 13px; animation: sl-rise 260ms var(--sl-ease) both; }
.slp-pick-hint[hidden] { display: none; }
.slp-gallery { display: flex; flex-direction: column; gap: 16px; }
.slp-pgroup__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 8px; }
.slp-pgroup__head b { font-size: 14px; font-weight: 600; }
.slp-pgroup__head span { font-size: 12.5px; color: var(--sl-muted); }
.slp-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.slp-ph {
  position: relative; display: block; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 12px; overflow: hidden;
  background: linear-gradient(110deg, #E6ECE8 30%, #F1F5F2 50%, #E6ECE8 70%) 0 0 / 220% 100%;
  cursor: zoom-in; isolation: isolate;
  animation: sl-rise 380ms var(--sl-ease) both, slp-shimmer 1.4s linear infinite;
  animation-delay: calc(var(--i, 0) * 28ms), 0s;
  transition: box-shadow var(--sl-dur-2) var(--sl-ease), transform var(--sl-dur-1) var(--sl-ease);
}
.slp-ph.is-ready { animation: sl-rise 380ms var(--sl-ease) both; animation-delay: calc(var(--i, 0) * 28ms); background: #E9EFEB; }
.slp-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 520ms var(--sl-ease), opacity 320ms var(--sl-ease); }
html.slp-js .slp-ph img:not(.is-loaded) { opacity: 0; }
.slp-ph::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(29, 38, 34, 0.06); pointer-events: none; }
.slp-ph:hover img { transform: scale(1.045); }
.slp-ph:active { transform: scale(0.98); }
.slp-ph:focus-visible { outline: 2px solid var(--sl-accent); outline-offset: 2px; }
.slp-ph.is-hidden-for-lb img, .slp-ms__thumb.is-hidden-for-lb img { opacity: 0 !important; }
.slp-ph__lock {
  position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(29, 38, 34, 0.55); color: #FFFFFF; display: flex; align-items: center; justify-content: center;
}
.slp-ph__lock svg { width: 12px; height: 12px; stroke-width: 2; }
.slp-ph__pick {
  position: absolute; right: 7px; top: 7px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #FFFFFF; background: rgba(29, 38, 34, 0.28); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  opacity: 0; transform: scale(0.6); transition: opacity var(--sl-dur-2), transform var(--sl-dur-2) var(--sl-ease-spring), background var(--sl-dur-1);
}
.slp-photos.is-picking .slp-ph { cursor: pointer; }
.slp-photos.is-picking .slp-ph__pick { opacity: 1; transform: none; }
.slp-ph.is-picked { box-shadow: 0 0 0 3px var(--sl-accent); }
.slp-ph.is-picked .slp-ph__pick { background: var(--sl-accent); }
.slp-ph.is-picked .slp-ph__pick::after { content: attr(data-n); }
.slp-ph.is-uploading { cursor: progress; }
.slp-ph.is-uploading img { opacity: 0.55 !important; filter: saturate(0.7); }
.slp-ph__bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.6); overflow: hidden; }
.slp-ph__bar span { display: block; height: 100%; width: var(--p, 4%); background: var(--sl-accent); border-radius: inherit; transition: width 200ms linear; }
.slp-ph.is-failed { box-shadow: 0 0 0 2px var(--sl-danger-ink); }
.slp-ph.is-failed .slp-ph__bar span { background: var(--sl-danger-ink); }
.slp-noph {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px;
  border: 1.5px dashed #C9D5CF; background: var(--sl-surface-2); color: var(--sl-ink-2); font-size: 13.5px;
}
.slp-noph b { display: block; color: var(--sl-ink); font-size: 14.5px; font-weight: 600; }
.slp-noph__icon { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--sl-tint); color: var(--sl-accent); display: flex; align-items: center; justify-content: center; }
.slp-noph__icon svg { width: 22px; height: 22px; }
.slp-drop {
  position: absolute; inset: 0; z-index: 5; border-radius: inherit; border: 2px dashed var(--sl-accent);
  background: rgba(230, 240, 235, 0.92); display: flex; align-items: center; justify-content: center;
  color: var(--sl-accent-dark); font-size: 15px; font-weight: 600; text-align: center; padding: 20px;
  opacity: 0; pointer-events: none; transform: scale(0.99); transition: opacity var(--sl-dur-2), transform var(--sl-dur-2) var(--sl-ease);
}
.slp-photos.is-drag .slp-drop { opacity: 1; transform: none; }

/* Последние сообщения */
.slp-chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; background: var(--sl-ground); }
.slp-chat__msg { max-width: 78%; padding: 8px 12px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.slp-chat__msg.is-in { align-self: flex-start; background: #FFFFFF; border-radius: 16px 16px 16px 6px; }
.slp-chat__msg.is-out { align-self: flex-end; background: var(--sl-tint-2); color: #18302A; border-radius: 16px 16px 6px 16px; }
.slp-chat__meta { font-size: 12px; color: var(--sl-muted); }
.slp-chat__meta b { color: #8A5A1E; font-weight: 600; }

/* Заметки */
.slp-notes__list { display: flex; flex-direction: column; gap: 8px; }
.slp-notes__more { align-self: center; }
.slp-note {
  padding: 9px 13px; border: 1px dashed #C7B48F; border-radius: 14px; background: #FBF6EC;
  color: #5C4520; font-size: 14px; overflow-wrap: anywhere;
}
.slp-note strong { font-weight: 600; }
.slp-note__time { font-size: 12px; color: #8C7550; white-space: nowrap; }
.slp-note.is-old { display: none; }
.slp-notes__list.is-all .slp-note.is-old { display: block; animation: sl-rise 320ms var(--sl-ease) both; }
.slp-note.is-new { animation: slp-pop 520ms var(--sl-ease-spring) both; }
.slp-note.is-sending { opacity: 0.6; }
.slp-notes__empty { font-size: 13px; }
.slp-noteform { display: flex; align-items: flex-end; gap: 8px; }
.slp-noteform textarea {
  flex: 1; min-width: 0; min-height: 38px; max-height: 180px; padding: 8px 12px; resize: none;
  border: 1px solid var(--sl-line); border-radius: 11px; background: var(--sl-surface-2); color: var(--sl-ink);
  font: inherit; font-size: 14px; line-height: 1.45;
  transition: border-color var(--sl-dur-1), box-shadow var(--sl-dur-1), background var(--sl-dur-1);
}
.slp-noteform textarea:focus { outline: none; border-color: var(--sl-accent); background: var(--sl-surface); box-shadow: var(--sl-focus); }
.slp-noteform .slp-tbtn { height: 38px; padding: 0 14px; border-radius: 11px; }
.slp-noteform.is-flash textarea { animation: slp-ring 1.1s var(--sl-ease) both; }

/* История */
.slp-hist { margin: 0; padding: 0; list-style: none; }
.slp-hist__item { position: relative; display: flex; gap: 12px; padding-bottom: 13px; }
.slp-hist__item::before { content: ""; position: absolute; left: 5px; top: 17px; bottom: -1px; width: 2px; background: #E3EAE6; }
.slp-hist__item:last-child { padding-bottom: 0; }
.slp-hist__item:last-child::before, .slp-hist:not(.is-all) .slp-hist__item:nth-child(6)::before { display: none; }
.slp-hist:not(.is-all) .slp-hist__item:nth-child(6) { padding-bottom: 0; }
.slp-hist__item.is-more { display: none; }
.slp-hist.is-all .slp-hist__item.is-more { display: flex; animation: sl-rise 320ms var(--sl-ease) both; }
.slp-hist__dot { position: relative; z-index: 1; flex: 0 0 12px; height: 12px; margin-top: 4px; border-radius: 50%; background: #9DBDB0; }
.slp-hist__item--op .slp-hist__dot { background: var(--sl-accent); box-shadow: 0 0 0 3px #DCEBE4; }
.slp-hist__item--first .slp-hist__dot { background: #D9C49C; }
.slp-hist__item--miss .slp-hist__dot { background: #D99484; }
.slp-hist__item--off .slp-hist__dot { background: #D3DDD7; }
.slp-hist__item--off .slp-hist__txt b { color: var(--sl-muted); font-weight: 500; text-decoration: line-through; text-decoration-color: #B8C8C0; }
.slp-hist__txt { min-width: 0; display: flex; flex-direction: column; }
.slp-hist__txt b { font-size: 14px; font-weight: 600; }
.slp-hist__txt small { font-size: 12.5px; color: var(--sl-ink-2); }

/* Боковая колонка */
.slp-visit { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: #F1F6F3; }
.slp-visit__date {
  flex: 0 0 46px; height: 56px; border-radius: 11px; background: #FFFFFF;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.slp-visit__date small { font-size: 11px; color: var(--sl-ink-2); }
.slp-visit__date b { font-family: var(--sl-font-display); font-weight: 400; font-size: 22px; color: var(--sl-accent-dark); }
.slp-visit__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.slp-visit__txt b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.slp-visit__txt small { font-size: 12.5px; color: var(--sl-ink-2); }
.slp-visit-line {
  display: flex; align-items: baseline; gap: 8px; padding: 6px; margin: -4px -6px; border-radius: 9px;
  color: inherit; text-decoration: none; font-size: 13px;
}
.slp-visit-line:hover { background: var(--sl-surface-2); }
.slp-visit-line span { flex: 0 0 auto; color: var(--sl-ink-2); font-variant-numeric: tabular-nums; }
.slp-visit-line b { min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slp-tasks { margin: 0 -6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1px; }
.slp-task { display: flex; align-items: flex-start; gap: 10px; padding: 7px 6px; border-radius: 10px; color: inherit; text-decoration: none; transition: background var(--sl-dur-1); }
.slp-task:hover { background: var(--sl-surface-2); }
.slp-task__box { flex: 0 0 16px; height: 16px; margin-top: 2px; border-radius: 5px; border: 1.5px solid #9DBDB0; }
.slp-task__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slp-task__txt b { font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.slp-task__txt small { font-size: 12px; color: var(--sl-muted); }
.slp-task.is-late .slp-task__box { border-color: #D99484; }
.slp-task.is-late small { color: var(--sl-danger-ink); }
.slp-task__flag { flex: 0 0 auto; padding: 1px 7px; border-radius: 999px; background: var(--sl-sand); color: var(--sl-sand-ink); font-size: 11px; font-weight: 600; }
.slp-dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 13.5px; }
.slp-dl dt { color: var(--sl-ink-2); }
.slp-dl dd { margin: 0; min-width: 0; }
.slp-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.slp-ops, .slp-docs, .slp-consents { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.slp-ops li { display: flex; align-items: flex-start; gap: 10px; }
.slp-ops__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.slp-ops__txt b { font-size: 14px; font-weight: 600; }
.slp-ops__txt small { font-size: 12.5px; color: var(--sl-ink-2); }
.slp-opstate { flex: 0 0 auto; margin-top: 1px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.slp-opstate--ok { background: #DCEBE4; color: #18302A; }
.slp-opstate--wait { background: #FFFFFF; color: var(--sl-ink); box-shadow: inset 0 0 0 1px #9DBDB0; }
.slp-opstate--done { background: #EEF2EF; color: var(--sl-ink-2); }
.slp-opstate--off { background: #ECEFED; color: var(--sl-muted); }
.slp-docs { gap: 2px; margin: 0 -6px; }
.slp-docs a { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 9px; color: var(--sl-accent-dark); text-decoration: none; font-size: 13.5px; }
.slp-docs a:hover { background: var(--sl-surface-2); }
.slp-docs svg { flex: 0 0 16px; width: 16px; height: 16px; }
.slp-docs span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slp-docs small { flex: 0 0 auto; font-size: 12px; color: var(--sl-muted); }
.slp-consents li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.slp-consents__mark { flex: 0 0 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.slp-consents .is-ok .slp-consents__mark { background: var(--sl-accent); color: #FFFFFF; }
.slp-consents .is-ok svg { width: 11px; height: 11px; stroke-width: 3; }
.slp-consents .is-no { color: var(--sl-sand-ink); }
.slp-consents .is-no .slp-consents__mark { border: 1.5px solid #C7B48F; }

/* ---------- Просмотр фото ---------- */

html.slp-lock, html.slp-lock body { overflow: hidden; }
.slp-lb { position: fixed; inset: 0; z-index: 60; color: #FFFFFF; touch-action: none; }
.slp-lb[hidden] { display: none; }
.slp-lb__scrim { position: absolute; inset: 0; background: rgba(11, 16, 14, 0.95); opacity: 0; transition: opacity 340ms var(--sl-ease); }
.slp-lb.is-open .slp-lb__scrim { opacity: var(--scrim, 1); }
.slp-lb.is-dragging .slp-lb__scrim { transition: none; }
.slp-lb__stage { position: absolute; inset: 64px 76px 92px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.slp-lb__img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; pointer-events: auto;
  user-select: none; -webkit-user-select: none; cursor: zoom-in; will-change: transform;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.slp-lb.is-zoomed .slp-lb__img { cursor: grab; }
.slp-lb__top, .slp-lb__cap, .slp-lb__nav { opacity: 0; transition: opacity 260ms var(--sl-ease); }
.slp-lb.is-open .slp-lb__top, .slp-lb.is-open .slp-lb__cap, .slp-lb.is-open .slp-lb__nav { opacity: 1; }
.slp-lb.is-dragging .slp-lb__top, .slp-lb.is-dragging .slp-lb__cap, .slp-lb.is-dragging .slp-lb__nav { opacity: 0; }
.slp-lb__top { position: absolute; left: 0; right: 0; top: 0; height: 60px; padding: 0 14px 0 20px; display: flex; align-items: center; gap: 6px; }
.slp-lb__count { font-size: 13px; color: rgba(255, 255, 255, 0.75); font-variant-numeric: tabular-nums; }
.slp-lbtn {
  position: relative; width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255, 255, 255, 0.1); color: #FFFFFF; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slp-lbtn:hover { background: rgba(255, 255, 255, 0.2); }
.slp-lbtn:active { transform: scale(0.92); }
.slp-lbtn svg { width: 18px; height: 18px; }
.slp-lb__nav {
  position: absolute; top: 50%; width: 46px; height: 46px; margin-top: -23px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255, 255, 255, 0.1); color: #FFFFFF; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.slp-lb__nav:hover { background: rgba(255, 255, 255, 0.2); }
.slp-lb__nav svg { width: 22px; height: 22px; }
.slp-lb__nav--prev { left: 16px; }
.slp-lb__nav--next { right: 16px; }
.slp-lb__nav[disabled] { opacity: 0 !important; pointer-events: none; }
.slp-lb__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 20px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.slp-lb__cap b { font-family: var(--sl-font-display); font-weight: 400; font-size: 20px; }
.slp-lb__cap span { font-size: 13px; color: rgba(255, 255, 255, 0.7); }

/* ---------- Сравнение до/после ---------- */

.slp-cmp { position: fixed; inset: 0; z-index: 61; display: flex; flex-direction: column; background: #111814; color: #FFFFFF; }
.slp-cmp[hidden] { display: none; }
.slp-cmp.is-open { animation: slp-cmp-in 460ms var(--sl-ease) both; }
.slp-cmp.is-closing { animation: slp-cmp-out 220ms var(--sl-ease) both; }
.slp-cmp__bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px 10px 20px; }
.slp-cmp__h { margin: 0 6px 0 0; font-family: var(--sl-font-display); font-weight: 400; font-size: 21px; }
.slp-seg { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: rgba(255, 255, 255, 0.08); }
.slp-seg button {
  height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  color: rgba(255, 255, 255, 0.75); font: inherit; font-size: 13px; cursor: pointer;
  transition: background var(--sl-dur-2) var(--sl-ease), color var(--sl-dur-2);
}
.slp-seg button[aria-pressed="true"] { background: #FFFFFF; color: var(--sl-ink); font-weight: 600; }
.slp-cmp__pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px 10px; }
.slp-cmp__pick select {
  width: 100%; max-width: 420px; height: 34px; padding: 0 30px 0 12px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16); background-color: rgba(255, 255, 255, 0.07); color: #FFFFFF;
  font: inherit; font-size: 13px; cursor: pointer;
}
.slp-cmp__pick select option, .slp-cmp__pick select optgroup { color: var(--sl-ink); background: #FFFFFF; }
.slp-cmp__body { flex: 1; min-height: 0; padding: 0 16px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.slp-cmp__pane { position: relative; margin: 0; min-width: 0; min-height: 0; border-radius: 16px; overflow: hidden; background: rgba(255, 255, 255, 0.035); display: flex; align-items: center; justify-content: center; }
.slp-cmp__pane img { width: 100%; height: 100%; object-fit: contain; display: block; user-select: none; }
.slp-cmp__pane img.is-swap { animation: slp-fade-in 360ms var(--sl-ease) both; }
.slp-cmp__pane figcaption, .slp-cmp__label {
  position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px);
  padding: 5px 10px; border-radius: 9px; background: rgba(13, 19, 16, 0.62); backdrop-filter: blur(6px);
  font-size: 12.5px; line-height: 1.35; color: #FFFFFF; pointer-events: none;
}
.slp-cmp__slider { display: none; grid-column: 1 / -1; min-height: 0; border-radius: 16px; background: rgba(255, 255, 255, 0.035); touch-action: none; cursor: ew-resize; user-select: none; }
.slp-cmp__body[data-mode="slider"] .slp-cmp__pane { display: none; }
.slp-cmp__body[data-mode="slider"] .slp-cmp__slider { display: flex; align-items: center; justify-content: center; }
/* Рамка по пропорциям фото: шторка ходит по самому снимку, а не по пустым полям */
.slp-cmp__frame { position: relative; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; }
.slp-cmp__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.slp-cmp__top { clip-path: inset(0 0 0 var(--split, 50%)); }
.slp-cmp__label--a { bottom: auto; top: 12px; }
.slp-cmp__label--b { left: auto; right: 12px; bottom: auto; top: 12px; }
.slp-cmp__handle { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: #FFFFFF; box-shadow: 0 0 12px rgba(0, 0, 0, 0.4); outline: none; }
.slp-cmp__handle span {
  position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform var(--sl-dur-2) var(--sl-ease-spring);
}
.slp-cmp__handle span::before, .slp-cmp__handle span::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border-left: 2px solid var(--sl-accent); border-bottom: 2px solid var(--sl-accent);
}
.slp-cmp__handle span::before { left: 11px; transform: rotate(45deg); }
.slp-cmp__handle span::after { right: 11px; transform: rotate(-135deg); }
.slp-cmp__slider.is-dragging .slp-cmp__handle span, .slp-cmp__handle:focus-visible span { transform: scale(1.12); }
.slp-cmp__handle:focus-visible span { box-shadow: 0 0 0 4px rgba(207, 227, 217, 0.6), 0 6px 18px rgba(0, 0, 0, 0.35); }

/* ---------- Переходы список ⇄ карточка ---------- */

::view-transition-group(slp-avatar) { animation-duration: 480ms; animation-timing-function: var(--sl-ease); }
/* Список ⇄ карточка: пункт меню тот же — его подсветку не переносим (иначе она на миг закрывает подпись) */
html.slp-same .sl-rail__ind { view-transition-name: none; }
::view-transition-old(slp-avatar), ::view-transition-new(slp-avatar) { height: 100%; }

@keyframes slp-grow { from { transform: scaleX(0); } }
@keyframes slp-grow-y { from { transform: scaleY(0); } }
@keyframes slp-spin { to { transform: rotate(360deg); } }
@keyframes slp-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes slp-pop { 0% { opacity: 0; transform: translateY(10px) scale(0.96); } 100% { opacity: 1; transform: none; } }
@keyframes slp-fade-in { from { opacity: 0; } }
@keyframes slp-pulse { 0% { box-shadow: 0 0 0 0 rgba(62, 114, 98, 0.45); } 70%, 100% { box-shadow: 0 0 0 9px rgba(62, 114, 98, 0); } }
@keyframes slp-pulse-red { 0% { box-shadow: 0 0 0 0 rgba(142, 47, 34, 0.4); } 70%, 100% { box-shadow: 0 0 0 9px rgba(142, 47, 34, 0); } }
@keyframes slp-breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(62, 114, 98, 0.3); } 50% { box-shadow: 0 0 0 5px rgba(62, 114, 98, 0); } }
@keyframes slp-ring { 0% { box-shadow: 0 0 0 0 rgba(62, 114, 98, 0.5); } 100% { box-shadow: 0 0 0 10px rgba(62, 114, 98, 0); } }
@keyframes slp-cmp-in { from { opacity: 0; transform: scale(0.985); } }
@keyframes slp-cmp-out { to { opacity: 0; transform: scale(0.99); } }

/* ---------- Узкие экраны ---------- */

@media (max-width: 1180px) {
  .slp-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .slp-thead, .slp-row { grid-template-columns: minmax(200px, 2fr) minmax(112px, 0.9fr) minmax(140px, 1.2fr) minmax(150px, 1.5fr) 56px; gap: 12px; }
}
@media (max-width: 1040px) {
  .slp-grid { grid-template-columns: minmax(0, 1fr); }
  .slp-track { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 18px; }
  .slp-track__line { display: none; }
}

@media (max-width: 860px) {
  /* Список */
  .slp-list { padding: 16px 14px 20px; gap: 12px; }
  .slp-list__head { gap: 10px; }
  .slp-list__titles { flex: 1 1 0; flex-direction: column; align-items: flex-start; gap: 2px; margin: 0; }
  .slp-sub { white-space: normal; font-size: 12.5px; }
  .slp-h1 { font-size: 26px; }
  .slp-search { order: 3; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .slp-search__input { height: 42px; font-size: 16px; }
  .slp-kbd { display: none; }
  .slp-list__head .slp-ibtn--label { padding: 0; width: 38px; height: 38px; }
  .slp-list__head .slp-ibtn--label span { display: none; }
  .slp-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .slp-chips::-webkit-scrollbar { display: none; }
  .slp-chip { flex: 0 0 auto; height: 32px; }
  .slp-thead { display: none; }
  .slp-table { border-radius: 18px; }
  .slp-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 11px 14px; align-items: start; }
  .slp-row__who { grid-column: 1; }
  .slp-row__last { grid-column: 2; grid-row: 1; padding-top: 3px; }
  .slp-row__info { display: flex; grid-column: 1 / -1; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-left: 50px; min-width: 0; }
  .slp-row__next { flex-direction: row; gap: 6px; align-items: baseline; font-size: 12.5px; max-width: 100%; }
  .slp-row__next:not(:has(.slp-row__when)) { display: none; }
  .slp-row__follow { flex: 1 1 100%; max-width: 100%; }
  .slp-row__follow:empty { display: none; }

  /* Карточка: как лист на телефоне, всё в одну колонку */
  .slp-page { padding: 8px 12px 24px; gap: 12px; }
  .slp-crumbs { gap: 10px; font-size: 12.5px; }
  .slp-hero { padding: 16px 16px 14px; border-radius: 24px; gap: 16px; }
  .slp-hero__top { flex-wrap: wrap; gap: 12px 14px; }
  .slp-hero__avatar { flex-basis: 56px; height: 56px; font-size: 20px; box-shadow: 0 0 0 5px #F3F8F5; view-transition-name: none; }
  .slp-hero__name { font-size: 23px; }
  .slp-hero__meta { gap: 4px 10px; font-size: 12.5px; }
  .slp-hero__resp { display: none; }
  .slp-actions { flex: 1 1 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
  .slp-actions .slp-ibtn {
    width: auto; height: 50px; padding: 0 4px; border-radius: 14px; gap: 3px;
    flex-direction: column; font-size: 12px; line-height: 1.1;
  }
  .slp-actions .slp-ibtn svg { width: 19px; height: 19px; flex-basis: 19px; }
  .slp-actions .slp-ibtn:not(.slp-ibtn--primary) { background: #F1F6F3; border-color: transparent; }
  .slp-actions .slp-ibtn--label { padding: 0 4px; }
  .slp-ibtn__ph { display: inline; }
  .slp-journey { gap: 5px; }
  .slp-journey__step { gap: 6px; }
  .slp-journey__name { font-size: 11.5px; letter-spacing: -0.01em; }
  .slp-journey__name .sl-step-dot { display: none; }
  .slp-journey__step.is-now .slp-journey__name { color: var(--sl-accent-dark); }
  .slp-journey__sub { display: none; }
  .slp-grid { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .slp-main, .slp-side { display: contents; }
  .slp-sec { order: var(--o, 20); padding: 14px 14px 15px; border-radius: 18px; }
  .slp-sec__head { flex-wrap: wrap; row-gap: 2px; }
  .slp-sec__aside { flex: 1 1 100%; margin-left: 0; text-align: left; order: 3; }
  .slp-next { flex-wrap: wrap; padding: 11px 12px; }
  .slp-next__acts { flex: 1 1 100%; justify-content: flex-start; padding-left: 16px; }
  .slp-track { grid-template-columns: 1fr; row-gap: 0; }
  .slp-track__line { display: block; left: 11px; right: auto; top: 14px; bottom: 14px; width: 3px; height: auto; }
  .slp-track__line span { width: 100%; height: var(--progress, 0%); bottom: auto; transform-origin: center top; animation-name: slp-grow-y; }
  .slp-ms {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 0;
    padding: 6px 0; text-align: left;
  }
  .slp-ms.is-next::before { inset: 0 -8px; }
  .slp-ms__dot { grid-row: 1 / span 2; margin: 0; }
  .slp-ms__title { grid-column: 2; }
  .slp-ms__what { grid-column: 2; }
  .slp-ms__date { grid-column: 3; grid-row: 1; margin: 0; text-align: right; }
  .slp-ms__state { grid-column: 3; grid-row: 2; text-align: right; }
  .slp-ms__thumbs { grid-column: 2 / -1; justify-content: flex-start; margin: 6px 0 2px; }
  .slp-presteps { grid-template-columns: 1fr; }
  .slp-pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .slp-ph { border-radius: 10px; }
  .slp-noteform textarea { font-size: 16px; }
  .slp-chat__msg { max-width: 88%; }

  /* Просмотр и сравнение: во весь экран, листание пальцем */
  .slp-lb__stage { inset: 56px 0 100px; }
  .slp-lb__img { border-radius: 0; }
  .slp-lb__nav { display: none; }
  .slp-lb__top { padding: env(safe-area-inset-top, 0px) 10px 0 16px; }
  .slp-cmp__bar { padding: 10px 10px 8px 14px; gap: 6px; }
  .slp-cmp__h { font-size: 18px; }
  .slp-cmp__pickers { gap: 6px; padding: 0 10px 8px; }
  .slp-cmp__pick select { height: 36px; padding: 0 22px 0 8px; font-size: 12.5px; }
  .slp-cmp__body { padding: 0 10px calc(10px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .slp-cmp__pane { border-radius: 12px; }
  .slp-cmp__pane figcaption { left: 6px; bottom: 6px; max-width: calc(100% - 12px); font-size: 11.5px; padding: 4px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .slp-ph { animation: none !important; background: #E9EFEB; }
}

/* Вложения из мессенджеров, которые ещё никто не открыл: плитка без содержимого и «Показать» */
.slp-pgroup--locked { padding: 12px; margin: 0 -12px 6px; border-radius: 16px; background: #F7F3EA; }
.slp-pgroup--locked .slp-pgroup__head { align-items: center; }
.slp-reveal-all { margin-left: auto; }
.slp-ph--locked {
  cursor: default;
  background: radial-gradient(120% 90% at 30% 20%, #FFFFFF 0%, #EEF3F0 55%, #E3ECE7 100%);
  display: flex; flex-direction: column; justify-content: space-between; padding: 10px;
}
.slp-ph--locked:active { transform: none; }
.slp-ph__veil { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.slp-ph__veil svg {
  width: 38px; height: 38px; padding: 9px; border-radius: 50%;
  background: #FFFFFF; color: var(--sl-accent-dark); box-shadow: 0 4px 14px rgba(29, 38, 34, 0.08);
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.slp-ph__veil b { font-size: 12.5px; font-weight: 600; color: var(--sl-ink); }
.slp-ph__veil small { font-size: 11.5px; color: var(--sl-muted); }
.slp-ph__reveal {
  height: 30px; border: 0; border-radius: 999px;
  background: var(--sl-accent); color: #FFFFFF;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.slp-ph__reveal:hover { background: var(--sl-accent-dark); }
.slp-ph__reveal:active { transform: scale(0.95); }
.slp-ph--locked.is-revealing .slp-ph__veil svg { animation: slp-reveal-pulse 900ms var(--sl-ease) infinite; }
.slp-ph--locked.is-revealing .slp-ph__reveal { opacity: 0.6; pointer-events: none; }
.slp-locked-hint { margin: 8px 2px 0; font-size: 12px; color: var(--sl-sand-ink); }
@keyframes slp-reveal-pulse { 50% { transform: scale(0.9); opacity: 0.7; } }

/* ======================================================================
   ============ Сопровождение после операции (приложение care) ============
   План с точками в карточке пациента, список дел «Сопровождение»
   (/crm/n/care/), сигналы для врача (карточка, «Общение»), окна действий.
   Префикс .care-. Кнопки компактные: 32 px, подпись — подсказкой.
   ====================================================================== */

.care-i { width: 16px; height: 16px; flex: 0 0 16px; }
html.care-lock { overflow: hidden; }

/* Кнопки */
.care-btn {
  position: relative; flex: 0 0 auto;
  height: 32px; min-width: 32px; padding: 0 11px 0 9px; border-radius: 9px;
  border: 1px solid #C9DCD2; background: #F1F6F3; color: var(--sl-accent-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--sl-dur-1), border-color var(--sl-dur-2), color var(--sl-dur-1), opacity var(--sl-dur-2), transform var(--sl-dur-1) var(--sl-ease);
}
.care-btn:hover { background: #E4EFE9; }
.care-btn:active { transform: scale(0.94); }
.care-btn:focus-visible { outline: none; box-shadow: var(--sl-focus); }
.care-btn--icon { width: 32px; padding: 0; background: var(--sl-surface); border-color: var(--sl-line); color: var(--sl-ink-2); }
.care-btn--icon:hover { background: var(--sl-surface-2); color: var(--sl-accent-dark); border-color: #C9DCD2; }
.care-btn--primary { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }
.care-btn--primary:hover { background: var(--sl-accent-dark); border-color: var(--sl-accent-dark); }
.care-btn--muted { background: var(--sl-ink-2); border-color: var(--sl-ink-2); }
.care-btn--muted:hover { background: var(--sl-ink); border-color: var(--sl-ink); }
.care-btn--ghost { background: transparent; border-color: transparent; color: var(--sl-ink-2); }
.care-btn--ghost:hover { background: var(--sl-surface-2); }
.care-btn--danger { background: var(--sl-danger-ink); border-color: var(--sl-danger-ink); color: #FFFFFF; }
.care-btn--danger:hover { background: #74251B; border-color: #74251B; }
.care-btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.care-btn.is-busy { color: transparent !important; }
.care-btn.is-busy .care-i { opacity: 0; }
.care-btn.is-busy::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #FFFFFF; border-radius: 50%; animation: slp-spin 700ms linear infinite;
}
.care-btn--icon.is-busy::before, .care-btn--ghost.is-busy::before { border-color: #C9DCD2; border-top-color: var(--sl-accent); }
.care-acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
/* Пока окно открыто, у его кнопки нет подсказки и видно, что она нажата */
[data-care-act][aria-expanded="true"]::after { opacity: 0 !important; visibility: hidden !important; }
.care-btn--icon[aria-expanded="true"] { background: var(--sl-tint); border-color: #C9DCD2; color: var(--sl-accent-dark); }
.care-mini { width: 32px; height: 32px; min-width: 32px; color: var(--sl-ink-2); }
.care-mini .care-i { width: 17px; height: 17px; flex-basis: 17px; }

/* Подсказки там, где нет общих правил .slp (окно поверх страницы, «Общение») */
:is(.care-pop, .care-strip) [data-tip]::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 7px); left: 50%; z-index: 30;
  padding: 5px 9px; border-radius: 8px; background: var(--sl-ink); color: #FFFFFF;
  font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap;
  pointer-events: none; opacity: 0; visibility: hidden; transform: translate(-50%, -3px);
  transition: opacity 120ms ease, transform 160ms var(--sl-ease), visibility 0s linear 160ms;
}
:is(.care-pop, .care-strip) [data-tip-pos="end"]::after { left: auto; right: 0; transform: translateY(-3px); }
:is(.care-pop, .care-strip) [data-tip]:is(:hover, :focus-visible)::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 380ms, 380ms, 380ms; }
:is(.care-pop, .care-strip) [data-tip-pos="end"]:is(:hover, :focus-visible)::after { transform: none; }
@media (hover: none) { :is(.care-pop, .care-strip) [data-tip]::after { display: none; } }

/* ---------- Карточка: план сопровождения ---------- */

.care-meta { margin: -4px 2px 0; font-size: 12.5px; color: var(--sl-muted); }
.care-meta b { font-weight: 600; color: var(--sl-ink-2); }
.care-next { gap: 4px; }
.slp-next--requested { background: #F8F1E4; }
.slp-next--requested .slp-next__mark { background: #C29247; box-shadow: 0 0 0 4px rgba(194, 146, 71, 0.18); }
.slp-next--requested .slp-next__txt b { color: var(--sl-sand-ink); }

/* Точка на шкале нажимается целиком — открывается окно с подробностями и действиями */
.care-plan .slp-ms { cursor: pointer; }
.care-ms-hit {
  position: absolute; z-index: 0; inset: -6px 1px -8px; padding: 0; border: 0; border-radius: 12px;
  background: transparent; cursor: pointer;
  transition: background var(--sl-dur-2) var(--sl-ease), box-shadow var(--sl-dur-2);
}
.care-ms-hit:hover { background: rgba(62, 114, 98, 0.06); }
.care-ms-hit:focus-visible { outline: none; box-shadow: var(--sl-focus); }
.care-plan .slp-ms > :not(.care-ms-hit):not(template) { position: relative; z-index: 1; pointer-events: none; }
.care-plan .slp-ms .slp-ms__thumbs { pointer-events: auto; }
.care-plan .slp-ms.is-next::before { z-index: -1; }
.slp-ms--requested .slp-ms__dot { border: 2px dashed #C29247; background: #FBF4E6; }
.slp-ms--requested .slp-ms__dot::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #C29247; animation: slp-breathe 2.6s ease-in-out infinite; }
.slp-ms--requested .slp-ms__state { color: var(--sl-sand-ink); font-weight: 600; }

/* Список пациентов и кнопка входа */
.slp-fday--requested { background: #F6EBD7; color: var(--sl-sand-ink); }
.slp-ftext--requested { color: var(--sl-sand-ink); }
.slp-fday--alert { background: var(--sl-danger-ink); color: #FFFFFF; }
.care-entry { gap: 7px; }
.care-entry .care-i { width: 17px; height: 17px; flex-basis: 17px; }
.care-entry__n {
  min-width: 20px; height: 20px; padding: 0 6px; margin-right: -4px; border-radius: 999px;
  background: var(--sl-danger-ink); color: #FFFFFF; font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Сигнал для врача ---------- */

.care-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 12px 12px 14px; border-radius: 14px;
  background: #FBEFEC; box-shadow: inset 0 0 0 1px #F1D3CC;
  animation: care-alert-in 520ms var(--sl-ease) both;
}
.care-alert__mark {
  flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--sl-danger-ink); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; animation: slp-pulse-red 2.4s ease-out infinite;
}
.care-alert__mark .care-i { width: 16px; height: 16px; stroke-width: 2; }
.care-alert__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.care-alert__title { font-size: 14px; font-weight: 600; color: var(--sl-danger-ink); }
.care-alert__title span { font-weight: 500; }
.care-alert__quote { font-size: 14px; line-height: 1.45; color: var(--sl-ink); overflow-wrap: anywhere; }
.care-alert__quote mark, .care-row__quote mark { background: #F5D3CA; color: #6E1F15; border-radius: 4px; padding: 0 2px; }
.care-alert__meta { font-size: 12px; color: var(--sl-ink-2); }
.care-alert__note { font-size: 11.5px; color: #9A5A4E; }
.care-alert__acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.care-alert.is-resolved { background: var(--sl-tint); box-shadow: inset 0 0 0 1px #C9DCD2; transition: background var(--sl-dur-3) var(--sl-ease), box-shadow var(--sl-dur-3); }
.care-alert.is-resolved .care-alert__mark { background: var(--sl-accent); animation: none; }
@keyframes care-alert-in { from { opacity: 0; transform: translateY(-6px) scale(0.985); } }

/* «Общение»: полоса над перепиской и значок в списке */
.care-strip { flex: 0 0 auto; width: min(100% - 40px, 820px); margin: 10px auto 0; display: flex; flex-direction: column; gap: 6px; }
.care-strip .care-alert { padding: 10px 10px 10px 12px; box-shadow: inset 0 0 0 1px #F1D3CC, 0 6px 18px rgba(142, 47, 34, 0.08); }
.sl-row__alert { flex: 0 0 auto; font-size: 11px; line-height: 18px; border-radius: 999px; padding: 0 7px; color: #FFFFFF; background: var(--sl-danger-ink); font-weight: 600; }
.sl-chip--alert { border-color: #EBC2B9; color: var(--sl-danger-ink); }
.sl-chip--alert[aria-current="true"] { background: var(--sl-danger-ink); border-color: var(--sl-danger-ink); color: #FFFFFF; }

/* ---------- Окно действий: рядом с кнопкой, на телефоне — лист снизу ---------- */

.care-pop {
  position: fixed; z-index: 60; width: min(372px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto;
  background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: 16px;
  box-shadow: 0 22px 54px rgba(29, 38, 34, 0.18), 0 2px 8px rgba(29, 38, 34, 0.06);
  opacity: 0; transform: scale(0.96) translateY(-4px);
  transition: opacity 170ms var(--sl-ease), transform 260ms var(--sl-ease);
}
.care-pop.is-open { opacity: 1; transform: none; }
.care-pop.is-closing { opacity: 0; transform: scale(0.97); transition-duration: 150ms; }
.care-pop__body { padding: 14px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.care-pop__x {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; border: 0; border-radius: 9px;
  background: transparent; color: var(--sl-muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background var(--sl-dur-1), color var(--sl-dur-1);
}
.care-pop__x svg { width: 17px; height: 17px; }
.care-pop__x:hover { background: var(--sl-surface-2); color: var(--sl-ink); }
.care-pop__head { display: flex; flex-direction: column; gap: 2px; padding-right: 30px; }
.care-pop__head b { font-size: 15px; font-weight: 600; line-height: 1.3; }
.care-pop__head small { font-size: 12.5px; color: var(--sl-ink-2); }
.care-step { display: flex; flex-direction: column; gap: 12px; }
.care-pop__hint { margin: 0; padding: 8px 11px; border-radius: 10px; background: var(--sl-surface-2); color: var(--sl-ink-2); font-size: 12.5px; line-height: 1.4; }
.care-pop__dl { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: 13.5px; }
.care-pop__dl dt { color: var(--sl-muted); }
.care-pop__dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.care-state--done { color: var(--sl-accent-dark); font-weight: 600; }
.care-state--overdue { color: var(--sl-danger-ink); font-weight: 600; }
.care-state--today { color: var(--sl-accent-dark); font-weight: 600; }
.care-state--requested { color: var(--sl-sand-ink); font-weight: 600; }
.care-state--missed { color: var(--sl-muted); }
.care-pop__scrim {
  position: fixed; inset: 0; z-index: 59; background: rgba(29, 38, 34, 0.32);
  opacity: 0; transition: opacity 220ms var(--sl-ease);
}
.care-pop__scrim.is-open { opacity: 1; }
.care-pop--sheet {
  left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-height: 86dvh;
  border-radius: 20px 20px 0 0; border-bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translateY(100%); opacity: 1;
  transition: transform 340ms var(--sl-ease);
}
.care-pop--sheet::before { content: ""; display: block; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: #D3DDD7; }
.care-pop--sheet.is-open { transform: none; }
.care-pop--sheet.is-closing { transform: translateY(100%); opacity: 1; transition-duration: 200ms; }
.care-pop--sheet .care-pop__body { padding: 8px 16px 16px; }
.care-pop--sheet .care-pop__x { top: 12px; }

/* Формы в окне */
.care-form { display: flex; flex-direction: column; gap: 12px; }
.care-field { display: flex; flex-direction: column; gap: 6px; }
.care-field__label { font-size: 12.5px; font-weight: 500; color: var(--sl-ink-2); }
.care-field__hint { font-size: 12px; line-height: 1.4; color: var(--sl-muted); }
.care-input {
  width: 100%; min-height: 38px; padding: 8px 11px; border-radius: 10px;
  border: 1px solid var(--sl-line); background: var(--sl-surface-2); color: var(--sl-ink);
  font: inherit; font-size: 14px; line-height: 1.45;
  transition: border-color var(--sl-dur-1), box-shadow var(--sl-dur-1), background var(--sl-dur-1);
}
.care-input:focus { outline: none; border-color: var(--sl-accent); background: var(--sl-surface); box-shadow: var(--sl-focus); }
.care-input--area { min-height: 80px; resize: none; }
.care-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.care-chip {
  height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid #D3DDD7; background: var(--sl-surface);
  color: #33413B; font: inherit; font-size: 12.5px; cursor: pointer;
  transition: background var(--sl-dur-1), color var(--sl-dur-1), border-color var(--sl-dur-1), transform var(--sl-dur-1) var(--sl-ease);
}
.care-chip:hover { background: var(--sl-surface-2); }
.care-chip:active { transform: scale(0.95); }
.care-chip[aria-pressed="true"] { background: var(--sl-accent); border-color: var(--sl-accent); color: #FFFFFF; }
.care-form__err { margin: 0; padding: 8px 11px; border-radius: 10px; background: var(--sl-danger); color: var(--sl-danger-ink); font-size: 13px; }
.care-form__err[hidden] { display: none; }
.care-form__bar { display: flex; justify-content: flex-end; gap: 6px; }
.care-form__bar .care-btn { height: 34px; padding: 0 14px; }

/* ---------- «Сопровождение»: дела на сегодня ---------- */

.care-wrap { flex: 1; width: 100%; min-width: 0; max-width: 1180px; margin: 0 auto; padding: 16px 28px 40px; display: flex; flex-direction: column; gap: 14px; }
.care-head { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.care-head__titles { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex-wrap: wrap; margin-right: auto; }
.care-head__day { color: var(--sl-ink); font-weight: 500; }
.care-groups { display: flex; flex-direction: column; gap: 14px; transition: opacity var(--sl-dur-2); }
.care-groups.is-loading { opacity: 0.55; }
.care-group { background: var(--sl-surface); border: 1px solid var(--sl-line); border-radius: 18px; padding: 6px 0 4px; overflow: hidden; }
.care-group__head { margin: 0; min-height: 40px; padding: 4px 18px 2px; display: flex; align-items: center; gap: 8px; font: inherit; }
.care-group__hint { margin-left: auto; font-size: 12px; color: var(--sl-muted); }
.care-group__toggle {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 -8px; padding: 4px 8px; border: 0; border-radius: 9px;
  background: transparent; font: inherit; cursor: pointer; transition: background var(--sl-dur-1);
}
.care-group__toggle:hover { background: var(--sl-surface-2); }
.care-group__chev { width: 16px; height: 16px; color: var(--sl-muted); transition: transform var(--sl-dur-3) var(--sl-ease); }
.care-group__toggle[aria-expanded="true"] .care-group__chev { transform: rotate(180deg); }
.care-group.is-collapsed .care-rows { display: none; }
.care-group.is-collapsed { padding-bottom: 6px; }
.care-group--alerts { border-color: #EBC2B9; background: linear-gradient(180deg, #FDF4F2 0, var(--sl-surface) 64px); }
.care-group--alerts .slp-cap { color: var(--sl-danger-ink); }
.care-group--alerts .slp-count { background: var(--sl-danger-ink); color: #FFFFFF; }
.care-group--overdue .slp-count { background: var(--sl-danger); color: var(--sl-danger-ink); }
.care-group--waiting .slp-count { background: var(--sl-sand); color: var(--sl-sand-ink); }

.care-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.care-row {
  position: relative; display: grid; align-items: center; gap: 6px 16px; padding: 9px 18px;
  grid-template-columns: minmax(200px, 250px) minmax(0, 1fr) auto;
  border-top: 1px solid #EEF2EF;
  transition: background var(--sl-dur-2) var(--sl-ease);
}
.care-row:first-child { border-top-color: transparent; }
.care-row:hover { background: #F9FBFA; }
.care-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.care-row--overdue::before { background: var(--sl-danger-ink); }
.care-row--today::before { background: var(--sl-accent); }
.care-row--requested::before { background: #C29247; }
.care-row--alert::before { background: var(--sl-danger-ink); }
.care-row__who { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; text-decoration: none; border-radius: 10px; }
.care-row__who:hover .care-row__name { color: var(--sl-accent-dark); text-decoration: underline; text-decoration-color: #C9DCD2; text-underline-offset: 3px; }
.care-row__avatar { flex: 0 0 36px; height: 36px; font-size: 13px; }
.care-row:hover .care-row__avatar { transform: scale(1.05); }
.care-row__names { min-width: 0; display: flex; flex-direction: column; }
.care-row__name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.care-row__sub { font-size: 12px; color: var(--sl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.care-row__main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.care-row__title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; font-weight: 500; }
.care-row__state { font-size: 12.5px; color: var(--sl-ink-2); }
.care-row--overdue .care-row__state { color: var(--sl-danger-ink); }
.care-row--requested .care-row__state { color: var(--sl-sand-ink); }
.care-row--today .care-row__state { color: var(--sl-accent-dark); font-weight: 500; }
.care-row__resp { color: var(--sl-muted); font-weight: 400; }
.care-row__quote { font-size: 13.5px; color: var(--sl-ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.care-row__acts { display: flex; justify-content: flex-end; }
.care-tag { flex: 0 0 auto; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.care-tag--alert { background: var(--sl-danger-ink); color: #FFFFFF; }
.care-row.is-done { background: var(--sl-tint); }
.care-row.is-done::after, .care-row.is-skipped::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%;
  background: var(--sl-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8.5' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
  animation: care-check 420ms var(--sl-ease-spring) both;
}
.care-row.is-skipped { background: var(--sl-surface-2); }
.care-row.is-skipped::after { background-color: #9DAFA6; }
.care-row:is(.is-done, .is-skipped) .care-row__acts { opacity: 0; transition: opacity 120ms; }
.care-enter { animation: sl-rise var(--sl-dur-3) var(--sl-ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
@keyframes care-check { from { opacity: 0; transform: scale(0.4); } }
.care-empty { margin: 36px 12px; }
.care-empty .slp-link { align-self: center; }
.care-foot { margin: 2px 4px 0; font-size: 12px; color: var(--sl-muted); text-align: center; }

@media (max-width: 1040px) {
  .care-row { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr) auto; gap: 6px 12px; }
}

@media (max-width: 860px) {
  .care-wrap { padding: 8px 12px 24px; gap: 12px; }
  .care-head { gap: 8px; }
  .care-head__titles { flex-direction: column; align-items: flex-start; gap: 2px; }
  .care-head .slp-sub { white-space: normal; }
  .care-scope { flex: 1 1 100%; }
  .care-group__head { padding: 4px 14px 2px; flex-wrap: wrap; }
  .care-group__hint { flex: 1 1 100%; margin: 0 0 4px; }
  .care-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 11px 14px 12px; }
  .care-row__main { padding-left: 47px; }
  .care-row__acts { justify-content: flex-start; padding-left: 47px; }
  .care-row.is-done::after, .care-row.is-skipped::after { top: 22px; right: 14px; }
  .care-strip { width: calc(100% - 16px); margin-top: 8px; }
  .care-alert { flex-wrap: wrap; }
  .care-alert__acts { flex: 1 1 100%; justify-content: flex-start; padding-left: 42px; }
  /* «Общение» на телефоне: полоса компактная — переписке нужно место */
  .care-strip .care-alert { gap: 4px 10px; padding: 9px 10px; }
  .care-strip .care-alert__mark { flex-basis: 26px; height: 26px; }
  .care-strip .care-alert__mark .care-i { width: 14px; height: 14px; }
  .care-strip .care-alert__title { font-size: 13.5px; }
  .care-strip .care-alert__quote { font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .care-strip :is(.care-alert__meta, .care-alert__note) { display: none; }
  .care-strip .care-alert__acts { padding-left: 36px; }
  .slp-next__acts.care-next { padding-left: 0; }
  .care-more { display: none; }
  .care-entry { position: relative; }
  .care-entry .care-entry__n { position: absolute; top: -6px; right: -6px; margin: 0; box-shadow: 0 0 0 2px var(--sl-ground); }
  .care-ms-hit { inset: 0 -8px; }
}
@media (max-width: 640px) {
  .care-pop:not(.care-pop--sheet) { left: 12px !important; right: 12px; width: auto; }
}
