/* =====================================================================
   ДИЗАЙН-СИСТЕМА CRM FRONTSHOP — та же, что у админки Aquaret

   Образец: ~/Desktop/AQUARET/public/css/admin-ui.css. Токены ниже названы
   и заданы так же, как там, — в том значении, которое админка получает в
   итоге (файл слоистый: «Облик A» около строки 893, «Контейнеры как в
   профиле» около 2016, «Единый язык разделов» около 2824, серые плашки
   --dash-* около 2715). Поменялся токен в админке — здесь меняется одна
   строка. Описание системы — marketing/CLIENTS_DESIGN.md.

   Тёмная тема: у админки это body.tg-dark, здесь — html[data-theme="dark"]
   (переключатель CRM и тема Telegram). Значения те же.
   ===================================================================== */

/* ---------- Шрифты: Geist и Geist Mono, локальные файлы ---------- */
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/geist-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/geist-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/geist-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/geist-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/geist-mono-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/geist-mono-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Токены ---------- */
:root {
  --adm-ink: #171717;
  --adm-muted: #666666;
  --adm-faint: #6E6E6E;
  --adm-ground: #FFFFFF;
  --adm-surface: #FFFFFF;
  --adm-inset: #F4F4F3;
  --adm-line: #E5E5E5;
  --adm-line-soft: #E8E8E6;

  --adm-accent: #171717;
  --adm-on-accent: #FFFFFF;
  --adm-accent-wash: #F2F2F2;
  --adm-accent-line: #171717;

  --adm-ok: #1F7A4D;   --adm-ok-fill: #EAF5EE;   --adm-ok-ink: #1F6B44;
  --adm-warn: #B7791F; --adm-warn-fill: #FBF3E3; --adm-warn-ink: #8A5A12;
  --adm-bad: #C1361B;  --adm-bad-fill: #FCECE8;  --adm-bad-ink: #A12E17;

  --adm-radius: 18px;
  --adm-radius-sm: 12px;

  /* Тёмный материал — нижняя пилюля, чёрные узлы схемы. Одинаков в обеих темах. */
  --adm-material: linear-gradient(180deg, #262626 0%, #0C0C0C 100%);
  --adm-material-flat: #111111;
  --adm-material-active: #2E2E2E;
  --adm-material-line: rgba(255, 255, 255, .12);
  --adm-material-hi: inset 0 1px 0 rgba(255, 255, 255, .09);
  --adm-on-material: #FFFFFF;
  --adm-on-material-muted: #A8A8AD;
  --adm-material-shadow: 0 12px 28px -10px rgba(0, 0, 0, .45);
  --adm-veil: rgba(10, 10, 10, .34);
  --adm-telegram: linear-gradient(180deg, #37AEE2 0%, #1E96C8 100%);

  /* Серые плашки дашборда: строка, нажатая строка, белый диск на строке. */
  --dash-row: #F3F3F3;
  --dash-row-press: #EAEAEA;
  --dash-disc: #FFFFFF;

  --font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  /* В админке числа в итоге набраны той же Geist табличными цифрами
     (admin-ui.css, «Строка списка как на дашборде»); Mono — для кода:
     пути, идентификаторы, порты, трек-номера. */
  --font-numbers: var(--font-family);
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-theme="dark"] {
  --adm-ink: #EDEDED; --adm-muted: #A1A1A1; --adm-faint: #8C8C8C;
  --adm-material-line: rgba(255, 255, 255, .16);
  --adm-ground: #000000; --adm-surface: #141414; --adm-inset: #1F1F1F;
  --adm-line: #2E2E2E; --adm-line-soft: #262626;
  --adm-accent: #EDEDED; --adm-on-accent: #0A0A0A; --adm-accent-wash: #1F1F1F; --adm-accent-line: #EDEDED;
  --adm-ok: #3DD68C; --adm-ok-fill: #0F2A1C; --adm-ok-ink: #62D69A;
  --adm-warn: #E0A83A; --adm-warn-fill: #2A2110; --adm-warn-ink: #E6B95C;
  --adm-bad: #F2695A; --adm-bad-fill: #2E1512; --adm-bad-ink: #F58A7C;
  --dash-row: #141414; --dash-row-press: #1C1C1C; --dash-disc: #262626;
}

/* ---------- Основа ---------- */
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  background: var(--adm-ground);
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--adm-ground);
  color: var(--adm-ink);
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
::selection { background: color-mix(in oklab, var(--adm-ink) 22%, var(--adm-surface)); color: var(--adm-ink); }
:is(input, textarea) { caret-color: var(--adm-accent); }
:is(button, input, select, textarea, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--adm-accent-line); outline-offset: 2px; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.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; }
.num { font-family: var(--font-numbers); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; }

/* ---------- Каркас: колонка меню и полотно ----------
   Как #admin-navigation: от 901px колонка 220px слева, на ground, с
   волосяной линией справа; уже — чёрная пилюля внизу экрана. */
