/* ========================================================================
   ozim.qilaman · дизайн-система 2026 v2

   Плотный операционный интерфейс. Ключевые отличия от предыдущей версии:
   · Белый фон вместо серого — контент отделяется границами, а не подложкой
   · Границы вместо теней: 1px #E4E7EC. Тени только у оверлеев и primary-кнопок
   · Скругления жёстче: 6-14px вместо 12-32px
   · Цифры ВСЕГДА моноширинным IBM Plex Mono — колонки сумм выравниваются
   · Чёрные карточки #0B0D12 для ключевых метрик вместо цветных градиентов везде

   Имена классов сохранены от v1 — все шаблоны продолжают работать.
   ===================================================================== */

:root {
  /* ---- Текст ---- */
  --ink:        #0B0D12;
  --ink-2:      #3D4453;
  --ink-3:      #59606E;
  --ink-4:      #7A8290;
  --muted:      #949BA8;
  --muted-2:    #A6ADBA;
  --muted-3:    #C4C9D2;

  /* ---- Линии и границы ---- */
  --line:        #ECEEF2;
  --line-2:      #F2F4F7;
  --line-3:      #F5F6F8;
  --border:      #E4E7EC;
  --border-hover:#C9CFD8;
  --dashed:      #DDE1E8;
  --hairline:    #F0F1F3;
  --line-strong: #C9CFD8;

  /* ---- Поверхности ---- */
  --page-bg:    #FFFFFF;
  --card:       #FFFFFF;
  --surface:    #F1F3F6;
  --surface-2:  #F7F8FA;
  --surface-3:  #F1F3F6;
  --surface-4:  #FCFCFD;
  --surface-5:  #F4F5F7;
  --tab-bg:     #EFF1F5;
  --hover:      #F5F7FA;

  /* ---- Акцент ---- */
  --accent:       #2962FF;
  --accent-dark:  #1B44C8;
  --accent-deep:  #12307F;
  --accent-tint:  #EEF3FF;
  --accent-tint-2:#F7FAFF;
  --accent-soft:  #DCE7FF;
  --accent-pale:  #C9D8FF;

  /* ---- Тона состояний ---- */
  --green:      #12805C;
  --green-bg:   #E9F6F0;
  --green-bd:   #CDEADF;
  --green-fg:   #0C6449;
  --green-dim:  #5A8A78;

  --amber:      #E08C00;
  --amber-bg:   #FDF3E3;
  --amber-bg-2: #FDF9F0;
  --amber-bd:   #F2DEB8;
  --amber-fg:   #96560B;
  --amber-deep: #8A5006;
  --amber-dim:  #B08243;

  --red:        #E5484D;
  --red-bg:     #FCEDEB;
  --red-fg:     #C3352B;
  --red-deep:   #8E241D;

  --purple:     #6A45D9;
  --purple-bg:  #F0EBFC;
  --purple-fg:  #5A34C4;
  --purple-lite:#C7B4FF;

  --gold:       #A87A12;
  --gold-bg:    #FBF3E0;
  --gold-fg:    #8A6208;

  --tg:         #229ED9;

  /* ---- Семантика статусов (совместимость с v1) ---- */
  --status-pending:   #E08C00;
  --status-progress:  #2962FF;
  --status-done:      #12805C;
  --status-cancelled: #949BA8;
  --status-danger:    #C3352B;

  /* ---- Роли ---- */
  --role-owner-bg:  #EEF3FF;
  --role-owner-fg:  #1B44C8;
  --role-remote-bg: #F0EBFC;
  --role-remote-fg: #5A34C4;
  --role-onsite-bg: #F1F3F6;
  --role-onsite-fg: #59606E;

  /* ---- Тени: только оверлеи и primary ---- */
  --shadow-sm:      0 1px 2px rgba(11, 13, 18, 0.10);
  --shadow-md:      0 4px 16px rgba(11, 13, 18, 0.10);
  --shadow-lg:      0 12px 40px rgba(11, 13, 18, 0.16);
  --shadow-accent:  0 1px 2px rgba(41, 98, 255, 0.28);
  --shadow-accent-lg: 0 2px 6px rgba(41, 98, 255, 0.30);
  --shadow-glow:    0 2px 6px rgba(41, 98, 255, 0.30);
  --shadow-glow-lg: 0 4px 12px rgba(41, 98, 255, 0.30);

  /* ---- Радиусы ---- */
  --radius-xs:   6px;
  --radius-sm:   8px;
  --radius:      9px;
  --radius-md:   12px;
  --radius-lg:   14px;
  --radius-xl:   18px;
  --radius-2xl:  22px;
  --radius-pill: 99px;

  /* ---- Метрики ---- */
  --sidebar-w:  238px;
  --topbar-h:   60px;
}

/* ========================= БАЗА ========================= */

* { box-sizing: border-box; }

/* Двойной тап не приближает экран: быстро жмёшь «+» в кассе или две кнопки
   подряд — страница стоит на месте. Щипок пальцами остаётся. На каждом
   элементе, а не только на html: Safari считает это свойство только до
   ближайшего блока со своей прокруткой. Свои правила (подпись в акте —
   touch-action: none) перебивают это, у * специфичность нулевая. */
* { touch-action: manipulation; }

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

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }

::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: #DCE0E6;
  border: 3px solid var(--page-bg);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover { background: #BFC5CE; }
::-webkit-scrollbar-track { background: transparent; }

@keyframes blip { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================= ТИПОГРАФИКА ========================= */

.text-display,
.font-display {
  font-family: 'Onest', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.text-num,
.font-num,
.font-mono {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Запятая в «1,5»: в моноширинном она шириной с цифру — поджимаем. */
.num-comma { margin: 0 -0.16em; }
/* В крупной цифре карточки трекинг и так поджат — там запятой меньше. */
.bk-hcard-n .num-comma { margin: 0 -0.06em 0 -0.1em; }

/* ========================= ОБОЛОЧКА ========================= */

.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--page-bg);
}

.app-sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  position: sticky;
  top: 0;
  height: 100vh;
}

/* Рабочая область — слегка притушённая подложка.
   На чистом белом белые карточки с тонкой границей сливаются с фоном
   и экран читается как «пустой лист». Подложка даёт им объём. */
.app-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #F6F7F9;
}
/* Топбар и шапки таблиц остаются белыми — граница между зонами видна */
.app-content > main > .screen-topbar { background: var(--card); }

.sidebar-brand {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 10px;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--muted-2);
  padding: 14px 8px 6px;
  text-transform: uppercase;
}
.sidebar-scroll > .sidebar-section-label:first-child { padding-top: 8px; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--ink-2);
  margin-bottom: 1px;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}
.sidebar-item svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--muted-3);
  transition: color .12s ease;
}
.sidebar-item:hover { background: var(--surface-4); color: var(--ink); }
.sidebar-item:hover svg { color: var(--ink-3); }
.sidebar-item.is-active {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 500;
}
.sidebar-item.is-active svg { color: var(--accent); }

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  margin: 0 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-4);
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.sidebar-logout {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--muted-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 28px;
  transition: background .12s ease, color .12s ease;
}
.sidebar-logout:hover { background: var(--red-bg); color: var(--red-fg); }

/* ---- Топбар экрана (десктоп) ---- */
.screen-topbar {
  height: var(--topbar-h);
  flex: 0 0 var(--topbar-h);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  background: var(--page-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.screen-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
  color: var(--ink);
}

/* ========================= КАРТОЧКИ ========================= */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card-lg {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
}

.card-dim {
  background: var(--surface-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.card-tint {
  background: var(--accent-tint-2);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-lg);
}

/* Тёмная карточка ключевой метрики */
.card-ink {
  background: var(--ink);
  color: #fff;
  border: 1px solid var(--ink);
  border-radius: var(--radius-lg);
}
.card-ink .kpi-label,
.card-ink .card-label { color: rgba(255,255,255,.62); }
.card-ink .kpi-value { color: #fff; }

/* Градиентная карточка выручки */
.card-accent {
  background: linear-gradient(148deg, #2962FF 0%, #1B44C8 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
}
.card-accent .kpi-label { color: rgba(255,255,255,.72); }
.card-accent .kpi-value { color: #fff; }

/* Заголовок секции внутри карточки */
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.card-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

/* Стеклянные слои v1 — оставлены для обратной совместимости, но сплющены */
.glass, .glass-dim, .glass-strong {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: none;
}

/* ========================= КНОПКИ ========================= */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-accent);
  transition: background .12s ease;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
/* Уменьшенный вариант основной кнопки: в формах внутри карточек полноразмерная
   перевешивает содержимое. Класс использовался в разметке, но его не было. */
.btn-sm { padding: 8px 15px; font-size: 13px; }
.btn-primary:disabled,
.btn-primary[disabled] {
  background: var(--surface);
  color: var(--muted-3);
  cursor: default;
  box-shadow: none;
}
.btn-primary-block { width: 100%; }

.btn-accent { composes: btn-primary; }
.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-accent);
}
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

/* Тёмная кнопка — вторичное главное действие */
.btn-ink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border: none;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease;
}
.btn-ink:hover { background: #22262F; color: #fff; }
.btn-ink:disabled { background: var(--surface); color: var(--muted-3); cursor: default; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.btn-ghost:hover { background: var(--hover); color: var(--ink); }
.btn-ghost:disabled { color: var(--muted-3); cursor: default; }

.btn-ghost-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border: none;
  border-radius: var(--radius);
  background: var(--red-fg);
  color: #fff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease;
}
.btn-danger:hover { background: var(--red-deep); color: #fff; }
/* Как у основной: неактивная красная иначе выглядит нажимаемой. */
.btn-danger:disabled,
.btn-danger[disabled] {
  background: var(--surface);
  color: var(--muted-3);
  cursor: default;
}

.btn-success-soft {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--green-bd);
  border-radius: var(--radius);
  background: var(--green-bg);
  color: var(--green-fg);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.btn-success-soft:hover { background: #DCF0E7; }

/* Крупная кнопка действия (карточка брони, оплата) */
.btn-lg {
  height: 52px;
  padding: 0 26px;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .12s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn-sm { width: 30px; height: 30px; border-radius: var(--radius-sm); }
.icon-btn-square { border-radius: var(--radius-sm); }

/* ========================= ЧИПЫ / ПИЛЮЛИ ========================= */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--ink-3);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
}
.chip-lg { font-size: 12.5px; padding: 4px 10px; border-radius: var(--radius-sm); }

.chip-done      { background: var(--green-bg); color: var(--green-fg); }
.chip-progress  { background: var(--accent-tint); color: var(--accent-dark); }
.chip-accent    { background: var(--accent-tint); color: var(--accent-dark); }
.chip-pending   { background: var(--amber-bg); color: var(--amber-fg); }
.chip-danger    { background: var(--red-bg); color: var(--red-fg); }
.chip-cancelled { background: var(--surface); color: var(--ink-3); }

.chip-role-owner  { background: var(--role-owner-bg);  color: var(--role-owner-fg); }
.chip-role-remote { background: var(--role-remote-bg); color: var(--role-remote-fg); }
.chip-role-onsite { background: var(--role-onsite-bg); color: var(--role-onsite-fg); }

.chip-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: currentColor;
  flex: 0 0 6px;
}

/* Живая точка со свечением */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--green);
  flex: 0 0 8px;
  animation: blip 2.4s ease-in-out infinite;
}

/* Фильтр-пилюли над таблицами */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
  border: none;
  font-family: inherit;
  text-decoration: none;
  transition: background .12s ease;
}
.filter-pill:hover { background: #E7EAEF; color: var(--ink); }
.filter-pill.is-active {
  background: var(--ink);
  color: #fff;
  font-weight: 500;
}
.filter-pill.is-active:hover { background: #22262F; color: #fff; }
/* Шапка раздела: заголовок и объяснение. Отступ снизу больше, чем между
   заголовком и подписью, — иначе подпись «прилипает» к вкладкам под ней. */
.page-head { margin-bottom: 24px; }

/* Кому не дошла рассылка. Одна строка на клиента: имя ссылкой, что случилось,
   что делать. Красным — только суть, объяснение спокойным серым. */
.bc-fails { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bc-fail {
  padding: 9px 11px; border-radius: 9px;
  background: rgba(181, 75, 65, .07);
  font-size: 12.5px; line-height: 1.5;
}
.bc-fail-who {
  font-weight: 600; color: var(--ink); text-decoration: none;
  margin-right: 7px;
}
.bc-fail-who:hover { text-decoration: underline; }
.bc-fail-what { color: var(--red-fg); }
.bc-fail-todo { display: block; margin-top: 3px; color: var(--ink-2); }

/* ---- Общие мелкие элементы ----
   Эти классы жили в <style> внутри карточки клиента и обзора бота. Когда их
   переиспользовала админка платформы, стилей там не оказалось — кнопки
   рисовались голым текстом. Правило простое: класс, нужный больше чем одной
   странице, живёт здесь. */

/* Красная плашка с объяснением, почему форма не сохранилась. */
.car-err {
  margin: 0 15px 12px; padding: 9px 12px;
  background: var(--red-bg); color: var(--red-fg);
  border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.4;
}

/* Мелкая кнопка-действие в строке списка. */
.car-btn {
  border: 1px solid var(--border); background: var(--card);
  border-radius: var(--radius-sm); padding: 5px 10px;
  font-family: inherit; font-size: 11.5px; font-weight: 500; color: var(--ink-3);
  cursor: pointer; white-space: nowrap;
  transition: border-color .16s ease, color .16s ease, background-color .16s ease;
}
.car-btn:hover { border-color: var(--border-hover); color: var(--ink); }
.car-btn.is-del { padding: 5px 9px; }
.car-btn.is-del:hover {
  border-color: var(--red); color: var(--red-fg); background: var(--red-bg);
}

/* Счётчик рядом с заголовком карточки. */
.car-count {
  font-size: 12px; color: var(--ink-3);
  background: var(--surface-4); border-radius: 20px; padding: 1px 7px;
}
/* Пустое состояние внутри карточки. */
.car-empty {
  padding: 16px 15px; font-size: 12.5px; line-height: 1.5; color: var(--muted);
}

/* Полоса тревог: не показатели, а «горит / не горит». Число и подпись
   в одну строку, без карточки вокруг каждого. */
.bd-alerts { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-alert {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid transparent;
}
.bd-alert-val { font-size: 14px; font-weight: 600; color: var(--muted-3); }
.bd-alert-lbl { font-size: 12.5px; color: var(--muted); }
.bd-alert.is-amber {
  background: rgba(193, 138, 46, .09); border-color: rgba(193, 138, 46, .28);
}
.bd-alert.is-amber .bd-alert-val { color: var(--amber-fg); }
.bd-alert.is-amber .bd-alert-lbl { color: var(--ink-2); }
.bd-alert.is-red { background: var(--red-bg); border-color: rgba(181, 75, 65, .3); }
.bd-alert.is-red .bd-alert-val { color: var(--red-fg); }
.bd-alert.is-red .bd-alert-lbl { color: var(--ink-2); }

/* ---- Платформа ---- */
/* Строка состояния вместо четырёх карточек: «сколько уроков» — справка,
   а не показатель. Крупно то, что смотрят, остальное подсвечивается только
   когда требует внимания. */
.el-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 18px; padding: 12px 15px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card);
}
.el-bar-main { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.el-bar-main i { font-style: normal; font-size: 14px; color: var(--muted-3); }
.el-bar-lbl { font-size: 12.5px; color: var(--muted); }
.el-bar-sep { width: 1px; height: 18px; background: var(--border); }
.el-bar-link { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.el-bar-link:hover { text-decoration: underline; }

/* Обложку берём у YouTube — отдельно хранить нечего, а без неё восемь
   одинаковых строк не различить глазом. */
.el-cover {
  position: relative; flex: none; width: 62px; height: 40px;
  border-radius: 7px; overflow: hidden; background: var(--surface);
  display: grid; place-items: center;
}
.el-cover img { width: 100%; height: 100%; object-fit: cover; }
.el-cover i {
  font-style: normal; font-size: 9px; line-height: 1.2;
  color: var(--muted-3); text-align: center;
}
.el-body { display: flex; flex-direction: column; min-width: 0; }

/* ---- Платформа: строка урока ---- */
.el-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.el-row:last-child { border-bottom: 0; }
.el-row.is-hidden { background: var(--surface-2); }
.el-row.is-hidden .el-title { color: var(--ink-3); }
.el-order { display: flex; flex-direction: column; gap: 2px; flex: none; }
.el-move {
  width: 22px; height: 17px; padding: 0; line-height: 1;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--card); color: var(--ink-3);
  font-family: inherit; font-size: 10px; cursor: pointer;
}
.el-move:hover:not(:disabled) { color: var(--ink); border-color: var(--border-hover); }
.el-move:disabled { opacity: .35; cursor: default; }
.el-main { flex: 1; min-width: 0; display: flex; align-items: center;
           gap: 12px; text-decoration: none; }
.el-title {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.el-title .chip { font-size: 10px; }
.el-meta { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.el-acts { display: flex; align-items: center; gap: 6px; flex: none; }

/* ---- Отзывы ---- */
.rv-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin-bottom: 22px;
}
.rv-stats .kpi.is-warn {
  border-color: rgba(193, 138, 46, .35); background: rgba(193, 138, 46, .05);
}
.rv-filters {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; margin-bottom: 14px;
}
.rv-filters-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
/* Пять звёзд подряд читаются хуже, чем цифра: «3⭐» видно с одного взгляда. */
.rv-stars { gap: 3px; }
.rv-stars-n { font-size: 12px; }
.rv-toggle {
  margin-left: auto; font-size: 13px; color: var(--accent);
  text-decoration: none; white-space: nowrap;
}
.rv-toggle:hover { text-decoration: underline; }

.rv-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.rv-row:last-child { border-bottom: 0; }
/* Низкую оценку видно по строке целиком, а не по цвету плашки внутри неё. */
.rv-row.is-low { background: rgba(181, 75, 65, .035); }
.rv-rating { width: 86px; flex: none; }
.rv-rating-stars { font-size: 13px; line-height: 1.2; letter-spacing: -1px; }
.rv-rating-date { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.rv-text {
  margin: 8px 0 0; padding: 2px 0 2px 12px;
  border-left: 2px solid var(--border);
  font-size: 13.5px; line-height: 1.55; color: var(--ink);
}
.rv-row.is-low .rv-text { border-left-color: var(--status-danger); }
.rv-act { flex: none; padding-top: 1px; }

@media (max-width: 720px) {
  .rv-row { flex-wrap: wrap; gap: 10px; padding: 14px 15px; }
  .rv-rating { width: auto; display: flex; align-items: baseline; gap: 8px; }
  .rv-rating-date { margin-top: 0; }
  .rv-act { flex: 1 0 100%; }
  .rv-stats { grid-template-columns: 1fr 1fr; }
  .rv-stats .kpi:first-child { grid-column: 1 / -1; }
  .rv-toggle { margin-left: 0; flex: 1 0 100%; }
}

/* ---- Подменю Telegram-бота ----
   Вкладок восемь, и в один плотный ряд они читаются как забор. Разбиваем на
   группы: внутри группы 4px, между группами — вертикальная черта и воздух. */
.bot-tabs {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px 14px; margin-bottom: 26px;
}
.bot-tabs-group { display: flex; flex-wrap: wrap; gap: 4px; }
.bot-tabs-sep {
  width: 1px; height: 18px; background: var(--border);
  flex: none;
}
.bot-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 9px;
  font-size: 13px; line-height: 1; color: var(--ink-3);
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.bot-tab:hover { background: var(--surface-2); color: var(--ink); }
.bot-tab.is-active {
  background: var(--card); color: var(--ink); font-weight: 600;
  border-color: var(--border); box-shadow: var(--shadow-sm);
}
/* Эмодзи в подписи вкладки крупнее текста и тянет строку вверх — сажаем. */
.bot-tab-ico { font-size: 13px; line-height: 1; }

@media (max-width: 900px) {
  /* На узком экране группы уже не помогают: рвём в горизонтальную прокрутку,
     иначе восемь вкладок займут треть экрана высотой. */
  .bot-tabs {
    flex-wrap: nowrap; overflow-x: auto; gap: 8px;
    margin-inline: -16px; padding-inline: 16px;
    scrollbar-width: none;
  }
  .bot-tabs::-webkit-scrollbar { display: none; }
  .bot-tabs-group { flex-wrap: nowrap; }
}

.filter-pill .cnt {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--muted-2);
}
.filter-pill.is-active .cnt { color: rgba(255,255,255,.6); }

/* ---- Сегментированные табы ---- */
.seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  background: var(--tab-bg);
  border-radius: var(--radius);
}
.seg-item {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--ink-4);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  border: none;
  background: transparent;
  font-family: inherit;
  transition: color .12s ease;
}
.seg-item:hover { color: var(--ink); }
.seg-item.is-active {
  background: var(--card);
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

/* ========================= KPI ========================= */

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 17px;
}
.kpi-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.3;
}
.kpi-value {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-top: 10px;
  line-height: 1.05;
  white-space: nowrap;
}
.kpi-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
}
.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
}
.kpi-trend-up   { color: var(--green-fg); }
.kpi-trend-down { color: var(--red-fg); }

