/* Стиль "soft" (тёплый): спокойный продуктовый вид. Onest, сгруппированные скруглённые блоки,
   тонкая рамка и низкая тень, плоские монограммы без декора, чипы времени, липкая нижняя панель.
   Цвета читают только переменные. Светлая тема задана здесь, "тёмную" и "фирменную" досчитывает
   сервер из акцента организации (theme.py) отдельным блоком <style nonce> и перекрывает переменные
   акцента и нейтральных тонов. Раскладка и механика - в base.css. */

@font-face { font-family: 'Onest'; font-weight: 100 900; font-display: swap;
  src: url(../fonts/onest-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-weight: 100 900; font-display: swap;
  src: url(../fonts/onest-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Onest'; font-weight: 100 900; font-display: swap;
  src: url(../fonts/onest-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Переменные: светлая тема ---------- */
:root,
html[data-theme="light"],
html[data-theme="brand"] {
  color-scheme: light;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #F2F6F2; --bg-deep: #E7EEE8;
  --surface: #FFFFFF; --surface-2: #F5F8F5; --plate: #FFFFFF;
  --line: rgba(22, 48, 28, 0.09); --line-strong: rgba(22, 48, 28, 0.18);
  --ink: #142319; --ink-2: #465A4D; --ink-3: #5A6D60;
  --accent: #2E7D32; --accent-hover: #256A29; --on-accent: #FFFFFF; --accent-ink: #2A7430;
  --accent-soft: #E3F0E4; --accent-soft-ink: #1D5C22; --accent-line: rgba(46, 125, 50, 0.28);
  --danger: #B3261E; --danger-bg: #FCEBE9; --danger-solid: #B3261E;
  --warn-bg: #FFF3DA; --warn-ink: #7A4B00;
  --scrim: rgba(14, 24, 17, 0.42);
  --shadow-s: 0 1px 2px rgba(16, 40, 22, 0.05), 0 8px 20px -10px rgba(16, 40, 22, 0.14);
  --shadow-bar: 0 -8px 24px -12px rgba(16, 40, 22, 0.18);
  --shadow-pop: 0 24px 60px -12px rgba(16, 40, 22, 0.35);
  /* Тона монограмм: у каждого человека свой, подложка плоская */
  --av-0: #DDEFDF; --av-0t: #1D5C22;
  --av-1: #E1ECF9; --av-1t: #1D4A80;
  --av-2: #FBE5CF; --av-2t: #7A3E08;
  --av-3: #FADCE0; --av-3t: #8A2336;
  --av-4: #E9E2F7; --av-4t: #4A3592;
  --av-5: #D6EEEA; --av-5t: #0D5A52;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Переменные: тёмная (акцент и нейтральные тона досчитывает сервер) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1511; --bg-deep: #0A0F0C;
  --surface: #171E1B; --surface-2: #1F2723; --plate: rgba(255, 255, 255, 0.94);
  --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.17);
  --ink: #ECEFEE; --ink-2: #AEB5B1; --ink-3: #939A96;
  --accent: #6DA470; --accent-hover: #81B184; --on-accent: #0F1A0F; --accent-ink: #6DA470;
  --accent-soft: #26362A; --accent-soft-ink: #A0C4A2; --accent-line: rgba(109, 164, 112, 0.38);
  --danger: #FF8A80; --danger-bg: rgba(255, 138, 128, 0.14); --danger-solid: #C62828;
  --warn-bg: rgba(255, 183, 77, 0.13); --warn-ink: #FFC77A;
  --scrim: rgba(0, 0, 0, 0.6);
  --shadow-s: 0 0 0 0.5px rgba(255, 255, 255, 0.03), 0 10px 24px -12px rgba(0, 0, 0, 0.7);
  --shadow-bar: 0 -10px 28px -10px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, 0.8);
  --av-0: #26362A; --av-0t: #A0C4A2;
  --av-1: #20324A; --av-1t: #9DC0F0;
  --av-2: #43301C; --av-2t: #F2C48E;
  --av-3: #46242C; --av-3t: #F4A8B5;
  --av-4: #31294A; --av-4t: #C3B5F0;
  --av-5: #1B3A37; --av-5t: #8DD5CB;
}
/* Служебные страницы (404, ошибки) не знают тему организации и идут за системной */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
    --bg: #0E1511; --bg-deep: #0A0F0C;
    --surface: #171E1B; --surface-2: #1F2723; --plate: rgba(255, 255, 255, 0.94);
    --line: rgba(255, 255, 255, 0.08); --line-strong: rgba(255, 255, 255, 0.17);
    --ink: #ECEFEE; --ink-2: #AEB5B1; --ink-3: #939A96;
    --accent: #6DA470; --accent-hover: #81B184; --on-accent: #0F1A0F; --accent-ink: #6DA470;
    --accent-soft: #26362A; --accent-soft-ink: #A0C4A2; --accent-line: rgba(109, 164, 112, 0.38);
    --danger: #FF8A80; --danger-bg: rgba(255, 138, 128, 0.14); --danger-solid: #C62828;
    --warn-bg: rgba(255, 183, 77, 0.13); --warn-ink: #FFC77A;
    --scrim: rgba(0, 0, 0, 0.6);
    --shadow-s: 0 0 0 0.5px rgba(255, 255, 255, 0.03), 0 10px 24px -12px rgba(0, 0, 0, 0.7);
    --shadow-bar: 0 -10px 28px -10px rgba(0, 0, 0, 0.7);
    --shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, 0.8);
  }
}