.shell { min-height: 100vh; }
.side { display: none; }
.main { padding: 20px 16px calc(104px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 901px) {
  .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .side {
    position: sticky; top: 0; height: 100dvh;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--adm-line-soft);
    background: var(--adm-ground);
  }
  .main { max-width: 1180px; padding: 24px 32px 56px; }
}
.side__head { display: flex; align-items: center; gap: 10px; padding: 18px 16px 10px; }
.side__logo { height: 18px; width: auto; filter: invert(1) brightness(.35); }
:root[data-theme="dark"] .side__logo { filter: brightness(.93); }
.side__body { flex: 1; min-height: 0; overflow: auto; padding: 4px 10px; scrollbar-width: thin; scrollbar-color: var(--adm-line) transparent; }
.side__group { padding: 14px 8px 4px; font-size: 12px; font-weight: 500; color: var(--adm-faint); }
.side__foot { padding: 10px; border-top: 1px solid var(--adm-line-soft); }

.nav-list { display: flex; flex-direction: column; gap: 1px; }
.nav {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px;
  padding: 6px 8px; border: 0; border-radius: var(--adm-radius-sm);
  background: none; color: var(--adm-muted);
  font: inherit; font-size: 13px; font-weight: 500; text-align: left; text-decoration: none;
  cursor: pointer; touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease;
}
.nav svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--adm-faint); }
.nav:hover { background: var(--adm-inset); color: var(--adm-ink); }
.nav:hover svg { color: var(--adm-muted); }
.nav.is-on { background: var(--adm-inset); color: var(--adm-ink); }
.nav.is-on svg { color: var(--adm-ink); }
.nav__count { margin-left: auto; font-family: var(--font-numbers); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 400; color: var(--adm-faint); }
.nav.is-on .nav__count { color: var(--adm-muted); }
/* Подложка выбранного раздела едет по колонке на LiveMotion. */
.nav-list.has-live-indicator .nav.is-on { background: transparent; }
.nav-list.has-live-indicator > .live-indicator { background: var(--adm-inset); border-radius: var(--adm-radius-sm); }