/* ========================= ФОРМЫ ========================= */

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: .01em;
}

/* ВАЖНО: селекторы с префиксом body.
   Tailwind CDN инжектит свой <style> ПОСЛЕ нашего <link>, и его forms-плагин
   (`select`, `[type='text']`) перебивал наши стили — поля выходили квадратными
   с серой рамкой #6b7280. Префикс body поднимает специфичность и возвращает
   наш вид. Не убирать. */
body input[type="text"],
body input[type="password"],
body input[type="number"],
body input[type="tel"],
body input[type="email"],
body input[type="url"],
body input[type="search"],
body input[type="date"],
body input[type="time"],
body input[type="datetime-local"],
body select,
body textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--card);
  background-image: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.2;
  outline: none;
  box-shadow: none;
  transition: border-color .12s ease, box-shadow .12s ease;
  -webkit-appearance: none;
  appearance: none;
}
body textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.5;
  resize: vertical;
}
body select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23949BA8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  cursor: pointer;
  text-overflow: ellipsis;
}
body input::placeholder,
body textarea::placeholder { color: var(--muted-2); opacity: 1; }

body input:hover,
body select:hover,
body textarea:hover { border-color: var(--border-hover); }

body input:focus,
body select:focus,
body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, .10);
  outline: none;
}

body input:disabled,
body select:disabled,
body textarea:disabled {
  background-color: var(--surface-4);
  color: var(--muted);
  cursor: not-allowed;
}

/* ---------- Наш выпадающий список (static/js/oz-ui.js) ----------
   Настоящий <select> остаётся в форме, но невидим; вместо него — кнопка
   .oz-sel того же вида, что и поля, и наш список .oz-pop. */
body select.oz-native {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  margin: 0 !important; padding: 0 !important; border: 0 !important;
  opacity: 0 !important; pointer-events: none !important;
  clip-path: inset(50%) !important; overflow: hidden !important;
}
body .oz-sel {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 38px; min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font-family: inherit; font-size: 13.5px; line-height: 1.2; font-weight: 400;
  text-align: left; cursor: pointer;
  transition: border-color .2s cubic-bezier(.32,.72,0,1), box-shadow .2s cubic-bezier(.32,.72,0,1);
}
body .oz-sel:hover { border-color: var(--border-hover); }
body .oz-sel:focus-visible,
body .oz-sel.is-open { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41, 98, 255, .10); outline: none; }
body .oz-sel:disabled { background: var(--surface-4); color: var(--muted); cursor: not-allowed; }
body .oz-sel.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 72, 77, .12); }
body .oz-sel.is-placeholder .oz-sel-val { color: var(--muted-2); }
.oz-sel-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oz-sel-chev { flex: 0 0 auto; color: var(--muted); transition: transform .3s cubic-bezier(.32,.72,0,1); }
.oz-sel.is-open .oz-sel-chev { transform: rotate(180deg); color: var(--accent); }

.oz-pop {
  position: fixed; z-index: 1000;
  display: flex; flex-direction: column;
  min-width: 180px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(11, 13, 18, .07);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 18px 48px rgba(11, 13, 18, .16), 0 2px 8px rgba(11, 13, 18, .05);
  font-size: 13.5px; color: var(--ink);
  overflow: hidden;
}
.oz-pop-list { overflow-y: auto; overscroll-behavior: contain; min-height: 0; flex: 1 1 auto; }
.oz-opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 7px 10px;
  border-radius: 9px;
  cursor: pointer; user-select: none;
  line-height: 1.3;
}
.oz-opt-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.oz-opt-check { flex: 0 0 auto; color: var(--accent); opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.32,.72,0,1); }
.oz-opt.is-active { background: rgba(11, 13, 18, .05); }
.oz-opt.is-selected { font-weight: 500; }
.oz-opt.is-selected .oz-opt-check { opacity: 1; transform: none; }
.oz-opt.is-disabled { color: var(--muted-2); cursor: default; }
.oz-opt.is-disabled.is-active { background: none; }
.oz-opt.is-action { color: var(--accent); font-weight: 500; }
.oz-pop-group { padding: 9px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.oz-pop-sep { height: 1px; margin: 5px 6px; background: rgba(11, 13, 18, .07); }
.oz-pop-empty { padding: 14px 10px; color: var(--muted); text-align: center; }
.oz-pop-search {
  display: flex; align-items: center; gap: 8px;
  margin: 1px 1px 5px; padding: 0 10px; height: 36px;
  border-radius: 10px; background: rgba(11, 13, 18, .045); color: var(--muted);
  flex: 0 0 auto;
}
body .oz-pop-search input {
  height: 34px; padding: 0; border: none; background: transparent; box-shadow: none;
  font-size: 13.5px;
}
body .oz-pop-search input:focus { box-shadow: none; }

/* Фильтр-«пилюля» (журнал действий): по ширине содержимого, а не на всю
   строку. Класс стоял на селектах давно, но стилей у него не было. */
body .oz-sel.select-pill { width: auto; max-width: 100%; height: 34px; border-radius: 10px; font-size: 13px; }

/* На телефоне — нижний лист, пункты крупнее под палец */
.oz-pop.is-sheet {
  left: 0; right: 0; bottom: 0; top: auto;
  width: auto; max-height: 72vh;
  padding: 6px 10px calc(12px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: rgba(255, 255, 255, .94);
  font-size: 15.5px;
}
.oz-pop.is-sheet .oz-opt { min-height: 48px; padding: 10px 12px; border-radius: 12px; }
.oz-pop.is-sheet .oz-pop-search { height: 42px; margin: 2px 2px 8px; }
body .oz-pop.is-sheet .oz-pop-search input { font-size: 16px; }
.oz-pop-grip { width: 38px; height: 5px; border-radius: 99px; background: rgba(11, 13, 18, .14); margin: 4px auto 8px; flex: 0 0 auto; }
.oz-pop-title { padding: 2px 12px 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); flex: 0 0 auto; }
.oz-pop-back { position: fixed; inset: 0; z-index: 999; background: rgba(11, 13, 18, .32); }

/* Пока окно плавно меняет высоту (OzUI.morph) — без прокрутки внутри:
   сжатое тело иначе мигает полосой справа. */
.oz-morphing, .oz-morphing .shop-dialog-body { overflow: hidden !important; }

/* Числовые поля — моно */
input.font-num,
input.text-num,
input[type="number"] {
  font-family: 'IBM Plex Mono', monospace;
  font-variant-numeric: tabular-nums;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

input[type="checkbox"],
input[type="radio"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

body .input-tint { background-color: var(--accent-tint-2); border-color: var(--accent-soft); }

.field-readonly {
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-4);
  color: var(--ink-3);
  font-size: 13.5px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  transition: border-color .12s ease;
}
.search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,255,.10); }
/* Префикс body обязателен: глобальное body input[type="text"] по специфичности
   выше одиночного класса и навязывало полю свою высоту, рамку и подсветку —
   при вводе поле «распухало» внутри обёртки. */
body .search-wrap input {
  border: none;
  height: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-size: 13px;
  flex: 1;
  min-width: 0;
}
body .search-wrap input:focus {
  box-shadow: none;
  border: none;
  outline: none;
}

/* Тумблер */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 23px;
  flex: 0 0 40px;
}
.toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.toggle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--muted-3);
  border-radius: var(--radius-pill);
  transition: background .16s ease;
}
.toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  background: #fff;
  border-radius: 50%;
  z-index: 1;
  transition: transform .16s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,.18);
}
.toggle:has(.toggle-checkbox:checked)::after { background: var(--accent); }
.toggle:has(.toggle-checkbox:checked)::before { transform: translateX(17px); }

/* ========================= ТАБЛИЦЫ И СТРОКИ ========================= */

.tbl-head {
  display: grid;
  gap: 12px;
  padding: 9px 18px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  background: var(--surface-4);
}

/* gap обязателен: без него соседние колонки слипаются
   («80 00023.07.2026») — числа выровнены вправо и упираются в следующую. */
.tbl-row {
  display: grid;
  gap: 12px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-3);
  text-decoration: none;
  color: inherit;
  transition: background .1s ease;
}
.tbl-head > *, .tbl-row > * { min-width: 0; }
.tbl-row:hover { background: var(--surface-4); }
.tbl-row:last-child { border-bottom: none; }

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-3);
  text-decoration: none;
  color: inherit;
  transition: background .1s ease;
}
.list-row:hover { background: var(--surface-4); }
.list-row:last-child { border-bottom: none; }

/* Полоса прогресса */
.bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: width .3s ease;
}

.sparkline { display: flex; align-items: flex-end; gap: 4px; }

/* ========================= УВЕДОМЛЕНИЯ ========================= */

/* Кнопка, которая никуда не ведёт (например «Сегодня», когда уже сегодня).
   Класс стоял в разметке календаря, но ничего не делал. */
.btn-ghost.is-disabled,
a.is-disabled {
  opacity: .45; pointer-events: none; cursor: default;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-soft);
  background: var(--accent-tint-2);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}
.notice-warn    { background: var(--amber-bg-2); border-color: var(--amber-bd); color: var(--amber-deep); }
/* Синоним: в шаблонах встречалось `notice-ok`, и «Сохранено ✅» рисовалось
   обычной синей подсказкой вместо зелёной. Держим оба имени. */
.notice-ok      { background: var(--green-bg); border-color: var(--green-bd); color: var(--green-fg); }
.notice-danger  { background: var(--red-bg);   border-color: #F4CFCB; color: var(--red-deep); }
.notice-success { background: var(--green-bg); border-color: var(--green-bd); color: var(--green-fg); }

/* ========================= ПУСТЫЕ СОСТОЯНИЯ ========================= */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--dashed);
  border-radius: var(--radius-lg);
  background: var(--surface-4);
}
.empty-state-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.empty-state-text {
  font-size: 13px;
  color: var(--muted);
  margin-top: 5px;
  max-width: 380px;
  line-height: 1.5;
}

/* ========================= АВАТАРЫ ========================= */

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-weight: 600;
  color: #fff;
  background: var(--muted);
  flex-shrink: 0;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.avatar-sm { width: 28px; height: 28px; flex: 0 0 28px; font-size: 11px; border-radius: var(--radius-sm); }
.avatar-md { width: 34px; height: 34px; flex: 0 0 34px; font-size: 12px; border-radius: 11px; }
.avatar-lg { width: 46px; height: 46px; flex: 0 0 46px; font-size: 15px; border-radius: 15px; }
.avatar-xl { width: 64px; height: 64px; flex: 0 0 64px; font-size: 22px; border-radius: 18px; }

.avatar-owner   { background: var(--accent); }
.avatar-remote  { background: var(--purple); }
.avatar-onsite  { background: var(--ink-3); }
.avatar-neutral { background: var(--muted); }

/* Статусы лояльности */
.avatar-diamond { background: var(--purple); }
.avatar-gold    { background: var(--gold); }
.avatar-silver  { background: var(--muted); }
.avatar-new     { background: var(--accent); }

/* ========================= ДИАЛОГИ ========================= */

dialog { border: none; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(11, 13, 18, .42); backdrop-filter: blur(2px); }
/* Анимируем само окно, а не то, что в нём. Открытое окно — прокручиваемый
   блок (overflow: auto у браузера), и сдвинутое анимацией содержимое на
   полсекунды вылезало за его край: macOS мигала полосой прокрутки справа.
   Сдвиг самого окна его прокрутку не трогает. */
dialog[open] { animation: oz-dlg-in .42s cubic-bezier(.32, .72, 0, 1); }
dialog[open]::backdrop { animation: oz-fade .3s cubic-bezier(.32, .72, 0, 1); }
@keyframes oz-dlg-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes oz-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  dialog[open], dialog[open]::backdrop { animation: none; }
}

.dialog-shell,
.dialog-glass {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
}

/* Нижний лист (мобильный) */
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(11, 13, 18, .24);
  z-index: 60;
}
.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--dashed);
  margin: 0 auto 14px;
}

/* ========================= МОБИЛЬНАЯ ОБОЛОЧКА ========================= */

.app-topbar {
  display: none;
  height: 54px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--page-bg);
  position: sticky;
  top: 0;
  z-index: 30;
}
.app-topbar-brand { flex: 1; min-width: 0; display: flex; align-items: center; }

.mobile-menu-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 38px;
}

/* Нижний таббар — основная мобильная навигация */
.mobile-tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: var(--card);
  z-index: 50;
}
.mobile-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 0 6px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  min-height: 48px;
}
.mobile-tab svg { width: 20px; height: 20px; }
.mobile-tab.is-active { color: var(--accent); font-weight: 600; }