/* ---------- Основа ---------- */
body {
  font-family: var(--font); font-size: 15px; line-height: 1.4;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-ink); text-decoration: none; }
h1, h2, h3 { letter-spacing: -0.01em; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 12px; }
.page { max-width: 560px; margin: 0 auto; }
.content { padding: 14px 16px 8px; }

/* ---------- Группа: скруглённый блок со строками внутри ---------- */
.group, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow-s); overflow: hidden;
}
.card { padding: 16px; }
.muted { color: var(--ink-2); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 16px; border: 1px solid transparent;
  font-size: 16px; font-weight: 600; letter-spacing: 0.005em; text-decoration: none; line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 500; font-size: 15px; }
.btn--danger { color: var(--danger); }
.btn--danger-fill { background: var(--danger-solid); color: #FFFFFF; }
.btn--ghost { background: transparent; color: var(--ink-2); font-weight: 500; font-size: 15px; }
.btn--block { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 16px; border-radius: 14px; font-size: 15px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.btn .icon { margin-right: -2px; }
.spec__cta .icon { display: none; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--accent-hover); }
  .btn--secondary:hover { background: var(--surface-2); }
  .btn--ghost:hover { background: var(--surface-2); }
  .btn--danger:hover { background: var(--danger-bg); }
}
.icon-btn {
  display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ink); text-decoration: none;
}
.icon-btn--round { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-s); }
.icon-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); }
.icon-btn[disabled] { opacity: 0.3; }
@media (hover: hover) { .icon-btn:not(.icon-btn--round):not([disabled]):hover { background: var(--surface-2); } }
.link-btn {
  min-height: 44px; padding: 0 4px; border: 0; background: none; font-size: 14px; font-weight: 600;
  color: var(--accent-ink); cursor: pointer;
}

/* ---------- Лицо организации: логотип или инициал ---------- */
.brand { display: flex; align-items: center; min-width: 0; }
.brand__plate {
  display: inline-flex; align-items: center; height: 48px; padding: 6px 12px; border-radius: 14px;
  background: var(--plate); border: 1px solid var(--line); box-shadow: var(--shadow-s); min-width: 0;
}
.brand__logo { max-height: 34px; max-width: 200px; width: auto; height: auto; object-fit: contain; }
.brand__mark {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 15px;
  background: var(--accent); color: var(--on-accent); font-size: 22px; font-weight: 700; line-height: 1;
}