/* ---------- Чёрная пилюля на телефоне (#admin-tabbar) ---------- */
.pill {
  position: fixed; z-index: 60; left: 0; right: 0;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: max-content; margin: 0 auto;
  display: flex; gap: 2px; padding: 5px;
  border-radius: 999px; background: var(--adm-material-flat);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .08), var(--adm-material-shadow);
}
:root[data-theme="dark"] .pill { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 12px 28px -10px rgba(0, 0, 0, .8); }
.pill__item {
  position: relative; z-index: 1;
  display: grid; place-items: center; width: 46px; height: 46px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: #7A7A7A;
  cursor: pointer; touch-action: manipulation;
}
.pill__item svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pill__item.is-on { color: #FFFFFF; background: var(--adm-material-active); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.pill__item:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: -3px; }
.pill__sep { width: 1px; margin: 10px 3px; background: var(--adm-material-line); }
.pill.has-live-indicator .pill__item.is-on { background: transparent; box-shadow: none; }
/* Значок белеет по мере того, как под ним оказывается подложка. */
.pill.has-live-indicator .pill__item[data-go] { color: color-mix(in srgb, #FFFFFF calc(var(--live-on, 0) * 100%), #7A7A7A); }
.pill.has-live-indicator > .live-indicator { background: var(--adm-material-active); border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
/* Контент растворяется под пилюлей. */
.pill-fade {
  position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; pointer-events: none;
  height: calc(92px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, color-mix(in srgb, var(--adm-ground) 0%, transparent), var(--adm-ground) 72%);
}
/* LiveMotion ставит хозяину ползунка position: relative — пилюле нужно fixed. */
.pill.has-live-indicator { position: fixed; }
@media (min-width: 901px) { .pill, .pill-fade { display: none; } }

/* ---------- Шапка раздела ---------- */
.page-head { display: flex; align-items: center; gap: 10px; min-height: 44px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head__count { font-family: var(--font-numbers); font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 500; color: var(--adm-faint); }
.page-head__tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.page-sub { margin: -8px 0 16px; font-size: 13.5px; color: var(--adm-muted); }

/* Круглая кнопка: серая заливка без рамки (.adm-round / .psheet__round). */
.round {
  display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: var(--dash-row); color: var(--adm-ink);
  cursor: pointer; touch-action: manipulation; text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
}
.round svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.round:hover { background: var(--dash-row-press); }
.round--primary { background: var(--adm-accent); color: var(--adm-on-accent); }
.round--primary:hover { background: var(--adm-accent); filter: brightness(1.15); }
.round--danger { color: var(--adm-bad-ink); }
.round--danger:hover { background: var(--adm-bad-fill); }
.round--sm { flex-basis: 40px; width: 40px; height: 40px; }
.round--sm svg { width: 17px; height: 17px; }
.round.is-busy { pointer-events: none; color: var(--adm-faint); }
.round.is-busy svg { animation: crm-spin .9s linear infinite; }
@keyframes crm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .round.is-busy svg { animation-duration: 1.6s; } }

/* ---------- Кнопки: только пилюли ----------
   Основная — чёрная, второстепенная — серая заливка (на серой строке —
   белая), опасное — красный текст без фона. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: var(--dash-row); color: var(--adm-ink);
  font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  cursor: pointer; touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease, filter .15s ease;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { background: var(--dash-row-press); }
.btn--primary { background: var(--adm-accent); color: var(--adm-on-accent); font-weight: 600; }
.btn--primary:hover { background: var(--adm-accent); filter: brightness(1.15); }
.btn--danger { background: transparent; color: var(--adm-bad-ink); padding: 0 4px; }
.btn--danger:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
/* Второстепенная кнопка на серой строке — белая, иначе её не видно. */
:is(.row, .card) .btn:not(.btn--primary):not(.btn--danger) { background: var(--dash-disc); }
:is(.row, .card) .round:not(.round--primary) { background: var(--dash-disc); }

/* ---------- Чипы фильтров (.ord-chip) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 12px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 11px; border: 0; border-radius: 999px;
  background: var(--dash-row); color: var(--adm-ink);
  font: inherit; font-size: 12px; font-weight: 500; line-height: 1;
  cursor: pointer; touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease;
}
/* Зона касания 44px — невидимым полем, чип остаётся 28px. */
.chip::after { content: ''; position: absolute; inset: -8px -1px; }
.chip:hover { background: var(--dash-row-press); }
.chip__count { font-family: var(--font-numbers); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--adm-faint); }
.chip.is-on { background: var(--adm-accent); color: var(--adm-on-accent); }
.chip.is-on .chip__count { color: color-mix(in srgb, var(--adm-on-accent) 72%, transparent); }
/* Ползунок в режиме clip: каждый чип заливается чёрным ровно по ходу. */
.chips.has-live-indicator { touch-action: pan-y; }
.chips.has-live-indicator .chip,
.chips.has-live-indicator .chip.is-on {
  background: var(--dash-row);
  color: color-mix(in srgb, var(--adm-on-accent) calc(clamp(0, (var(--live-on, 0) - .4) * 3.4, 1) * 100%), var(--adm-ink));
}
.chips.has-live-indicator .chip > span { position: relative; z-index: 1; }
.chips.has-live-indicator .chip::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--adm-accent); pointer-events: none;
  clip-path: inset(0 var(--live-cr, 0px) 0 var(--live-cl, 100%) round 999px);
}
.chips.has-live-indicator .chip .chip__count {
  color: color-mix(in srgb, color-mix(in srgb, var(--adm-on-accent) 72%, transparent) calc(clamp(0, (var(--live-on, 0) - .4) * 3.4, 1) * 100%), var(--adm-faint));
}

/* ---------- Поиск (.toolbar .search-input) ---------- */
.search {
  display: block; width: 100%; height: 44px; margin: 0 0 12px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 999px;
  background: var(--dash-row); color: var(--adm-ink);
  font: inherit; font-size: 15px;
  transition: background-color .15s ease, border-color .15s ease;
}
.search::placeholder { color: var(--adm-faint); }
.search:focus { outline: none; background: var(--adm-surface); border-color: var(--adm-accent-line); }

/* ---------- Плитки показателей (.an-metric) ---------- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 26px; }
.metric {
  display: grid; align-content: start; gap: 6px; min-width: 0; padding: 16px 18px;
  border: 0; border-radius: 20px; background: var(--dash-row); color: inherit;
  font: inherit; text-align: left; cursor: pointer; touch-action: manipulation;
  transition: background-color .15s ease;
}
.metric:hover { background: var(--dash-row-press); }
.metric__label { font-size: 13px; font-weight: 500; color: var(--adm-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric__value { font-family: var(--font-numbers); font-variant-numeric: tabular-nums; font-size: clamp(22px, 2.4vw, 30px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.metric__value.is-bad { color: var(--adm-bad-ink); }
@media (max-width: 720px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 14px; }
  .metric__value { font-size: clamp(20px, 6vw, 26px); }
}

/* ---------- Списки: заголовок и серые строки (.dash-list, .dash-row) ---------- */
.lists { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; margin-bottom: 26px; }
@media (min-width: 1100px) { .lists { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 4px 12px; }
.list-head h2 { margin: 0; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.list-head__link { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--adm-muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: none; }
.list-head__link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.list-head__link:hover { color: var(--adm-ink); }
.rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

.row {
  display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 72px; padding: 12px 16px;
  border: 0; border-radius: 16px; background: var(--dash-row); color: inherit;
  font: inherit; text-align: left; text-decoration: none;
  transition: background-color .18s;
}
:is(a, button).row, .row[tabindex], .row.is-tap { cursor: pointer; }
:is(a, button).row:hover, .row[tabindex]:hover, .row.is-tap:hover { background: var(--dash-row-press); }
.row--flat { cursor: default; }
.row__disc {
  display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--dash-disc); color: var(--adm-ink);
  font-size: 16px; font-weight: 500;
}
.row__disc svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row__disc--warn { color: var(--adm-warn); }
.row__disc--bad { color: var(--adm-bad); }
.row__disc--ok { color: var(--adm-ok); }
.row__disc--muted { color: var(--adm-faint); }
/* Круг с буквой — тон от имени, как .u-avatar в админке (avatarHue). */
.row__disc--av { background: hsl(var(--av-h, 220) 60% 91%); color: hsl(var(--av-h, 220) 32% 32%); }
.row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row__title { font-size: 16px; font-weight: 500; color: var(--adm-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__sub { font-size: 13px; color: var(--adm-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__end { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.row__end b { font-family: var(--font-numbers); font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; white-space: nowrap; }
.row__end span { font-size: 12.5px; color: var(--adm-faint); white-space: nowrap; }
.row__chev { flex: none; width: 18px; height: 18px; color: var(--adm-faint); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Смысловой тон короткого статуса справа. */
.tone--ok { color: var(--adm-ok-ink) !important; }
.tone--warn { color: var(--adm-warn-ink) !important; }
.tone--bad { color: var(--adm-bad-ink) !important; }

/* Подзаголовок группы в ленте («Сегодня», «Вчера») — как группы в «Клиентах» админки. */
.group-label { margin: 22px 4px 10px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; color: var(--adm-ink); }
.group-label:first-child { margin-top: 0; }

/* ---------- Серая карточка (.card-box) и белый список в ней (.set-list) ---------- */
.card { padding: 18px 16px; border-radius: 20px; background: var(--dash-row); min-width: 0; }
@media (min-width: 721px) { .card { padding: 20px 22px; } }
.card > h2, .card__title { margin: 0 0 12px; font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.card__hint { margin: -6px 0 14px; font-size: 13px; line-height: 1.45; color: var(--adm-muted); max-width: 72ch; }
.card + .card { margin-top: 16px; }

.set-list { overflow: hidden; border-radius: 16px; background: var(--dash-disc); }
.set-list > * + * { border-top: 1px solid var(--adm-line-soft); }
.set-row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 14px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left; list-style: none; text-decoration: none;
}
.set-row::-webkit-details-marker { display: none; }
:is(button, summary, a).set-row { cursor: pointer; }
:is(button, summary, a).set-row:hover { background: color-mix(in srgb, var(--adm-inset) 60%, transparent); }
.set-row__ic {
  flex: 0 0 40px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--adm-inset); color: var(--adm-ink);
}
.set-row__ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.set-row__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.set-row__body b { font-size: 15px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.set-row__body span { font-size: 13.5px; line-height: 1.4; color: var(--adm-muted); }
.set-row__end { flex: 0 0 auto; color: var(--adm-faint); font-family: var(--font-numbers); font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; white-space: nowrap; }
.set-row__end svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Пары «название — значение» в белом списке. */
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 14px; font-size: 14px; }
.kv dt { color: var(--adm-muted); }
.kv dd { margin: 0; font-family: var(--font-numbers); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--adm-inset); color: var(--adm-ink); font-size: 12.5px; font-style: normal; }

/* ---------- Поля формы: 44px, серая заливка, при фокусе белые с линией ----------
   В серой карточке поле белое (.card-box .ctl → --dash-disc). */
.field { display: block; min-width: 0; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 5px; font-size: 12.5px; font-weight: 500; color: var(--adm-muted); }
.ctl,
.field :is(input, select, textarea) {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid transparent; border-radius: 12px;
  background: var(--dash-row); color: var(--adm-ink);
  font: inherit; font-size: 15px;
  transition: background-color .15s ease, border-color .15s ease;
}
.card :is(.ctl, .field input, .field select, .field textarea) { background: var(--dash-disc); }
.field textarea { min-height: 120px; line-height: 1.45; resize: vertical; }
.field select, select.ctl { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C8C8C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.ctl:focus, .field :is(input, select, textarea):focus { outline: none; background-color: var(--adm-surface); border-color: var(--adm-ink); }
.ctl::placeholder, .field :is(input, textarea)::placeholder { color: var(--adm-faint); }
.field input[readonly] { color: var(--adm-muted); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 380px) { .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; } }

/* ---------- Сегмент страниц формы (.psheet__nav) ---------- */
.seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  height: 40px; padding: 3px; margin-bottom: 16px; border-radius: 999px; background: var(--dash-disc);
}
.seg button {
  position: relative; z-index: 1; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--adm-muted);
  transition: color .2s ease;
}
.seg button[aria-selected="true"] { background: var(--adm-ink); color: var(--adm-surface); font-weight: 600; }
.seg button:focus-visible { outline-offset: -2px; }
.seg button.has-error::after { content: ''; position: absolute; top: 8px; right: 14px; width: 6px; height: 6px; border-radius: 50%; background: var(--adm-bad); }
.seg.has-live-indicator { touch-action: pan-y; }
.seg.has-live-indicator > .live-indicator { background: var(--adm-ink); border-radius: 999px; }
.seg.has-live-indicator button,
.seg.has-live-indicator button[aria-selected="true"] {
  background: transparent; transition: none; user-select: none; -webkit-user-select: none;
  color: color-mix(in srgb, var(--adm-surface) calc(clamp(0, (var(--live-on, 0) - .4) * 3.4, 1) * 100%), var(--adm-muted));
  font-weight: calc(500 + var(--live-on, 0) * 100);
}
.seg.has-live-indicator button[aria-selected="true"] { cursor: grab; }

/* Строка действий формы: круги и чёрная пилюля «Сохранить» (.psheet__actions). */
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.form-actions .btn--primary { flex: 1 1 auto; min-height: 46px; font-size: 15px; }
.form-actions .round { flex-basis: 46px; width: 46px; height: 46px; }
.form-msg { min-height: 18px; margin: 8px 4px 0; font-size: 13px; color: var(--adm-muted); }
.form-msg.is-bad { color: var(--adm-bad-ink); }

/* ---------- Пустое состояние (.ntf-empty) ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 56px 20px; color: var(--adm-muted); text-align: center; font-size: 14px; }
.empty b { color: var(--adm-ink); font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.empty .btn { margin-top: 12px; }

/* ---------- Плашка-состояние (не ошибка) ---------- */
.notice { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 12px 14px; border-radius: 16px; background: var(--adm-warn-fill); color: var(--adm-warn-ink); font-size: 13.5px; }
.notice svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.badge-local { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 4px 10px; border-radius: 999px; background: var(--dash-row); color: var(--adm-muted); font-size: 12px; }
.badge-local::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--adm-warn); }

/* ---------- Движение ----------
   Пружины ведёт LiveMotion (live-motion.js, копия из Aquaret). В тихом
   режиме («Уменьшение движения») он не выключается, а становится тише:
   без размытия и перелёта. CSS-переходы здесь — только цвет. */
@media (prefers-reduced-motion: reduce) {
  .row, .metric, .chip, .btn, .round, .nav { transition-duration: .01ms; }
}

/* =====================================================================
   ЧЁРНЫЙ БЛОК ОБЗОРА (.dash-hero админки)

   Число за период, белый график по дням — его ведут пальцем, — действия
   пилюлями и строка статуса. Материал одинаков в обеих темах.
   ===================================================================== */
.hero {
  --hero-line: rgba(255, 255, 255, .12);
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  margin-bottom: 26px; padding: 18px 20px 22px; color: #fff;
  background: linear-gradient(180deg, #2B2B2B 0%, #151515 38%, #070707 100%);
  border-radius: 32px;
}
:root[data-theme="dark"] .hero { box-shadow: inset 0 0 0 1px #242424; }
.hero__top { align-self: stretch; display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.hero__tools { display: flex; gap: 8px; }
.hero__round {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%;
  border: 1px solid var(--hero-line); color: #fff; cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02));
}
.hero__round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero__round.is-busy svg { animation: crm-spin .9s linear infinite; }
.hero__period { position: relative; display: inline-flex; align-items: center; gap: 5px; color: rgba(255, 255, 255, .92); font-size: 16px; font-weight: 500; cursor: pointer; }
.hero__period select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; padding: 2px 0; cursor: pointer; text-align: center; outline: none; }
.hero__period select:focus-visible { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: 3px; border-radius: 6px; }
.hero__period select option { color: #171717; }
.hero__period svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; opacity: .85; }
/* Блик на числе — сверху вниз, одинаковый у каждой цифры. */
.hero__sum {
  display: block; margin-top: 4px; font-size: clamp(40px, 12vw, 64px); font-weight: 600;
  line-height: 1.08; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: linear-gradient(180deg, #FFFFFF 45%, #C8C8C8 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { margin-top: 6px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; font-size: 15px; color: rgba(255, 255, 255, .78); }
.trend { padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.trend--up { background: color-mix(in oklab, #4ADE80 14%, transparent); color: #6EE7A0; }
.trend--down { background: color-mix(in oklab, #F87171 14%, transparent); color: #FCA5A5; }

.hero__chart {
  position: relative; align-self: stretch; margin: 18px -20px 22px; touch-action: pan-y;
  -webkit-user-select: none; user-select: none; cursor: crosshair;
}
.hero__chart:focus-visible { outline: 2px solid rgba(255, 255, 255, .5); outline-offset: 2px; border-radius: 6px; }
.spark { display: block; width: 100%; height: 84px; color: #fff;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 80%, transparent 96%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 80%, transparent 96%); }
.hero__chart.is-scrubbing .spark {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 var(--x), rgba(0, 0, 0, .3) var(--x), rgba(0, 0, 0, .3) 80%, transparent 96%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 var(--x), rgba(0, 0, 0, .3) var(--x), rgba(0, 0, 0, .3) 80%, transparent 96%);
}
/* «Сегодня» — точка на конце данных с мягкой волной. */
.spark-now { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; pointer-events: none; transition: opacity .16s ease; }
.spark-now::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; background: rgba(255, 255, 255, .35); animation: sparkNow 2.4s cubic-bezier(.2, .7, .3, 1) infinite; }
@keyframes sparkNow { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.hero__chart.is-scrubbing .spark-now { opacity: 0; }
.scrub { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .16s ease; }
.scrub__line { position: absolute; top: -10px; bottom: 0; left: var(--dot-x, 0); width: 1px; transform: translateX(-.5px);
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55) 25%, rgba(255, 255, 255, .06)); }
.scrub__dot { position: absolute; left: var(--dot-x, 0); top: var(--y, 0); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .14), 0 0 16px 2px rgba(255, 255, 255, .35); }
.scrub__tip {
  position: absolute; top: 0; left: 0; z-index: 2; display: grid; min-width: 96px; padding: 6px 11px 7px;
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; pointer-events: none;
  background: linear-gradient(180deg, rgba(40, 40, 40, .94), rgba(18, 18, 18, .94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 12px 28px -10px rgba(0, 0, 0, .7);
  color: #fff; text-align: left; white-space: nowrap; opacity: 0; transform: translateY(4px);
  transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.scrub__tip span:first-child { font-size: 11px; font-weight: 500; line-height: 1.35; color: rgba(255, 255, 255, .58); }
.scrub__tip b { font-size: 15.5px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.hero__chart.is-scrubbing .scrub { opacity: 1; }
.hero__chart.is-scrubbing .scrub__tip { opacity: 1; transform: none; }

.hero__actions { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hero__pill, .hero__plus {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #fff; cursor: pointer; font: inherit;
  border: 1px solid var(--hero-line); background: var(--adm-material); box-shadow: var(--adm-material-hi);
  transition: border-color .18s;
}
.hero__pill { min-width: 104px; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 500; }
.hero__pill svg, .hero__plus svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.hero__plus { width: 58px; height: 58px; border-radius: 50%; border-color: rgba(255, 255, 255, .18); }
.hero__plus svg { width: 22px; height: 22px; }
.hero__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #fff; color: #000; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.hero__count[hidden] { display: none; }
@media (hover: hover) { :is(.hero__pill, .hero__plus, .hero__round):hover { border-color: rgba(255, 255, 255, .3); } }
:is(.hero__pill, .hero__plus, .hero__round, .hero__status):focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: 2px; }
.hero__status {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 22px; height: 30px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--hero-line); background: linear-gradient(180deg, #232323, #101010); color: rgba(255, 255, 255, .92);
  font: inherit; font-size: 13px; cursor: pointer;
}
.hero__led { width: 6px; height: 6px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 8px color-mix(in oklab, #4ADE80 70%, transparent); }
.hero__led--warn { background: #F5B94A; box-shadow: 0 0 8px color-mix(in oklab, #F5B94A 60%, transparent); }
.hero__led--bad { background: #F87171; box-shadow: 0 0 8px color-mix(in oklab, #F87171 60%, transparent); }
/* Телефон: блок во всю ширину с полем 8px, заголовок раздела не нужен. */
@media (max-width: 720px) {
  .hero { margin: -12px calc(-16px + 8px) 26px; padding: 16px 18px 22px; border-radius: 40px 40px 34px 34px; }
  .hero__chart { margin-left: -18px; margin-right: -18px; }
}
@media (min-width: 721px) {
  .hero { padding: 22px 28px 26px; }
  .hero__top { position: absolute; top: 22px; left: 28px; right: 28px; margin: 0; justify-content: flex-end; pointer-events: none; }
  .hero__top > * { pointer-events: auto; }
  .hero__top > .hero__round:first-child { display: none; }
  .hero__period { margin-top: 10px; }
  .hero__chart { margin: 22px -28px 24px; }
  .spark { height: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .scrub__tip { transform: none; transition: opacity .16s ease; }
  .spark-now::after { animation-duration: 4s; }
}

/* =====================================================================
   ПОИСК ⌘K (.cmdk админки)
   На ноутбуке — окно по центру над затемнением; на телефоне — свой экран,
   который вырастает кругом из лупы и сворачивается в неё обратно.
   ===================================================================== */
.cmdk {
  position: fixed; inset: 0; z-index: 300; display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 16px 16px; background: rgba(0, 0, 0, .32);
}
.cmdk[hidden] { display: none; }
.cmdk__panel {
  width: min(640px, 100%); max-height: 72vh; display: flex; flex-direction: column; overflow: hidden;
  background: var(--adm-ground); color: var(--adm-ink); border-radius: 24px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .45);
}
:root[data-theme="dark"] .cmdk__panel { box-shadow: inset 0 0 0 1px #242424, 0 30px 80px -30px rgba(0, 0, 0, .8); }
.cmdk__bar { display: flex; align-items: center; gap: 10px; padding: 12px 12px 6px; }
.cmdk__field { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 14px; border-radius: 999px; background: var(--dash-row); color: var(--adm-faint); cursor: text; }
.cmdk__field svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cmdk__field input { flex: 1; min-width: 0; height: 48px; border: 0; outline: none; background: none; font: inherit; font-size: 16px; color: var(--adm-ink); }
.cmdk__field input::-webkit-search-cancel-button { display: none; }
.cmdk__field input::placeholder { color: var(--adm-faint); }
.cmdk__cancel { flex: 0 0 auto; padding: 8px 4px; border: 0; background: none; color: var(--adm-ink); font: inherit; font-size: 16px; cursor: pointer; }
.cmdk__cancel-text { display: none; }
.kbd { padding: 1px 6px; border: 1px solid var(--adm-line); border-radius: 6px; background: var(--adm-inset); color: var(--adm-faint); font-family: var(--font-numbers); font-size: 11px; font-weight: 400; }
.cmdk__list { flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; padding: 4px 12px 16px; }
.cmdk__group { padding: 12px 4px 2px; font-size: 13px; font-weight: 500; color: var(--adm-faint); }
.cmdk__item { min-height: 64px; }
.cmdk__list.is-kbd .cmdk__item.is-active { box-shadow: inset 0 0 0 1.5px var(--adm-ink); }
.cmdk__item mark { background: none; color: inherit; font-weight: 700; }
.cmdk.is-opening { animation: cmdk-fade .2s ease-out both; }
.cmdk.is-opening .cmdk__panel { animation: cmdk-in .26s cubic-bezier(.16, 1, .3, 1) both; }
.cmdk.is-closing { animation: cmdk-fade .2s ease-in reverse both; pointer-events: none; }
.cmdk.is-closing .cmdk__panel { animation: cmdk-in .2s ease-in reverse both; }
@keyframes cmdk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 720px) {
  .cmdk { padding: 0; align-items: stretch; background: var(--adm-ground); }
  .cmdk__panel { width: 100%; max-height: none; height: 100%; border-radius: 0; box-shadow: none !important; padding-top: env(safe-area-inset-top, 0px); }
  .cmdk__bar { padding: 10px 16px 6px; }
  .cmdk__list { padding: 6px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .cmdk__cancel-text { display: inline; }
  .cmdk .kbd { display: none; }
  .cmdk.is-opening { animation: cmdk-reveal .52s cubic-bezier(.45, 0, .2, 1) both; }
  .cmdk.is-opening .cmdk__panel { animation: none; }
  .cmdk.is-opening .cmdk__bar { animation: cmdk-bar-in .4s cubic-bezier(.16, 1, .3, 1) .14s both; }
  .cmdk.is-opening :is(.cmdk__item, .cmdk__group) { animation: cmdk-row-in .36s cubic-bezier(.16, 1, .3, 1) both; animation-delay: calc(.2s + var(--i, 0) * .035s); }
  .cmdk.is-closing { animation: cmdk-unreveal .32s cubic-bezier(.5, 0, .75, 0) both; }
  .cmdk.is-closing .cmdk__panel { animation: none; }
}
@keyframes cmdk-reveal { from { clip-path: circle(var(--or, 22px) at var(--ox, 50%) var(--oy, 40px)); } to { clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 40px)); } }
@keyframes cmdk-unreveal { from { clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 40px)); } to { clip-path: circle(var(--or, 22px) at var(--ox, 50%) var(--oy, 40px)); opacity: .4; } }
@keyframes cmdk-bar-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes cmdk-row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  /* Раскрытие из лупы остаётся (оно на месте, без полёта), строки не едут. */
  .cmdk.is-opening :is(.cmdk__item, .cmdk__group, .cmdk__bar) { animation: cmdk-fade .2s ease-out both; }
}
.nav--search { margin-bottom: 8px; border: 1px solid var(--adm-line); background: var(--adm-surface); color: var(--adm-faint); }
.nav--search:hover { border-color: var(--adm-accent-line); background: var(--adm-surface); }
.nav--search .kbd { margin-left: auto; }

/* =====================================================================
   ШТОРКА (.psheet админки): снизу на телефоне, окном на ноутбуке.
   Сверху полоска — за неё шторку стягивают вниз; вуаль одна на все слои.
   ===================================================================== */
.sheet { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet__veil { position: absolute; inset: 0; background: var(--adm-veil); -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1); }
.sheet__panel:focus { outline: none; }
.sheet__panel {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; overscroll-behavior: contain;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 28px 28px 0 0;
  background: var(--adm-surface); color: var(--adm-ink); box-shadow: 0 -18px 50px -20px rgba(0, 0, 0, .35);
}
/* В тёмной теме шторка — #141414, ровно как серая строка: плашкам внутри
   нужен тон светлее, иначе они пропадают. */
:root[data-theme="dark"] .sheet__panel { --dash-row: #1F1F1F; --dash-row-press: #262626; box-shadow: inset 0 0 0 1px #242424; }
.sheet__grab { position: sticky; top: 0; z-index: 1; height: 26px; margin: 0 -16px; cursor: grab; touch-action: none; background: var(--adm-surface); }
.sheet__grab::before { content: ''; position: absolute; top: 10px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 999px; background: var(--adm-line); }
.sheet__head { margin: 0 4px 14px; }
.sheet__head h2 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -.015em; }
.sheet__head p { margin: 2px 0 0; font-size: 13.5px; color: var(--adm-muted); }
.sheet .chips { margin-bottom: 14px; }
.sheet .chip { height: 40px; padding: 0 16px; font-size: 14px; }
.sheet .chip::after { display: none; }
@media (min-width: 721px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet__panel { border-radius: 24px; padding-bottom: 20px; }
  .sheet__grab { display: none; }
  .sheet__head { margin-top: 20px; }
}

/* ---------- Уведомление (.toast админки) ---------- */
.toast {
  position: fixed; z-index: 400; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 32px);
  padding: 12px 18px; border-radius: 999px; background: var(--adm-material-flat); color: #fff;
  box-shadow: var(--adm-material-hi), 0 24px 60px -24px rgba(0, 0, 0, .35);
  font-size: 14px; font-weight: 600; opacity: 0; transform: translateX(-50%) translateY(10px); transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toast--bad { background: var(--adm-bad-ink); }
.toast__undo { margin-left: 4px; padding: 4px 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
@media (min-width: 901px) { .toast { bottom: 24px; } }

/* ---------- Скелетон загрузки (мерцание строк, как в поиске админки) ---------- */
.skel {
  height: 72px; border-radius: 16px;
  background: linear-gradient(90deg, var(--dash-row) 0%, var(--dash-row-press) 50%, var(--dash-row) 100%);
  background-size: 200% 100%; animation: skel-shimmer 1.2s linear infinite;
}
@keyframes skel-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation-duration: 2.4s; } }

/* =====================================================================
   ЖЕСТЫ (admin-gestures.css): веер по удержанию и капли у пилюли.
   Только на телефоне. Положение и масштаб пишет скрипт пружинами.
   ===================================================================== */
.fan { position: fixed; inset: 0; z-index: 250; }
.fan__shade { position: absolute; inset: 0; background: var(--adm-veil); -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1); opacity: 0; transition: opacity .2s ease; }
.fan.is-open .fan__shade { opacity: 1; }
.fan__lift { position: fixed; margin: 0 !important; transform-origin: 50% 50%; pointer-events: none; will-change: transform; }
.fan-source { visibility: hidden; }
.fan__touch { position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; border-radius: 50%; border: 3px solid rgba(160, 160, 160, .38); opacity: 0; scale: .5; transition: opacity .18s ease, scale .3s cubic-bezier(.16, 1, .3, 1); pointer-events: none; }
.fan.is-open .fan__touch { opacity: 1; scale: 1; }
.fan.is-closing .fan__touch { opacity: 0; scale: .5; }
.fan__btn { position: absolute; left: 0; top: 0; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: #2B2B2B; color: #fff; opacity: 0; will-change: transform; transition: background-color .12s ease, color .12s ease; }
.fan__btn svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fan__btn.is-hot { background: #fff; color: var(--adm-material-flat); }
.fan__label { position: fixed; left: 18px; right: 18px; top: 0; color: #fff; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; opacity: 0; transition: opacity .12s ease; }
.fan__label.is-on { opacity: 1; }
@media (max-width: 720px) {
  .rows > :is(.lead, .shop) { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
}

/* =====================================================================
   КАПЛИ И ОБНОВЛЕНИЕ ЖЕСТОМ (admin-gestures.css, ведёт crm-gestures.js)

   Капли — круги материала пилюли по её бокам; между ними и пилюлей
   тянется перемычка (SVG-путь каждый кадр). Слои: перемычка под каплей,
   капля под пилюлей — выходит из-под края, а не наезжает сверху; шов —
   над всеми, кроме внутренности пилюли. Положение и масштаб пишет скрипт.
   ===================================================================== */
.liq-bridge, .liq-drop, .liq-seam, .liq-pull, .liq-pull-bridge { display: none; }
@media (max-width: 900px) {
  /* Пилюля плотнее: по бокам должны встать два круга даже на 375px.
     Во всех разделах одинаково — иначе она дёргается при смене раздела. */
  .pill { gap: 0; }
  .pill__item { width: 44px; height: 44px; }

  .liq-bridge { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 57; pointer-events: none; overflow: visible; fill: var(--adm-material-flat); }
  .liq-drop {
    display: grid; place-items: center; position: fixed; left: 0; top: 0; z-index: 58;
    width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%;
    background: var(--adm-material-flat); color: var(--adm-on-material);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .08), var(--adm-material-shadow);
    transform-origin: 50% 50%; will-change: transform; cursor: pointer; touch-action: manipulation;
  }
  :root[data-theme="dark"] .liq-drop { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 12px 28px -10px rgba(0, 0, 0, .8); }
  .liq-drop[hidden] { display: none !important; }
  .liq-seam { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; overflow: visible; }
  .liq-seam__line { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
  :root[data-theme="dark"] .liq-seam__line { stroke: rgba(255, 255, 255, .14); }
  .liq-drop__icon { display: grid; place-items: center; opacity: var(--icon-o, 1); transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
  .liq-drop__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
  .liq-drop:active .liq-drop__icon { transform: scale(.86); }
  .liq-drop:focus { outline: none; }
  .liq-drop:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: -3px; }

  /* Обновление жестом сверху: капля из-за верхнего края, дуга внутри
     дорастает с натяжением, при загрузке — крутится. */
  .liq-pull-bridge { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 70; pointer-events: none; overflow: visible; fill: var(--adm-material-flat); }
  .liq-pull {
    display: grid; place-items: center; position: fixed; left: 0; top: 0; z-index: 71; width: 40px; height: 40px; border-radius: 50%; pointer-events: none;
    color: var(--adm-on-material); background: var(--adm-material-flat); box-shadow: var(--adm-material-hi);
    transform-origin: 50% 50%; will-change: transform;
  }
  .liq-pull[hidden] { display: none; }
  .liq-pull circle { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 50.3; stroke-dashoffset: calc(50.3 * (1 - var(--arc, 0) * .8)); transform-origin: 12px 12px; rotate: -90deg; }
  .liq-pull.is-loading svg { animation: liqPullSpin .8s linear infinite; }
  .liq-pull.is-loading circle { stroke-dashoffset: 34; }
  @keyframes liqPullSpin { to { rotate: 360deg; } }
}
@media (prefers-reduced-motion: reduce) { .liq-pull.is-loading svg { animation-duration: 1.4s; } }

/* =====================================================================
   КНОПКА СОХРАНЕНИЯ: ПИЛЮЛЯ → КРУГ ЗАГРУЗКИ → ГАЛОЧКА
   (как «Оформить» в корзине Aquaret, .co-submit). Ширину ведёт пружина,
   здесь — только форма и рисунок внутри.
   ===================================================================== */
.btn.is-morphing { position: relative; display: grid; place-items: center; flex: none; margin-inline: auto; padding: 0; overflow: hidden; border-radius: 999px; white-space: nowrap; transition: none; }
.btn.is-morphing > * { grid-area: 1 / 1; }
.btn.is-morphing[disabled] { opacity: 1; pointer-events: none; cursor: default; }
.btn__glyph { width: 22px; height: 22px; opacity: 0; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn__arc { stroke-dasharray: .28 1; stroke-dashoffset: 0; }
.btn__tick { stroke-dasharray: 1; stroke-dashoffset: 1; }
.btn.is-loading .btn__glyph { animation: btnSpin .8s linear infinite; }
.btn.is-done .btn__arc { stroke-dasharray: 1 0; transition: stroke-dasharray .32s cubic-bezier(.4, 0, .2, 1); }
.btn.is-done .btn__tick { stroke-dashoffset: 0; transition: stroke-dashoffset .3s cubic-bezier(.4, 0, .2, 1) .22s; }
@keyframes btnSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn.is-loading .btn__glyph { animation-duration: 1.4s; } }