/* Выдвижное меню «Ещё» */
.mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 18, .42);
  z-index: 70;
}
.mobile-drawer.is-open { display: block; }
.mobile-drawer-panel {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: min(300px, 86vw);
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

@media (max-width: 1024px) {
  /* Сайдбар прячется — оболочка перестаёт быть flex-строкой,
     иначе топбар встаёт СБОКУ от контента вместо того чтобы лечь сверху. */
  .app-shell { display: block; }
  .app-sidebar { display: none; }
  .app-topbar { display: flex; }
  .mobile-tabbar { display: flex; }
  .app-content { padding-bottom: calc(64px + env(safe-area-inset-bottom)); width: 100%; }

  /* Топбар экрана: горизонтальный скролл вместо распирания страницы */
  .screen-topbar {
    height: auto;
    min-height: 52px;
    flex: 0 0 auto;
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
    position: static;
  }
  .screen-title { font-size: 20px; letter-spacing: -0.03em; }
  /* Кнопка действия на мобиле — на всю ширину, отдельной строкой */
  .screen-topbar .btn-primary { width: 100%; order: 10; }

  /* Тач-таргеты крупнее */
  .btn-primary, .btn-ghost, .btn-ink, .btn-danger { height: 44px; font-size: 14.5px; }
  .btn-ghost-sm { height: 36px; font-size: 13px; }
  input, select, textarea, body .oz-sel { height: 46px; font-size: 16px; } /* 16px — iOS не зумит */
  textarea { height: auto; min-height: 96px; }
  .icon-btn { width: 42px; height: 42px; }

  /* Таблицы превращаются в карточки */
  .tbl-head { display: none; }
  .tbl-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 13px 14px;
  }

  .kpi { padding: 13px 15px; }
  .kpi-value { font-size: 22px; }
  .card-head { padding: 12px 14px; }
  .list-row { padding: 13px 14px; }
}

/* ========================= FLATPICKR ========================= */

.flatpickr-calendar {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  font-family: 'Onest', system-ui, sans-serif !important;
  background: var(--card) !important;
}
.flatpickr-months { padding: 6px 0 2px; }
.flatpickr-month { color: var(--ink) !important; fill: var(--ink) !important; }
.flatpickr-current-month { font-size: 14px !important; font-weight: 600 !important; }
.flatpickr-monthDropdown-months { font-family: inherit !important; font-weight: 600 !important; }
.flatpickr-prev-month, .flatpickr-next-month { fill: var(--ink-3) !important; }
.flatpickr-weekday {
  color: var(--muted) !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
}
.flatpickr-weekdays { background: transparent !important; }
.dayContainer { padding: 0 6px 6px; }
.flatpickr-day {
  font-family: 'IBM Plex Mono', monospace !important;
  font-size: 12.5px !important;
  border-radius: var(--radius-sm) !important;
  color: var(--ink-2) !important;
  border: none !important;
}
.flatpickr-day:hover { background: var(--surface) !important; }
.flatpickr-day.today { box-shadow: inset 0 0 0 1.5px var(--accent) !important; color: var(--accent) !important; }
.flatpickr-day.selected {
  background: var(--accent) !important;
  color: #fff !important;
}
.flatpickr-day.flatpickr-disabled { color: var(--muted-3) !important; }
.flatpickr-time input { font-family: 'IBM Plex Mono', monospace !important; }

/* ========================= EMOJI PICKER ========================= */

.ep-shell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ep-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.ep-title { font-size: 14px; font-weight: 600; letter-spacing: -0.015em; }
.ep-close {
  width: 28px; height: 28px;
  border: none; background: transparent;
  color: var(--muted-2);
  border-radius: var(--radius-xs);
  cursor: pointer;
}
.ep-close:hover { background: var(--surface); color: var(--ink); }
.ep-body { max-height: 320px; overflow-y: auto; padding: 8px 12px 14px; }
.ep-group-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 4px 6px;
}
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; }
.ep-cell {
  aspect-ratio: 1;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ep-cell:hover { background: var(--surface); }

/* ========================= ПРОЧЕЕ ========================= */

.pay-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.pay-row:hover { border-color: var(--border-hover); }
.pay-row.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(41, 98, 255, .10);
}
.pay-row-icon {
  width: 26px; height: 26px;
  flex: 0 0 26px;
  border-radius: var(--radius-sm);
}
.pay-row-title { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.pay-row-sub { font-size: 11.5px; color: var(--muted); }
.pay-row-label { font-size: 13.5px; font-weight: 500; }

/* Таймлайн */
.tl-line { width: 1.5px; background: var(--line); flex: 0 0 1.5px; }
.tl-dot {
  width: 9px; height: 9px;
  border-radius: 3px;
  background: var(--muted-3);
  flex: 0 0 9px;
}

.uz-lookup-status { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ================= Публичный букинг =================
   Страницы жили на чистом белом, и белые карточки со светлой рамкой на нём
   не читались — слоты времени выглядели как пустое место. Даём ту же подложку,
   что и рабочей области CRM. */
.booking-shell { background: #F6F7F9; }

/* Границы карточек на подложке делаем заметнее «волосяной» --line */
.booking-shell .time-cell,
.booking-shell .tariff-card-inner,
.booking-shell .time-empty { border-color: var(--border); }

/* ================= Шапка публичного букинга =================
   При переезде на новую дизайн-систему .nav-shell осталась пустой заглушкой —
   шапка теряла фон, а логотип налезал на кнопки. */
.nav-shell {
  display: flex; align-items: center; gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 9px 10px 9px 14px;
}
.nav-shell > a:first-child { flex-shrink: 1; min-width: 0; overflow: hidden; }
.nav-shell nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.nav-link {
  display: inline-flex; align-items: center;
  padding: 8px 13px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  color: var(--ink-2); text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.nav-link:hover { background: var(--surface-4); color: var(--ink); }
.nav-link.is-active { background: var(--accent); color: #fff; }

@media (max-width: 420px) {
  /* На узком экране логотип ужимаем, чтобы кнопки помещались в строку */
  .nav-shell { padding: 8px 8px 8px 12px; gap: 6px; }
  .nav-shell > a:first-child span { font-size: 16px; }
  .nav-link { padding: 7px 10px; font-size: 12.5px; }
}

/* Скрытие для скринридеров */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Печать */
@media print {
  .app-sidebar, .app-topbar, .mobile-tabbar, .screen-topbar { display: none !important; }
  body { background: #fff; }
}

/* ========================================================================
   ПУБЛИЧНЫЙ БУКИНГ · дизайн 2026
   Сквозной приём: горизонтальная линейка рабочего дня. На главной она
   показывает загрузку, на выборе времени по ней двигается блок сессии,
   на экране подтверждения — где именно встала бронь. Всё остальное
   подчинено ей: моноширинные числа, жёсткие границы, никаких теней.
   ===================================================================== */

.booking-shell { background: #FFFFFF; }

.bk-wrap {
  width: 100%; max-width: 600px; margin: 0 auto; padding: 0 16px;
  display: flex; flex-direction: column; flex: 1;
  container-type: inline-size;
}
/* min-height:100% тут стояло раньше и ломало прокрутку на телефоне: высоту
   оно берёт от родителя, у которого 100vh, а панель браузера то появляется,
   то исчезает — контент выходил за пределы, но страница не прокручивалась
   до конца. flex:1 растягивает так же, но без фиксации высоты. */

/* ---- Шапка ---- */
.bk-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 24px 0 14px; border-bottom: 1px solid var(--line);
}
.bk-logo {
  font-family: 'Inter Tight', 'Onest', sans-serif;
  font-weight: 700; font-style: italic; letter-spacing: -0.03em;
  font-size: clamp(19px, 4.4cqw, 24px); color: var(--ink);
}
.bk-logo span { color: var(--accent); }
.bk-hours {
  font-size: 11px; font-weight: 500; color: var(--ink-4);
}

/* ---- Хиро ---- */
.bk-hero { padding-top: clamp(30px, 7cqw, 54px); }
.bk-kicker { font-size: 11.5px; color: var(--ink-4); margin-bottom: 14px; }
.bk-h1 {
  margin: 0; font-size: clamp(38px, 10.4cqw, 68px); line-height: 0.98;
  letter-spacing: -0.045em; font-weight: 600; color: var(--ink);
  white-space: pre-line; text-wrap: pretty;
}
.bk-lead {
  margin: 20px 0 0; font-size: clamp(14px, 2.8cqw, 16px); line-height: 1.45;
  color: var(--ink-2); max-width: 40ch; text-wrap: pretty;
}
.bk-features {
  margin-top: 16px; font-size: 10.5px; letter-spacing: 0.02em;
  line-height: 1.7; color: var(--ink-4);
  /* Список длинный, на телефоне обязан переноситься, а не уезжать за край */
  overflow-wrap: anywhere; text-wrap: pretty;
}

/* ---- Выбор языка ---- */
.bk-langs { padding-top: 26px; }
.bk-langs-lbl { font-size: 12.5px; color: var(--ink-4); margin-bottom: 9px; }
.bk-langs-row { display: flex; gap: 9px; flex-wrap: wrap; }
.bk-lang {
  flex: 1; min-width: 150px; height: 56px;
  display: flex; align-items: center; gap: 9px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 13px;
  background: var(--card); color: var(--ink); text-decoration: none;
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  transition: border-color .18s ease, background-color .2s ease, transform .14s cubic-bezier(.23,1,.32,1);
}
.bk-lang:hover { border-color: var(--border-hover); }
.bk-lang:active { transform: scale(0.98); }
.bk-lang.is-on {
  border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark);
}
.bk-lang-flag { font-size: 19px; line-height: 1; }
.bk-lang-arrow { margin-left: auto; font-size: 15px; opacity: .5; }

/* ---- Линейка рабочего дня ---- */
.bk-ruler-wrap { margin-top: clamp(26px, 6cqw, 38px); }
.bk-ruler-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.bk-ruler-day { font-size: 11.5px; color: var(--ink-2); font-weight: 500; }
.bk-ruler-free { font-size: 11px; color: var(--ink-4); }
.bk-ruler-free b { font-weight: 500; color: var(--ink-2); }

.bk-ruler {
  position: relative; height: clamp(64px, 15cqw, 86px);
  border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; background: var(--card);
}
.bk-ruler-grid { position: absolute; inset: 0; display: flex; }
.bk-ruler-cell { flex: 1; border-left: 1px solid var(--line); }
.bk-ruler-cell.is-soft { border-left-color: var(--line-3); }
.bk-ruler-cell:first-child { border-left: none; }

.bk-ruler-busy {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg,
    var(--surface) 0 5px, var(--card) 5px 10px);
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
}
.bk-ruler-busy span {
  font-size: 9.5px; color: var(--muted-2); letter-spacing: 0.04em;
}

.bk-ruler-ticks {
  display: flex; justify-content: space-between; padding-top: 5px;
  font-size: 9.5px; font-weight: 500; color: var(--ink-4);
}

@media (max-width: 420px) {
  .bk-lang { min-width: 100%; }
}

/* ---- Шапка шагов ---- */
.bk-step-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 20px 0 14px;
}
.bk-step-top .bk-logo { font-size: 17px; text-decoration: none; }
.bk-dots { display: flex; gap: 7px; align-items: center; }
.bk-dot {
  width: 25px; height: 25px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  background: var(--surface); color: var(--muted-2);
  transition: background-color .3s cubic-bezier(.23,1,.32,1), color .3s ease, box-shadow .3s cubic-bezier(.23,1,.32,1);
}
.bk-dot.is-done { background: var(--accent); color: #fff; }
.bk-dot.is-now {
  background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-tint);
}

/* ---- Тело шага ----
   Подвал прибит к окну (position:fixed), поэтому из потока он выпал —
   нижний отступ равен его высоте, иначе сводка прячется под кнопкой. */
.booking-shell { --bk-foot-h: 80px; }
@media (max-width: 420px) { .booking-shell { --bk-foot-h: 141px; } }

.bk-body {
  flex: 1;
  padding-bottom: calc(var(--bk-foot-h) + env(safe-area-inset-bottom, 0px) + 22px);
}
.bk-title {
  margin: 24px 0 5px; font-size: clamp(25px, 5.4cqw, 33px);
  font-weight: 600; letter-spacing: -0.025em; color: var(--ink);
}
.bk-sub {
  margin: 0 0 18px; font-size: 12.5px; line-height: 1.5;
  color: var(--ink-4); text-wrap: pretty;
}
.bk-empty {
  padding: 26px 18px; border: 1px dashed var(--dashed); border-radius: var(--radius-lg);
  text-align: center; font-size: 13.5px; color: var(--ink-4);
}

/* Место под полосу прокрутки держим всегда. На компьютере одни шаги брони
   короче экрана, другие длиннее: полоса то появлялась, то пропадала, и вся
   колонка при переходе прыгала вбок на её ширину. На телефоне полосы поверх
   страницы — там это правило ничего не меняет. */
html:has(.bk-wrap) { scrollbar-gutter: stable; }

/* ---- Карточки часов ---- */
.bk-hgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.bk-hgrid-more { padding-top: 10px; }

.bk-hcard {
  border: 1px solid var(--border); border-radius: 14px;
  padding: 15px 15px 13px; background: var(--card);
  text-decoration: none; color: var(--ink); display: block;
  transition: border-color .18s ease, background-color .18s ease, transform .15s cubic-bezier(.23,1,.32,1);
}
.bk-hcard:hover { border-color: var(--border-hover); }
.bk-hcard:active { transform: scale(0.978); }
.bk-hcard-top { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.bk-hcard-n {
  font-size: clamp(36px, 8.6cqw, 50px); font-weight: 600;
  letter-spacing: -0.045em; line-height: 0.88;
}
.bk-hcard-u { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.bk-hcard-tag { font-size: 12px; color: var(--ink-4); padding-left: 4px; }
.bk-hcard-price {
  margin-top: 13px; display: flex; align-items: baseline; gap: 4px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
}
.bk-hcard-from, .bk-hcard-cur { font-size: 10px; color: var(--ink-4); font-weight: 400; }

/* Карточка — это блок со ссылкой-подложкой на всю площадь и кнопкой ⓘ
   поверх неё. Кнопку нельзя класть внутрь <a>: вложенные интерактивные
   элементы браузер разбирает как попало, и тап уводил бы на выбор даты. */
.bk-hcard { position: relative; }
.bk-hcard-link {
  position: absolute; inset: 0; z-index: 1; border-radius: inherit;
}
.bk-hcard-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bk-hcard:has(.bk-hcard-link:active) { transform: scale(0.978); }
.bk-hcard:active { transform: none; }
.bk-hcard-i {
  position: absolute; top: 7px; right: 7px; z-index: 2;
  width: 34px; height: 34px; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--ink-4); cursor: pointer;
  transition: background-color .18s ease, color .18s ease, transform .15s cubic-bezier(.23,1,.32,1);
}
.bk-hcard-i svg { width: 19px; height: 19px; }
.bk-hcard-i:hover { background: var(--surface); color: var(--accent); }
.bk-hcard-i:active { transform: scale(0.9); }

/* Мойка: над числом — название, под ним — правило брони заранее */
.bk-hcard-kicker {
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: -0.005em; margin-bottom: 8px; padding-right: 30px;
}
.bk-hcard-rule { margin-top: 8px; font-size: 11px; line-height: 1.35; color: var(--ink-4); }
.bk-hcard-wash .bk-hcard-price { margin-top: 10px; }
/* «Другие тарифы» видны сразу, но отделены от основных линией и своим
   заголовком — чтобы мойку не приняли за обычные часы на боксе. */
.bk-other {
  margin-top: 26px; padding-top: 20px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 16px;
}
.bk-other-head { margin: 0 2px 12px; }
.bk-other-h {
  margin: 0; font-size: 17px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--ink);
}
.bk-other-hint {
  margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-4);
  text-wrap: pretty;
}

/* ---- Окно «Что входит» ----
   На телефоне — лист снизу, на широком экране — окно по центру. */
.bk-info {
  width: min(560px, 100%); max-width: 100%; max-height: min(86dvh, 720px);
  margin: auto auto 0; padding: 0; border: 0;
  border-radius: 22px 22px 0 0; background: var(--card); color: var(--ink);
  box-shadow: 0 -12px 44px rgba(11, 13, 18, 0.14);
  flex-direction: column; overflow: hidden;
}
.bk-info[open] { display: flex; animation: bkSheetIn .42s cubic-bezier(.23,1,.32,1) both; }
.bk-info.is-closing { animation: bkSheetOut .18s ease-in both; }
.bk-info::backdrop { background: rgba(11, 13, 18, 0.36); }
.bk-info[open]::backdrop { animation: bkFadeIn .3s ease both; }
@media (min-width: 640px) {
  .bk-info { margin: auto; border-radius: 22px; box-shadow: 0 24px 64px rgba(11, 13, 18, 0.18); }
  .bk-info-grab { display: none; }
}
@keyframes bkSheetIn {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes bkSheetOut { to { opacity: 0; transform: translateY(20px); } }
@keyframes bkFadeIn { from { opacity: 0; } }

.bk-info-grab {
  width: 38px; height: 4px; border-radius: var(--radius-pill);
  background: var(--border); margin: 9px auto 0; flex: none;
}
.bk-info-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 14px 22px; border-bottom: 1px solid var(--line); flex: none;
}
.bk-info-kicker {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-4);
}
.bk-info-h {
  margin: 5px 0 4px; font-size: 22px; font-weight: 600;
  letter-spacing: -0.025em; line-height: 1.15;
}
.bk-info-meta { font-size: 13px; color: var(--ink-3); }
.bk-info-x {
  width: 36px; height: 36px; flex: none; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background-color .18s ease, transform .15s cubic-bezier(.23,1,.32,1);
}
.bk-info-x svg { width: 16px; height: 16px; }
.bk-info-x:hover { background: var(--line); }
.bk-info-x:active { transform: scale(0.92); }
.bk-info-body {
  padding: 18px 22px 8px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
}
/* Описание владелец пишет строками и списком «• …» — переносы сохраняем */
.bk-info-text {
  font-size: 14.5px; line-height: 1.6; color: var(--ink-2);
  white-space: pre-line; text-wrap: pretty;
}
.bk-info-note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 13px;
  background: var(--amber-bg); border: 1px solid var(--amber-bd);
  font-size: 13.5px; line-height: 1.5; color: var(--amber-deep);
  white-space: pre-line;
}
.bk-info-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--amber); }
.bk-info-rule {
  padding: 12px 14px; border-radius: 13px; background: var(--accent-tint);
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2);
}
.bk-info-rule-h {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 3px;
}
.bk-info-foot {
  padding: 12px 22px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); flex: none;
}
.bk-info-pick {
  height: 50px; display: flex; align-items: center; justify-content: center;
  border-radius: 14px; background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 600; text-decoration: none;
  transition: background-color .18s ease, transform .15s cubic-bezier(.23,1,.32,1);
}
.bk-info-pick:hover { background: var(--accent-dark); }
.bk-info-pick:active { transform: scale(0.98); }
@media (prefers-reduced-motion: reduce) {
  .bk-info[open], .bk-info.is-closing, .bk-info[open]::backdrop { animation: none; }
}