/* ---------- Монограмма специалиста: плоская подложка ---------- */
.avatar {
  display: grid; place-items: center; flex: none; overflow: hidden; width: 48px; height: 48px; border-radius: 15px;
  font-size: 17px; font-weight: 600; letter-spacing: 0.02em; background: var(--av-0); color: var(--av-0t);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.av-1 { background: var(--av-1); color: var(--av-1t); }
.av-2 { background: var(--av-2); color: var(--av-2t); }
.av-3 { background: var(--av-3); color: var(--av-3t); }
.av-4 { background: var(--av-4); color: var(--av-4t); }
.av-5 { background: var(--av-5); color: var(--av-5t); }

/* ---------- Организация: шапка ---------- */
.hero { padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 0; }
.hero__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.hero__actions { display: flex; gap: 8px; }
.hero__actions .icon-btn { color: var(--accent-ink); }
.hero__title { margin-top: 14px; font-size: 25px; line-height: 29px; letter-spacing: -0.012em; text-wrap: balance; overflow-wrap: anywhere; }
.hero__desc { margin-top: 8px; font-size: 14.5px; line-height: 21px; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.contacts { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.contact { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 13.5px; color: var(--ink-2); }
.contact__icon { display: grid; place-items: center; flex: none; color: var(--accent-ink); }
.contact__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.contact__value { overflow-wrap: anywhere; }
.howto { display: none; }

.section-head { margin: 18px 4px 10px; }
.section-title { font-size: 18px; letter-spacing: -0.006em; }
.section-sub { display: none; }

/* Узкая строка при прокрутке */
.minibar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px); transition: transform 0.2s var(--ease), visibility 0.2s;
}
.minibar__in { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 8px 0 16px; max-width: 560px; margin: 0 auto; }
.minibar__name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibar .icon-btn { color: var(--accent-ink); }

/* ---------- Карточка специалиста на странице организации ---------- */
.spec-list { display: grid; gap: 10px; }
.spec {
  display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 12px 14px 14px;
  grid-template-areas: "head head" "about about" "near cta";
  animation: rise 0.3s var(--ease) both; overflow: visible;
}
.spec:nth-child(2) { animation-delay: 0.04s; }
.spec:nth-child(n+3) { animation-delay: 0.08s; }
.spec__head { grid-area: head; display: flex; align-items: center; gap: 12px; min-width: 0; }
.spec__avatar { display: block; flex: none; }
.spec__who { flex: 1; min-width: 0; }
.spec__name { font-size: 16px; line-height: 21px; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.spec__name a { color: var(--ink); }
.spec__title { margin-top: 1px; font-size: 13.5px; line-height: 18px; color: var(--ink-2); overflow-wrap: anywhere; }
.spec__head .icon-btn { margin: -4px -8px -4px 0; color: var(--ink-3); }
.spec__about { grid-area: about; }
.about { margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.spec__near { grid-area: near; margin-top: 10px; min-width: 0; align-self: end; }
.spec__near-label { margin-bottom: 4px; font-size: 12.5px; line-height: 16px; font-weight: 500; color: var(--ink-3); }
.spec__cta { grid-area: cta; align-self: end; min-height: 44px; padding: 0 16px; border-radius: 14px; font-size: 15px; }
.spec__all { display: none; }
.chips { display: flex; gap: 6px; }
.chip {
  display: grid; place-items: center; min-width: 58px; min-height: 44px; padding: 0 10px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums; text-decoration: none; transition: background 0.15s, color 0.15s;
}
.chip:nth-child(n+4) { display: none; }
@media (hover: hover) { .chip:hover { background: var(--accent); color: var(--on-accent); } }
.spec--idle { grid-template-areas: "head head" "about about" "near near"; }
.no-slots { margin-bottom: 10px; font-size: 14px; color: var(--ink-2); }

.empty { text-align: center; padding: 28px 16px; color: var(--ink-2); }
.empty__icon { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-ink); }
.empty__title { margin-bottom: 4px; font-size: 16px; font-weight: 600; color: var(--ink); }

.foot { padding: 22px 20px calc(22px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 0 16px; justify-content: center; }

/* ---------- Запись: шапка шага, прогресс, карточка специалиста ---------- */
.flow-head {
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 4px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 0;
}
.flow-head__title { text-align: center; min-width: 0; }
.flow-head__name { font-size: 16.5px; line-height: 20px; letter-spacing: -0.005em; }
.flow-head__step { font-size: 12.5px; line-height: 16px; color: var(--ink-2); }
.stepper { display: flex; gap: 6px; padding: 10px 20px 0; }
.stepper li { flex: 1; min-width: 0; }
.stepper__bar { height: 4px; border-radius: 2px; background: var(--line-strong); transition: background 0.25s; }
.stepper li.is-done .stepper__bar, .stepper li.is-current .stepper__bar { background: var(--accent); }
.stepper li.is-done { cursor: pointer; }
.stepper__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.page--flow .content { padding-top: 16px; }
.page--flow .foot { display: none; }
.who__row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px 10px 10px; }
.who .avatar { width: 40px; height: 40px; border-radius: 13px; font-size: 15px; }
.who__text { flex: 1; min-width: 0; }
.who__name { font-size: 15px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who__sub { font-size: 13px; line-height: 17px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who__act { flex: none; }
.who__more {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 0 16px;
  border: 0; border-top: 1px solid var(--line); background: none; font-size: 13.5px; font-weight: 600; color: var(--ink-2); text-align: left;
}
.who__more .icon { transition: transform 0.2s var(--ease); }
.who__more[aria-expanded="true"] .icon { transform: rotate(180deg); }
.who .about { margin: 0 12px 12px; }

.stage { outline: none; }
.stage.enter { animation: rise 0.28s var(--ease) both; }
.step-title { margin: 22px 4px 12px; font-size: 22px; line-height: 27px; letter-spacing: -0.012em; }
.step-title--quiet { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* Услуги */
.services { display: grid; gap: 10px; }
.cat { margin: 8px 4px 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.service {
  display: flex; align-items: flex-start; gap: 14px; padding: 16px; border-radius: 22px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-s);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.service.is-selected {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-s);
}
.service:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.service__radio {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--on-accent);
}
.service.is-selected .service__radio { background: var(--accent); border-color: var(--accent); }
.service__main { display: block; flex: 1; min-width: 0; }
.service__name { display: block; font-size: 16.5px; line-height: 22px; font-weight: 600; letter-spacing: -0.006em; overflow-wrap: anywhere; }
.service__desc { display: block; margin-top: 3px; font-size: 13.5px; line-height: 19px; color: var(--ink-2); overflow-wrap: anywhere; }
.service__meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin-top: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pill--accent { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: transparent; font-weight: 600; }
/* Длительность и цена услуги: таблетки; число и единица (.svc__dur-num, .svc__dur-unit) в одной строке */
.svc__dur-num { font-variant-numeric: tabular-nums; }

/* Дата: лента дней и сетка месяца */
.cal__head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 14px 0 4px; }
.cal__title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.cal__nav { gap: 2px; margin-right: -8px; }
.cal--strip .cal__days { gap: 8px; margin: 0 -16px; padding: 4px 16px 10px; scroll-padding: 0 16px; }
.day {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 56px; height: 76px; padding: 0; border-radius: 18px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-s); color: var(--ink);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.day__dow { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-2); }
.day__num { font-size: 20px; line-height: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.day:active:not([disabled]) { transform: scale(0.96); }
.day[disabled] { background: transparent; box-shadow: none; border-style: dashed; border-color: var(--line-strong); }
.day[disabled] .day__dow, .day[disabled] .day__num { color: var(--ink-3); font-weight: 500; }
.day--today:not(.day--sel) .day__num { color: var(--accent-ink); }
.day--sel, .day--sel:hover { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 18px -8px var(--accent-line); }
.day--sel .day__dow, .day--sel .day__num { color: var(--on-accent); }
.cal__skel .day { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.tz-note { margin: 12px 4px 0; font-size: 12.5px; color: var(--ink-3); }
/* Сетка месяца (strict): те же дни, но компактнее */
.cal--month { margin-top: 16px; padding: 4px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-s); }
.cal--month .cal__head { margin: 6px 0 2px; }
.cal--month .cal__dow, .cal--month .cal__days { gap: 4px; }
.cal__dow span { padding: 8px 0 6px; text-align: center; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.cal--month .day { width: auto; height: 44px; flex-direction: row; border-radius: 12px; border: 0; box-shadow: none; background: transparent; }
.cal--month .day__num { font-size: 15.5px; line-height: 20px; }
.cal--month .day--avail { background: var(--accent-soft); }
.cal--month .day--avail .day__num { color: var(--accent-soft-ink); }
.cal--month .day[disabled] { border: 0; }
.cal--month .day--sel { background: var(--accent); box-shadow: none; }
.cal--month .day--sel .day__num { color: var(--on-accent); }

/* Время: группы Утро, День, Вечер */
.times__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 14px 4px 8px; }
.times__title { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.times__count { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.slot-group { padding: 12px 14px 14px; }
.slot-group + .slot-group { border-top: 1px solid var(--line); }
.slot-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.slot-group__head .icon { color: var(--accent-ink); }
.slot-group__range { margin-left: auto; font-size: 12.5px; font-weight: 400; color: var(--ink-3); }
.slot-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot {
  min-height: 44px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 15.5px; font-weight: 500; font-variant-numeric: tabular-nums;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
@media (hover: hover) { .slot:hover { border-color: var(--line-strong); background: var(--surface); } }
.slot:active { transform: scale(0.96); }
.slot.is-selected { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 0 8px 18px -8px var(--accent-line); }
.skeleton { border-radius: 14px; background-image: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); }
.skeleton--slot { height: 44px; }
.times__title .skeleton--slot { width: 60%; height: 24px; }

/* ---------- Форма ---------- */
.fields { margin-top: 16px; }
.field { display: flex; flex-direction: column; position: relative; min-height: 62px; padding: 9px 16px; }
.field + .field { border-top: 1px solid var(--line); }
.field__label { order: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-2); }
.field__opt { flex: none; font-size: 12px; font-weight: 400; color: var(--ink-3); }
.field__opt--inline { margin-left: 4px; }
.field .input, .field .select, .field .check { order: 2; }
.field__hint { order: 4; margin-top: 2px; font-size: 12.5px; line-height: 17px; color: var(--ink-3); }
.field__error { order: 5; margin-top: 4px; font-size: 13px; line-height: 17px; font-weight: 500; color: var(--danger); }
.input {
  display: block; width: 100%; min-height: 24px; margin-top: 1px; padding: 0; border: 0; border-radius: 0; background: transparent;
  font-size: 16.5px; line-height: 24px; font-weight: 500; color: var(--ink); outline: none;
  -webkit-appearance: none; appearance: none;
}
textarea.input { min-height: 72px; resize: none; font-weight: 400; line-height: 23px; }
.input::placeholder { color: var(--ink-3); opacity: 1; font-weight: 400; }
.select {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 24px; margin-top: 1px;
  padding: 0; border: 0; background: none; font-size: 16.5px; line-height: 24px; font-weight: 500; text-align: left; color: var(--ink);
}
.select__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select.is-empty .select__value { color: var(--ink-3); font-weight: 400; }
.select .icon { color: var(--ink-3); }
.field:focus-within { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--surface); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.field:focus-within .field__label { color: var(--accent-ink); }
.field--error, .field--error:focus-within { box-shadow: inset 0 0 0 1.5px var(--danger); }
.field--error .field__label { color: var(--danger); }
.field .select:focus-visible { outline: none; }

.check { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0; cursor: pointer; }
.fields .check { padding: 8px 0; }
.check__box {
  display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 8px;
  background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--on-accent);
  transition: background 0.15s, border-color 0.15s;
}
.check__input:checked + .check__box { background: var(--accent); border-color: var(--accent); }
.check__input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check__text { flex: 1; min-width: 0; font-size: 14px; line-height: 20px; color: var(--ink-2); }
.field--error .check__box { border-color: var(--danger); }

.consent { margin: 14px 0 20px; padding: 0 4px; }
.consent .field, .consent .field:focus-within { min-height: 0; padding: 0; border: 0; box-shadow: none; background: none; }
.consent .field + .field { margin-top: 8px; }
.consent__more { margin: 2px 0 8px 36px; font-size: 13px; color: var(--ink-2); }
.consent__more a, .consent .check__text a { color: var(--accent-ink); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.consent__more .link-btn { min-height: 28px; padding: 0; font-size: 13px; font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.consent__text { margin: 4px 0 10px 36px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; line-height: 1.5; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
#form-banner:empty { display: none; }

.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.notice .icon { margin-top: 1px; }
.notice--info { background: var(--accent-soft); color: var(--accent-soft-ink); }
.notice--warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice--error { background: var(--danger-bg); color: var(--danger); font-weight: 500; }
.notice__body { flex: 1; min-width: 0; }
.notice__body a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.notice__action { margin-top: 6px; }

/* ---------- Нижняя панель действий ---------- */
.actionbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, calc((100% - 528px) / 2)) calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-bar);
}
.actionbar__sum { flex: 1; min-width: 0; }
.actionbar__small { display: block; font-size: 12px; line-height: 15px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actionbar__strong { display: block; font-size: 14.5px; line-height: 19px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actionbar .btn { flex: none; }
.actionbar--solo .actionbar__sum { display: none; }
.actionbar--solo .btn { flex: 1; }
.actionbar--stack { flex-direction: column; align-items: stretch; gap: 10px; }
.actionbar--stack .btn { flex: none; }
.actionbar__pair { display: flex; gap: 10px; }
.actionbar__pair .btn { flex: 1; min-height: 48px; }

/* ---------- Страница записи (управление) ---------- */
.pagebar { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 0; }
.pagebar__back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-right: 12px; max-width: 100%; font-size: 15px; font-weight: 500; color: var(--ink-2); }
.pagebar__back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { padding: 14px 8px 22px; text-align: center; animation: rise 0.35s var(--ease) both; }
.status__badge { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; background: var(--accent); color: var(--on-accent); }
.status__title { margin-top: 10px; font-size: 28px; line-height: 32px; letter-spacing: -0.018em; }
.status__badge + .status__title { margin-top: 0; }
.status__text { max-width: 330px; margin: 8px auto 0; font-size: 14.5px; line-height: 21px; color: var(--ink-2); text-wrap: balance; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge--ok { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: transparent; }
.badge--off { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.detail__row { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 11px 16px 11px 12px; }
.detail__row + .detail__row { border-top: 1px solid var(--line); }
.detail .avatar { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }
.detail__icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-ink); }
.detail__text { min-width: 0; flex: 1; }
.detail__label { font-size: 12px; line-height: 15px; font-weight: 500; color: var(--ink-3); }
.detail__value { font-size: 15px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.detail__sub { font-size: 13px; line-height: 17px; color: var(--ink-2); }
/* Дата и время записи: части (.when__*) складываются порядком flex. Строка 1 - день недели и число жирно,
   строка 2 - время мельче; разделители рисуют псевдоэлементы, в разметке их нет */
.when__vis { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.3em; }
.when__weekday, .when__dm { font-size: 15px; line-height: 20px; font-weight: 600; }
.when__weekday { order: 1; }
.when__weekday:not(:last-child)::after { content: ","; }
.when__dm { order: 2; }
.when__vis::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
.when__start, .when__end, .when__tz { font-size: 13px; line-height: 17px; color: var(--ink-2); }
.when__start { order: 4; }
.when__end { order: 5; }
.when__end::before { content: "- "; }
.when__end:not(:last-child)::after { content: ","; }
.when__tz { order: 6; }
.manage-msg:empty { display: none; }
.manage-msg, .page--manage .notice { margin-top: 14px; }
.page--manage .notice { margin-bottom: 0; }
.resched { margin-top: 18px; animation: rise 0.28s var(--ease) both; }
.resched__actions { margin-top: 14px; }

/* ---------- Документы и служебные страницы ---------- */
.doc__title { margin: 8px 4px 14px; font-size: 24px; line-height: 1.2; letter-spacing: -0.014em; }
.doc__body { padding: 18px; }
.doc__body p { font-size: 14.5px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.doc__body p + p { margin-top: 12px; }
.err { padding: 84px 24px 24px; text-align: center; }
.err__art { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 20px; background: var(--accent-soft); color: var(--accent-ink); }
.err__title { font-size: 24px; line-height: 1.2; letter-spacing: -0.014em; }
.err__text { max-width: 360px; margin: 10px auto 24px; color: var(--ink-2); }

/* ---------- Листы ---------- */
.sheet-backdrop { background: var(--scrim); animation: fade 0.2s ease both; }
.sheet {
  background: var(--surface); color: var(--ink); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-pop);
  animation: sheet-up 0.28s var(--ease) both;
}
.sheet__head { padding: 14px 8px 4px 20px; }
.sheet__title { font-size: 17px; line-height: 22px; overflow-wrap: anywhere; }
.sheet__body { padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.sheet__actions { display: grid; gap: 10px; margin-top: 18px; }
.sheet__text { font-size: 14.5px; line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; }
.sheet__text p + p { margin-top: 10px; }
.sheet__text a { text-decoration: underline; text-underline-offset: 3px; }
.options { display: grid; gap: 2px; margin: 0 -8px; }
.option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 0; border-radius: 14px; background: transparent; font-size: 15.5px; text-align: left; color: var(--ink);
}
.option:hover, .option:focus-visible { background: var(--surface-2); }
.option[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; }
@media (min-width: 600px) { .sheet { border-radius: 22px; animation-name: pop-in; } }

/* ---------- Широкий экран: рамка с панелью организации слева ---------- */
@media (min-width: 960px) {
  body { background: var(--bg-deep); }
  .minibar { display: none; }
  .page--org {
    display: grid; grid-template-columns: 332px 1fr; max-width: 960px; margin: 56px auto 0; overflow: hidden;
    background: var(--bg); border: 1px solid var(--line); border-radius: 30px;
    box-shadow: 0 1px 2px rgba(16, 40, 22, 0.06), 0 30px 60px -30px rgba(16, 40, 22, 0.28);
  }
  .page--org .hero {
    display: flex; flex-direction: column; padding: 32px 28px 28px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .page--org .hero__actions { display: none; }
  .page--org .hero__top { min-height: 0; }
  .page--org .hero__title { margin-top: 22px; font-size: 27px; line-height: 32px; }
  .page--org .hero__desc { margin-top: 10px; font-size: 15px; line-height: 23px; }
  .page--org .contacts { gap: 0; margin-top: 22px; border-top: 1px solid var(--line); }
  .page--org .contact { gap: 12px; min-height: 0; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .page--org .contact__icon { width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); }
  .page--org .contact__text { display: block; min-width: 0; }
  .page--org .contact__label { position: static; display: block; width: auto; height: auto; overflow: visible; clip: auto; font-size: 12px; line-height: 15px; font-weight: 500; color: var(--ink-3); }
  .page--org .contact__value { display: block; font-size: 15px; line-height: 20px; font-weight: 500; }
  .howto { display: block; margin-top: auto; padding: 16px 16px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; }
  .howto__title { margin-bottom: 8px; font-size: 14px; }
  .howto__list li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 13.5px; line-height: 18px; color: var(--ink-2); }
  .howto__num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 12.5px; font-weight: 600; }
  .page--org .contacts { margin-bottom: 28px; }
  .page--org .content { padding: 34px 32px 28px; }
  .section-head { margin: 0 0 20px; }
  .section-title { font-size: 28px; line-height: 32px; letter-spacing: -0.016em; }
  .section-sub { display: block; margin-top: 4px; font-size: 14.5px; color: var(--ink-2); }
  .spec-list { gap: 14px; }
  .spec { grid-template-columns: 1fr auto; padding: 20px; border-radius: 24px; grid-template-areas: "head cta" "about about" "near near"; }
  .spec .avatar { width: 56px; height: 56px; border-radius: 18px; font-size: 20px; }
  .spec__head { gap: 14px; }
  .spec__name { font-size: 17px; line-height: 23px; }
  .spec__title { font-size: 14.5px; line-height: 20px; }
  .spec__cta .icon { display: block; }
  .spec__cta { align-self: center; min-height: 48px; padding: 0 20px; border-radius: 15px; }
  .spec__near { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
  .spec__near-label { margin: 0; white-space: nowrap; }
  .spec__all { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; font-size: 14px; font-weight: 600; white-space: nowrap; }
  .spec--idle .spec__near { display: block; }
  .foot { padding-top: 26px; }
}