/* ---- «Нужно больше времени» ---- */
.bk-more { margin-top: 12px; }
.bk-more-btn {
  height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--ink-2); font-size: 13.5px; font-weight: 500; cursor: pointer;
  list-style: none; transition: border-color .18s ease;
}
.bk-more-btn::-webkit-details-marker { display: none; }
.bk-more-btn:hover { border-color: var(--border-hover); }
.bk-more-caret {
  font-size: 11px; color: var(--ink-4);
  transition: transform .3s cubic-bezier(.34,1.22,.5,1);
}
.bk-more[open] .bk-more-caret { transform: rotate(180deg); }
.bk-more[open] .bk-hgrid-more > * {
  animation: bkSpringIn .5s cubic-bezier(.34,1.4,.64,1) both;
}
.bk-more[open] .bk-hgrid-more > *:nth-child(2) { animation-delay: .05s; }
.bk-more[open] .bk-hgrid-more > *:nth-child(3) { animation-delay: .1s; }
.bk-more[open] .bk-hgrid-more > *:nth-child(4) { animation-delay: .15s; }
.bk-more[open] .bk-hgrid-more > *:nth-child(5) { animation-delay: .2s; }

@keyframes bkSpringIn {
  from { opacity: 0; transform: translateY(-9px) scale(0.972); }
  to   { opacity: 1; transform: none; }
}

/* ---- Подвал шага ----
   Раньше стояло position:sticky — и не работало: подвал последний ребёнок
   .bk-wrap, а прилипнуть снизу элемент может, только если под ним внутри
   контейнера есть запас. Запаса нет, поэтому подвал просто лежал в конце
   документа: на длинном экране (контакты) кнопка уезжала за нижний край.
   fixed прибивает его к окну на всех экранах; отступ снизу у .bk-body
   гарантирует, что подвал ничего не накрывает. */
.bk-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--card); border-top: 1px solid var(--line);
  /* боковой отступ держит строку в той же колонке 600px, что и контент */
  padding: 12px max(16px, calc((100% - 600px) / 2 + 16px));
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 9px;
}
.bk-back {
  width: 52px; height: 52px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 13px;
  background: var(--card); color: var(--ink-2); font-size: 15px;
  text-decoration: none;
  transition: border-color .18s ease, transform .14s cubic-bezier(.23,1,.32,1);
}
.bk-back:hover { border-color: var(--border-hover); }
.bk-back:active { transform: scale(0.97); }
.bk-foot-hint { flex: 1; font-size: 11.5px; color: var(--ink-4); }

@media (prefers-reduced-motion: reduce) {
  .bk-more[open] .bk-hgrid-more > * { animation: none; }
}

/* ---- Календарь ---- */
.bk-title-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin: 24px 0 16px;
}
.bk-month { display: flex; align-items: baseline; gap: 7px; }
.bk-month-name { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.bk-month-year { font-size: 14px; font-weight: 500; color: var(--ink-4); }
.bk-month-nav {
  font-size: 14px; color: var(--ink-3); text-decoration: none;
  padding: 2px 5px; border-radius: var(--radius-xs);
}
.bk-month-nav:hover { background: var(--surface); color: var(--accent); }

/* minmax(0, 1fr), а не 1fr: у 1fr нижняя граница — ширина содержимого, и
   на телефоне 320 px кнопка «Смотреть октябрь» в хвосте недели раздвигала
   колонки — календарь вылезал за экран, и страница ездила вбок. */
.bk-cal-heads {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 6px;
}
.bk-cal-head {
  text-align: center; font-size: 10.5px; font-weight: 500;
  padding: 4px 0; color: var(--ink-3);
}
.bk-cal-head.is-weekend { color: var(--muted-2); }

.bk-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.bk-day {
  aspect-ratio: 1 / 1; border-radius: 9px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1px solid transparent; background: transparent;
  text-decoration: none; font-size: 14px; font-weight: 500; color: var(--muted-3);
  transition: background-color .2s ease, border-color .18s ease, transform .15s cubic-bezier(.23,1,.32,1);
}
.bk-day.is-free {
  border-color: var(--border); color: var(--ink); background: var(--card);
}
.bk-day.is-free:hover { border-color: var(--accent); background: var(--accent-tint); }
.bk-day.is-free:active { transform: scale(0.94); }
/* Занят целиком или закрыт — число зачёркнуто, как в макете */
.bk-day.is-full span:first-child,
.bk-day.is-closed span:first-child {
  text-decoration: line-through; text-decoration-thickness: 1px;
}
.bk-day.is-other-month { visibility: hidden; }

/* «Смотреть октябрь» — в хвосте последней недели или строкой под сеткой.
   К концу месяца свободных дней остаётся два-три, и стрелку в шапке
   находят не все: человек решает, что мест нет, и уходит. */
.bk-day-next {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 9px; border: 1px solid var(--accent-soft);
  background: var(--accent-tint); color: var(--accent-dark);
  font-size: 13.5px; font-weight: 600; text-decoration: none; text-align: center;
  padding: 8px 10px; line-height: 1.25; min-width: 0; overflow-wrap: anywhere;
  transition: background-color .18s ease, border-color .18s ease, transform .15s cubic-bezier(.23,1,.32,1);
}
.bk-day-next:hover { border-color: var(--accent); background: var(--accent-soft); }
.bk-day-next:active { transform: scale(0.97); }
.bk-day-next-arrow {
  width: 26px; height: 26px; flex: none; border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 13px;
  transition: transform .25s cubic-bezier(.34,1.4,.64,1);
}
.bk-day-next:hover .bk-day-next-arrow { transform: translateX(2px); }
.bk-day-next.is-row { margin-top: 10px; height: 52px; }

/* Правило «бронь заранее» над календарём */
.bk-rule {
  display: flex; gap: 10px; align-items: flex-start;
  margin: -4px 0 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--accent-tint); color: var(--ink-2);
  font-size: 13px; line-height: 1.5;
}
.bk-rule svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--accent); }
.bk-rule b { color: var(--ink); font-weight: 600; }

.bk-day-tick {
  width: 9px; height: 2px; border-radius: var(--radius-pill); background: transparent;
}
.bk-day-tick.is-on { background: var(--muted-3); }

.bk-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 16px 0 4px; border-top: 1px solid var(--line); margin-top: 14px;
}
.bk-leg {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3);
}
.bk-leg-box {
  width: 11px; height: 11px; border-radius: 4px; border: 1px solid var(--border-hover);
}
.bk-leg-strike {
  font-style: normal; color: var(--muted-3);
  text-decoration: line-through; font-size: 11px;
}
.bk-leg-tick {
  width: 9px; height: 2px; border-radius: var(--radius-pill); background: var(--muted-3);
}

/* ---- Экран времени ---- */
.bk-day-ruler { border-top: 1px solid var(--line); padding-top: 14px; }
.bk-dr-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px; flex-wrap: wrap;
}
.bk-dr-time { display: flex; align-items: baseline; gap: 9px; }
.bk-dr-time span:first-child,
.bk-dr-time span:last-child {
  font-size: clamp(23px, 5.6cqw, 31px); font-weight: 600; letter-spacing: -0.035em;
}
.bk-dr-time span:last-child { color: var(--ink-3); }
.bk-dr-arrow { font-size: 14px; color: var(--muted-2); }
.bk-dr-day { font-size: 12.5px; color: var(--ink-4); }

.bk-ruler-tall { height: 78px; border-radius: 12px; }
.bk-dr-block {
  position: absolute; top: 6px; bottom: 6px; left: 0;
  background: var(--accent); border-radius: 4px;
  transition: left .42s cubic-bezier(.32,.72,0,1);
}

.bk-dr-hint {
  margin: 12px 0 0; font-size: 12.5px; line-height: 1.5;
  color: var(--ink-4); text-wrap: pretty;
}
.bk-dr-hint span { color: var(--ink-2); }

.bk-starts-lbl { font-size: 11.5px; color: var(--ink-4); margin: 22px 0 9px; }
.bk-starts { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-start {
  height: 44px; padding: 0 15px;
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: 11px;
  background: var(--card); color: var(--ink); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .14s cubic-bezier(.23,1,.32,1);
}
.bk-start:hover, .bk-start:focus {
  border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark);
}
.bk-start:active { transform: scale(0.96); }

.bk-warn {
  margin-top: 6px; padding: 14px;
  border: 1px solid var(--amber-bd); background: var(--amber-bg);
  border-radius: 12px; font-size: 13px; line-height: 1.5; color: var(--ink-2);
}
/* «19:00 уже заняли» — над линейкой дня, куда форма вернула клиента. */
.bk-taken { margin: 0 0 12px; font-weight: 500; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .bk-dr-block { transition: none; }
}

/* ---- Финальные экраны: готово / ошибка ---- */
.bk-final {
  position: fixed; inset: 0; overflow-y: auto;
  display: flex; justify-content: center; color: #FFFFFF;
}
.bk-final-ok  { background: #12805C; }
.bk-final-err { background: #E5484D; }

.bk-final-inner {
  width: 100%; max-width: 600px; padding: 0 16px;
  display: flex; flex-direction: column; min-height: 100%;
  container-type: inline-size;
}
.bk-final-body {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 34px 0 26px;
}

/* Галочка: вычерчивается штрихом */
.bk-check, .bk-cross {
  width: clamp(34px, 8cqw, 44px); height: auto; display: block; margin-bottom: 20px;
}
.bk-check path {
  stroke-dasharray: 160; stroke-dashoffset: 160;
  animation: bkDraw .56s cubic-bezier(.32,.72,0,1) .18s forwards;
}
.bk-cross path { stroke-dasharray: 80; stroke-dashoffset: 80; }
.bk-cross-a { animation: bkDraw .32s cubic-bezier(.32,.72,0,1) .18s forwards; }
.bk-cross-b { animation: bkDraw .32s cubic-bezier(.32,.72,0,1) .42s forwards; }

@keyframes bkDraw { to { stroke-dashoffset: 0; } }

.bk-final-lbl {
  font-size: 11.5px; color: rgba(255,255,255,.66); margin-bottom: 4px;
  animation: bkRise .34s cubic-bezier(.23,1,.32,1) .5s both;
}
/* Номер брони — герой экрана */
.bk-code {
  font-size: clamp(42px, 12.4cqw, 80px); font-weight: 600;
  letter-spacing: -0.05em; line-height: 1.06;
  animation: bkRise .4s cubic-bezier(.23,1,.32,1) .56s both;
}
.bk-final-h1 {
  margin: 20px 0 0; font-size: clamp(19px, 4.2cqw, 25px);
  font-weight: 600; letter-spacing: -0.025em;
  animation: bkRise .4s cubic-bezier(.23,1,.32,1) .68s both;
}
.bk-final-h1-lead {
  margin-top: 0; font-size: clamp(24px, 5.6cqw, 34px);
  animation-delay: .52s;
}
.bk-final-text {
  margin: 16px 0 0; font-size: clamp(13.5px, 2.6cqw, 15px); line-height: 1.5;
  color: rgba(255,255,255,.86); max-width: 38ch; text-wrap: pretty;
  animation: bkRise .4s cubic-bezier(.23,1,.32,1) .66s both;
}

.bk-final-rows { margin-top: 20px; }
.bk-final-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.18);
  animation: bkRise .34s cubic-bezier(.23,1,.32,1) both;
}
.bk-final-row:nth-child(1) { animation-delay: .76s; }
.bk-final-row:nth-child(2) { animation-delay: .82s; }
.bk-final-row:nth-child(3) { animation-delay: .88s; }
.bk-final-row:nth-child(4) { animation-delay: .94s; }
.bk-final-row span { font-size: 12.5px; color: rgba(255,255,255,.66); }
.bk-final-row b { font-size: 13.5px; font-weight: 500; }

.bk-final-ruler {
  margin-top: 24px; animation: bkRise .4s cubic-bezier(.23,1,.32,1) 1.02s both;
}
.bk-fr-track {
  position: relative; height: 22px; display: flex;
  border-bottom: 1px solid rgba(255,255,255,.28);
  border-right: 1px solid rgba(255,255,255,.28);
}
.bk-fr-cell { flex: 1; border-left: 1px solid rgba(255,255,255,.28); }
.bk-fr-block {
  position: absolute; top: 3px; bottom: 3px; background: #FFFFFF; border-radius: 2px;
}
.bk-fr-ticks {
  display: flex; justify-content: space-between; padding-top: 5px;
  font-size: 9.5px; font-weight: 500; color: rgba(255,255,255,.6);
}

.bk-final-foot {
  padding-bottom: 26px;
  animation: bkRise .4s cubic-bezier(.23,1,.32,1) 1.06s both;
}
/* Цвет текста задаём явно во всех состояниях: color:inherit здесь наследовал
   белый от цветной подложки — на белой кнопке надпись пропадала. */
.bk-final-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 52px; border-radius: 13px;
  background: #FFFFFF; color: #0C6449; text-decoration: none;
  font-size: 15px; font-weight: 600;
  transition: transform .16s cubic-bezier(.23,1,.32,1),
              background-color .2s ease, box-shadow .2s ease;
}
.bk-final-btn:hover,
.bk-final-btn:focus-visible { color: #0C6449; background: #F2FBF7; }
.bk-final-btn:active { transform: scale(0.985); }

.bk-final-btn-err,
.bk-final-btn-err:hover,
.bk-final-btn-err:focus-visible { color: #C2262B; }
.bk-final-btn-err:hover { background: #FFF5F4; }
.bk-final-note { padding-top: 12px; font-size: 12px; color: rgba(255,255,255,.66); }
.bk-final-link {
  display: block; text-align: center; padding-top: 14px;
  font-family: 'Inter Tight', 'Onest', sans-serif; font-style: italic; font-weight: 700;
  font-size: 13px; color: rgba(255,255,255,.7); text-decoration: none;
}
.bk-final-link:hover { color: #FFFFFF; }

@keyframes bkRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-check path, .bk-cross path { animation: none; stroke-dashoffset: 0; }
  .bk-final-lbl, .bk-code, .bk-final-h1, .bk-final-text,
  .bk-final-row, .bk-final-ruler, .bk-final-foot { animation: none; }
}

/* ---- Экран контактов ---- */
.bk-field { margin-top: 14px; }
.bk-label {
  display: block; font-size: 12.5px; font-weight: 500;
  color: var(--ink-2); margin-bottom: 6px;
}
body .bk-input {
  width: 100%; height: 48px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--ink);
  font-family: 'Onest', sans-serif; font-size: 15px; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
body .bk-input.font-num { font-family: 'IBM Plex Mono', monospace; }
body .bk-input:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint);
}
body .bk-textarea {
  height: auto; padding: 12px 14px; line-height: 1.45; resize: none;
}
.bk-field-err { min-height: 16px; padding-top: 5px; font-size: 13px; font-weight: 500; color: var(--red-fg); }
.bk-field-err[data-err-for]:empty { display: none; }
/* Поле с ошибкой видно и в фокусе: красная рамка поверх акцентной */
body .bk-input.is-bad, body .bk-input.is-bad:focus {
  border-color: var(--red-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-fg) 14%, transparent);
}

.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.bk-chip {
  border: 1px solid transparent; border-radius: var(--radius-pill);
  padding: 7px 12px; background: var(--surface); color: var(--ink-2);
  font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: transform .14s cubic-bezier(.23,1,.32,1), border-color .16s ease, background-color .16s ease;
}
.bk-chip:hover { border-color: var(--border-hover); }
.bk-chip:active { transform: scale(0.96); }
.bk-chip.is-on { background: var(--accent-tint); color: var(--accent-dark); border-color: var(--accent); }

/* Знакомый клиент из Telegram */
.bk-known {
  border: 1px solid var(--accent-soft); background: var(--accent-tint-2);
  border-radius: var(--radius-md); padding: 13px 15px;
}
.bk-known-lbl { font-size: 11.5px; color: var(--ink-4); }
.bk-known-name { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 3px; }
.bk-known-phone { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* Старое меню бота: просим обновить, чтобы узнавать без ввода номера */
.bk-relink {
  margin-top: 18px;
  border: 1px solid var(--accent-soft); background: var(--accent-tint-2);
  border-radius: var(--radius-md); padding: 14px 15px;
}
.bk-relink-text { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.bk-relink-btn {
  margin-top: 11px; height: 40px; padding: 0 16px;
  border: 0; border-radius: 11px; background: var(--accent); color: #fff;
  font-family: inherit; font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; transition: transform .14s cubic-bezier(.23,1,.32,1), background-color .2s ease;
}
.bk-relink-btn:hover { background: var(--accent-dark); }
.bk-relink-btn:active { transform: scale(0.97); }
.bk-relink-fail { margin-top: 9px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

/* Промокод */
.bk-promo-open {
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
  border-bottom: 1px solid var(--border-hover); display: inline-block;
  list-style: none; padding-bottom: 1px;
}
.bk-promo-open::-webkit-details-marker { display: none; }
.bk-promo-open:hover { color: var(--accent); border-color: var(--accent); }
.bk-promo-body { margin-top: 12px; }
.bk-promo-row { display: flex; gap: 8px; }
body .bk-promo-input { flex: 1; height: 44px; text-transform: uppercase; }
.bk-promo-btn {
  height: 44px; padding: 0 16px; flex: none;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--ink-2);
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
  transition: border-color .16s ease, color .16s ease;
}
.bk-promo-btn:hover { border-color: var(--accent); color: var(--accent); }
.bk-promo-status { min-height: 16px; padding-top: 6px; font-size: 11.5px; color: var(--ink-4); }
.bk-promo-status.is-ok  { color: var(--green-fg); font-weight: 500; }
.bk-promo-status.is-err { color: var(--red-fg); }

/* Оплата */
.bk-pay { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.bk-pay-row {
  display: flex; align-items: center; gap: 11px; padding: 13px 14px;
  font-size: 14px; cursor: pointer;
}
.bk-pay-row.is-on { background: var(--accent-tint); font-weight: 500; }
.bk-pay-row.is-off { border-top: 1px solid var(--line); cursor: default; }
.bk-pay-dot {
  width: 16px; height: 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--border); flex: none; background: var(--card);
}
.bk-pay-dot.is-on { border: 5px solid var(--accent); }
.bk-pay-soon {
  margin-left: auto; font-size: 10.5px; color: var(--ink-4);
  background: var(--surface); border-radius: var(--radius-pill); padding: 4px 9px;
}

/* Сводка */
.bk-summary { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px; }
.bk-sum-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 7px 0;
}
.bk-sum-row span { font-size: 12.5px; color: var(--ink-4); }
.bk-sum-row b { font-size: 13.5px; font-weight: 500; color: var(--ink); }

/* Подвал с итогом и кнопкой */
.bk-foot-total { display: flex; align-items: baseline; gap: 4px; margin-left: auto; }
.bk-foot-total > span:first-child {
  font-size: 22px; font-weight: 600; letter-spacing: -0.03em; color: var(--ink);
}
.bk-foot-cur { font-size: 11px; color: var(--ink-4); }
.bk-cta {
  height: 52px; padding: 0 22px; flex: none;
  border: 0; border-radius: 13px; background: var(--accent); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; box-shadow: var(--shadow-accent);
  transition: transform .14s cubic-bezier(.23,1,.32,1), background-color .2s ease;
}
.bk-cta:hover { background: var(--accent-dark); }
.bk-cta:active { transform: scale(0.98); }
/* Кнопка гаснет сразу после отправки: на медленной связи человек иначе жмёт
   второй раз и получает отказ по слоту, который сам же только что занял. */
.bk-cta:disabled,
/* Кнопка в работе.

   Раньше это был просто `opacity: .55` — кнопка гасла и висела серым пятном,
   пока сервер отвечает. На медленной связи это читается как «сломалось»:
   человек либо жмёт ещё раз, либо уходит со страницы. Гасим меньше, а вместо
   этого показываем вращающийся индикатор и меняем подпись на «Бронируем…».
   Нажать всё равно нельзя — от двойной брони защищает `disabled`. */
.bk-cta { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.bk-cta-spin { display: none; flex: none; }
.bk-cta.is-busy {
  background: var(--accent); opacity: .82;
  cursor: default; box-shadow: none; transform: none;
}
.bk-cta.is-busy .bk-cta-spin {
  display: block; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: bk-spin .7s linear infinite;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  /* Кому вращение мешает — оставляем точку: она всё равно говорит «идёт». */
  .bk-cta.is-busy .bk-cta-spin { animation: none; border-top-color: rgba(255,255,255,.6); }
}

@media (max-width: 420px) {
  .bk-foot { flex-wrap: wrap; }
  .bk-cta { width: 100%; order: 3; }
}

/* ---- Плавность букинга ----
   Контент шага приезжает снизу-справа: движение подсказывает направление
   по потоку. Хиро на главной разбираем лесенкой, чтобы взгляд шёл сверху вниз. */
.bk-body,
.bk-day-ruler {
  animation: bkStepIn .42s cubic-bezier(.32,.72,0,1) both;
}
.bk-day-ruler { animation-delay: .02s; }

@keyframes bkStepIn {
  from { opacity: 0; transform: translate3d(14px, 6px, 0); }
  to   { opacity: 1; transform: none; }
}

.bk-home .bk-top    { animation: bkRise .5s cubic-bezier(.23,1,.32,1) both; }
.bk-home .bk-hero   { animation: bkRise .55s cubic-bezier(.23,1,.32,1) .06s both; }
.bk-home .bk-langs  { animation: bkRise .55s cubic-bezier(.23,1,.32,1) .14s both; }
.bk-home .bk-ruler-wrap { animation: bkRise .6s cubic-bezier(.23,1,.32,1) .2s both; }

/* Карточки часов и слоты появляются лесенкой */
.bk-hgrid > *   { animation: bkRise .44s cubic-bezier(.23,1,.32,1) both; }
.bk-hgrid > *:nth-child(2) { animation-delay: .04s; }
.bk-hgrid > *:nth-child(3) { animation-delay: .08s; }
.bk-hgrid > *:nth-child(4) { animation-delay: .12s; }
.bk-hgrid > *:nth-child(n+5) { animation-delay: .16s; }

/* Клетки календаря и чипы времени — общий мягкий вход */
.bk-cal, .bk-starts, .bk-summary { animation: bkRise .46s cubic-bezier(.23,1,.32,1) .06s both; }

/* Поля формы: фокус мягче, кнопка отзывается сразу */
body .bk-input { transition: border-color .18s ease, box-shadow .22s cubic-bezier(.23,1,.32,1); }
.bk-lang, .bk-hcard, .bk-day, .bk-start, .bk-chip, .bk-cta, .bk-back, .bk-promo-btn {
  will-change: transform;
}

/* backdrop-filter тут был лишним: фон подвала непрозрачный, размывать нечего,
   а слой композитинга на закреплённом элементе только мешает прокрутке. */

@media (prefers-reduced-motion: reduce) {
  .bk-body, .bk-day-ruler, .bk-home .bk-top, .bk-home .bk-hero,
  .bk-home .bk-langs, .bk-home .bk-ruler-wrap, .bk-hgrid > *,
  .bk-cal, .bk-starts, .bk-summary { animation: none; }
}

/* ========================================================================
   АБОНЕМЕНТ: КОНСТРУКТОР НА САЙТЕ БРОНИ
   Сверху — карта абонемента: всё, что клиент выбирает, сразу видно на ней.
   Ниже — шаги с номерами. Выбранное — акцентная рамка и бледная заливка,
   как у способа оплаты и чипов; числа — моноширинные.
   ===================================================================== */

.ab-langs {
  display: flex; gap: 2px; padding: 3px;
  border-radius: var(--radius-pill); background: var(--surface);
}
.ab-lang {
  min-width: 36px; height: 26px; padding: 0 9px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-pill); text-decoration: none;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; color: var(--ink-4);
  transition: background-color .2s ease, color .2s ease;
}
.ab-lang:hover { color: var(--ink-2); }
.ab-lang.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.08); }

.ab-body { counter-reset: absec; }
/* Что показываем только у бокса или только у мойки */
.ab-body[data-kind="box"] [data-for="wash"],
.ab-body[data-kind="wash"] [data-for="box"] { display: none; }

.ab-hero { margin-top: 20px; }
.ab-kicker { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--accent); }
.bk-title.ab-title {
  margin: 6px 0 0; font-size: clamp(32px, 8.8cqw, 48px);
  letter-spacing: -0.045em; line-height: 1.02; text-wrap: balance;
}
.ab-lead {
  margin: 12px 0 0; max-width: 46ch; font-size: 14px; line-height: 1.5;
  color: var(--ink-3); text-wrap: pretty;
}
.ab-error { margin-top: 16px; }

/* ---- Карта абонемента ---- */
.ab-pass {
  position: relative; overflow: hidden;
  margin-top: 22px; padding: 18px 20px 16px;
  border-radius: 24px; color: #fff; background: var(--accent);
  animation: bkRise .6s cubic-bezier(.23,1,.32,1) .06s both;
}
.ab-pass-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ab-pass-logo {
  font-family: 'Inter Tight', 'Onest', sans-serif; font-style: italic;
  font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
}
.ab-pass-logo span { opacity: .55; }
.ab-pass-lbl { font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; opacity: .72; }
.ab-pass-main { display: flex; align-items: baseline; gap: 8px; margin-top: 26px; overflow: hidden; }
.ab-pass-n {
  display: inline-block; font-size: clamp(56px, 16cqw, 76px); font-weight: 600;
  letter-spacing: -0.06em; line-height: .9;
}
.ab-pass-u { font-size: 18px; font-weight: 500; opacity: .82; }
.ab-pass-meta { margin-top: 8px; font-size: 13.5px; font-weight: 500; opacity: .92; }
.ab-pass-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ab-pass-tags:empty { display: none; }
.ab-pass-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: var(--radius-pill); background: rgba(255,255,255,.17);
  font-size: 11px; font-weight: 500; animation: abPop .3s cubic-bezier(.23,1,.32,1);
}
@keyframes abPop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.ab-pass-foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.2);
}
.ab-pass-rate { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ab-pass-rate b { font-size: 21px; font-weight: 600; letter-spacing: -0.04em; }
.ab-pass-rate span { font-size: 12px; opacity: .8; }
.ab-pass-was { margin-top: 2px; font-size: 11.5px; opacity: .7; }
.ab-pass-pct {
  flex: none; display: inline-flex; align-items: center; height: 30px; padding: 0 12px;
  border-radius: var(--radius-pill); background: #fff; color: var(--accent-dark);
  font-size: 13px; font-weight: 600;
}

/* ---- Шаги ---- */
.ab-sec { margin-top: 32px; }
.ab-sec-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.ab-sec-num { flex: none; font-size: 11px; font-weight: 500; color: var(--accent); }
.ab-sec-num::before { counter-increment: absec; content: counter(absec, decimal-leading-zero); }
.ab-h { flex: 1; margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.ab-sec-hint { font-size: 11.5px; color: var(--ink-4); text-align: right; }

/* Скрытые поля выбора: рисуем свои. appearance — против плагина форм
   Tailwind, он рисует радио даже под opacity. */
body .ab-radio, body .ab-check {
  position: absolute; width: 1px; height: 1px; margin: 0;
  opacity: 0; pointer-events: none; appearance: none; -webkit-appearance: none;
}

/* ---- Что берёт ---- */
.ab-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab-kind {
  position: relative; display: flex; flex-direction: column;
  padding: 14px 14px 13px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--card); cursor: pointer;
  transition: border-color .18s ease, background-color .2s ease, box-shadow .2s ease,
              transform .14s cubic-bezier(.23,1,.32,1);
}
.ab-kind:hover { border-color: var(--border-hover); }
.ab-kind:active { transform: scale(0.98); }
.ab-kind:has(.ab-radio:checked) {
  border-color: var(--accent); background: var(--accent-tint-2);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.ab-kind:has(.ab-radio:focus-visible) { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-tint); }
.ab-kind-ic {
  width: 38px; height: 38px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink-3);
  transition: background-color .22s ease, color .22s ease;
}
.ab-kind-ic svg { width: 22px; height: 22px; }
.ab-kind:has(.ab-radio:checked) .ab-kind-ic { background: var(--accent); color: #fff; }
.ab-kind-check {
  position: absolute; top: 13px; right: 13px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%; color: transparent;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ab-kind-check svg { width: 12px; height: 12px; }
.ab-kind:has(.ab-radio:checked) .ab-kind-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.ab-kind-t { margin-top: 12px; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; color: var(--ink); }
.ab-kind-s { margin-top: 4px; font-size: 11.5px; line-height: 1.35; color: var(--ink-4); text-wrap: pretty; }
.ab-kind-from { margin-top: auto; padding-top: 10px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.ab-kind:has(.ab-radio:checked) .ab-kind-from { color: var(--accent-dark); }

/* ---- Сколько ---- */
.ab-qty-sec { position: relative; }
.ab-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ab-step {
  width: 48px; height: 48px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: border-color .18s ease, color .18s ease, transform .14s cubic-bezier(.23,1,.32,1);
}
.ab-step svg { width: 20px; height: 20px; }
.ab-step:hover { border-color: var(--border-hover); color: var(--accent); }
.ab-step:active { transform: scale(0.92); }
.ab-qty-v { display: flex; align-items: baseline; gap: 7px; overflow: hidden; padding: 4px 0; }
.ab-qty-n {
  display: inline-block; min-width: 2ch; text-align: right;
  font-size: 46px; font-weight: 600; letter-spacing: -0.05em; line-height: .95; color: var(--ink);
}
.ab-qty-u { min-width: 5ch; font-size: 16px; font-weight: 500; color: var(--ink-3); }
.ab-pass-n.is-up, .ab-qty-n.is-up     { animation: abTickUp .28s cubic-bezier(.23,1,.32,1); }
.ab-pass-n.is-down, .ab-qty-n.is-down { animation: abTickDown .28s cubic-bezier(.23,1,.32,1); }
@keyframes abTickUp   { from { transform: translateY(18%); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes abTickDown { from { transform: translateY(-18%); opacity: .3; } to { transform: none; opacity: 1; } }

/* Ступени скидки за объём: над шкалой проценты, сама шкала — серые
   отрезки и поверх них синяя копия, открытая ровно до выбранного числа. */
.ab-lad { margin-top: 18px; }
.ab-lad-track {
  position: relative; cursor: pointer; border-radius: 12px;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.ab-qty-sec:has(.ab-range:focus-visible) .ab-lad-track { outline: 2px solid var(--accent); outline-offset: 4px; }
.ab-lad-labels { position: relative; height: 22px; margin-bottom: 10px; }
.ab-lad-lbl { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; }
.ab-lad-lbl i {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px;
  border-radius: var(--radius-pill); font-style: normal;
  font-size: 10.5px; font-weight: 500; color: var(--ink-4);
  transition: background-color .22s ease, color .22s ease;
}
.ab-lad-lbl.is-on i { background: var(--accent-tint); color: var(--accent-dark); font-weight: 600; }
.ab-lad-bar { position: relative; height: 10px; }
.ab-lad-layer { position: absolute; inset: 0; }
.ab-lad-layer.is-fill { transition: clip-path .3s cubic-bezier(.32,.72,0,1); }
.ab-lad-seg { position: absolute; top: 0; bottom: 0; }
.ab-lad-seg::before {
  content: ""; position: absolute; inset: 0 1.5px; border-radius: 5px; background: var(--border);
}
.ab-lad-seg:first-child::before { left: 0; }
.ab-lad-seg:last-child::before { right: 0; }
.ab-lad-layer.is-fill .ab-lad-seg::before { background: var(--accent); }
.ab-lad-thumb {
  position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%; background: #fff; pointer-events: none;
  box-shadow: 0 0 0 1px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.14), 0 6px 14px -4px rgba(41,98,255,.4);
  transition: left .3s cubic-bezier(.32,.72,0,1), transform .18s cubic-bezier(.23,1,.32,1);
}
.ab-lad-thumb::after {
  content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--accent);
}
.ab-lad-track.is-drag .ab-lad-thumb { transform: scale(1.12); }
.ab-lad-track.is-drag .ab-lad-layer.is-fill,
.ab-lad-track.is-drag .ab-lad-thumb { transition-duration: .08s, .18s; }
.ab-lad-ticks {
  position: relative; height: 14px; margin-top: 12px;
  font-size: 9.5px; font-weight: 500; color: var(--ink-4);
}
.ab-lad-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
body .ab-range {
  position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; margin: 0;
  opacity: 0; pointer-events: none;
}
.ab-next {
  margin-top: 12px; display: inline-flex; align-items: center; min-height: 32px; padding: 6px 13px;
  border: 0; border-radius: var(--radius-pill); background: var(--accent-tint); color: var(--accent-dark);
  font: inherit; font-size: 12.5px; font-weight: 500; text-align: left; cursor: pointer;
  transition: background-color .2s ease, transform .14s cubic-bezier(.23,1,.32,1);
}
.ab-next:hover { background: var(--accent-soft); }
.ab-next:active { transform: scale(0.97); }
.ab-next.is-max { background: var(--green-bg); color: var(--green-fg); cursor: default; transform: none; }

/* ---- Срок: сегменты с бегущей подложкой ---- */
.ab-sc {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  padding: 4px; border-radius: 16px; background: var(--surface);
}
.ab-sc::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 12px; background: var(--card);
  box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 4px 12px -6px rgba(15,23,42,.14);
  transition: transform .38s cubic-bezier(.32,.72,0,1);
}
.ab-sc:has(.ab-sc-opt:nth-child(2) .ab-radio:checked)::before { transform: translateX(100%); }
.ab-sc-opt {
  position: relative; z-index: 1; height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; cursor: pointer;
}
.ab-sc-opt:has(.ab-radio:focus-visible) { box-shadow: 0 0 0 2px var(--accent); }
.ab-sc-t { font-size: 13.5px; font-weight: 500; color: var(--ink-4); transition: color .2s ease; }
.ab-sc-t b { font-size: 21px; font-weight: 600; letter-spacing: -0.04em; color: inherit; }
.ab-sc-opt:has(.ab-radio:checked) .ab-sc-t { color: var(--ink); }
.ab-sc-pct {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  border-radius: var(--radius-pill); background: var(--green-bg); color: var(--green-fg);
  font-size: 10.5px; font-weight: 600;
}

/* ---- Когда приезжает ---- */
.ab-days { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab-day {
  position: relative; display: flex; flex-direction: column;
  padding: 14px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--card); cursor: pointer;
  transition: border-color .18s ease, background-color .2s ease, box-shadow .2s ease,
              transform .14s cubic-bezier(.23,1,.32,1);
}
.ab-day::after {
  content: ""; position: absolute; top: 14px; right: 14px;
  width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card);
  transition: border-width .2s cubic-bezier(.23,1,.32,1), border-color .18s ease;
}
.ab-day:hover { border-color: var(--border-hover); }
.ab-day:active { transform: scale(0.98); }
.ab-day:has(.ab-radio:checked) {
  border-color: var(--accent); background: var(--accent-tint-2);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.ab-day:has(.ab-radio:checked)::after { border: 5px solid var(--accent); }
.ab-day:has(.ab-radio:focus-visible) { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-tint); }
.ab-day-t { padding-right: 24px; font-size: 15px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.ab-day-s { margin-top: 2px; font-size: 11.5px; color: var(--ink-4); }
.ab-day-rate { margin-top: 14px; display: flex; flex-direction: column; gap: 1px; }
.ab-day-rate b { font-size: 18px; font-weight: 600; letter-spacing: -0.035em; color: var(--ink); }
.ab-day-rate span { font-size: 10.5px; color: var(--ink-4); }
.ab-day:has(.ab-radio:checked) .ab-day-rate b { color: var(--accent-dark); }

/* ---- Дополнительно ---- */
.ab-opts { border: 1px solid var(--border); border-radius: 18px; background: var(--card); overflow: hidden; }
.ab-opt {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; cursor: pointer; transition: background-color .2s ease;
}
.ab-opt:hover { background: var(--line-3); }
.ab-opt:has(.ab-check:checked) { background: var(--accent-tint-2); }
.ab-opt:has(.ab-check:focus-visible) { box-shadow: inset 0 0 0 2px var(--accent); }
.ab-opt-ic {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); color: var(--ink-3);
  transition: background-color .22s ease, color .22s ease;
}
.ab-opt-ic svg { width: 21px; height: 21px; }
.ab-opt:has(.ab-check:checked) .ab-opt-ic { background: var(--accent); color: #fff; }
.ab-opt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ab-opt-t { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.ab-opt-s { font-size: 12px; line-height: 1.45; color: var(--ink-3); text-wrap: pretty; }
.ab-opt-s b { font-weight: 600; color: var(--ink-2); }
.ab-opt-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.ab-opt-price { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ab-opt:has(.ab-check:checked) .ab-opt-price { color: var(--accent-dark); }
.ab-switch {
  position: relative; width: 44px; height: 26px; flex: none;
  border-radius: 13px; background: var(--border); transition: background-color .22s ease;
}
.ab-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.18);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
}
.ab-opt:has(.ab-check:checked) .ab-switch { background: var(--accent); }
.ab-opt:has(.ab-check:checked) .ab-switch::after { transform: translateX(18px); }
/* Допы мойки выезжают, когда выбрана мойка */
.ab-opts-wash {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows .42s cubic-bezier(.32,.72,0,1), visibility 0s;
}
.ab-opts-wash-in { min-height: 0; overflow: hidden; }
.ab-opts-wash-in .ab-opt { border-top: 1px solid var(--line); }
.ab-body[data-kind="box"] .ab-opts-wash {
  grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows .42s cubic-bezier(.32,.72,0,1), visibility 0s .42s;
}

/* ---- Чек ---- */
.ab-receipt {
  margin-top: 32px; padding: 18px 18px 16px;
  border: 1px solid var(--border); border-radius: 22px; background: var(--card);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 16px 36px -24px rgba(15,23,42,.22);
}
.ab-r-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px dashed var(--dashed);
}
.ab-r-title { font-size: 15px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.ab-r-valid { font-size: 11.5px; color: var(--ink-4); text-align: right; }
.ab-r-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 0; }
.ab-r-row[hidden] { display: none; }
.ab-r-l { font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.ab-r-l small { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-4); }
.ab-r-l small:empty { display: none; }
.ab-r-pct { font-size: 11px; font-weight: 600; color: var(--green-fg); }
.ab-r-row b { flex: none; font-size: 14px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.ab-r-row b.ab-strike { color: var(--ink-4); text-decoration: line-through; text-decoration-color: var(--muted-2); }
.ab-r-row b.ab-green { color: var(--green-fg); }
.ab-r-total {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line);
}
.ab-r-total-l { font-size: 15px; font-weight: 600; color: var(--ink); }
.ab-r-total-v { display: flex; align-items: baseline; gap: 5px; }
.ab-r-total-v b { font-size: clamp(28px, 7.6cqw, 38px); font-weight: 600; letter-spacing: -0.045em; color: var(--ink); }
.ab-r-cur { font-size: 12px; color: var(--ink-4); }
.ab-r-save { display: flex; justify-content: flex-end; margin-top: 10px; }
.ab-save {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px;
  border-radius: var(--radius-pill); background: var(--green-bg); color: var(--green-fg);
  font-size: 12.5px; font-weight: 600;
}
.ab-save::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- Как это работает ---- */
.ab-how { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--surface); }
.ab-how-h { margin-bottom: 10px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.ab-how-list {
  margin: 0; padding: 0; list-style: none; counter-reset: ab;
  display: flex; flex-direction: column; gap: 9px;
}
.ab-how-list li {
  counter-increment: ab; display: flex; gap: 10px;
  font-size: 12.5px; line-height: 1.45; color: var(--ink-3); text-wrap: pretty;
}
.ab-how-list li::before {
  content: counter(ab, decimal-leading-zero); flex: none; padding-top: 2px;
  font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; font-weight: 500; color: var(--accent);
}
.ab-note { margin: 12px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-4); text-wrap: pretty; }

/* ---- Вход в конструктор: главная и выбор часов ---- */
.ab-entry {
  margin-top: 18px; display: flex; align-items: center; gap: 13px;
  padding: 14px 15px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--card); color: var(--ink); text-decoration: none;
  transition: border-color .18s ease, transform .14s cubic-bezier(.23,1,.32,1);
}
.ab-entry:hover { border-color: var(--accent); color: var(--ink); }
.ab-entry:active { transform: scale(0.985); }
.ab-entry-ic {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-tint); color: var(--accent);
}
.ab-entry-ic svg { width: 22px; height: 22px; }
.ab-entry-txt { flex: 1; min-width: 0; }
.ab-entry-t { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.ab-entry-s { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--ink-4); text-wrap: pretty; }
.ab-entry-go { flex: none; font-size: 12.5px; font-weight: 600; color: var(--accent); }
.bk-home .ab-entry { animation: bkRise .55s cubic-bezier(.23,1,.32,1) .17s both; }
.ab-entry.is-soon .ab-entry-go {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--accent-tint); font-size: 11.5px;
}

/* ---- Расчёт абонемента: экономия и шаги ---- */
.ac-edit { margin-left: 4px; color: var(--accent); font-weight: 500; text-decoration: none; white-space: nowrap; }
.ac-edit:hover { text-decoration: underline; }
.ac-save {
  margin-top: 22px; padding: 18px 18px 16px; border-radius: 22px;
  background: var(--green-bg); color: var(--green-fg);
  animation: bkRise .6s cubic-bezier(.23,1,.32,1) .06s both;
}
.ac-save-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ac-save-l { font-size: 13px; font-weight: 600; }
.ac-save-pct {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px;
  border-radius: var(--radius-pill); background: var(--card); font-size: 12.5px; font-weight: 600;
}
.ac-save-v { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.ac-save-v b { font-size: clamp(36px, 10cqw, 52px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.ac-save-v span { font-size: 14px; font-weight: 500; opacity: .8; }
.ac-save-free { margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-wrap: pretty; }
.ac-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ac-bar { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: baseline; }
.ac-bar-l { font-size: 12.5px; color: var(--ink-3); }
.ac-bar b { font-size: 14px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ac-bar.is-with b { color: var(--ink); }
.ac-bar-track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.65); overflow: hidden; }
.ac-bar-track i { display: block; height: 100%; border-radius: inherit; background: var(--muted-2, #c9ccd3); }
.ac-bar.is-with .ac-bar-track i { background: var(--green-fg); transform-origin: left; animation: acGrow .9s cubic-bezier(.23,1,.32,1) .25s both; }
@keyframes acGrow { from { transform: scaleX(.2); } to { transform: none; } }
.ac-unit { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid rgba(0,0,0,.06);
  font-size: 13px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
.ac-steps { margin-top: 18px; }
.ac-steps .ab-r-l { min-width: 0; }
.ac-steps .ab-r-row.ac-sub { border-top: 1px dashed var(--dashed); margin-top: 4px; padding-top: 12px; }
.ac-total-s { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-4); text-align: right; }
.ac-soon {
  margin-top: 22px; display: flex; gap: 12px; align-items: flex-start;
  padding: 15px 16px; border-radius: 16px; background: var(--accent-tint);
}
.ac-soon-dot {
  flex: none; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 0 var(--accent);
  animation: acPulse 1.8s ease-out infinite;
}
@keyframes acPulse { 0% { box-shadow: 0 0 0 0 rgba(41,98,255,.45); } 100% { box-shadow: 0 0 0 10px rgba(41,98,255,0); } }
.ac-soon-txt { display: flex; flex-direction: column; gap: 3px; }
.ac-soon-txt b { font-size: 14.5px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.ac-soon-txt span { font-size: 12.5px; line-height: 1.45; color: var(--ink-3); text-wrap: pretty; }

/* ---- Запись по абонементу: часов больше остатка ---- */
.ab-bk-extra {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--accent-tint);
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty;
}
.ab-bk-calc { margin-top: 14px; padding: 14px 15px; border-radius: 16px; background: var(--surface); }
.ab-bk-calc-h { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.ab-bk-calc p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); text-wrap: pretty; }
.ab-bk-calc .ab-bk-calc-f { font-size: 13px; color: var(--ink-2); }
.ab-bk-calc .ab-bk-calc-f b { color: var(--ink); }
.ab-bk-calc .ab-bk-calc-s { font-size: 11.5px; color: var(--ink-4); }

.bk-final-row.ab-final-calc span { font-size: 11.5px; color: var(--ink-4); }

/* ---- «Совсем скоро» ---- */
.as-stage { position: relative; margin-top: 18px; }
.as-pass { margin-top: 0; filter: saturate(.9); }
.as-pass::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(115deg, rgba(255,255,255,0) 30%, rgba(255,255,255,.28) 50%, rgba(255,255,255,0) 70%);
  background-size: 250% 100%; animation: asShine 2.8s ease-in-out infinite;
}
@keyframes asShine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.as-foot .bk-cta { flex: 1; }
.as-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%); white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--card); color: var(--ink); font-size: 12px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 8px 20px -10px rgba(15,23,42,.3);
}
.as-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: acPulse 1.8s ease-out infinite; }
.as-hero { margin-top: 26px; }
.as-list { margin: 18px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.as-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 14px; line-height: 1.45; color: var(--ink-2); text-wrap: pretty;
}
.as-list li::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--accent-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.4 8.3l2.3 2.3 4.9-5.1' fill='none' stroke='%232962FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
@media (prefers-reduced-motion: reduce) {
  .as-pass::after, .as-badge i, .ac-soon-dot, .ac-bar.is-with .ac-bar-track i { animation: none; }
}

/* ---- «Ваш абонемент»: главная и выбор часов ----
   Клиенту, которого узнали по Telegram. Та же сплошная синяя карта, что в
   конструкторе, только компактная: остаток, срок и кнопка записи. */
.ab-mine {
  margin-top: 18px; display: block; padding: 15px 16px 14px;
  border-radius: 18px; background: var(--accent); color: #fff; text-decoration: none;
  box-shadow: var(--shadow-accent);
  transition: transform .14s cubic-bezier(.23,1,.32,1), background-color .2s ease;
}
.ab-mine + .ab-mine { margin-top: 10px; }
.ab-mine:hover { background: var(--accent-dark); color: #fff; }
.ab-mine:active { transform: scale(0.985); }
.ab-mine-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
}
.ab-mine-lbl { opacity: .75; }
.ab-mine-kind { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .85; }
.ab-mine-main { display: flex; align-items: baseline; gap: 7px; margin-top: 14px; }
.ab-mine-main b { font-size: 40px; font-weight: 600; letter-spacing: -0.05em; line-height: .95; }
.ab-mine-main span { font-size: 15px; font-weight: 500; opacity: .85; }
.ab-mine-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.2);
}
.ab-mine-meta { min-width: 0; font-size: 12px; opacity: .85; }
.ab-mine-go {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: var(--radius-pill); background: #fff; color: var(--accent-dark);
  font-size: 13px; font-weight: 600;
}
.ab-mine-go i { font-style: normal; transition: transform .25s cubic-bezier(.34,1.4,.64,1); }
.ab-mine:hover .ab-mine-go i { transform: translateX(2px); }
.bk-home .ab-mine { animation: bkRise .55s cubic-bezier(.23,1,.32,1) .17s both; }
.bk-body > .ab-mine { margin: 0 0 10px; }
.bk-body > .ab-mine + .bk-hgrid { margin-top: 18px; }

/* ---- Запись по абонементу ---- */
.ab-bk-kinds {
  display: inline-flex; gap: 4px; padding: 4px; margin-top: 8px;
  border-radius: var(--radius-pill); background: var(--surface);
}
.ab-bk-kind {
  height: 34px; padding: 0 16px; display: inline-flex; align-items: center;
  border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 500;
  color: var(--ink-3); text-decoration: none;
  transition: background-color .2s ease, color .18s ease;
}
.ab-bk-kind:hover { color: var(--ink); }
.ab-bk-kind.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(15,23,42,.08); }
.ab-bk-pass { margin-top: 16px; }
.ab-bk-pass .ab-pass-main { margin-top: 20px; }
.ab-bk-open {
  margin-top: 14px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
.ab-bk-open-h { font-size: 11.5px; color: var(--ink-4); margin-bottom: 3px; }
.ab-bk-open-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 5px 0;
  font-size: 13.5px; color: var(--ink-2);
}
.ab-bk-open-row b { font-weight: 600; color: var(--ink); }
.ab-bk-block { margin-top: 18px; }
.ab-bk-sec { margin-top: 28px; }
.ab-bk-sec .ab-sec-head { margin-bottom: 12px; }
.ab-bk-sec .bk-title-row { margin: 0 0 12px; align-items: baseline; }
.ab-step:disabled { opacity: .35; cursor: default; transform: none; }
.ab-step:disabled:hover { border-color: var(--border); color: var(--ink-2); }
.ab-bk-wash {
  margin-top: 24px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
}
.ab-bk-wash-t { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.ab-bk-wash-s { margin-top: 2px; font-size: 12.5px; color: var(--ink-4); }
.ab-bk-wash-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ab-bk-wash-add span {
  height: 24px; padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: var(--radius-pill); background: var(--accent-tint); color: var(--accent-dark);
  font-size: 11.5px; font-weight: 500;
}
.ab-bk-rule { margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-4); text-wrap: pretty; }

/* Экран «Заявка отправлена»: пятая строка и простая ссылка домой */
.bk-final-row:nth-child(5) { animation-delay: 1s; }
.bk-final-row:nth-child(6) { animation-delay: 1.1s; }
.bk-final-link.ab-final-home { font-family: inherit; font-style: normal; font-weight: 500; font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) {
  .ab-pass, .ab-pass-tag, .ab-pass-n.is-up, .ab-pass-n.is-down,
  .ab-qty-n.is-up, .ab-qty-n.is-down, .bk-home .ab-entry, .bk-home .ab-mine { animation: none; }
  .ab-lad-layer.is-fill, .ab-lad-thumb, .ab-sc::before,
  .ab-opts-wash, .ab-switch::after { transition: none; }
}

/* ========================================================================
   РЕДАКТОР РАССЫЛКИ + ПРЕДПРОСМОТР TELEGRAM
   Владелец выделяет слово и жмёт кнопку — в текст встаёт markdown. Справа
   тот же текст рендерит сервер тем же кодом, что и отправка, поэтому
   «увидел одно, ушло другое» невозможно.
   ===================================================================== */

.ed-wrap {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); overflow: hidden;
  transition: border-color .18s ease;
}
.ed-wrap:focus-within { border-color: var(--accent); }

.ed-bar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 7px 8px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.ed-btn {
  min-width: 30px; height: 30px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--ink-2);
  font-family: inherit; font-size: 13px; line-height: 1;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.ed-btn:hover { background: var(--card); border-color: var(--border); color: var(--ink); }
.ed-btn:active { transform: scale(0.94); }
.ed-hint {
  margin-left: auto; font-size: 11px; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }

/* Поле пишем без своей рамки — рамку держит .ed-wrap, иначе двойной контур */
textarea.ed-area {
  width: 100%; border: 0; border-radius: 0; background: transparent;
  padding: 12px 13px; font-size: 14px; line-height: 1.55; color: var(--ink);
  resize: vertical; min-height: 150px; display: block;
}
textarea.ed-area:focus { outline: none; box-shadow: none; }

.ed-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 11px; border-top: 1px solid var(--line);
  background: var(--surface-2); font-size: 11.5px; color: var(--ink-3);
}

/* ---- Выбор картинки ---- */
.img-pick {
  border: 1px dashed var(--border-hover); border-radius: 12px;
  padding: 14px; background: var(--surface-2);
}
.img-empty { text-align: center; }
.img-has { display: flex; align-items: center; gap: 12px; }
.img-thumb {
  width: 56px; height: 56px; flex: none; object-fit: cover;
  border-radius: 9px; border: 1px solid var(--border);
}

/* ---- Пузырь сообщения ---- */
.tg-stage {
  padding: 14px; border-radius: 12px;
  background: linear-gradient(160deg, #E8EEF6 0%, #DDE7F2 100%);
  display: flex; flex-direction: column; gap: 7px;
}
.tg-bubble {
  position: relative; align-self: flex-start;
  max-width: 100%; padding: 8px 11px 6px;
  background: #FFFFFF; border-radius: 14px 14px 14px 5px;
  font-size: 14px; line-height: 1.45; color: #0B0D12;
  word-break: break-word;
}
.tg-photo {
  display: block; width: 100%; max-height: 220px; object-fit: cover;
  border-radius: 9px; margin: -2px 0 7px;
}
.tg-text { white-space: normal; }
.tg-text b, .tg-text strong { font-weight: 700; }
.tg-time { margin-top: 3px; font-size: 10.5px; color: #8D96A3; text-align: right; }

.tg-code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px;
  background: #F1F3F6; padding: 1px 4px; border-radius: 4px;
}
.tg-pre {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12.5px;
  background: #F1F3F6; padding: 8px 10px; border-radius: 7px;
  margin: 5px 0; overflow-x: auto; white-space: pre;
}
.tg-quote {
  border-left: 3px solid var(--accent); padding: 2px 0 2px 9px;
  margin: 5px 0; color: #3C4655;
}
.tg-link { color: #2481CC; text-decoration: none; }
.tg-link:hover { text-decoration: underline; }

/* Спойлер: до клика текст скрыт «шумом», как в Telegram */
.tg-spoiler {
  background: #C4CBD4; color: transparent; border-radius: 3px;
  cursor: pointer; transition: color .2s ease, background-color .2s ease;
}
.tg-spoiler.is-open { background: transparent; color: inherit; }

/* Инлайн-кнопка под сообщением */
.tg-btn {
  align-self: stretch; padding: 9px 12px;
  border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, 0.92); color: #2481CC;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: default; text-align: center;
}

/* Две кнопки языка в предпросмотре стоят рядом — как их покажет Telegram. */
.tg-btn-row { display: flex; gap: 4px; align-self: stretch; }
.tg-btn-row .tg-btn { flex: 1; }

/* Галка «спросить язык» — не поле, а решение: даём ей место и объяснение. */
.lang-ask-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 12px; border-radius: 11px;
  background: var(--surface-1); border: 1px solid var(--hairline);
  cursor: pointer;
}
.lang-ask-row input { margin-top: 2px; flex: none; }
.lang-ask-row b { font-size: 13px; font-weight: 600; color: var(--ink); }
.lang-ask-hint {
  display: block; margin-top: 3px;
  font-size: 12px; line-height: 1.45; color: var(--ink-3);
}

.preview-err {
  margin-top: 10px; padding: 9px 11px; border-radius: 9px;
  background: rgba(181, 75, 65, 0.08); border: 1px solid var(--status-danger);
  font-size: 12.5px; color: var(--status-danger); line-height: 1.45;
}

/* Мягкое предупреждение в предпросмотре рассылки: отправить можно, но клиент
   увидит непарные звёздочки. Отличается от ошибки цветом, а не только значком. */
.preview-err.is-warn {
  background: rgba(193, 138, 46, 0.10);
  border-color: rgba(193, 138, 46, 0.35);
  color: #8A6114;
}

/* ========================================================================
   ПРОГРЕСС РАССЫЛКИ
   Отправка идёт на сервере в фоне, окно раз в секунду спрашивает, сколько
   ушло. Закрыть окно можно в любой момент: рассылка не остановится, а
   баннер над формой держит с ней связь.
   ===================================================================== */

.bc-spin {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2px solid var(--accent-soft); border-top-color: var(--accent);
  animation: bc-spin .9s cubic-bezier(.45, .15, .55, .85) infinite;
}
@keyframes bc-spin { to { transform: rotate(360deg); } }

/* Баннер «идёт рассылка» над формой */
.bc-live {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px 16px;
  border-color: var(--accent-soft); background: var(--accent-tint-2);
}
.bc-live-ok {
  display: none; width: 22px; height: 22px; flex: none; border-radius: 50%;
  align-items: center; justify-content: center;
  background: var(--green); color: #fff; font-size: 12px; font-weight: 700;
}
.bc-live-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bc-live-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.bc-live-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent-soft); }
.bc-live-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .8s cubic-bezier(.32, .72, 0, 1); }
.bc-live.is-done { border-color: var(--green-bd); background: var(--green-bg); }
.bc-live.is-done .bc-spin { display: none; }
.bc-live.is-done .bc-live-ok { display: flex; }
.bc-live.is-done .bc-live-bar { background: var(--green-bd); }
.bc-live.is-done .bc-live-bar i { background: var(--green); }
.bc-live.is-cut { border-color: var(--amber-bd); background: var(--amber-bg-2); }
.bc-live.is-cut .bc-live-ok { background: var(--amber); }
.bc-live.is-cut .bc-live-bar { background: var(--amber-bd); }
.bc-live.is-cut .bc-live-bar i { background: var(--amber); }

/* Пометки в карточке результата и в истории */
.bc-cut-note { margin-top: 6px; font-size: 12.5px; line-height: 1.5; color: var(--amber-fg); }
.bc-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px;
  border-radius: var(--radius-pill); font-size: 11px; font-weight: 600;
}
.bc-chip.is-live { background: var(--accent-tint); color: var(--accent-dark); }
.bc-chip.is-cut { background: var(--amber-bg); color: var(--amber-fg); }

/* Окно */
/* Браузер ужимает <dialog> до «100% − 2em − 6px»: при 92vw на телефоне окно
   вылезало за край, и снизу появлялась горизонтальная прокрутка. */
.bcp { width: min(460px, calc(100vw - 40px)); padding: 24px; }
.bcp [hidden] { display: none !important; }
.bcp-head { display: flex; align-items: center; gap: 14px; }
.bcp-ico {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-tint); color: var(--accent);
  transition: background-color .4s cubic-bezier(.32, .72, 0, 1), color .4s cubic-bezier(.32, .72, 0, 1);
}
.bcp-ico .bc-spin { width: 20px; height: 20px; }
.bcp-ico svg { display: none; width: 22px; height: 22px; }
.bcp[data-state="done"] .bcp-ico { background: var(--green-bg); color: var(--green); }
.bcp[data-state="interrupted"] .bcp-ico { background: var(--amber-bg); color: var(--amber); }
.bcp:not([data-state="running"]) .bcp-ico .bc-spin { display: none; }
.bcp[data-state="done"] .bcp-ok,
.bcp[data-state="interrupted"] .bcp-warn { display: block; }
.bcp-title { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; color: var(--ink); }
.bcp-sub {
  font-size: 13px; color: var(--ink-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bcp-count { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; }
.bcp-done { font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; color: var(--ink); }
.bcp-of { font-size: 15px; color: var(--ink-3); }
.bcp-pct { margin-left: auto; font-size: 13px; color: var(--ink-2); }

.bcp-bar {
  display: flex; height: 8px; margin-top: 12px; overflow: hidden;
  border-radius: var(--radius-pill); background: var(--surface-5);
}
.bcp-bar i { display: block; height: 100%; width: 0; transition: width .8s cubic-bezier(.32, .72, 0, 1); }
.bcp-fill-sent { background: var(--green); }
.bcp-fill-blocked { background: var(--amber); }
.bcp-fill-failed { background: var(--red); }
.bcp-eta { min-height: 18px; margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }

.bcp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.bcp-stat { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--hairline); }
.bcp-stat-k { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; line-height: 1.3; color: var(--ink-3); }
.bcp-stat b { display: block; margin-top: 4px; font-size: 18px; font-weight: 600; color: var(--ink); }
.bcp-dot { width: 7px; height: 7px; flex: none; margin-top: 4px; border-radius: 50%; }

.bcp-note {
  margin-top: 16px; padding: 10px 12px; border-radius: 12px;
  background: var(--accent-tint-2); font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
}
.bcp-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 480px) {
  .bcp { padding: 20px; }
  .bcp-stats { grid-template-columns: 1fr; gap: 6px; }
  .bcp-stat { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; }
  .bcp-stat b { margin-top: 0; font-size: 16px; }
  .bcp-foot > * { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .bc-spin { animation-duration: 2.4s; }
  .bcp-bar i, .bc-live-bar i { transition: none; }
}

/* ========================= ФИНАНСЫ (05.10.2026) =========================
   /finance — список месяцев и справочник категорий, /finance/months/{id} —
   месяц. Префикс fx-, чтобы не путаться со старыми fin-* из шаблона. */

.fx-page { padding: 18px 20px 48px; display: flex; flex-direction: column; gap: 16px; }
.fx-num { font-family: 'IBM Plex Mono', monospace; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.fx-plus { color: var(--green-fg); }
.fx-minus { color: var(--ink); }
.fx-muted { color: var(--muted); }
.fx-h2 { font-size: 13px; font-weight: 600; color: var(--ink-3); letter-spacing: .01em; margin: 6px 2px -4px; display: flex; align-items: center; gap: 8px; }
.fx-h2 .cnt { font-family: 'IBM Plex Mono', monospace; font-weight: 500; color: var(--muted-2); }

/* ---- Список месяцев: открытые — крупные карточки ---- */
.fx-open-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.fx-mcard {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl);
  padding: 16px 18px 15px; position: relative;
  transition: border-color .25s cubic-bezier(.32,.72,0,1), transform .35s cubic-bezier(.32,.72,0,1), box-shadow .35s cubic-bezier(.32,.72,0,1);
}
.fx-mcard:hover { border-color: var(--border-hover); transform: translateY(-1px); box-shadow: 0 10px 30px rgba(11,13,18,.06); }
.fx-mcard-top { display: flex; align-items: center; gap: 10px; }
.fx-mcard-title { font-size: 19px; font-weight: 600; letter-spacing: -0.03em; }
.fx-mcard-go {
  margin-left: auto; width: 30px; height: 30px; border-radius: 99px; background: var(--surface);
  display: grid; place-items: center; color: var(--ink-3);
  transition: transform .35s cubic-bezier(.32,.72,0,1), background .2s;
}
.fx-mcard:hover .fx-mcard-go { transform: translateX(2px); background: var(--ink); color: #fff; }
.fx-days { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.fx-days-bar { flex: 1; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.fx-days-bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.fx-mcard-pl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.fx-k { font-size: 11.5px; color: var(--muted); }
.fx-v { font-size: 15.5px; font-weight: 500; margin-top: 3px; white-space: nowrap; }
.fx-mcard-bal { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.fx-mcard-bal b { font-weight: 500; color: var(--ink); }
.fx-mcard .fx-warn { margin-top: 12px; }
.fx-warn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px;
  background: var(--amber-bg); color: var(--amber-fg); font-size: 12px; font-weight: 500;
}

/* ---- Закрытые — строки ---- */
.fx-rows { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.fx-row {
  display: grid; grid-template-columns: minmax(140px, 1.3fr) repeat(3, minmax(90px, 1fr)) minmax(120px, 1.1fr) 36px;
  align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit; transition: background .15s;
}
.fx-row:last-child { border-bottom: none; }
.fx-row:hover { background: var(--hover); }
.fx-row-head { background: var(--surface-2); font-size: 11.5px; color: var(--muted); font-weight: 500; padding-top: 9px; padding-bottom: 9px; }
.fx-row-head:hover { background: var(--surface-2); }
.fx-row .r { text-align: right; }
.fx-row-title { font-weight: 600; font-size: 14px; letter-spacing: -0.015em; display: flex; align-items: center; gap: 8px; }
.fx-lock { color: var(--muted-2); }
.fx-xls {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--green-fg);
  background: var(--green-bg); font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.fx-xls:hover { background: #d6efe3; }

/* ---- Пустое состояние ---- */
.fx-empty { text-align: center; padding: 48px 20px; }
.fx-empty-ico { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; background: var(--accent-tint); display: grid; place-items: center; font-size: 26px; }
.fx-empty-t { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.fx-empty-s { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.55; }

/* ---- Справочник категорий ---- */
.fx-cat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.fx-cat { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 12px; border-bottom: 1px solid var(--line); }
.fx-cat:last-child { border-bottom: none; }
.fx-cat.is-archived { opacity: .55; }
.fx-ico {
  width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; line-height: 1;
}
.fx-cat-name { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.fx-cat-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }
.fx-cat-act { margin-left: auto; display: flex; gap: 2px; opacity: .0; transition: opacity .2s; }
.fx-cat:hover .fx-cat-act, .fx-cat:focus-within .fx-cat-act { opacity: 1; }
@media (hover: none) { .fx-cat-act { opacity: 1; } }
.fx-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface); padding: 2px 6px; border-radius: 6px; margin-left: 6px; vertical-align: 1px; }

/* ---- Шапка месяца ---- */
.fx-mhead { display: flex; align-items: center; gap: 4px; min-width: 0; }
.fx-mhead .screen-title { padding: 0 4px; }
.fx-nav-arrow { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-3); text-decoration: none; }
.fx-nav-arrow:hover { background: var(--hover); color: var(--ink); }
.fx-nav-arrow.is-off { opacity: .3; pointer-events: none; }
.fx-rate {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 12px;
  border-radius: 99px; border: 1px solid var(--border); background: var(--card);
  font-size: 13px; color: var(--ink-3); cursor: pointer; font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.fx-rate b { color: var(--ink); font-weight: 500; }
.fx-rate .pen { width: 24px; height: 24px; border-radius: 99px; background: var(--surface); display: grid; place-items: center; color: var(--ink-3); transition: background .2s, color .2s; }
.fx-rate:hover { border-color: var(--border-hover); }
.fx-rate:hover .pen { background: var(--ink); color: #fff; }
.fx-rate[disabled] { cursor: default; padding-right: 12px; }

/* ---- Меню «⋯» ---- */
.fx-menu { position: relative; }
.fx-menu > summary { list-style: none; }
.fx-menu > summary::-webkit-details-marker { display: none; }
.fx-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; padding: 5px;
  border-radius: 14px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(11,13,18,.07); box-shadow: 0 18px 48px rgba(11,13,18,.16), 0 2px 8px rgba(11,13,18,.05);
}
.fx-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: none; background: none;
  font: inherit; font-size: 13.5px; color: var(--ink); text-align: left; cursor: pointer; text-decoration: none;
}
.fx-menu-item:hover { background: rgba(11,13,18,.05); }
.fx-menu-item.is-danger { color: var(--red-fg); }
.fx-menu-item small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---- Счета ---- */
.fx-acc { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 12px; }
.fx-acc-card { padding: 15px 17px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); min-width: 0; }
.fx-acc-card.is-ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.fx-acc-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.fx-acc-card.is-ink .fx-acc-label { color: rgba(255,255,255,.6); }
.fx-acc-val { font-size: 26px; font-weight: 500; margin-top: 10px; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-acc-val small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.fx-acc-card.is-ink .fx-acc-val small { color: rgba(255,255,255,.5); }
.fx-acc-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 9px; }
.fx-acc-card.is-ink .fx-acc-sub { color: rgba(255,255,255,.55); }
.fx-acc-foot { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.fx-acc-card.is-ink .fx-acc-foot { border-top-color: rgba(255,255,255,.1); color: rgba(255,255,255,.5); }
.fx-open-edit { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
.fx-open-edit svg { opacity: .55; transition: opacity .15s ease; }
.fx-open-edit:hover { color: var(--accent); }
.fx-acc-card.is-ink .fx-open-edit:hover { color: #fff; }
.fx-open-edit:hover svg { opacity: 1; }
.fx-up { color: var(--green-fg); } .fx-acc-card.is-ink .fx-up { color: #7fe0b5; }
.fx-down { color: var(--red-fg); } .fx-acc-card.is-ink .fx-down { color: #ff9c94; }
.fx-pl-bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--line); margin-top: 12px; gap: 2px; }
.fx-pl-bar i { display: block; height: 100%; border-radius: 99px; }

/* ---- Сетка месяца ---- */
.fx-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.fx-side { display: flex; flex-direction: column; gap: 14px; }

/* ---- Операции ---- */
.fx-ops-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.fx-ops-actions { display: flex; gap: 6px; margin-left: auto; }
.fx-act {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: border-color .2s, background .2s, transform .2s cubic-bezier(.32,.72,0,1);
}
.fx-act:hover { border-color: var(--border-hover); }
.fx-act:active { transform: scale(.97); }
.fx-act .dot { width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; font-size: 13px; line-height: 1; color: #fff; }
.fx-act.is-in { background: var(--ink); border-color: var(--ink); color: #fff; }
.fx-act.is-in .dot { background: var(--green); }
.fx-act.is-out .dot { background: var(--red); }
.fx-act.is-ex .dot { background: var(--accent); font-size: 11px; }
.fx-day { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.fx-day .fx-num { font-weight: 500; }
.fx-tx {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 18px; border: none; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer; transition: background .15s;
}
.fx-tx:hover { background: var(--hover); }
.fx-tx[disabled] { cursor: default; }
.fx-tx[disabled]:hover { background: none; }
.fx-tx-main { flex: 1; min-width: 0; }
.fx-tx-name { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-tx-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 2px; }
.fx-tx-meta .c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: var(--ink-3); }
.fx-pill { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--surface); color: var(--ink-3); white-space: nowrap; }
.fx-pill.is-shift { background: var(--accent-tint); color: var(--accent-dark); }
.fx-tx-amt { font-size: 14.5px; font-weight: 500; white-space: nowrap; text-align: right; }
.fx-tx-amt small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); }
.fx-ops-empty { padding: 44px 20px; text-align: center; color: var(--ink-3); font-size: 14px; }
.fx-ops-empty .fx-ops-actions { justify-content: center; margin: 14px 0 0; }
[data-fx-filter="income"] .fx-tx[data-kind]:not([data-kind="income"]),
[data-fx-filter="expense"] .fx-tx[data-kind]:not([data-kind="expense"]),
[data-fx-filter="exchange"] .fx-tx[data-kind]:not([data-kind="exchange"]) { display: none; }

/* ---- Цели ---- */
.fx-goal-sum { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.fx-goal-sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.fx-goal-big { font-size: 22px; font-weight: 500; }
.fx-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.fx-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .6s cubic-bezier(.32,.72,0,1); }
.fx-bar.is-done i { background: var(--green); }
.fx-goal { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px 11px 16px; border-bottom: 1px solid var(--line); }
.fx-goal:last-child { border-bottom: none; }
.fx-goal-main { flex: 1; min-width: 0; }
.fx-goal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.fx-goal-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-goal-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.fx-goal-meta .ok { color: var(--green-fg); font-weight: 500; }
.fx-goal-meta .no { color: var(--amber-fg); }
.fx-goal-tools { display: flex; flex-direction: column; gap: 1px; margin-top: -3px; }
.fx-mini { width: 24px; height: 22px; border-radius: 6px; border: none; background: none; color: var(--muted-2); cursor: pointer; display: grid; place-items: center; font-size: 12px; }
.fx-mini:hover { background: var(--hover); color: var(--ink); }
.fx-mini:disabled { opacity: .3; cursor: default; background: none; }
.fx-note { padding: 10px 16px 12px; font-size: 11.5px; color: var(--muted); line-height: 1.5; border-top: 1px dashed var(--dashed); }

/* ---- Статистика по категориям ---- */
.fx-stat { padding: 8px 16px; }
.fx-stat-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fx-stat-row .n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-stat .fx-bar { height: 4px; margin-top: 6px; }

/* ---- Окна ---- */
.fx-dlg { width: min(520px, 94vw); }
.fx-dlg-sm { width: min(400px, 94vw); }
.fx-dlg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.fx-dlg-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.fx-dlg-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; line-height: 1.5; }
.fx-x { margin-left: auto; width: 32px; height: 32px; border-radius: 99px; border: none; background: var(--surface); color: var(--ink-3); cursor: pointer; display: grid; place-items: center; }
.fx-x:hover { background: var(--ink); color: #fff; }
.fx-field { margin-top: 14px; }
.fx-dlg-head + .fx-field { margin-top: 0; }
.fx-hint { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.fx-hint b { color: var(--ink-3); font-weight: 500; }
.fx-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fx-foot { display: flex; align-items: center; gap: 8px; margin-top: 22px; }
.fx-foot .sp { flex: 1; }

/* Сегменты на всю ширину */
.fx-seg { display: flex; gap: 3px; padding: 3px; background: var(--tab-bg); border-radius: 11px; }
.fx-seg label { flex: 1; position: relative; }
.fx-seg input { position: absolute; opacity: 0; pointer-events: none; }
.fx-seg span {
  display: flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 10px;
  border-radius: 8px; font-size: 13.5px; color: var(--ink-4); cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, box-shadow .2s;
}
.fx-seg input:checked + span { background: var(--card); color: var(--ink); font-weight: 500; box-shadow: var(--shadow-sm); }
.fx-seg input:disabled + span { opacity: .4; cursor: not-allowed; }
.fx-seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(41,98,255,.18); }
.fx-seg.is-kind input[value="income"]:checked + span { color: var(--green-fg); }
.fx-seg.is-kind input[value="expense"]:checked + span { color: var(--red-fg); }

/* Крупное поле суммы с валютой внутри */
.fx-amount {
  display: flex; align-items: center; gap: 8px; height: 58px; padding: 0 8px 0 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.fx-amount:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,255,.10); }
body .fx-amount input {
  flex: 1; min-width: 0; height: 100%; border: none !important; box-shadow: none !important; padding: 0; background: transparent;
  font-family: 'IBM Plex Mono', monospace; font-size: 24px; font-weight: 500; letter-spacing: -0.03em;
}
.fx-amount .fx-seg { flex: 0 0 auto; }
.fx-amount .fx-seg span { height: 32px; padding: 0 11px; font-size: 13px; }
.fx-amount-unit { font-size: 15px; color: var(--muted); padding-right: 8px; }
.fx-amount.is-sm { height: 48px; }
body .fx-amount.is-sm input { font-size: 18px; }

/* Курс: «1 $ = [12 650] сум» одной строкой */
.fx-rate-field {
  display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card); font-size: 16px; color: var(--ink-3);
}
.fx-rate-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,255,.10); }
.fx-rate-field .one { font-family: 'IBM Plex Mono', monospace; color: var(--ink); white-space: nowrap; }
body .fx-rate-field input {
  flex: 1; min-width: 0; height: 100%; border: none !important; box-shadow: none !important; padding: 0; background: transparent; text-align: right;
  font-family: 'IBM Plex Mono', monospace; font-size: 24px; font-weight: 500; letter-spacing: -0.03em;
}

/* Категории в окне операции */
.fx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 9px; border-radius: 99px;
  border: 1px solid var(--border); background: var(--card); font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .2s cubic-bezier(.32,.72,0,1);
}
.fx-chip:hover { border-color: var(--border-hover); }
.fx-chip:active { transform: scale(.97); }
.fx-chip .e { font-size: 15px; line-height: 1; }
.fx-chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fx-chip.is-other { border-style: dashed; color: var(--ink-3); }
.fx-chip.is-other.is-on { border-style: solid; }
.fx-combo { margin-top: 10px; }
.fx-combo-box {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  transition: border-color .15s, box-shadow .15s;
}
.fx-combo-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,255,.10); }
.fx-combo-box .e { font-size: 18px; width: 22px; text-align: center; }
body .fx-combo-box input { flex: 1; height: 100%; border: none !important; box-shadow: none !important; padding: 0; background: transparent; font-size: 14px; }
.fx-combo-list { display: block; overflow-y: auto; overscroll-behavior: contain; max-height: 300px; }
.fx-combo-list[hidden], .fx-calpop[hidden] { display: none; }
.fx-combo-list .oz-opt b { font-weight: 600; }
.fx-combo-list .oz-opt .e { font-size: 16px; width: 22px; text-align: center; }
.fx-combo-list .oz-opt .u { margin-left: auto; font-size: 11.5px; color: var(--muted); }

.fx-locked { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.fx-locked-amt { margin-left: auto; font-size: 17px; font-weight: 500; white-space: nowrap; }

/* Обмен: итог */
.fx-ex-result { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--accent-tint-2); border: 1px solid var(--accent-soft); }
.fx-ex-result .big { font-size: 22px; font-weight: 500; white-space: nowrap; }
.fx-ex-flow { font-size: 12.5px; color: var(--ink-3); }

/* Открытие месяца: три остатка */
.fx-open-bal { display: grid; gap: 10px; }
.fx-open-line { display: grid; grid-template-columns: 1fr 190px; align-items: center; gap: 12px; }
.fx-open-line .l { font-size: 13.5px; }
.fx-open-line .l small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
body .fx-open-line input { text-align: right; font-family: 'IBM Plex Mono', monospace; font-size: 15px; }
.fx-open-total {
  margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2);
  font-size: 13px; color: var(--ink-3); line-height: 1.45;
}
.fx-open-total:empty { display: none; }
.fx-open-total b { color: var(--ink); font-weight: 600; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; }
.fx-check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; }
body .fx-check input { width: 18px; height: 18px; accent-color: var(--ink); }

/* Закрытый месяц */
.fx-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius-lg); background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.fx-banner .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; flex: 0 0 32px; }

@media (max-width: 1180px) {
  .fx-main { grid-template-columns: minmax(0, 1fr); }
  .fx-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 1024px) {
  .fx-page { padding: 14px 14px 32px; gap: 14px; }
  .fx-acc { grid-template-columns: 1fr 1fr; }
  .fx-acc-card.is-ink { grid-column: 1 / -1; }
  .fx-side { grid-template-columns: minmax(0, 1fr); }
  .fx-cat-cols { grid-template-columns: minmax(0, 1fr); }
  .fx-row { grid-template-columns: minmax(0, 1fr) auto 32px; }
  .fx-row .hide-m { display: none; }
  .fx-row-head { display: none; }
  .fx-cat-act { opacity: 1; }
  .fx-ops-actions { width: 100%; margin-left: 0; }
  .fx-ops-actions .fx-act { flex: 1; justify-content: center; height: 42px; }
  .fx-amount { height: 60px; }
  .fx-open-line { grid-template-columns: 1fr 150px; }
}
@media (max-width: 560px) {
  .fx-acc { grid-template-columns: 1fr; }
  .fx-open-grid { grid-template-columns: minmax(0, 1fr); }
  .fx-mcard-pl { grid-template-columns: 1fr 1fr; }
  .fx-mcard-pl > :last-child { grid-column: 1 / -1; }
  .fx-grid2 { grid-template-columns: 1fr; }
  .fx-open-line { grid-template-columns: 1fr; gap: 6px; }
  /* Браузер не даёт окну быть шире «экран − 2em», а форма в 100vw вылезала
     за него: справа обрезались крестик и «Записать». */
  /* Ширину держит окно, форма заполняет то, что внутри: на компьютере с узким
     окном полоса прокрутки занимает место, и форма шириной в экран вылезала
     вбок с горизонтальной прокруткой. */
  dialog:has(> .fx-dlg), dialog:has(> .fx-dlg-sm) { width: calc(100vw - 16px); max-width: calc(100vw - 16px); }
  .fx-dlg, .fx-dlg-sm { width: auto; padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-mcard, .fx-mcard-go, .fx-bar i, .fx-act, .fx-chip { transition: none; }
}
.fx-row { position: relative; }
.fx-row-link { color: inherit; text-decoration: none; }
.fx-row-link::after { content: ''; position: absolute; inset: 0; }
.fx-row .fx-xls { position: relative; z-index: 1; }
.fx-page [id] { scroll-margin-top: 72px; }
.fx-dlg-head [tabindex="-1"]:focus { outline: none; }

/* Дата операции: кнопка + встроенный календарь под ней (внутри окна
   всплывающий календарь flatpickr уходил под окно — top layer). */
.fx-date { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fx-date-btn {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card); font: inherit; font-size: 14px; color: var(--ink);
  cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.fx-date-btn:hover { border-color: var(--border-hover); }
.fx-date-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(41,98,255,.10); }
.fx-date-btn svg { color: var(--ink-3); flex: 0 0 auto; }
.fx-date-btn .chev { margin-left: auto; transition: transform .3s cubic-bezier(.32,.72,0,1); }
.fx-date-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.fx-date-q {
  height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card);
  font: inherit; font-size: 13px; color: var(--ink-3); cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.fx-date-q:hover { border-color: var(--border-hover); color: var(--ink); }
.fx-date-q.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fx-date-q[disabled] { display: none; }
/* Календарь месяца — всплывает под кнопкой (или над ней, если внизу мало
   места) и окно не раздвигает. Только дни этого месяца, без чужих хвостов. */
.fx-calpop { display: block; padding: 14px 12px 10px; }
.fx-calpop-head { display: flex; align-items: baseline; gap: 6px; padding: 0 6px 10px; font-size: 15px; letter-spacing: -0.01em; }
.fx-calpop-head b { font-weight: 600; color: var(--ink); }
.fx-calpop-head span { color: var(--muted); }
.fx-calpop-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.fx-calpop-grid .wd { padding: 2px 0 6px; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.fx-calpop-grid .d {
  position: relative; height: 38px; border: 0; border-radius: 11px; background: transparent;
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink); cursor: pointer;
  transition: background .15s, color .15s, transform .2s cubic-bezier(.32,.72,0,1);
}
.fx-calpop-grid .d:hover { background: rgba(11, 13, 18, .05); }
.fx-calpop-grid .d:active { transform: scale(.94); }
.fx-calpop-grid .d:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fx-calpop-grid .d.is-wknd { color: var(--ink-3); }
.fx-calpop-grid .d.is-today::after {
  content: ''; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 99px; background: var(--accent);
}
.fx-calpop-grid .d.is-sel { background: var(--accent); color: #fff; font-weight: 600; }
.fx-calpop-grid .d.is-sel::after { background: #fff; }
/* Окна финансов стоят у верхнего края, а не по центру: когда окно меняет
   высоту (поле «Другая», чипы другого типа), растёт только низ — верх и
   поле, в которое смотришь, остаются на месте. */
dialog:has(> .fx-dlg) { margin-top: max(16px, 7vh); margin-bottom: auto; max-height: calc(100dvh - max(16px, 7vh) - 16px); }
@media (max-width: 1024px) {
  .fx-date-btn, .fx-date-q { height: 46px; font-size: 15px; }
}
.fx-err { color: var(--red-fg); font-size: 12.5px; margin-top: 6px; }
.fx-err[hidden] { display: none; }
/* flatpickr делает своё поле видимым — календарю оно не нужно, дата живёт в кнопке */
.fx-cal > input { display: none !important; }
.fx-dayblock:last-child { padding-bottom: 8px; }
