/* ==========================================================================
   Умный постинг — bundle.css
   Префикс классов: sp-. Модификаторы: sp-x--variant. Состояния: is-*.
   Классы is-hover / is-focus / is-active — только для демонстрации
   состояний в витрине; в продукте состояния дают :hover/:focus-visible/:active.
   ========================================================================== */

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px; line-height: 22px;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, video { display: block; max-width: 100%; }
:focus { outline: none; }
:focus-visible, .is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-inverse :focus-visible, .sp-inverse .is-focus { outline-color: var(--focus-ring-inverse); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
.sp-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp-num { font-variant-numeric: tabular-nums; }

/* ---------- Раскладка ---------- */
.sp-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.sp-stack--2 { gap: var(--space-2); } .sp-stack--3 { gap: var(--space-3); } .sp-stack--6 { gap: var(--space-6); } .sp-stack--8 { gap: var(--space-8); }
.sp-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.sp-row--2 { gap: var(--space-2); } .sp-row--4 { gap: var(--space-4); } .sp-row--6 { gap: var(--space-6); }
.sp-row--top { align-items: flex-start; } .sp-row--between { justify-content: space-between; } .sp-row--nowrap { flex-wrap: nowrap; }
.sp-grow { flex: 1 1 auto; min-width: 0; }
.sp-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
@media (max-width: 767px) { .sp-grid { grid-template-columns: 1fr; } }
.sp-container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-4); }
@media (min-width: 768px) { .sp-container { padding: 0 var(--space-6); } }
@media (min-width: 1440px) { .sp-container { padding: 0 var(--space-8); } }

/* ---------- Превью-обвязка (только витрина) ---------- */
.pv { padding: var(--space-6); background: var(--bg-page); color: var(--text-primary); min-height: 100%; }
.pv--surface { background: var(--bg-surface); }
.pv-label { font-size: 12px; line-height: 16px; color: var(--text-secondary); margin: 0 0 var(--space-2); }
.pv-cell { display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.pv-grid { display: grid; gap: var(--space-5) var(--space-6); grid-template-columns: repeat(auto-fill, minmax(var(--pv-min, 180px), 1fr)); align-items: start; }
.pv-sep { height: 1px; background: var(--border); margin: var(--space-6) 0; border: 0; }
.pv-title { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 var(--space-3); }

/* ---------- Иконки (Lucide, stroke 2, currentColor) ---------- */
.sp-i { display: inline-flex; flex: none; width: 20px; height: 20px; align-items: center; justify-content: center; color: inherit; }
.sp-i svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sp-i--xs { width: 12px; height: 12px; } .sp-i--s { width: 16px; height: 16px; } .sp-i--l { width: 24px; height: 24px; }
.sp-i--xl { width: 32px; height: 32px; } .sp-i--2xl { width: 48px; height: 48px; }
.sp-i--xl svg, .sp-i--2xl svg { stroke-width: 1.5; }

/* ---------- Типографика ---------- */
.sp-display { font-size: 56px; line-height: 64px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.sp-h1 { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.015em; margin: 0; }
.sp-h2 { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.sp-h3 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.005em; margin: 0; }
.sp-h4 { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.sp-h5 { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0; }
.sp-h6 { font-size: 15px; line-height: 20px; font-weight: 600; margin: 0; }
.sp-lead { font-size: 19px; line-height: 28px; margin: 0; color: var(--text-secondary); }
.sp-body-lg { font-size: 17px; line-height: 26px; margin: 0; }
.sp-body { font-size: 15px; line-height: 22px; margin: 0; }
.sp-body-sm { font-size: 13px; line-height: 18px; margin: 0; }
.sp-caption { font-size: 12px; line-height: 16px; letter-spacing: .01em; margin: 0; }
.sp-overline { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin: 0; color: var(--text-secondary); }
.sp-strong { font-weight: 500; }
.sp-muted { color: var(--text-secondary); }
.sp-subtle { color: var(--text-tertiary); }
@media (max-width: 767px) {
  .sp-display { font-size: 36px; line-height: 42px; }
  .sp-h1 { font-size: 30px; line-height: 36px; }
  .sp-h2 { font-size: 26px; line-height: 32px; }
  .sp-h3 { font-size: 20px; line-height: 28px; }
}

/* ---------- Ссылка ---------- */
.sp-link { color: var(--text-link); text-decoration: none; border-radius: min(var(--radius-xs), 2px); cursor: pointer; transition: color var(--duration-fast) var(--ease-standard); }
.sp-link:hover, .sp-link.is-hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-link:active, .sp-link.is-active { opacity: .8; }
.sp-link--muted { color: var(--text-secondary); }
.sp-link--inherit { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.sp-link[aria-disabled="true"] { color: var(--text-disabled); pointer-events: none; }
.sp-link .sp-i { display: inline-flex; vertical-align: -3px; margin-left: 4px; }

/* ---------- Кнопка ---------- */
.sp-btn {
  --h: var(--control-m);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--h); min-width: var(--h); padding: 0 var(--space-4);
  border: 1px solid transparent; border-radius: var(--radius-md);
  font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap; text-decoration: none;
  cursor: pointer; user-select: none; vertical-align: middle;
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.sp-btn:active:not(:disabled), .sp-btn.is-active { transform: translateY(1px); }
.sp-btn--xs { --h: var(--control-xs); padding: 0 var(--space-2); font-size: 13px; border-radius: var(--radius-sm); gap: var(--space-1); }
.sp-btn--s { --h: var(--control-s); padding: 0 var(--space-3); font-size: 13px; line-height: 18px; border-radius: var(--radius-sm); gap: 6px; }
.sp-btn--l { --h: var(--control-l); padding: 0 var(--space-5); font-size: 15px; }
.sp-btn--xl { --h: var(--control-xl); padding: 0 var(--space-8); font-size: 17px; border-radius: var(--radius-lg); }
.sp-btn--block { display: flex; width: 100%; }
.sp-btn--icon { padding: 0; width: var(--h); }
.sp-btn--s .sp-i, .sp-btn--xs .sp-i { width: 16px; height: 16px; }
/* primary */
.sp-btn--primary { background: var(--primary); color: var(--on-primary); }
.sp-btn--primary:hover, .sp-btn--primary.is-hover { background: var(--primary-hover); }
.sp-btn--primary:active, .sp-btn--primary.is-active { background: var(--primary-active); }
/* secondary — серая плашка, как «Показать все» */
.sp-btn--secondary { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-btn--secondary:hover, .sp-btn--secondary.is-hover { background: var(--bg-surface-3); }
.sp-btn--secondary:active, .sp-btn--secondary.is-active { background: var(--border-strong); }
/* outline */
.sp-btn--outline { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-strong); }
.sp-btn--outline:hover, .sp-btn--outline.is-hover { border-color: var(--border-control); background: var(--bg-sunken); }
.sp-btn--outline:active, .sp-btn--outline.is-active { background: var(--bg-surface-2); }
/* ghost */
.sp-btn--ghost { background: transparent; color: var(--text-primary); }
.sp-btn--ghost:hover, .sp-btn--ghost.is-hover { background: var(--bg-surface-2); }
.sp-btn--ghost:active, .sp-btn--ghost.is-active { background: var(--bg-surface-3); }
/* accent — только промо и апгрейд тарифа */
.sp-btn--accent { background: var(--accent); color: var(--on-accent); }
.sp-btn--accent:hover, .sp-btn--accent.is-hover { background: var(--sun-300); }
.sp-btn--accent:active, .sp-btn--accent.is-active { background: var(--sun-500); }
/* danger */
.sp-btn--danger { background: var(--danger); color: var(--on-danger); }
.sp-btn--danger:hover, .sp-btn--danger.is-hover { background: var(--danger-hover); }
.sp-btn--danger-soft { background: var(--danger-soft); color: var(--danger-ink); }
.sp-btn--danger-soft:hover, .sp-btn--danger-soft.is-hover { background: var(--red-100); }
[data-theme="dark"] .sp-btn--danger-soft:hover, [data-theme="dark"] .sp-btn--danger-soft.is-hover { background: #4a1c1f; }
/* link-кнопка */
.sp-btn--link { background: none; color: var(--text-link); padding: 0; height: auto; min-width: 0; border-radius: min(var(--radius-xs), 2px); }
.sp-btn--link:hover, .sp-btn--link.is-hover { text-decoration: underline; text-underline-offset: 3px; }
/* на тёмной подложке (sidebar, inverse) */
.sp-inverse .sp-btn--ghost { color: var(--text-sidebar); }
.sp-inverse .sp-btn--ghost:hover { background: var(--bg-sidebar-active); }
/* disabled */
.sp-btn:disabled, .sp-btn[aria-disabled="true"], .sp-btn.is-disabled {
  background: var(--bg-surface-2); color: var(--text-disabled); border-color: transparent; cursor: not-allowed; transform: none;
}
.sp-btn--ghost:disabled, .sp-btn--link:disabled, .sp-btn--ghost.is-disabled, .sp-btn--link.is-disabled { background: transparent; }
/* loading */
.sp-btn.is-loading { color: transparent !important; pointer-events: none; }
.sp-btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: var(--radius-full);
  border: 2px solid currentColor; border-right-color: transparent; animation: sp-spin .7s linear infinite;
}
.sp-btn--primary.is-loading::after { border-color: var(--on-primary); border-right-color: transparent; }
.sp-btn--danger.is-loading::after { border-color: var(--on-danger); border-right-color: transparent; }
.sp-btn--secondary.is-loading::after, .sp-btn--outline.is-loading::after, .sp-btn--ghost.is-loading::after { border-color: var(--text-primary); border-right-color: transparent; }
.sp-btn--accent.is-loading::after { border-color: var(--on-accent); border-right-color: transparent; }
@media (max-width: 767px) { .sp-btn, .sp-btn--xs, .sp-btn--s { --h: var(--control-touch); } .sp-btn--l { --h: var(--control-l); } .sp-btn--xl { --h: var(--control-xl); } .sp-btn--link { height: auto; } }

/* Группа кнопок */
.sp-btn-group { display: inline-flex; }
.sp-btn-group .sp-btn { border-radius: 0; }
.sp-btn-group .sp-btn + .sp-btn { margin-left: -1px; }
.sp-btn-group .sp-btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.sp-btn-group .sp-btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }

/* ---------- Спиннер ---------- */
@keyframes sp-spin { to { transform: rotate(360deg); } }
.sp-spinner { --s: 20px; display: inline-block; width: var(--s); height: var(--s); border-radius: var(--radius-full); border: 2px solid var(--bg-surface-3); border-top-color: var(--primary); animation: sp-spin .8s linear infinite; flex: none; }
.sp-spinner--s { --s: 16px; } .sp-spinner--l { --s: 32px; border-width: 3px; } .sp-spinner--xl { --s: 48px; border-width: 4px; }
.sp-spinner--inverse { border-color: rgba(255,255,255,.3); border-top-color: #fff; }

/* ---------- Скелетон ---------- */
@keyframes sp-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sp-skeleton { display: block; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--bg-surface-3) 37%, var(--bg-surface-2) 63%); background-size: 400% 100%; animation: sp-shimmer 1.4s ease infinite; height: 14px; }
.sp-skeleton--text { height: 12px; margin: 5px 0; }
.sp-skeleton--title { height: 22px; width: 50%; }
.sp-skeleton--circle { border-radius: var(--radius-full); }
.sp-skeleton--block { height: 120px; border-radius: var(--radius-lg); }

/* ---------- Бейдж и счётчик ---------- */
.sp-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: var(--radius-full); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap;
  background: var(--bg-surface-2); color: var(--text-primary);
}
.sp-badge .sp-i { width: 12px; height: 12px; }
.sp-badge--primary { background: var(--primary); color: var(--on-primary); }
.sp-badge--accent { background: var(--accent); color: var(--on-accent); }
.sp-badge--info { background: var(--info-soft); color: var(--info-ink); }
.sp-badge--success { background: var(--success-soft); color: var(--success-ink); }
.sp-badge--warning { background: var(--warning-soft); color: var(--warning-ink); }
.sp-badge--danger { background: var(--danger-soft); color: var(--danger-ink); }
.sp-badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-badge--l { height: 28px; padding: 0 12px; font-size: 13px; }
.sp-badge__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: currentColor; }
.sp-counter { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); font-size: 11px; line-height: 1; font-weight: 600; background: var(--accent); color: var(--on-accent); font-variant-numeric: tabular-nums; }
.sp-counter--danger { background: var(--danger); color: var(--on-danger); }
.sp-counter--muted { background: var(--bg-surface-3); color: var(--text-secondary); }
.sp-counter--dot { min-width: 8px; width: 8px; height: 8px; padding: 0; }

/* ---------- Поле формы ---------- */
.sp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-field__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-primary); }
.sp-field__label .sp-req { color: var(--danger-ink); margin-left: 2px; }
.sp-field__hint { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-field__error { font-size: 12px; line-height: 16px; color: var(--danger-ink); display: flex; gap: 4px; align-items: flex-start; }
.sp-field__error .sp-i { width: 14px; height: 14px; margin-top: 1px; }
.sp-field__success { font-size: 12px; line-height: 16px; color: var(--success-ink); }
.sp-field__warn { font-size: 12px; line-height: 16px; color: var(--warning-ink); }

/* Контрол (input, select-кнопка, textarea) */
.sp-control {
  --h: var(--control-m);
  position: relative; display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--h); padding: 0 var(--space-3);
  background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border-control); border-radius: var(--radius-sm);
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.sp-control:hover, .sp-control.is-hover { border-color: var(--text-secondary); }
.sp-control:focus-within, .sp-control.is-focus { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); outline: none; }
.sp-control.is-error { border-color: var(--danger); }
.sp-control.is-error:focus-within, .sp-control.is-error.is-focus { box-shadow: 0 0 0 1px var(--danger); }
.sp-control.is-success { border-color: var(--success); }
.sp-control.is-disabled, .sp-control:has(:disabled) { background: var(--bg-surface-2); border-color: transparent; color: var(--text-disabled); cursor: not-allowed; }
.sp-control.is-readonly { background: var(--bg-sunken); border-style: dashed; }
.sp-control--s { --h: var(--control-s); font-size: 13px; }
.sp-control--l { --h: var(--control-l); }
.sp-control > .sp-i { color: var(--text-tertiary); width: 18px; height: 18px; }
.sp-control input, .sp-control textarea, .sp-control select {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 0; height: calc(var(--h) - 2px);
  font-size: inherit; color: inherit;
}
.sp-control input::placeholder, .sp-control textarea::placeholder { color: var(--text-tertiary); }
.sp-control input:disabled::placeholder { color: var(--text-disabled); }
.sp-control__affix { color: var(--text-secondary); font-size: 13px; white-space: nowrap; }
.sp-control__btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: -6px; border: 0; background: none; border-radius: var(--radius-xs); color: var(--text-tertiary); cursor: pointer; }
.sp-control__btn:hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-control__btn .sp-i { width: 18px; height: 18px; }
/* плавающий лейбл, как «Текущий статус / Работает» у референса */
.sp-control--float { --h: 56px; flex-direction: row; align-items: center; padding: 0 var(--space-4); border-color: var(--border-strong); border-radius: var(--radius-md); }
.sp-control--float .sp-control__stack { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 8px 0; }
.sp-control--float .sp-control__flabel { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-control--float input { height: 22px; font-size: 15px; }
@media (max-width: 767px) { .sp-control, .sp-control--s { --h: var(--control-l); font-size: 16px; } }

/* ---------- Карточка ---------- */
.sp-card { background: var(--bg-surface); border-radius: var(--radius-xl); padding: var(--space-8); color: var(--text-primary); }
.sp-card--s { padding: var(--space-5); border-radius: var(--radius-lg); }
.sp-card--flush { padding: 0; overflow: hidden; }
.sp-card--outline { box-shadow: inset 0 0 0 1px var(--border); }
.sp-card--interactive { cursor: pointer; transition: box-shadow var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard); }
.sp-card--interactive:hover, .sp-card--interactive.is-hover { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.sp-card--selected { box-shadow: inset 0 0 0 2px var(--primary); }
.sp-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-2); }
.sp-card__desc { color: var(--text-secondary); margin: 0 0 var(--space-6); }
.sp-card__foot { display: flex; gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; }
@media (max-width: 767px) { .sp-card { padding: var(--space-5); border-radius: var(--radius-lg); } }

/* ---------- Аватар ---------- */
.sp-avatar { --s: 40px; position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--s); height: var(--s); border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; font-size: calc(var(--s) * .38); overflow: visible; }
.sp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.sp-avatar--xs { --s: 24px; } .sp-avatar--s { --s: 32px; } .sp-avatar--l { --s: 56px; } .sp-avatar--xl { --s: 80px; }
.sp-avatar--square { border-radius: var(--radius-lg); }
.sp-avatar__status { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 8px; min-height: 8px; border-radius: var(--radius-full); background: var(--success); box-shadow: 0 0 0 2px var(--bg-surface); }
.sp-avatar-group { display: inline-flex; }
.sp-avatar-group .sp-avatar { box-shadow: 0 0 0 2px var(--bg-surface); }
.sp-avatar-group .sp-avatar + .sp-avatar { margin-left: -8px; }

/* ---------- Разделитель ---------- */
.sp-divider { border: 0; height: 1px; background: var(--border); margin: var(--space-4) 0; }
.sp-divider--v { width: 1px; height: auto; align-self: stretch; margin: 0 var(--space-2); }
.sp-divider--label { display: flex; align-items: center; gap: var(--space-3); height: auto; background: none; color: var(--text-tertiary); font-size: 12px; }
.sp-divider--label::before, .sp-divider--label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sp-divider--dashed { background: none; border-top: 1px dashed var(--border-strong); height: 0; }

/* ==========================================================================
   10 — Текст и действия: Typography/Prose, Blockquote, Callout, Code, Link,
   Divider, Tag, Badge (расширение), Timeline, Button (расширение), IconButton,
   FAB, SegmentedControl, Chip, Avatar (расширение).
   Базовые .sp-btn/.sp-badge/.sp-avatar/.sp-divider/.sp-link — в 00-base.css.
   ========================================================================== */

/* ---------- Типографика: списки, выделения, утилиты ---------- */
.sp-list { margin: 0; padding-left: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); }
.sp-list > li { padding-left: var(--space-1); }
.sp-list > li::marker { color: var(--text-tertiary); }
ol.sp-list > li::marker { font-variant-numeric: tabular-nums; font-weight: 500; }
.sp-list--check { list-style: none; padding-left: 0; }
.sp-list--check > li { display: flex; gap: var(--space-2); align-items: flex-start; padding-left: 0; }
.sp-list--check > li > .sp-i { width: 20px; height: 20px; margin-top: 1px; color: var(--success-ink); }
.sp-list--check > li.is-todo { color: var(--text-secondary); }
.sp-list--check > li.is-todo > .sp-i { color: var(--text-tertiary); }
.sp-mark { background: var(--accent-soft); color: var(--text-primary); border-radius: min(var(--radius-xs), 3px); padding: 0 2px; }
.sp-em { font-style: italic; }
.sp-text--primary { color: var(--text-primary); }
.sp-text--secondary { color: var(--text-secondary); }
.sp-text--tertiary { color: var(--text-tertiary); }
.sp-text--success { color: var(--success-ink); }
.sp-text--warning { color: var(--warning-ink); }
.sp-text--danger { color: var(--danger-ink); }
.sp-text--info { color: var(--info-ink); }
.sp-text--accent { color: var(--accent-ink); }
.sp-text--strong { font-weight: 600; }
.sp-text--medium { font-weight: 500; }
.sp-text--truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sp-text--clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 2); overflow: hidden; }
.sp-text--num { font-variant-numeric: tabular-nums; }

/* ---------- Prose: пользовательский / markdown-контент ---------- */
.sp-prose { color: var(--text-primary); font-size: 15px; line-height: 24px; overflow-wrap: anywhere; max-width: 72ch; }
.sp-prose--wide { max-width: none; }
.sp-prose > * { margin: 0; }
.sp-prose > * + * { margin-top: var(--space-3); }
.sp-prose h1, .sp-prose h2, .sp-prose h3, .sp-prose h4, .sp-prose h5, .sp-prose h6 { font-weight: 600; color: var(--text-primary); }
.sp-prose h1 { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; }
.sp-prose h2 { font-size: 24px; line-height: 32px; letter-spacing: -0.005em; }
.sp-prose h3 { font-size: 20px; line-height: 28px; }
.sp-prose h4 { font-size: 17px; line-height: 24px; }
.sp-prose h5 { font-size: 15px; line-height: 22px; }
.sp-prose h6 { font-size: 13px; line-height: 18px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .06em; }
.sp-prose > h1 + *, .sp-prose > h2 + *, .sp-prose > h3 + *, .sp-prose > h4 + *, .sp-prose > h5 + *, .sp-prose > h6 + * { margin-top: var(--space-2); }
.sp-prose > * + h1, .sp-prose > * + h2 { margin-top: var(--space-8); }
.sp-prose > * + h3, .sp-prose > * + h4 { margin-top: var(--space-6); }
.sp-prose > * + h5, .sp-prose > * + h6 { margin-top: var(--space-5); }
.sp-prose a { color: var(--text-link); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; border-radius: min(var(--radius-xs), 2px); }
.sp-prose a:hover { text-decoration-color: currentColor; }
.sp-prose strong, .sp-prose b { font-weight: 600; }
.sp-prose mark { background: var(--accent-soft); color: var(--text-primary); border-radius: min(var(--radius-xs), 3px); padding: 0 2px; }
.sp-prose ul, .sp-prose ol { padding-left: var(--space-6); }
.sp-prose li + li { margin-top: var(--space-1); }
.sp-prose li > ul, .sp-prose li > ol { margin-top: var(--space-1); }
.sp-prose li::marker { color: var(--text-tertiary); }
.sp-prose blockquote { border-left: 3px solid var(--accent); padding: 2px 0 2px var(--space-4); color: var(--text-primary); }
.sp-prose code { font-family: var(--font-mono); font-size: .87em; background: var(--bg-surface-2); color: var(--text-primary); padding: 1px 5px; border-radius: var(--radius-xs); }
.sp-prose pre { font-family: var(--font-mono); font-size: 13px; line-height: 20px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); overflow-x: auto; }
.sp-prose pre code { background: none; padding: 0; font-size: inherit; }
.sp-prose hr { border: 0; height: 1px; background: var(--border); margin: var(--space-6) 0; }
.sp-prose img { border-radius: var(--radius-md); max-width: 100%; height: auto; }
.sp-prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.sp-prose th { text-align: left; font-weight: 600; color: var(--text-secondary); font-size: 13px; background: var(--bg-sunken); }
.sp-prose th, .sp-prose td { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.sp-prose--s { font-size: 13px; line-height: 20px; }
@media (max-width: 767px) {
  .sp-prose h1 { font-size: 26px; line-height: 32px; }
  .sp-prose h2 { font-size: 21px; line-height: 28px; }
  .sp-prose table { display: block; overflow-x: auto; }
}

/* ---------- Цитата ---------- */
.sp-quote { margin: 0; padding: 2px 0 2px var(--space-5); border-left: 3px solid var(--accent); color: var(--text-primary); }
.sp-quote__text { margin: 0; font-size: 17px; line-height: 26px; }
.sp-quote__footer { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); }
.sp-quote__author { display: flex; flex-direction: column; min-width: 0; }
.sp-quote__name { font-size: 15px; line-height: 20px; font-weight: 600; font-style: normal; }
.sp-quote__role { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-quote--card { border-left: 0; background: var(--bg-surface); border-radius: var(--radius-xl); padding: var(--space-8); }
.sp-quote--pull { border-left: 0; padding: 0; text-align: center; max-width: 720px; margin: 0 auto; }
.sp-quote--pull::before { content: "«"; display: block; font-size: 72px; line-height: 48px; height: 44px; font-weight: 700; color: var(--accent-ink); }
.sp-quote--pull .sp-quote__text { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.sp-quote--pull .sp-quote__footer { justify-content: center; margin-top: var(--space-6); }
.sp-quote--pull .sp-quote__author { text-align: left; }
@media (max-width: 767px) {
  .sp-quote--card { padding: var(--space-5); border-radius: var(--radius-lg); }
  .sp-quote--pull .sp-quote__text { font-size: 21px; line-height: 28px; }
}

/* ---------- Выноска ---------- */
.sp-callout {
  --c-ink: var(--text-secondary);
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--bg-surface-2); color: var(--text-primary);
  font-size: 15px; line-height: 22px;
}
.sp-callout--info { --c-ink: var(--info-ink); background: var(--info-soft); }
.sp-callout--success { --c-ink: var(--success-ink); background: var(--success-soft); }
.sp-callout--warning { --c-ink: var(--warning-ink); background: var(--warning-soft); }
.sp-callout--danger { --c-ink: var(--danger-ink); background: var(--danger-soft); }
.sp-callout--accent { --c-ink: var(--accent-ink); background: var(--accent-soft); }
.sp-callout--neutral { --c-ink: var(--text-secondary); background: var(--bg-surface-2); }
.sp-callout--outline { background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-callout__icon { display: inline-flex; flex: none; color: var(--c-ink); padding-top: 1px; }
.sp-callout__icon .sp-i { width: 20px; height: 20px; }
.sp-callout__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-callout__title { font-weight: 600; margin: 0; font-size: 15px; line-height: 22px; }
.sp-callout__text { margin: 0; }
.sp-callout__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); }
.sp-callout__close {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -3px -4px -3px 0;
  border: 0; background: none; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.sp-callout__close:hover, .sp-callout__close.is-hover { background: color-mix(in srgb, currentColor 12%, transparent); color: var(--text-primary); }
.sp-callout__close .sp-i { width: 18px; height: 18px; }
.sp-callout--compact { padding: var(--space-3) var(--space-4); align-items: center; font-size: 13px; line-height: 18px; border-radius: var(--radius-md); }
.sp-callout--compact .sp-callout__icon { padding-top: 0; }
.sp-callout--compact .sp-callout__icon .sp-i { width: 18px; height: 18px; }
.sp-callout--compact .sp-callout__title { font-size: 13px; line-height: 18px; }
@media (max-width: 767px) {
  .sp-callout__close { width: 40px; height: 40px; margin: -10px -10px -10px 0; }
}

/* ---------- Код ---------- */
.sp-code { font-family: var(--font-mono); font-size: .87em; line-height: inherit; background: var(--bg-surface-2); color: var(--text-primary); padding: 1px 5px; border-radius: var(--radius-xs); white-space: break-spaces; }
.sp-codeblock { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; color: var(--text-primary); min-width: 0; }
.sp-codeblock__head { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-2) 0 var(--space-4); border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.sp-codeblock__file { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-codeblock__file .sp-i { width: 16px; height: 16px; color: var(--text-tertiary); }
.sp-codeblock__lang { font-family: var(--font-mono); font-size: 11px; line-height: 16px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
.sp-codeblock__copy.is-copied, .sp-codeblock__copy.is-copied:hover { color: var(--success-ink); background: var(--success-soft); }
.sp-codeblock__pre { margin: 0; padding: var(--space-4); overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 20px; tab-size: 2; }
.sp-codeblock__pre code { font: inherit; }
.sp-codeblock--numbered .sp-codeblock__pre { counter-reset: sp-ln; padding-left: 0; }
.sp-codeblock--numbered .sp-codeblock__line { display: block; counter-increment: sp-ln; padding-left: 52px; position: relative; }
.sp-codeblock--numbered .sp-codeblock__line::before { content: counter(sp-ln); position: absolute; left: 0; width: 36px; text-align: right; color: var(--text-tertiary); user-select: none; }
.sp-codeblock__line { display: block; min-height: 20px; }
.sp-codeblock__pre--wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
/* подсветка — только семантические inks */
.sp-tok-k { color: var(--info-ink); }
.sp-tok-s { color: var(--success-ink); }
.sp-tok-n { color: var(--warning-ink); }
.sp-tok-c { color: var(--text-tertiary); font-style: italic; }
.sp-tok-p { color: var(--text-secondary); }
/* клавиши */
.sp-kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1; font-weight: 500; color: var(--text-primary);
  background: var(--bg-surface); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-xs);
  vertical-align: middle; white-space: nowrap;
}
.sp-kbd--s { min-width: 18px; height: 18px; font-size: 11px; padding: 0 4px; }
.sp-kbd-combo { display: inline-flex; align-items: center; gap: 4px; color: var(--text-tertiary); font-size: 12px; }
/* моноширинный ID (id кабинета) */
.sp-mono-id {
  display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 2px 0 var(--space-2); max-width: 100%;
  background: var(--bg-surface-2); border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.sp-mono-id__label { font-family: var(--font-sans); color: var(--text-secondary); font-weight: 400; margin-right: 4px; }
.sp-mono-id__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-mono-id__copy { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; background: none; border-radius: min(var(--radius-sm), 6px); color: var(--text-secondary); cursor: pointer; flex: none; }
.sp-mono-id__copy:hover, .sp-mono-id__copy.is-hover { background: var(--bg-surface-3); color: var(--text-primary); }
.sp-mono-id__copy.is-copied { color: var(--success-ink); }
.sp-mono-id__copy .sp-i { width: 14px; height: 14px; }
.sp-mono-id--plain { background: none; padding: 0; height: auto; }
@media (max-width: 767px) { .sp-mono-id { height: 40px; } .sp-mono-id__copy { width: 36px; height: 36px; } }

/* ---------- Ссылка (расширение базы) ---------- */
.sp-link.is-hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-link--inline { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; }
.sp-link--inline:hover, .sp-link--inline.is-hover { text-decoration-color: currentColor; }
.sp-link--track:visited, .sp-link.is-visited { color: var(--primary-ink); }
.sp-link--standalone { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.sp-link--standalone .sp-i { margin-left: 0; width: 18px; height: 18px; transition: transform var(--duration-fast) var(--ease-standard); }
.sp-link--standalone:hover .sp-i, .sp-link--standalone.is-hover .sp-i { transform: translateX(3px); }
.sp-link--external .sp-i { width: 14px; height: 14px; vertical-align: -1px; margin-left: 3px; }
.sp-link--external:hover .sp-i, .sp-link--external.is-hover .sp-i { transform: none; }
.sp-link--s { font-size: 13px; line-height: 18px; }
.sp-link.is-disabled { color: var(--text-disabled); pointer-events: none; text-decoration: none; }
.sp-inverse .sp-link { color: var(--text-sidebar); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Разделитель (расширение базы) ---------- */
.sp-divider--flush { margin: 0; }
.sp-divider--menu { margin: var(--space-1) 0; }
.sp-divider--strong { background: var(--border-strong); }
.sp-divider--label.sp-divider--start::before { flex: 0 0 0; }
.sp-divider--label.sp-divider--start { gap: 0; }
.sp-divider--label.sp-divider--start > span { margin-right: var(--space-3); }
.sp-divider--label > span { white-space: nowrap; }
.sp-divider--v.sp-divider--dashed { border-top: 0; border-left: 1px dashed var(--border-strong); width: 0; }
.sp-divider--v.sp-divider--flush { margin: 0; }
.sp-divider--v.sp-divider--inset { margin-top: var(--space-2); margin-bottom: var(--space-2); }

/* ---------- Тег-метка (рубрики поста) ---------- */
.sp-tag {
  --t-bg: var(--bg-surface-2); --t-ink: var(--text-primary);
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--space-2); max-width: 100%;
  border: 0; border-radius: var(--radius-sm); background: var(--t-bg); color: var(--t-ink);
  font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap; vertical-align: middle; text-decoration: none;
  transition: box-shadow var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.sp-tag--s { height: 22px; padding: 0 6px; gap: 4px; font-size: 12px; line-height: 16px; border-radius: min(var(--radius-sm), 6px); }
.sp-tag__label { overflow: hidden; text-overflow: ellipsis; }
.sp-tag .sp-i { width: 14px; height: 14px; }
.sp-tag--s .sp-i { width: 12px; height: 12px; }
.sp-tag__dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: currentColor; flex: none; }
.sp-tag--s .sp-tag__dot { width: 6px; height: 6px; }
.sp-tag--primary { --t-bg: var(--primary-soft); --t-ink: var(--primary-ink); }
.sp-tag--accent { --t-bg: var(--accent-soft); --t-ink: var(--accent-ink); }
.sp-tag--info { --t-bg: var(--info-soft); --t-ink: var(--info-ink); }
.sp-tag--success { --t-bg: var(--success-soft); --t-ink: var(--success-ink); }
.sp-tag--warning { --t-bg: var(--warning-soft); --t-ink: var(--warning-ink); }
.sp-tag--danger { --t-bg: var(--danger-soft); --t-ink: var(--danger-ink); }
.sp-tag--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
button.sp-tag, a.sp-tag, .sp-tag--clickable { cursor: pointer; font-family: inherit; }
button.sp-tag:hover, a.sp-tag:hover, .sp-tag--clickable:hover, .sp-tag.is-hover { box-shadow: inset 0 0 0 1px currentColor; }
.sp-tag.is-selected { box-shadow: inset 0 0 0 2px currentColor; }
.sp-tag__remove {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 18px; height: 18px; margin-right: -4px; padding: 0; border: 0; border-radius: var(--radius-xs);
  background: none; color: inherit; cursor: pointer;
}
.sp-tag__remove::after { content: ""; position: absolute; inset: -6px; }
.sp-tag__remove:hover, .sp-tag__remove.is-hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.sp-tag__remove .sp-i { width: 14px; height: 14px; }
.sp-tag--s .sp-tag__remove { width: 16px; height: 16px; margin-right: -3px; }
.sp-tag.is-disabled, .sp-tag:disabled { --t-bg: var(--bg-surface-2); --t-ink: var(--text-disabled); box-shadow: none; cursor: not-allowed; }
.sp-tag.is-disabled .sp-tag__remove { pointer-events: none; }
.sp-tag-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 767px) { .sp-tag__remove::after { inset: -11px; } }

/* ---------- Бейдж и счётчик (расширение базы) ---------- */
.sp-badge--neutral { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-badge--s { height: 18px; padding: 0 6px; font-size: 11px; line-height: 14px; }
.sp-badge--s .sp-i { width: 10px; height: 10px; }
.sp-badge--l .sp-i { width: 14px; height: 14px; }
.sp-badge--outline { color: var(--text-primary); }
.sp-badge--outline.sp-badge--info, .sp-badge--outline.sp-badge--success, .sp-badge--outline.sp-badge--warning, .sp-badge--outline.sp-badge--danger { box-shadow: inset 0 0 0 1px currentColor; }
.sp-badge--outline.sp-badge--primary { color: var(--primary-ink); box-shadow: inset 0 0 0 1px currentColor; }
.sp-badge--outline.sp-badge--accent { color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.sp-badge--new { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.sp-counter--primary { background: var(--primary); color: var(--on-primary); }
.sp-counter--l { min-width: 22px; height: 22px; padding: 0 7px; font-size: 12px; }
.sp-counter-anchor { position: relative; display: inline-flex; }
.sp-counter-anchor > .sp-counter, .sp-icon-btn__counter { position: absolute; top: -5px; right: -5px; box-shadow: 0 0 0 2px var(--bg-surface); pointer-events: none; }
.sp-counter-anchor > .sp-counter--dot, .sp-icon-btn__counter.sp-counter--dot { top: 1px; right: 1px; }

/* ---------- Таймлайн ---------- */
.sp-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sp-timeline__item { --m: 32px; position: relative; display: flex; gap: var(--space-3); padding-bottom: var(--space-5); }
.sp-timeline__item:last-child { padding-bottom: 0; }
.sp-timeline__item::before { content: ""; position: absolute; left: calc(var(--m) / 2 - 1px); top: calc(var(--m) + 2px); bottom: 2px; width: 2px; border-radius: min(var(--radius-xs), 1px); background: var(--border-strong); }
.sp-timeline__item:last-child::before { display: none; }
.sp-timeline__item.is-done::before { background: var(--success); }
.sp-timeline__marker {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--m); height: var(--m); border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-secondary);
}
.sp-timeline__marker .sp-i { width: 16px; height: 16px; }
.sp-timeline__item.is-done .sp-timeline__marker { background: var(--success-soft); color: var(--success-ink); }
.sp-timeline__item.is-current .sp-timeline__marker { background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.sp-timeline__item.is-error .sp-timeline__marker { background: var(--danger-soft); color: var(--danger-ink); }
.sp-timeline__item.is-warning .sp-timeline__marker { background: var(--warning-soft); color: var(--warning-ink); }
.sp-timeline__item.is-pending .sp-timeline__marker { background: var(--bg-surface); color: var(--text-tertiary); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-timeline__content { flex: 1; min-width: 0; padding-top: 5px; }
.sp-timeline__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px var(--space-3); }
.sp-timeline__title { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text-primary); }
.sp-timeline__item.is-pending .sp-timeline__title { color: var(--text-secondary); font-weight: 400; }
.sp-timeline__item.is-error .sp-timeline__title { color: var(--danger-ink); }
.sp-timeline__time { font-size: 13px; line-height: 18px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-timeline__desc { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-timeline__extra { margin-top: var(--space-2); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
/* компактный */
.sp-timeline--compact .sp-timeline__item { --m: 12px; gap: var(--space-3); padding-bottom: var(--space-3); }
.sp-timeline--compact .sp-timeline__item::before { top: 18px; bottom: -2px; left: 5px; }
.sp-timeline--compact .sp-timeline__marker { margin-top: 5px; box-shadow: inset 0 0 0 2px var(--border-strong); background: var(--bg-surface); }
.sp-timeline--compact .sp-timeline__marker .sp-i { display: none; }
.sp-timeline--compact .is-done .sp-timeline__marker { background: var(--success); box-shadow: none; }
.sp-timeline--compact .is-current .sp-timeline__marker { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.sp-timeline--compact .is-error .sp-timeline__marker { background: var(--danger); box-shadow: none; }
.sp-timeline--compact .is-warning .sp-timeline__marker { background: var(--warning); box-shadow: none; }
.sp-timeline--compact .sp-timeline__content { padding-top: 0; }
.sp-timeline--compact .sp-timeline__head { flex-wrap: nowrap; }
.sp-timeline--compact .sp-timeline__title { font-size: 13px; line-height: 22px; }
.sp-timeline--compact .sp-timeline__time { font-size: 12px; line-height: 22px; }

/* ---------- Кнопка (расширение базы) ---------- */
.sp-btn--xl .sp-i { width: 24px; height: 24px; }
.sp-btn--danger-soft.is-loading::after { border-color: var(--danger-ink); border-right-color: transparent; }
.sp-btn--link.is-loading::after { border-color: var(--text-link); border-right-color: transparent; width: 16px; height: 16px; }
.sp-btn__label { overflow: hidden; text-overflow: ellipsis; }
.sp-btn--link.is-disabled, .sp-btn--link:disabled { color: var(--text-disabled); text-decoration: none; }
.sp-btn-group--spaced { gap: var(--space-2); flex-wrap: wrap; }
.sp-btn-group--spaced .sp-btn, .sp-btn-group--spaced .sp-btn:first-child, .sp-btn-group--spaced .sp-btn:last-child { border-radius: var(--radius-md); }
.sp-btn-group--spaced .sp-btn + .sp-btn { margin-left: 0; }
.sp-btn-group--spaced .sp-btn--s, .sp-btn-group--spaced .sp-btn--xs { border-radius: var(--radius-sm); }
.sp-btn-group .sp-btn:focus-visible, .sp-btn-group .sp-btn.is-focus { z-index: 1; }
.sp-btn-group--secondary .sp-btn + .sp-btn { margin-left: 1px; }
.sp-btn-group--block { display: flex; width: 100%; }
.sp-btn-group--block .sp-btn { flex: 1; }

/* ---------- Кнопка-иконка ---------- */
.sp-icon-btn { flex: none; }
.sp-icon-btn--round { border-radius: var(--radius-full) !important; }
.sp-icon-btn--muted { color: var(--text-secondary); }
.sp-icon-btn--muted:hover, .sp-icon-btn--muted.is-hover { color: var(--text-primary); }
.sp-icon-btn.is-selected { background: var(--primary-soft); color: var(--primary-ink); }
/* подпись-тултип из data-tip (дублирует aria-label) */
.sp-icon-btn[data-tip]::before {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  padding: 4px 8px; border-radius: var(--radius-sm); background: var(--bg-inverse); color: var(--text-inverse);
  font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden; z-index: var(--z-tooltip);
  transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.sp-icon-btn[data-tip]:hover::before, .sp-icon-btn[data-tip]:focus-visible::before, .sp-icon-btn[data-tip].is-tip::before { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 300ms; }
.sp-icon-btn[data-tip].is-tip::before { transition-delay: 0ms; }
.sp-icon-btn--tip-bottom[data-tip]::before { bottom: auto; top: calc(100% + 8px); }
.sp-icon-btn.is-loading .sp-i { visibility: hidden; }
/* плавающая кнопка */
.sp-fab {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  width: 56px; height: 56px; padding: 0; border: 0; border-radius: var(--radius-full);
  background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-md);
  font-size: 15px; line-height: 20px; font-weight: 500; cursor: pointer; flex: none;
  transition: background-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.sp-fab .sp-i { width: 24px; height: 24px; }
.sp-fab:hover, .sp-fab.is-hover { background: var(--primary-hover); box-shadow: var(--shadow-lg); }
.sp-fab:active, .sp-fab.is-active { background: var(--primary-active); transform: scale(.96); }
.sp-fab:focus-visible, .sp-fab.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.sp-fab--accent { background: var(--accent); color: var(--on-accent); }
.sp-fab--accent:hover, .sp-fab--accent.is-hover { background: var(--sun-300); }
.sp-fab--surface { background: var(--bg-surface); color: var(--text-primary); }
.sp-fab--surface:hover, .sp-fab--surface.is-hover { background: var(--bg-surface-2); }
.sp-fab--s { width: 48px; height: 48px; }
.sp-fab--extended { width: auto; padding: 0 var(--space-6) 0 var(--space-5); }
.sp-fab > .sp-counter { position: absolute; top: -2px; right: -2px; box-shadow: 0 0 0 2px var(--bg-surface); }
.sp-fab--extended > .sp-counter { position: static; box-shadow: none; }
.sp-fab:disabled, .sp-fab.is-disabled { background: var(--bg-surface-2); color: var(--text-disabled); box-shadow: none; cursor: not-allowed; transform: none; }
.sp-fab--fixed { position: fixed; right: var(--space-6); bottom: var(--space-6); z-index: var(--z-raised); }
@media (max-width: 767px) { .sp-fab--fixed { right: var(--space-4); bottom: var(--space-4); } }

/* ---------- Сегменты ---------- */
.sp-segmented {
  --seg-h: 32px;
  display: inline-flex; align-items: stretch; gap: 2px; padding: 4px; max-width: 100%;
  background: var(--bg-surface-2); border-radius: var(--radius-md); vertical-align: middle;
}
.sp-segmented__item {
  position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--seg-h); padding: 0 var(--space-4); border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-secondary);
  font-family: inherit; font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.sp-segmented__item .sp-i { width: 18px; height: 18px; }
.sp-segmented__item:hover, .sp-segmented__item.is-hover { color: var(--text-primary); background: color-mix(in srgb, var(--bg-surface) 50%, transparent); }
.sp-segmented__item.is-selected, .sp-segmented__item[aria-checked="true"] { background: var(--seg-thumb, var(--bg-surface)); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.sp-segmented__item:focus-visible, .sp-segmented__item.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 0; z-index: 1; }
.sp-segmented__item:disabled, .sp-segmented__item.is-disabled { color: var(--text-disabled); background: transparent; cursor: not-allowed; box-shadow: none; }
.sp-segmented__count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: var(--radius-full); font-size: 11px; line-height: 1; font-weight: 600; background: var(--bg-surface-3); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sp-segmented__item.is-selected .sp-segmented__count, .sp-segmented__item[aria-checked="true"] .sp-segmented__count { background: var(--accent); color: var(--on-accent); }
.sp-segmented__item.is-disabled .sp-segmented__count, .sp-segmented__item:disabled .sp-segmented__count { color: var(--text-disabled); }
.sp-segmented--s { --seg-h: 24px; padding: 4px; border-radius: min(var(--radius-md), 10px); }
.sp-segmented--s .sp-segmented__item { padding: 0 var(--space-3); font-size: 13px; line-height: 18px; border-radius: min(var(--radius-sm), 6px); }
.sp-segmented--s .sp-segmented__item .sp-i { width: 16px; height: 16px; }
.sp-segmented--l { --seg-h: 40px; }
.sp-segmented--block { display: flex; width: 100%; }
.sp-segmented--block .sp-segmented__item { flex: 1 1 0; min-width: 0; }
.sp-segmented--icons .sp-segmented__item { padding: 0; width: calc(var(--seg-h) + 8px); }
.sp-segmented.is-disabled { pointer-events: none; }
.sp-segmented.is-disabled .sp-segmented__item.is-selected { box-shadow: none; color: var(--text-disabled); }
[data-theme="dark"] .sp-segmented { --seg-thumb: var(--bg-surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sp-segmented { --seg-thumb: var(--bg-surface-3); } }
@media (max-width: 767px) {
  .sp-segmented, .sp-segmented--s { --seg-h: 40px; overflow-x: auto; scrollbar-width: none; }
  .sp-segmented--s .sp-segmented__item { font-size: 15px; }
}

/* ---------- Чипы-фильтры ---------- */
.sp-chip {
  --chip-h: 36px;
  position: relative; display: inline-flex; align-items: center; gap: 6px; height: var(--chip-h); padding: 0 var(--space-4); max-width: 100%;
  border: 0; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary);
  font-family: inherit; font-size: 15px; line-height: 20px; font-weight: 400; white-space: nowrap; cursor: pointer; vertical-align: middle; text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.sp-chip__label { overflow: hidden; text-overflow: ellipsis; }
.sp-chip .sp-i { width: 18px; height: 18px; }
.sp-chip:hover, .sp-chip.is-hover { background: var(--bg-surface-3); }
.sp-chip:active, .sp-chip.is-active { background: var(--border-strong); }
.sp-chip.is-selected, .sp-chip[aria-pressed="true"], .sp-chip[aria-checked="true"] { background: var(--primary); color: var(--on-primary); }
.sp-chip.is-selected:hover, .sp-chip[aria-pressed="true"]:hover, .sp-chip[aria-checked="true"]:hover, .sp-chip.is-selected.is-hover { background: var(--primary-hover); }
.sp-chip__count { font-size: 13px; line-height: 18px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sp-chip.is-selected .sp-chip__count, .sp-chip[aria-pressed="true"] .sp-chip__count, .sp-chip[aria-checked="true"] .sp-chip__count { color: var(--on-primary); opacity: .75; }
.sp-chip__remove {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-right: -6px; padding: 0;
  border: 0; border-radius: var(--radius-full); background: none; color: inherit; cursor: pointer; flex: none;
}
.sp-chip__remove:hover, .sp-chip__remove.is-hover { background: color-mix(in srgb, currentColor 16%, transparent); }
.sp-chip__remove .sp-i { width: 14px; height: 14px; }
.sp-chip--removable { padding-right: var(--space-3); }
.sp-chip--outline { background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-chip--outline:hover, .sp-chip--outline.is-hover { background: var(--bg-sunken); box-shadow: inset 0 0 0 1px var(--border-control); }
.sp-chip--outline.is-selected, .sp-chip--outline[aria-pressed="true"], .sp-chip--outline[aria-checked="true"] { box-shadow: none; }
.sp-chip--s { --chip-h: 28px; padding: 0 var(--space-3); gap: 4px; font-size: 13px; line-height: 18px; }
.sp-chip--s .sp-i { width: 16px; height: 16px; }
.sp-chip--s .sp-chip__count { font-size: 12px; }
.sp-chip:disabled, .sp-chip.is-disabled { background: var(--bg-surface-2); color: var(--text-disabled); box-shadow: none; cursor: not-allowed; }
.sp-chip:disabled .sp-chip__count, .sp-chip.is-disabled .sp-chip__count { color: var(--text-disabled); opacity: 1; }
.sp-chip.is-disabled.is-selected, .sp-chip:disabled[aria-pressed="true"] { background: var(--bg-surface-3); }
.sp-chip-group { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sp-chip-group--nowrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
@media (max-width: 767px) { .sp-chip, .sp-chip--s { --chip-h: 40px; } .sp-chip__remove::after { content: ""; position: absolute; inset: -10px; } }

/* ---------- Аватар (расширение базы) ---------- */
.sp-avatar--tone-1 { background: var(--primary-soft); color: var(--primary-ink); }
.sp-avatar--tone-2 { background: var(--info-soft); color: var(--info-ink); }
.sp-avatar--tone-3 { background: var(--success-soft); color: var(--success-ink); }
.sp-avatar--tone-4 { background: var(--warning-soft); color: var(--warning-ink); }
.sp-avatar--tone-5 { background: var(--accent-soft); color: var(--accent-ink); }
.sp-avatar--tone-6 { background: var(--danger-soft); color: var(--danger-ink); }
.sp-avatar--square.sp-avatar--xs { border-radius: min(var(--radius-sm), 6px); }
.sp-avatar--square.sp-avatar--s { border-radius: var(--radius-sm); }
.sp-avatar--square { border-radius: var(--radius-md); }
.sp-avatar--square.sp-avatar--l { border-radius: var(--radius-lg); }
.sp-avatar--square.sp-avatar--xl { border-radius: var(--radius-xl); }
.sp-avatar--logo { background: var(--bg-surface); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border); }
.sp-avatar__img { width: 100%; height: 100%; border-radius: inherit; background-size: cover; background-position: center; }
.sp-avatar .sp-i { width: 55%; height: 55%; }
.sp-avatar__status--online { background: var(--success); }
.sp-avatar__status--away { background: var(--warning); }
.sp-avatar__status--busy { background: var(--danger); }
.sp-avatar__status--offline { background: var(--bg-surface); box-shadow: 0 0 0 2px var(--bg-surface), inset 0 0 0 2px var(--border-control); }
.sp-avatar--square .sp-avatar__status { right: -2px; bottom: -2px; }
.sp-avatar--more { background: var(--bg-surface-2); color: var(--text-secondary); font-weight: 600; }
button.sp-avatar { border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.sp-avatar-group--xs .sp-avatar + .sp-avatar, .sp-avatar-group--s .sp-avatar + .sp-avatar { margin-left: -6px; }
.sp-avatar-group--l .sp-avatar + .sp-avatar { margin-left: -12px; }
.sp-avatar-group--xl .sp-avatar + .sp-avatar { margin-left: -16px; }

/* ==========================================================================
   20-forms — Формы: Input, Textarea, Select/Listbox, Combobox, MultiSelect,
   Checkbox, Radio, RadioCard, Switch, Slider, SearchField, CodeInput,
   DatePicker/TimePicker, ColorPicker, FileUpload, FormLayout.
   Расширяет .sp-field / .sp-control из 00-base.css.
   ========================================================================== */

/* ---------- Поле: подвал (подсказка + счётчик) ---------- */
.sp-field__foot { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.sp-field__foot > :first-child { flex: 1 1 auto; min-width: 0; }
.sp-field__count { font-size: 12px; line-height: 16px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; margin-left: auto; }
.sp-field__count.is-over { color: var(--danger-ink); }
.sp-field__success { display: flex; gap: 4px; align-items: flex-start; }
.sp-field__success .sp-i { width: 14px; height: 14px; margin-top: 1px; }
.sp-field.is-disabled .sp-field__label { color: var(--text-disabled); }

/* ---------- Input: расширения контрола ---------- */
.sp-control > .sp-i.sp-control__status--success { color: var(--success-ink); }
.sp-control > .sp-i.sp-control__status--error { color: var(--danger-ink); }
.sp-control--s > .sp-i { width: 16px; height: 16px; }
.sp-control--l { font-size: 16px; padding: 0 var(--space-4); border-radius: var(--radius-md); }
.sp-control.is-disabled input, .sp-control.is-disabled .sp-control__affix { color: var(--text-disabled); cursor: not-allowed; }
.sp-control.is-readonly input { color: var(--text-secondary); }
.sp-control .sp-spinner { --s: 16px; }
.sp-control__btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 0; }
/* Аддон — серый блок, приклеенный к краю (https://, ₽/мес) */
.sp-control__addon {
  align-self: stretch; display: inline-flex; align-items: center; padding: 0 var(--space-3);
  background: var(--bg-surface-2); color: var(--text-secondary); font-size: 13px; white-space: nowrap;
}
.sp-control__addon:first-child { margin-left: calc(var(--space-3) * -1); border-radius: max(0px, calc(var(--radius-sm) - 1px)) 0 0 max(0px, calc(var(--radius-sm) - 1px)); }
.sp-control__addon:last-child { margin-right: calc(var(--space-3) * -1); border-radius: 0 max(0px, calc(var(--radius-sm) - 1px)) max(0px, calc(var(--radius-sm) - 1px)) 0; }
.sp-control input.sp-num, .sp-control input[type="tel"] { font-variant-numeric: tabular-nums; }

/* Плавающий лейбл: пусто → лейбл как плейсхолдер; фокус/заполнено → лейбл сверху */
.sp-control--float .sp-control__stack { position: relative; padding: 24px 0 8px; }
.sp-control--float .sp-control__flabel {
  position: absolute; left: 0; right: 0; top: 8px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: top var(--duration-fast) var(--ease-standard), font-size var(--duration-fast) var(--ease-standard);
}
.sp-control--float.is-empty:not(:focus-within):not(.is-focus) .sp-control__flabel { top: 16px; font-size: 15px; line-height: 22px; }
.sp-control--float.is-empty:not(:focus-within):not(.is-focus) input::placeholder { color: transparent; }
.sp-control--float:hover, .sp-control--float.is-hover { border-color: var(--border-control); }
.sp-control--float:focus-within, .sp-control--float.is-focus { border-color: var(--focus-ring); }
.sp-control--float.is-error { border-color: var(--danger); }
.sp-control--float.is-error .sp-control__flabel { color: var(--danger-ink); }
.sp-control--float.is-disabled .sp-control__flabel { color: var(--text-disabled); }
.sp-control--float.is-disabled { border-color: transparent; }

/* ---------- Textarea ---------- */
.sp-textarea { flex-direction: column; align-items: stretch; gap: 0; padding: 0; border-radius: var(--radius-md); }
.sp-textarea textarea {
  display: block; width: 100%; height: auto; min-height: 96px; padding: 10px var(--space-3);
  line-height: 22px; resize: vertical; font-family: inherit;
}
.sp-textarea--noresize textarea, .sp-textarea--autosize textarea { resize: none; }
.sp-textarea--autosize textarea { overflow: hidden; }
.sp-textarea.is-disabled textarea { color: var(--text-disabled); cursor: not-allowed; }
.sp-textarea__toolbar {
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3); border-top: 1px solid var(--border);
}
.sp-textarea__toolbar .sp-field__count { margin-left: auto; padding-right: var(--space-1); }
.sp-textarea__tool {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-s); padding: 0 var(--space-3);
  border: 0; border-radius: var(--radius-sm); background: var(--bg-surface-2); color: var(--text-primary);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.sp-textarea__tool:hover, .sp-textarea__tool.is-hover { background: var(--bg-surface-3); }
.sp-textarea__tool .sp-i { width: 16px; height: 16px; }
.sp-textarea__tool .sp-num { color: var(--text-secondary); font-weight: 400; }
.sp-textarea__tool:disabled { color: var(--text-disabled); cursor: not-allowed; }
.sp-textarea__tool:disabled .sp-num { color: var(--text-disabled); }

/* ---------- Select (кнопка) ---------- */
.sp-dropdown { position: relative; display: flex; flex-direction: column; min-width: 0; }
.sp-select { width: 100%; text-align: left; cursor: pointer; font-size: 15px; line-height: 20px; }
.sp-select.sp-control--s { font-size: 13px; }
.sp-select__value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-select__placeholder { color: var(--text-tertiary); }
.sp-select__chev { color: var(--text-secondary); transition: transform var(--duration-fast) var(--ease-standard); }
.sp-control > .sp-i.sp-select__chev { color: var(--text-secondary); }
.sp-select.is-open .sp-select__chev, .sp-select[aria-expanded="true"] .sp-select__chev { transform: rotate(180deg); }
.sp-select.is-open { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); }
.sp-select:disabled, .sp-select.is-disabled { background: var(--bg-surface-2); border-color: transparent; color: var(--text-disabled); cursor: not-allowed; }
.sp-select:disabled .sp-select__chev, .sp-select.is-disabled .sp-select__chev, .sp-select:disabled .sp-select__placeholder { color: var(--text-disabled); }
.sp-select.sp-control--float .sp-select__value { font-size: 15px; line-height: 22px; }
.sp-select.sp-control--float .sp-control__flabel { position: static; }
.sp-select.sp-control--float .sp-control__stack { padding: 8px 0; }

/* ---------- Listbox (общий для Select/Combobox/MultiSelect/Search/Time) ---------- */
.sp-listbox {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: var(--z-dropdown);
  max-height: 296px; overflow: auto; padding: var(--space-1); margin: 0; list-style: none;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
.sp-listbox--up { top: auto; bottom: calc(100% + 4px); }
.sp-listbox--static { position: static; box-shadow: none; }
.sp-listbox__group { padding: var(--space-2) var(--space-3) var(--space-1); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.sp-listbox__sep { height: 1px; background: var(--border); margin: var(--space-1) calc(var(--space-1) * -1); }
.sp-listbox__empty, .sp-listbox__loading {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center;
  padding: var(--space-5) var(--space-4); color: var(--text-secondary); font-size: 13px; line-height: 18px;
}
.sp-listbox__loading { flex-direction: row; justify-content: center; }
.sp-listbox__empty .sp-i { color: var(--text-tertiary); width: 24px; height: 24px; }
.sp-listbox__empty strong { color: var(--text-primary); font-weight: 500; font-size: 15px; }
.sp-listbox__search { position: sticky; top: calc(var(--space-1) * -1); margin: calc(var(--space-1) * -1) calc(var(--space-1) * -1) var(--space-1); padding: var(--space-2); background: var(--bg-surface); border-bottom: 1px solid var(--border); z-index: 1; }
.sp-listbox__search .sp-control { --h: var(--control-s); font-size: 13px; }
.sp-listbox__footer { position: sticky; bottom: calc(var(--space-1) * -1); display: flex; gap: var(--space-2); justify-content: flex-end; margin: var(--space-1) calc(var(--space-1) * -1) calc(var(--space-1) * -1); padding: var(--space-2); background: var(--bg-surface); border-top: 1px solid var(--border); }

.sp-option {
  display: flex; align-items: center; gap: var(--space-3); min-height: 36px; padding: 6px var(--space-3);
  border-radius: var(--radius-sm); color: var(--text-primary); font-size: 15px; line-height: 20px; cursor: pointer; user-select: none;
}
.sp-option:hover, .sp-option.is-hover, .sp-option.is-active { background: var(--bg-surface-2); }
.sp-option.is-selected { font-weight: 500; }
.sp-option__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sp-option__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-option__desc { font-size: 12px; line-height: 16px; color: var(--text-secondary); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-option__meta { font-size: 12px; color: var(--text-secondary); font-weight: 400; white-space: nowrap; }
.sp-option > .sp-kbd, .sp-option > .sp-kbd-group, .sp-option > .sp-option__meta { margin-left: auto; }
.sp-option > .sp-option__meta + .sp-option__check, .sp-option > .sp-kbd + .sp-option__check { margin-left: 0; }
.sp-option > .sp-i { width: 18px; height: 18px; color: var(--text-secondary); }
.sp-option > .sp-option__check { color: var(--primary-ink); margin-left: auto; visibility: hidden; }
.sp-option.is-selected > .sp-option__check, .sp-option[aria-selected="true"] > .sp-option__check { visibility: visible; }
.sp-option.is-disabled, .sp-option[aria-disabled="true"] { color: var(--text-disabled); cursor: not-allowed; background: none; }
.sp-option.is-disabled .sp-option__desc, .sp-option[aria-disabled="true"] .sp-option__desc, .sp-option.is-disabled > .sp-i { color: var(--text-disabled); }
.sp-option mark { background: var(--accent-soft); color: var(--text-primary); font-weight: 600; border-radius: min(var(--radius-xs), 2px); padding: 0 1px; }
.sp-option.is-disabled mark, .sp-option[aria-disabled="true"] mark { background: none; color: inherit; }
.sp-option--all { font-weight: 500; }
.sp-option .sp-avatar { --s: 28px; }
.sp-control--s ~ .sp-listbox .sp-option { min-height: 32px; font-size: 13px; }
@media (max-width: 767px) { .sp-option { min-height: 44px; } }

/* ---------- Combobox ---------- */
.sp-combobox .sp-control { cursor: text; }
.sp-combobox .sp-control.is-open { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); }

/* ---------- MultiSelect ---------- */
.sp-multiselect { flex-wrap: nowrap; gap: 6px; padding: 4px var(--space-2) 4px 6px; cursor: pointer; text-align: left; width: 100%; }
.sp-multiselect__chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; min-width: 0; align-items: center; }
.sp-multiselect__chip {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; max-width: 200px; padding: 0 4px 0 10px;
  border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); font-size: 13px; font-weight: 500; white-space: nowrap;
}
.sp-multiselect__chip > span { overflow: hidden; text-overflow: ellipsis; }
.sp-multiselect__chip-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 0; padding: 0; border-radius: var(--radius-full); background: none; color: var(--text-secondary); cursor: pointer; }
.sp-multiselect__chip-x:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.sp-multiselect__chip-x .sp-i { width: 14px; height: 14px; }
.sp-multiselect__more { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; }
.sp-multiselect__placeholder { color: var(--text-tertiary); padding-left: 6px; }
.sp-multiselect__input { flex: 1 0 80px; min-width: 80px; border: 0; outline: none; background: transparent; height: 28px; padding: 0 4px; }
.sp-multiselect.sp-control--s { padding: 2px var(--space-2) 2px 4px; }
.sp-control--s .sp-multiselect__chip, .sp-control--s .sp-multiselect__more { height: 24px; font-size: 12px; }
.sp-control--l .sp-multiselect__chip, .sp-control--l .sp-multiselect__more { height: 32px; }
.sp-multiselect.is-open { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); }
.sp-multiselect.is-open .sp-select__chev { transform: rotate(180deg); }
.sp-multiselect.is-disabled { background: var(--bg-surface-2); border-color: transparent; cursor: not-allowed; }
.sp-multiselect.is-disabled .sp-multiselect__chip { color: var(--text-disabled); background: var(--bg-surface-3); }
.sp-option .sp-checkbox__box { margin: 0; }

/* ---------- Checkbox / Radio ---------- */
.sp-checkbox, .sp-radio {
  --s: 20px; position: relative; display: inline-flex; align-items: flex-start; gap: var(--space-3);
  font-size: 15px; line-height: 22px; color: var(--text-primary); cursor: pointer; user-select: none;
}
.sp-checkbox--s, .sp-radio--s { --s: 16px; font-size: 13px; line-height: 18px; gap: var(--space-2); }
.sp-checkbox.is-focus, .sp-radio.is-focus { outline: none; }
.sp-checkbox__input, .sp-radio__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sp-checkbox__box, .sp-radio__dot {
  position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: var(--s); height: var(--s); margin-top: calc((22px - var(--s)) / 2);
  background: var(--bg-surface); border: 1.5px solid var(--border-control); color: var(--on-primary);
  transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
.sp-checkbox--s .sp-checkbox__box, .sp-radio--s .sp-radio__dot { margin-top: calc((18px - var(--s)) / 2); }
.sp-checkbox__box { border-radius: var(--radius-xs); }
.sp-checkbox--s .sp-checkbox__box { border-radius: min(var(--radius-xs), 3px); }
.sp-radio__dot { border-radius: var(--radius-full); }
.sp-checkbox__box .sp-i { width: calc(var(--s) - 4px); height: calc(var(--s) - 4px); display: none; }
.sp-checkbox__box .sp-i svg { stroke-width: 3; }
.sp-radio__dot::after { content: ""; width: calc(var(--s) * .4); height: calc(var(--s) * .4); border-radius: var(--radius-full); background: var(--on-primary); transform: scale(0); transition: transform var(--duration-fast) var(--ease-standard); }
/* hover */
.sp-checkbox:hover .sp-checkbox__box, .sp-checkbox.is-hover .sp-checkbox__box,
.sp-radio:hover .sp-radio__dot, .sp-radio.is-hover .sp-radio__dot { border-color: var(--text-primary); background: var(--bg-sunken); }
/* checked */
.sp-checkbox__input:checked + .sp-checkbox__box, .sp-checkbox.is-checked .sp-checkbox__box, .sp-checkbox.is-indeterminate .sp-checkbox__box,
.sp-radio__input:checked + .sp-radio__dot, .sp-radio.is-checked .sp-radio__dot { background: var(--primary); border-color: var(--primary); }
.sp-checkbox:hover .sp-checkbox__input:checked + .sp-checkbox__box, .sp-checkbox.is-checked.is-hover .sp-checkbox__box, .sp-checkbox.is-indeterminate.is-hover .sp-checkbox__box,
.sp-radio:hover .sp-radio__input:checked + .sp-radio__dot, .sp-radio.is-checked.is-hover .sp-radio__dot { background: var(--primary-hover); border-color: var(--primary-hover); }
.sp-checkbox__input:checked + .sp-checkbox__box .sp-checkbox__on, .sp-checkbox.is-checked .sp-checkbox__on { display: inline-flex; }
.sp-checkbox.is-indeterminate .sp-checkbox__on { display: none; }
.sp-checkbox.is-indeterminate .sp-checkbox__mixed { display: inline-flex; }
.sp-radio__input:checked + .sp-radio__dot::after, .sp-radio.is-checked .sp-radio__dot::after { transform: scale(1); }
/* focus */
.sp-checkbox__input:focus-visible + .sp-checkbox__box, .sp-checkbox.is-focus .sp-checkbox__box,
.sp-radio__input:focus-visible + .sp-radio__dot, .sp-radio.is-focus .sp-radio__dot { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* error */
.sp-checkbox.is-error .sp-checkbox__box, .sp-radio.is-error .sp-radio__dot { border-color: var(--danger); }
.sp-checkbox.is-error.is-checked .sp-checkbox__box, .sp-checkbox.is-error.is-indeterminate .sp-checkbox__box, .sp-checkbox.is-error .sp-checkbox__input:checked + .sp-checkbox__box { background: var(--danger); border-color: var(--danger); }
/* disabled */
.sp-checkbox.is-disabled, .sp-checkbox:has(.sp-checkbox__input:disabled), .sp-radio.is-disabled, .sp-radio:has(.sp-radio__input:disabled) { color: var(--text-disabled); cursor: not-allowed; }
.sp-checkbox.is-disabled .sp-checkbox__box, .sp-checkbox:has(:disabled) .sp-checkbox__box,
.sp-radio.is-disabled .sp-radio__dot, .sp-radio:has(:disabled) .sp-radio__dot { background: var(--bg-surface-2); border-color: var(--border-strong); color: var(--text-disabled); }
.sp-radio.is-disabled .sp-radio__dot::after, .sp-radio:has(:disabled) .sp-radio__dot::after { background: var(--text-disabled); }
.sp-checkbox.is-disabled .sp-checkbox__desc, .sp-radio.is-disabled .sp-radio__desc { color: var(--text-disabled); }
.sp-checkbox__body, .sp-radio__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-checkbox__desc, .sp-radio__desc { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-checkbox--s .sp-checkbox__desc, .sp-radio--s .sp-radio__desc { font-size: 12px; line-height: 16px; }
@media (max-width: 767px) {
  .sp-checkbox, .sp-radio { min-height: 40px; padding: 9px 0; }
}

/* Группа (fieldset) */
.sp-choice-group { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.sp-choice-group > legend { padding: 0; margin-bottom: var(--space-2); }
.sp-choice-group__items { display: flex; flex-direction: column; gap: var(--space-3); }
.sp-choice-group--row .sp-choice-group__items { flex-direction: row; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
@media (max-width: 767px) { .sp-choice-group__items, .sp-choice-group--row .sp-choice-group__items { gap: 0 var(--space-6); } }

/* Radio-карточки: выбор тарифа / формата */
.sp-radio-cards { display: grid; gap: var(--space-3); grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
@media (max-width: 767px) { .sp-radio-cards { grid-template-columns: 1fr; } }
.sp-radio-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0;
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--bg-surface);
  box-shadow: inset 0 0 0 1px var(--border-strong); cursor: pointer; color: var(--text-primary);
  transition: box-shadow var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.sp-radio-card:hover, .sp-radio-card.is-hover { box-shadow: inset 0 0 0 1px var(--border-control); background: var(--bg-sunken); }
.sp-radio-card:has(.sp-radio__input:checked), .sp-radio-card.is-selected { box-shadow: inset 0 0 0 2px var(--primary); background: var(--bg-surface); }
.sp-radio-card:has(.sp-radio__input:focus-visible), .sp-radio-card.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-radio-card.is-disabled, .sp-radio-card:has(:disabled) { background: var(--bg-surface-2); box-shadow: none; color: var(--text-disabled); cursor: not-allowed; }
.sp-radio-card.is-disabled .sp-radio-card__desc, .sp-radio-card.is-disabled .sp-radio-card__price { color: var(--text-disabled); }
.sp-radio-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.sp-radio-card__top .sp-radio__dot { margin-top: 2px; }
.sp-radio-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-primary); }
.sp-radio-card.is-selected .sp-radio-card__icon, .sp-radio-card:has(:checked) .sp-radio-card__icon { background: var(--accent); color: var(--on-accent); }
.sp-radio-card__title { font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-radio-card__desc { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-radio-card__price { font-size: 20px; line-height: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-radio-card__price small { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.sp-radio-card__badge { align-self: flex-start; }
.sp-radio-card__media { height: 88px; border-radius: var(--radius-md); overflow: hidden; }

/* ---------- Switch ---------- */
.sp-switch {
  --w: 40px; --hh: 24px; --t: 18px;
  position: relative; display: inline-flex; align-items: flex-start; gap: var(--space-3);
  font-size: 15px; line-height: 22px; color: var(--text-primary); cursor: pointer; user-select: none;
}
.sp-switch--s { --w: 32px; --hh: 18px; --t: 14px; font-size: 13px; line-height: 18px; gap: var(--space-2); }
.sp-switch--between { display: flex; justify-content: space-between; width: 100%; }
.sp-switch--between .sp-switch__track { order: 2; }
.sp-switch.is-focus { outline: none; }
.sp-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sp-switch__track {
  position: relative; flex: none; width: var(--w); height: var(--hh); border-radius: var(--radius-full);
  background: var(--border-control); margin-top: calc((22px - var(--hh)) / 2);
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.sp-switch--s .sp-switch__track { margin-top: 0; }
.sp-switch__thumb {
  position: absolute; top: calc((var(--hh) - var(--t)) / 2); left: calc((var(--hh) - var(--t)) / 2);
  display: flex; align-items: center; justify-content: center;
  width: var(--t); height: var(--t); border-radius: var(--radius-full); background: var(--gray-0); box-shadow: var(--shadow-xs);
  transition: transform var(--duration-base) var(--ease-spring);
}
.sp-switch:hover .sp-switch__track, .sp-switch.is-hover .sp-switch__track { background: var(--text-secondary); }
.sp-switch__input:checked + .sp-switch__track, .sp-switch.is-on .sp-switch__track { background: var(--primary); }
.sp-switch:hover .sp-switch__input:checked + .sp-switch__track, .sp-switch.is-on.is-hover .sp-switch__track { background: var(--primary-hover); }
.sp-switch__input:checked + .sp-switch__track .sp-switch__thumb, .sp-switch.is-on .sp-switch__thumb { transform: translateX(calc(var(--w) - var(--hh))); background: var(--on-primary); }
.sp-switch__input:focus-visible + .sp-switch__track, .sp-switch.is-focus .sp-switch__track { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-switch.is-disabled, .sp-switch:has(.sp-switch__input:disabled) { color: var(--text-disabled); cursor: not-allowed; }
.sp-switch.is-disabled .sp-switch__track, .sp-switch:has(:disabled) .sp-switch__track { background: var(--bg-surface-3); }
.sp-switch.is-disabled .sp-switch__thumb, .sp-switch:has(:disabled) .sp-switch__thumb { background: var(--bg-surface); box-shadow: none; }
.sp-switch.is-disabled.is-on .sp-switch__track, .sp-switch .sp-switch__input:disabled:checked + .sp-switch__track { background: var(--border-strong); }
.sp-switch.is-disabled .sp-switch__desc { color: var(--text-disabled); }
.sp-switch.is-loading { cursor: progress; }
.sp-switch.is-loading .sp-switch__thumb::after { content: ""; width: calc(var(--t) - 6px); height: calc(var(--t) - 6px); border-radius: var(--radius-full); border: 2px solid var(--border-control); border-right-color: transparent; animation: sp-spin .7s linear infinite; }
.sp-switch.is-loading.is-on .sp-switch__thumb::after, .sp-switch.is-loading .sp-switch__input:checked + .sp-switch__track .sp-switch__thumb::after { border-color: var(--primary); border-right-color: transparent; }
.sp-switch__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-switch__label { font-weight: 500; }
.sp-switch__desc { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
@media (max-width: 767px) { .sp-switch { min-height: 40px; padding: 9px 0; } }

/* ---------- Slider ---------- */
.sp-slider { --v: 50%; --v2: 100%; display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; width: 100%; }
.sp-slider__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }
.sp-slider__value { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-slider__rail { position: relative; height: 24px; margin: 0 10px; cursor: pointer; touch-action: none; }
.sp-slider__track { position: absolute; left: -10px; right: -10px; top: 10px; height: 4px; border-radius: var(--radius-full); background: var(--bg-surface-3); }
.sp-slider__fill { position: absolute; top: 10px; height: 4px; border-radius: var(--radius-full); background: var(--primary); left: -10px; width: calc(var(--v) + 10px); }
.sp-slider--range .sp-slider__fill { left: var(--v); width: calc(var(--v2) - var(--v)); }
.sp-slider__thumb {
  position: absolute; top: 2px; left: var(--v); width: 20px; height: 20px; margin-left: -10px; border-radius: var(--radius-full);
  background: var(--bg-surface); border: 2px solid var(--primary); box-shadow: var(--shadow-xs); cursor: grab; outline: none;
  transition: box-shadow var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.sp-slider__thumb + .sp-slider__thumb, .sp-slider__thumb--end { left: var(--v2); }
.sp-slider__thumb:hover, .sp-slider__thumb.is-hover { box-shadow: 0 0 0 6px var(--primary-soft); }
.sp-slider__thumb:focus-visible, .sp-slider__thumb.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-slider__thumb:active, .sp-slider__thumb.is-active { cursor: grabbing; transform: scale(1.1); box-shadow: 0 0 0 8px var(--primary-soft); }
.sp-slider__tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 2px 8px; border-radius: var(--radius-sm); background: var(--bg-inverse); color: var(--text-inverse);
  font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; pointer-events: none;
  opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard);
}
.sp-slider__tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -4px; border: 4px solid transparent; border-top-color: var(--bg-inverse); }
.sp-slider__thumb:hover .sp-slider__tip, .sp-slider__thumb:focus-visible .sp-slider__tip, .sp-slider__thumb:active .sp-slider__tip, .sp-slider__thumb.is-hover .sp-slider__tip, .sp-slider__thumb.is-focus .sp-slider__tip, .sp-slider__thumb.is-active .sp-slider__tip, .sp-slider--tips .sp-slider__tip { opacity: 1; }
.sp-slider__ticks { position: relative; height: 22px; margin: 0 10px; }
.sp-slider__tick { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; line-height: 16px; color: var(--text-secondary); white-space: nowrap; }
.sp-slider__tick::before { content: ""; width: 1px; height: 4px; background: var(--border-control); }
.sp-slider.is-disabled { color: var(--text-disabled); }
.sp-slider.is-disabled .sp-slider__rail { cursor: not-allowed; }
.sp-slider.is-disabled .sp-slider__fill { background: var(--border-strong); }
.sp-slider.is-disabled .sp-slider__thumb { border-color: var(--border-strong); box-shadow: none; cursor: not-allowed; transform: none; }
.sp-slider.is-disabled .sp-slider__value, .sp-slider.is-disabled .sp-field__label, .sp-slider.is-disabled .sp-slider__tick { color: var(--text-disabled); }
@media (max-width: 767px) { .sp-slider__rail { height: 40px; } .sp-slider__track, .sp-slider__fill { top: 18px; } .sp-slider__thumb { top: 8px; width: 24px; height: 24px; margin-left: -12px; } }

/* ---------- SearchField ---------- */
.sp-search { background: var(--bg-surface-2); border-color: transparent; border-radius: var(--radius-md); }
.sp-search:hover, .sp-search.is-hover { background: var(--bg-surface-3); border-color: transparent; }
.sp-search:focus-within, .sp-search.is-focus { background: var(--bg-surface); border-color: var(--focus-ring); }
.sp-search > .sp-i { color: var(--text-secondary); }
.sp-search--outline { background: var(--bg-surface); border-color: var(--border-control); }
.sp-search--outline:hover, .sp-search--outline.is-hover { background: var(--bg-surface); border-color: var(--text-secondary); }
.sp-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.sp-search.is-disabled { background: var(--bg-surface-2); }
.sp-kbd-group { display: inline-flex; gap: 3px; flex: none; }
.sp-search:focus-within .sp-kbd-group, .sp-search.is-focus .sp-kbd-group, .sp-search.is-filled .sp-kbd-group { display: none; }
.sp-search--l { --h: var(--control-l); }
@media (max-width: 767px) { .sp-kbd-group { display: none; } }

/* ---------- CodeInput (sp-otp) ---------- */
.sp-otp { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.sp-otp__cells { display: flex; align-items: center; gap: var(--space-2); max-width: 100%; }
.sp-otp__sep { flex: none; width: 10px; height: 2px; border-radius: min(var(--radius-xs), 1px); background: var(--border-strong); margin: 0 2px; }
.sp-otp__cell {
  position: relative; flex: 1 1 48px; width: 48px; min-width: 0; max-width: 48px; height: 56px; padding: 0; text-align: center;
  font-family: var(--font-mono); font-size: 24px; font-weight: 500; color: var(--text-primary); caret-color: var(--focus-ring);
  background: var(--bg-surface); border: 1px solid var(--border-control); border-radius: var(--radius-md); outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}
.sp-otp__cell:hover, .sp-otp__cell.is-hover { border-color: var(--text-secondary); }
.sp-otp__cell:focus, .sp-otp__cell.is-focus { border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); outline: none; }
.sp-otp.is-error .sp-otp__cell { border-color: var(--danger); }
.sp-otp.is-error .sp-otp__cell:focus { box-shadow: 0 0 0 1px var(--danger); }
.sp-otp.is-success .sp-otp__cell { border-color: var(--success); background: var(--success-soft); color: var(--success-ink); }
.sp-otp.is-disabled .sp-otp__cell, .sp-otp__cell:disabled { background: var(--bg-surface-2); border-color: transparent; color: var(--text-disabled); cursor: not-allowed; }
.sp-otp.is-error .sp-otp__cells { animation: sp-otp-shake .32s var(--ease-standard) 1; }
@keyframes sp-otp-shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.sp-otp__meta { font-size: 13px; line-height: 18px; color: var(--text-secondary); display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.sp-otp__meta .sp-num { color: var(--text-primary); font-weight: 500; }
.sp-otp__status { display: flex; gap: 6px; align-items: center; font-size: 13px; line-height: 18px; }
.sp-otp__status .sp-i { width: 16px; height: 16px; }
.sp-otp__status--error { color: var(--danger-ink); }
.sp-otp__status--success { color: var(--success-ink); }
@media (max-width: 420px) { .sp-otp__cell { max-width: 44px; height: 52px; font-size: 22px; } .sp-otp__cells { gap: 6px; } }

/* ---------- Calendar / DatePicker / TimePicker ---------- */
.sp-popover-panel {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: var(--z-dropdown);
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.sp-popover-panel--static { position: static; box-shadow: none; }
.sp-popover-panel { max-width: calc(100vw - 32px); }
.sp-datepicker__panel { display: flex; }
.sp-datecal { padding: var(--space-4); width: 296px; display: flex; flex-direction: column; gap: var(--space-2); }
.sp-datecal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-1); }
.sp-datecal__title { font-size: 15px; line-height: 20px; font-weight: 600; text-transform: capitalize; }
.sp-datecal__nav { display: inline-flex; gap: 2px; }
.sp-datecal__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.sp-datecal__wd { height: 28px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.sp-datecal__wd.is-weekend { color: var(--danger-ink); }
.sp-datecal__day {
  position: relative; height: 36px; border: 0; padding: 0; background: none; border-radius: var(--radius-sm);
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-primary); cursor: pointer;
}
.sp-datecal__day:hover, .sp-datecal__day.is-hover { background: var(--bg-surface-2); }
.sp-datecal__day.is-weekend { color: var(--danger-ink); }
.sp-datecal__day.is-outside { color: var(--text-tertiary); }
.sp-datecal__day.is-today { font-weight: 700; }
.sp-datecal__day.is-today::after { content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px; margin-left: -2px; border-radius: var(--radius-full); background: var(--accent); }
.sp-datecal__day.is-in-range { background: var(--primary-soft); color: var(--primary-ink); border-radius: 0; }
.sp-datecal__day.is-range-start { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.sp-datecal__day.is-range-end { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.sp-datecal__day.is-selected, .sp-datecal__day[aria-selected="true"] { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.sp-datecal__day.is-disabled, .sp-datecal__day:disabled { color: var(--text-disabled); text-decoration: line-through; cursor: not-allowed; background: none; }
.sp-datecal__day:focus-visible, .sp-datecal__day.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 0; z-index: 1; }
.sp-datecal__foot { display: flex; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); margin-top: var(--space-1); border-top: 1px solid var(--border); }
.sp-datecal__presets { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); border-right: 1px solid var(--border); min-width: 148px; }
.sp-datecal__preset { display: flex; align-items: center; height: 36px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; font-size: 13px; color: var(--text-primary); text-align: left; cursor: pointer; white-space: nowrap; }
.sp-datecal__preset:hover, .sp-datecal__preset.is-hover { background: var(--bg-surface-2); }
.sp-datecal__preset.is-selected { background: var(--primary-soft); color: var(--primary-ink); font-weight: 500; }
.sp-timepicker .sp-listbox { max-height: 232px; width: 100%; }
.sp-timepicker .sp-option { font-variant-numeric: tabular-nums; }
.sp-datetime { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-2); }
@media (max-width: 767px) {
  .sp-datepicker__panel { flex-direction: column-reverse; width: 100%; }
  .sp-datepicker__panel > .sp-datecal { max-width: none; }
  .sp-datecal__presets { flex-direction: row; overflow-x: auto; border-right: 0; border-top: 1px solid var(--border); min-width: 0; }
  .sp-datecal { width: 100%; max-width: 358px; }
  .sp-datecal__day { height: 40px; }
}

/* ---------- ColorPicker ---------- */
.sp-colorpicker { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.sp-colorswatches { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sp-colorswatch {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--c, var(--primary)); cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.sp-colorswatch .sp-i { width: 16px; height: 16px; display: none; color: var(--gray-0); filter: drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.sp-colorswatch:hover, .sp-colorswatch.is-hover { transform: scale(1.08); }
.sp-colorswatch.is-selected, .sp-colorswatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--primary); }
.sp-colorswatch.is-selected .sp-i, .sp-colorswatch[aria-checked="true"] .sp-i { display: inline-flex; }
.sp-colorswatch:focus-visible, .sp-colorswatch.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 4px; }
.sp-colorswatch--add { background: var(--bg-surface-2); color: var(--text-secondary); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-colorswatch--add .sp-i { display: inline-flex; color: inherit; filter: none; }
.sp-colorpicker__preview { flex: none; width: 22px; height: 22px; border-radius: var(--radius-xs); background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.sp-colorpicker__hex input { font-family: var(--font-mono); text-transform: uppercase; }
.sp-colorpicker__panel { display: flex; flex-direction: column; gap: var(--space-3); width: 272px; padding: var(--space-4); }
.sp-colorpicker__sv {
  position: relative; height: 160px; border-radius: var(--radius-md); cursor: crosshair; touch-action: none;
  background: linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, hsl(var(--hue, 230) 100% 50%));
}
.sp-colorpicker__handle {
  position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: var(--radius-full);
  border: 2px solid var(--gray-0); box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.4); background: var(--c, transparent); pointer-events: none;
}
.sp-colorpicker__bar { position: relative; height: 12px; border-radius: var(--radius-full); cursor: pointer; touch-action: none; }
.sp-colorpicker__bar--hue { background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%); }
.sp-colorpicker__bar--alpha {
  background: linear-gradient(to right, rgba(0,0,0,0), var(--c, #000)),
    repeating-conic-gradient(var(--gray-200) 0% 25%, var(--gray-0) 0% 50%) 0 0 / 8px 8px;
}
.sp-colorpicker__bar .sp-colorpicker__handle { top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: transparent; outline: none; }
.sp-colorpicker__bar .sp-colorpicker__handle:focus-visible { box-shadow: 0 0 0 2px var(--focus-ring); }
.sp-colorpicker__row { display: flex; gap: var(--space-2); align-items: center; }
.sp-colorpicker__row .sp-control { --h: var(--control-s); font-size: 13px; }
.sp-colorpicker__alpha-input { width: 72px; flex: none; }

/* ---------- FileUpload ---------- */
.sp-dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 176px; padding: var(--space-6); text-align: center; cursor: pointer;
  background: var(--bg-sunken); border: 1.5px dashed var(--border-control); border-radius: var(--radius-lg); color: var(--text-primary);
  transition: border-color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.sp-dropzone:hover, .sp-dropzone.is-hover { border-color: var(--text-secondary); background: var(--bg-surface-2); }
.sp-dropzone:focus-visible, .sp-dropzone.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-dropzone__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--bg-surface); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border); }
.sp-dropzone__title { font-size: 15px; line-height: 22px; font-weight: 500; }
.sp-dropzone__title .sp-link { font-weight: 500; }
.sp-dropzone__hint { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-dropzone.is-dragover { border-style: solid; border-color: var(--info); background: var(--info-soft); }
.sp-dropzone.is-dragover .sp-dropzone__icon { background: var(--info); color: var(--gray-0); box-shadow: none; }
.sp-dropzone.is-dragover .sp-dropzone__title { color: var(--info-ink); }
.sp-dropzone.is-error { border-color: var(--danger); background: var(--danger-soft); }
.sp-dropzone.is-error .sp-dropzone__icon { color: var(--danger-ink); }
.sp-dropzone.is-disabled { cursor: not-allowed; background: var(--bg-surface-2); border-color: var(--border-strong); color: var(--text-disabled); }
.sp-dropzone.is-disabled .sp-dropzone__hint, .sp-dropzone.is-disabled .sp-link { color: var(--text-disabled); }
.sp-dropzone.is-disabled .sp-dropzone__icon { color: var(--text-disabled); }
.sp-dropzone--compact { min-height: 0; flex-direction: row; justify-content: flex-start; text-align: left; padding: var(--space-4); gap: var(--space-3); }
.sp-dropzone input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }

.sp-filelist { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.sp-file { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-2); border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border); min-width: 0; }
.sp-file__thumb { flex: none; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--bg-surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--text-secondary); overflow: hidden; background-size: cover; background-position: center; }
.sp-file__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sp-file__name { font-size: 13px; line-height: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-file__meta { font-size: 12px; line-height: 16px; color: var(--text-secondary); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; }
.sp-file__meta .sp-i { width: 14px; height: 14px; }
.sp-file__progress { height: 4px; border-radius: var(--radius-full); background: var(--bg-surface-3); overflow: hidden; }
.sp-file__progress > span { display: block; height: 100%; width: var(--p, 0%); background: var(--primary); border-radius: inherit; transition: width var(--duration-base) var(--ease-standard); }
.sp-file__actions { display: flex; gap: 2px; flex: none; }
.sp-file.is-error { box-shadow: inset 0 0 0 1px var(--danger); }
.sp-file.is-error .sp-file__meta { color: var(--danger-ink); }
.sp-file.is-done .sp-file__meta .sp-i { color: var(--success-ink); }
.sp-filegrid { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sp-filethumb { position: relative; width: 96px; height: 96px; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-surface-2); background-size: cover; background-position: center; flex: none; }
.sp-filethumb__x {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; padding: 0; border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center; background: rgba(19,20,29,.64); color: var(--gray-0); cursor: pointer;
}
.sp-filethumb__x .sp-i { width: 14px; height: 14px; }
.sp-filethumb__x:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.sp-filethumb__overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 6px; background: rgba(19,20,29,.56); color: var(--gray-0); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-filethumb__overlay .sp-file__progress { width: 64px; background: rgba(255,255,255,.3); }
.sp-filethumb__overlay .sp-file__progress > span { background: var(--gray-0); }
.sp-filethumb.is-error { box-shadow: inset 0 0 0 2px var(--danger); }
.sp-filethumb.is-error .sp-filethumb__overlay { background: rgba(120,20,24,.72); }
.sp-filethumb--add { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1.5px dashed var(--border-control); background: var(--bg-sunken); color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.sp-filethumb--add:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.sp-upload-btn { display: inline-flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.sp-upload-btn input[type="file"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
@media (max-width: 767px) { .sp-dropzone { min-height: 140px; padding: var(--space-5) var(--space-4); } .sp-filethumb { width: 80px; height: 80px; } .sp-filethumb__x { width: 32px; height: 32px; } }

/* ---------- FormLayout ---------- */
.sp-form { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.sp-form__section { background: var(--bg-surface); border-radius: var(--radius-xl); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
.sp-form__section-head { display: flex; flex-direction: column; gap: 4px; }
.sp-form__section-title { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.sp-form__section-desc { font-size: 13px; line-height: 18px; color: var(--text-secondary); margin: 0; }
.sp-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); }
.sp-form__full { grid-column: 1 / -1; }
.sp-form__summary {
  display: flex; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg);
  background: var(--danger-soft); color: var(--text-primary);
}
.sp-form__summary > .sp-i { color: var(--danger-ink); margin-top: 1px; }
.sp-form__summary-title { font-weight: 600; margin: 0 0 4px; color: var(--danger-ink); }
.sp-form__summary ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 20px; }
.sp-form__summary a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.sp-form__alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); font-size: 13px; line-height: 20px; }
.sp-form__alert--success { background: var(--success-soft); color: var(--success-ink); }
.sp-form__alert--info { background: var(--info-soft); color: var(--info-ink); }
.sp-form__footer {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-4) var(--space-8); background: var(--bg-surface); border-radius: var(--radius-xl);
}
.sp-form__footer-note { font-size: 12px; line-height: 16px; color: var(--text-secondary); margin-right: auto; }
.sp-form__footer--sticky { position: sticky; bottom: 0; z-index: var(--z-raised); border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: 0 -1px 0 var(--border), var(--shadow-sm); }
@media (max-width: 767px) {
  .sp-form__grid { grid-template-columns: 1fr; }
  .sp-form__section { padding: var(--space-5); border-radius: var(--radius-lg); }
  .sp-form__footer { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .sp-form__footer .sp-btn { flex: 1 1 auto; }
  .sp-form__footer-note { width: 100%; }
}

/* ---------- Дополнения для React ---------- */
.sp-datecal__row { display: contents; }
.sp-slider--tips .sp-slider__rail { margin-top: 28px; }
.sp-radio-card:has(.sp-radio__input:checked) .sp-radio__dot { background: var(--primary); border-color: var(--primary); }
.sp-radio-card:has(.sp-radio__input:checked) .sp-radio__dot::after { transform: scale(1); }
button.sp-filethumb--add { font: inherit; }
.sp-dropdown > .sp-popover-panel { min-width: 100%; }
.sp-colorswatch--light .sp-i { color: var(--gray-900); filter: none; }

/* ---------- Input copyable — значение для копирования (почта представителя, ссылка, ID) ---------- */
.sp-control--copy { background: var(--bg-sunken); border-style: dashed; }
.sp-control--copy input { font-family: var(--font-mono); font-size: 14px; }
.sp-control--copy .sp-control__copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; margin-right: -6px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius-xs); background: var(--bg-surface-2); color: var(--text-primary); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.sp-control--copy .sp-control__copy:hover, .sp-control--copy .sp-control__copy.is-hover { background: var(--bg-surface-3); }
.sp-control--copy .sp-control__copy .sp-i { width: 16px; height: 16px; }
.sp-control--copy .sp-control__copy.is-copied { background: var(--success-soft); color: var(--success-ink); }
.sp-control--copy.is-copied { border-color: var(--success); }

/* ==========================================================================
   30 — Навигация и оверлеи: Sidebar, Topbar, Tabs, Breadcrumbs, Pagination,
   Stepper, CommandPalette, ThemeToggle, Modal, Drawer
   ========================================================================== */

/* ---------- Sidebar ---------- */
.sp-sidebar {
  position: relative; display: flex; flex-direction: column; gap: var(--space-2);
  width: var(--sidebar-w); height: 100%; min-height: 0; padding: var(--space-3);
  background: var(--bg-sidebar); color: var(--text-sidebar);
  transition: width var(--duration-base) var(--ease-standard);
}
.sp-sidebar :focus-visible, .sp-sidebar .is-focus { outline: 2px solid var(--focus-ring-inverse); outline-offset: 2px; }
.sp-sidebar__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-1) 0 var(--space-3); }
.sp-sidebar__brand { font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-sidebar); white-space: nowrap; }
.sp-sidebar__brand-tag { margin-left: var(--space-2); vertical-align: 2px; }
.sp-sidebar__close { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-sidebar-muted); cursor: pointer; }
.sp-sidebar__close:hover { background: var(--bg-sidebar-active); color: var(--text-sidebar); }

/* Карточка организации */
.sp-sidebar__org { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-lg); background: var(--bg-sidebar-active); }
.sp-sidebar__org-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sp-sidebar__org-logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; overflow: hidden; }
.sp-sidebar__org-logo img { width: 100%; height: 100%; object-fit: cover; }
.sp-sidebar__org-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-sidebar__org-name { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--text-sidebar); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.sp-sidebar__org-addr { font-size: 12px; line-height: 16px; color: var(--text-sidebar-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sidebar__org-switch { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-right: -4px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-sidebar-muted); cursor: pointer; }
.sp-sidebar__org-switch .sp-i { width: 16px; height: 16px; }
.sp-sidebar__org-switch:hover, .sp-sidebar__org-switch.is-hover { background: var(--bg-sidebar); color: var(--text-sidebar); }
.sp-sidebar__org-progress { display: flex; flex-direction: column; gap: 6px; }
.sp-sidebar__org-progress-label { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--text-sidebar-muted); }
.sp-sidebar__org-progress-label b { color: var(--text-sidebar); font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-sidebar__org-track { height: 4px; border-radius: var(--radius-full); background: var(--bg-sidebar); overflow: hidden; }
.sp-sidebar__org-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* Список */
.sp-sidebar__nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 0 calc(var(--space-1) * -1); padding: var(--space-1); scrollbar-width: none; }
.sp-sidebar__nav::-webkit-scrollbar { display: none; }
.sp-sidebar__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-sidebar__section { padding: var(--space-3) var(--space-3) var(--space-1); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-sidebar-muted); }
.sp-sidebar__sep { height: 1px; margin: var(--space-2) var(--space-3); background: var(--bg-sidebar-active); border: 0; list-style: none; }

.sp-sidebar__item {
  position: relative; display: flex; align-items: center; gap: var(--space-3); width: 100%;
  height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md);
  background: transparent; color: var(--text-sidebar-muted); text-decoration: none; text-align: left;
  font-size: 15px; line-height: 20px; font-weight: 500; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.sp-sidebar__item > .sp-i { width: 20px; height: 20px; }
.sp-sidebar__item:hover, .sp-sidebar__item.is-hover { background: var(--bg-sidebar-active); color: var(--text-sidebar); }
.sp-sidebar__item.is-active, .sp-sidebar__item[aria-current="page"] { background: var(--bg-sidebar-active); color: var(--text-sidebar); font-weight: 600; }
.sp-sidebar__item.is-active::before, .sp-sidebar__item[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 min(var(--radius-xs), 3px) min(var(--radius-xs), 3px) 0; background: var(--accent); }
.sp-sidebar__item:disabled, .sp-sidebar__item.is-disabled, .sp-sidebar__item[aria-disabled="true"] { color: var(--text-sidebar-muted); opacity: var(--opacity-disabled); background: transparent; cursor: not-allowed; }
.sp-sidebar__label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-sidebar__meta { display: inline-flex; align-items: center; gap: var(--space-1); flex: none; }
.sp-sidebar__new { height: 18px; padding: 0 6px; font-size: 11px; font-weight: 600; }
.sp-sidebar__chevron { width: 16px; height: 16px; flex: none; color: var(--text-sidebar-muted); opacity: 0; transition: transform var(--duration-fast) var(--ease-standard), opacity var(--duration-fast) var(--ease-standard); }
.sp-sidebar__item:hover .sp-sidebar__chevron, .sp-sidebar__item:focus-visible .sp-sidebar__chevron, .sp-sidebar__item.is-hover .sp-sidebar__chevron, .sp-sidebar__item.is-focus .sp-sidebar__chevron,
.sp-sidebar__group.is-open > .sp-sidebar__item .sp-sidebar__chevron { opacity: 1; }
.sp-sidebar__group.is-open > .sp-sidebar__item .sp-sidebar__chevron { transform: rotate(90deg); color: var(--text-sidebar); }
/* Без наведения (сенсорные экраны, drawer) шеврон виден всегда */
.sp-sidebar-drawer .sp-sidebar__chevron, .sp-sidebar--touch .sp-sidebar__chevron { opacity: 1; }
@media (hover: none) { .sp-sidebar__chevron { opacity: 1; } }

/* Раскрывающийся раздел (NavGroup): кнопка-родитель + утопленный блок подпунктов */
.sp-sidebar__group { position: relative; list-style: none; }
.sp-sidebar__group.is-open > .sp-sidebar__item, .sp-sidebar__group.is-path > .sp-sidebar__item { color: var(--text-sidebar); }
.sp-sidebar__sub { list-style: none; display: none; flex-direction: column; gap: 2px; margin: 2px 0 0; padding: var(--space-1); border-radius: var(--radius-md); background: var(--bg-sidebar-sunken); }
.sp-sidebar__group.is-open > .sp-sidebar__sub { display: flex; }
.sp-sidebar__sub-title { display: none; padding: var(--space-2) var(--space-3) var(--space-1); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--text-sidebar); }
.sp-sidebar__sub .sp-sidebar__sep { margin: var(--space-1) var(--space-2); background: var(--bg-sidebar-active); }
.sp-sidebar__subitem {
  position: relative; display: flex; align-items: center; gap: var(--space-2); width: 100%; height: 36px;
  padding: 0 var(--space-2) 0 40px; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--text-sidebar-muted); font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; text-align: left; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.sp-sidebar__subitem:hover, .sp-sidebar__subitem.is-hover { color: var(--text-sidebar); background: var(--bg-sidebar-active); }
.sp-sidebar__subitem.is-active, .sp-sidebar__subitem[aria-current="page"] { color: var(--text-sidebar); background: var(--bg-sidebar-active); font-weight: 600; }
.sp-sidebar__subitem.is-active::before, .sp-sidebar__subitem[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 min(var(--radius-xs), 3px) min(var(--radius-xs), 3px) 0; background: var(--accent); }
.sp-sidebar__subitem .sp-sidebar__label { font-weight: inherit; }
.sp-sidebar__subitem .sp-sidebar__meta { margin-left: auto; }

/* Тултип (только в свёрнутом режиме) */
.sp-sidebar__tip {
  position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%); z-index: var(--z-tooltip);
  display: none; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--bg-inverse); color: var(--text-inverse); box-shadow: var(--shadow-md);
  font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap; pointer-events: none;
}

/* Низ */
.sp-sidebar__foot { display: flex; flex-direction: column; gap: 2px; padding-top: var(--space-2); border-top: 1px solid var(--bg-sidebar-active); }

/* Свёрнутое 72px */
.sp-sidebar--collapsed { width: var(--sidebar-w-collapsed); align-items: stretch; }
.sp-sidebar--collapsed .sp-sidebar__head { justify-content: center; padding: 0; }
.sp-sidebar--collapsed .sp-sidebar__brand,
.sp-sidebar--collapsed .sp-sidebar__org-text,
.sp-sidebar--collapsed .sp-sidebar__org-switch,
.sp-sidebar--collapsed .sp-sidebar__org-progress,
.sp-sidebar--collapsed .sp-sidebar__label,
.sp-sidebar--collapsed .sp-sidebar__new,
.sp-sidebar--collapsed .sp-sidebar__chevron,
.sp-sidebar--collapsed .sp-sidebar__section { display: none; }
.sp-sidebar--collapsed .sp-sidebar__org { padding: var(--space-1); background: transparent; align-items: center; }
.sp-sidebar--collapsed .sp-sidebar__nav { overflow: visible; }
.sp-sidebar--collapsed .sp-sidebar__item { justify-content: center; padding: 0; height: 44px; }
/* Свёрнутое меню: подпункты — всплывающим блоком справа от иконки */
.sp-sidebar--collapsed .sp-sidebar__group.is-open > .sp-sidebar__sub, .sp-sidebar--collapsed .sp-sidebar__group:hover > .sp-sidebar__sub, .sp-sidebar--collapsed .sp-sidebar__group.is-hover > .sp-sidebar__sub, .sp-sidebar--collapsed .sp-sidebar__group:focus-within > .sp-sidebar__sub { display: flex; position: absolute; left: calc(100% + var(--space-2)); top: 0; z-index: var(--z-dropdown); width: 232px; margin: 0; box-shadow: var(--shadow-md); animation: sp-nav-fade var(--duration-fast) var(--ease-enter); }
.sp-sidebar--collapsed .sp-sidebar__sub-title { display: block; }
.sp-sidebar--collapsed .sp-sidebar__sub .sp-sidebar__label, .sp-sidebar--collapsed .sp-sidebar__sub .sp-sidebar__new { display: block; }
.sp-sidebar--collapsed .sp-sidebar__subitem { padding-left: var(--space-3); height: 40px; }
.sp-sidebar--collapsed .sp-sidebar__group.is-open > .sp-sidebar__item, .sp-sidebar--collapsed .sp-sidebar__group:hover > .sp-sidebar__item, .sp-sidebar--collapsed .sp-sidebar__group.is-hover > .sp-sidebar__item { background: var(--bg-sidebar-active); color: var(--text-sidebar); }
.sp-sidebar--collapsed .sp-sidebar__group.is-open > .sp-sidebar__item .sp-sidebar__tip, .sp-sidebar--collapsed .sp-sidebar__group:hover > .sp-sidebar__item .sp-sidebar__tip, .sp-sidebar--collapsed .sp-sidebar__group.is-hover > .sp-sidebar__item .sp-sidebar__tip, .sp-sidebar--collapsed .sp-sidebar__group:focus-within > .sp-sidebar__item .sp-sidebar__tip { display: none; }
.sp-sidebar--collapsed .sp-sidebar__group::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: var(--space-2); }
.sp-sidebar--collapsed .sp-sidebar__group.is-path > .sp-sidebar__item::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 min(var(--radius-xs), 3px) min(var(--radius-xs), 3px) 0; background: var(--accent); }
.sp-sidebar--collapsed .sp-sidebar__item > .sp-sidebar__meta { position: absolute; top: 5px; right: 8px; }
.sp-sidebar--collapsed .sp-sidebar__item > .sp-sidebar__meta .sp-counter { min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; box-shadow: 0 0 0 2px var(--bg-sidebar); }
.sp-sidebar--collapsed .sp-sidebar__sep { margin: var(--space-2) var(--space-2); }
.sp-sidebar--collapsed .sp-sidebar__item:hover .sp-sidebar__tip,
.sp-sidebar--collapsed .sp-sidebar__item:focus-visible .sp-sidebar__tip,
.sp-sidebar--collapsed .sp-sidebar__item.is-hover .sp-sidebar__tip { display: inline-flex; }
/* «Скоро» — раздел объявлен, но ещё не открыт: не кликается, приглушён, метка и подсказка о назначении */
.sp-sidebar__item.is-soon { cursor: default; opacity: 1; background: transparent; }
.sp-sidebar__item.is-soon > .sp-i, .sp-sidebar__item.is-soon .sp-sidebar__label { opacity: var(--opacity-muted); }
.sp-sidebar__item.is-soon:hover, .sp-sidebar__item.is-soon.is-hover { background: transparent; color: var(--text-sidebar-muted); }
.sp-sidebar__soon { height: 18px; padding: 0 5px; font-size: 10px; letter-spacing: .02em; font-weight: 600; background: var(--bg-sidebar-active); color: var(--text-sidebar-muted); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.sp-sidebar__item.is-soon .sp-sidebar__tip { width: max-content; max-width: 240px; white-space: normal; text-align: left; line-height: 16px; }
.sp-sidebar__item.is-soon:hover .sp-sidebar__tip, .sp-sidebar__item.is-soon:focus-visible .sp-sidebar__tip, .sp-sidebar__item.is-soon.is-hover .sp-sidebar__tip { display: inline-flex; }

/* Мобильный drawer */
.sp-sidebar-drawer { position: fixed; inset: 0; z-index: var(--z-overlay); }
.sp-sidebar-drawer__backdrop { position: absolute; inset: 0; background: var(--bg-overlay); animation: sp-nav-fade var(--duration-base) var(--ease-enter); }
.sp-sidebar-drawer .sp-sidebar { position: absolute; top: 0; bottom: 0; left: 0; width: min(296px, 86%); box-shadow: var(--shadow-lg); animation: sp-nav-in-left var(--duration-slow) var(--ease-enter); }
.sp-sidebar-drawer .sp-sidebar__item, .sp-sidebar-drawer .sp-sidebar__subitem { height: 44px; }
@media (max-width: 767px) { .sp-sidebar__item, .sp-sidebar__subitem { height: var(--control-touch); } }

@keyframes sp-nav-fade { from { opacity: 0; } }
@keyframes sp-nav-in-left { from { transform: translateX(-100%); } }
@keyframes sp-nav-in-right { from { transform: translateX(100%); } }
@keyframes sp-nav-in-up { from { transform: translateY(100%); } }
@keyframes sp-nav-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Topbar ---------- */
.sp-topbar {
  position: relative; display: flex; align-items: center; gap: var(--space-6);
  height: var(--header-h); padding: 0 var(--space-6);
  background: var(--bg-surface); color: var(--text-primary); border-bottom: 1px solid var(--border);
}
.sp-topbar__logo { flex: none; font-size: 19px; line-height: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); text-decoration: none; white-space: nowrap; border-radius: var(--radius-xs); }
.sp-topbar__nav { display: flex; align-items: center; gap: var(--space-1); height: 100%; flex: none; }
.sp-topbar__link {
  position: relative; display: inline-flex; align-items: center; height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--text-secondary); text-decoration: none; font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.sp-topbar__link:hover, .sp-topbar__link.is-hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-topbar__link.is-active, .sp-topbar__link[aria-current="page"] { color: var(--text-primary); font-weight: 600; }
.sp-topbar__link.is-active::after, .sp-topbar__link[aria-current="page"]::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: -12px; height: 3px; border-radius: min(var(--radius-xs), 3px) min(var(--radius-xs), 3px) 0 0; background: var(--accent); }
.sp-topbar__spacer { flex: 1 1 auto; }
/* Переключатель организации в верхней панели */
.sp-topbar__org { display: inline-flex; align-items: center; gap: var(--space-2); height: 44px; max-width: 320px; padding: 0 var(--space-2) 0 var(--space-1); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); cursor: pointer; text-align: left; }
.sp-topbar__org:hover, .sp-topbar__org.is-hover { background: var(--bg-surface-2); }
.sp-topbar__org:active, .sp-topbar__org.is-active { background: var(--bg-surface-3); }
.sp-topbar__org-logo { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700; }
.sp-topbar__org-text { display: flex; flex-direction: column; min-width: 0; }
.sp-topbar__org-name { font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-topbar__org-addr { font-size: 12px; line-height: 16px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-topbar__org > .sp-i { width: 16px; height: 16px; color: var(--text-tertiary); flex: none; }
.sp-topbar__org-sep { width: 1px; height: 28px; background: var(--border); flex: none; }
/* Организация не подключена: заглушка вместо логотипа, призыв вместо названия */
.sp-topbar__org.is-empty .sp-topbar__org-logo { background: var(--bg-surface-2); color: var(--text-secondary); border: 1px dashed var(--border-control); }
.sp-topbar__org.is-empty .sp-topbar__org-name { color: var(--text-secondary); font-weight: 500; }
.sp-topbar__org.is-empty .sp-topbar__org-addr { color: var(--text-link); }
.sp-topbar__org.is-empty > .sp-i { color: var(--text-tertiary); }
.sp-topbar--mobile .sp-topbar__org { flex: 1 1 auto; min-width: 0; max-width: none; padding-left: 0; }
.sp-topbar--mobile .sp-topbar__org-addr, .sp-topbar--mobile .sp-topbar__org-sep { display: none; }
.sp-topbar--mobile .sp-topbar__org + .sp-topbar__logo, .sp-topbar--mobile .sp-topbar__logo:has(+ .sp-topbar__org) { display: none; }
.sp-topbar__search { width: 280px; flex: 0 1 280px; min-width: 140px; cursor: text; }
.sp-topbar__search .sp-cmdk__keys { flex: none; }
@media (max-width: 1279px) { .sp-topbar__search .sp-cmdk__keys { display: none; } }
.sp-topbar__search input { cursor: text; }
.sp-topbar__actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.sp-topbar__icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); cursor: pointer; }
.sp-topbar__icon-btn:hover, .sp-topbar__icon-btn.is-hover { background: var(--bg-surface-2); }
.sp-topbar__icon-btn .sp-counter { position: absolute; top: 3px; right: 1px; box-shadow: 0 0 0 2px var(--bg-surface); }
.sp-topbar__user-wrap { position: relative; }
.sp-topbar__user { display: inline-flex; align-items: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-2) 0 var(--space-1); border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-primary); cursor: pointer; }
.sp-topbar__user:hover, .sp-topbar__user.is-hover, .sp-topbar__user[aria-expanded="true"] { background: var(--bg-surface-2); }
.sp-topbar__user-name { font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.sp-topbar__user .sp-i { width: 16px; height: 16px; color: var(--text-secondary); }
.sp-topbar__burger, .sp-topbar__search-btn { display: none; }

/* Меню профиля (выпадающее) */
.sp-topbar__menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: var(--z-dropdown); min-width: 260px;
  padding: var(--space-2); background: var(--bg-surface); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  animation: sp-nav-pop var(--duration-fast) var(--ease-enter);
}
.sp-topbar__menu-head { display: flex; flex-direction: column; padding: var(--space-2) var(--space-3) var(--space-3); border-bottom: 1px solid var(--border); margin-bottom: var(--space-1); }
.sp-topbar__menu-head b { font-size: 15px; font-weight: 600; }
.sp-topbar__menu-head span { font-size: 13px; color: var(--text-secondary); }
.sp-topbar__menu-item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-primary); font-size: 14px; text-align: left; text-decoration: none; cursor: pointer; }
.sp-topbar__menu-item .sp-i { width: 18px; height: 18px; color: var(--text-secondary); }
.sp-topbar__menu-item:hover, .sp-topbar__menu-item.is-hover, .sp-topbar__menu-item:focus-visible { background: var(--bg-surface-2); outline-offset: -2px; }
.sp-topbar__menu-item--danger, .sp-topbar__menu-item--danger .sp-i { color: var(--danger-ink); }
.sp-topbar__menu-sep { height: 1px; margin: var(--space-1) 0; background: var(--border); }
.sp-topbar__menu-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-1) 0 var(--space-3); font-size: 14px; }
.sp-topbar__menu-row > span { display: inline-flex; align-items: center; gap: var(--space-3); }
.sp-topbar__menu-row > span .sp-i { width: 18px; height: 18px; color: var(--text-secondary); }

/* Промо-сайт */
.sp-topbar--promo { border-bottom-color: transparent; background: var(--bg-surface); height: 72px; }
.sp-topbar--promo .sp-topbar__nav { flex: 1; justify-content: center; }
.sp-topbar--promo .sp-topbar__link.is-active::after, .sp-topbar--promo .sp-topbar__link[aria-current="page"]::after { bottom: -16px; }

.sp-topbar__cta-short { display: none; }
/* Мобильная версия */
.sp-topbar--mobile.sp-topbar--promo .sp-btn { --h: 36px; padding: 0 var(--space-3); font-size: 14px; }
.sp-topbar--mobile .sp-topbar__cta-long { display: none; } .sp-topbar--mobile .sp-topbar__cta-short { display: inline; }
.sp-topbar--mobile { height: 56px; gap: var(--space-1); padding: 0 var(--space-2); }
.sp-topbar--mobile .sp-topbar__nav, .sp-topbar--mobile .sp-topbar__search, .sp-topbar--mobile .sp-topbar__user-name, .sp-topbar--mobile .sp-topbar__user > .sp-i, .sp-topbar--mobile .sp-topbar__promo-links { display: none; }
.sp-topbar--mobile .sp-topbar__burger, .sp-topbar--mobile .sp-topbar__search-btn { display: inline-flex; }
.sp-topbar--mobile .sp-topbar__logo { font-size: 17px; flex: 1; }
.sp-topbar--mobile .sp-topbar__actions { gap: 0; }
.sp-topbar--mobile .sp-topbar__user { padding: 0; width: 44px; justify-content: center; }
@media (max-width: 767px) {
  .sp-topbar { height: 56px; gap: var(--space-1); padding: 0 var(--space-2); }
  .sp-topbar__nav, .sp-topbar__search, .sp-topbar__user-name, .sp-topbar__user > .sp-i, .sp-topbar__promo-links { display: none; }
  .sp-topbar__burger, .sp-topbar__search-btn { display: inline-flex; }
  .sp-topbar__icon-btn, .sp-theme-toggle-btn { width: var(--control-touch); height: var(--control-touch); }
  .sp-topbar__org-addr, .sp-topbar__org-sep { display: none; }
  .sp-topbar__logo { font-size: 17px; flex: 1; }
  .sp-topbar__actions { gap: 0; }
  .sp-topbar__user { padding: 0; width: 44px; justify-content: center; }
  .sp-topbar--promo .sp-btn { --h: 36px; padding: 0 var(--space-3); font-size: 14px; }
  .sp-topbar__cta-long { display: none; } .sp-topbar__cta-short { display: inline; }
}

/* ---------- Tabs ---------- */
.sp-tabs { display: flex; align-items: stretch; gap: var(--space-6); border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sp-tabs::-webkit-scrollbar { display: none; }
.sp-tabs__tab {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-2); flex: none;
  height: 44px; padding: 0 2px; border: 0; background: transparent; color: var(--text-secondary);
  font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap; cursor: pointer; border-radius: var(--radius-xs);
  transition: color var(--duration-fast) var(--ease-standard);
}
.sp-tabs__tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: min(var(--radius-xs), 2px) min(var(--radius-xs), 2px) 0 0; background: transparent; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-tabs__tab .sp-i { width: 18px; height: 18px; }
.sp-tabs__tab:hover, .sp-tabs__tab.is-hover { color: var(--text-primary); }
.sp-tabs__tab:hover::after, .sp-tabs__tab.is-hover::after { background: var(--border-strong); }
.sp-tabs__tab:focus-visible, .sp-tabs__tab.is-focus { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sp-tabs__tab.is-active, .sp-tabs__tab[aria-selected="true"] { color: var(--text-primary); font-weight: 600; }
.sp-tabs__tab.is-active::after, .sp-tabs__tab[aria-selected="true"]::after { background: var(--primary); }
.sp-tabs__tab:disabled, .sp-tabs__tab.is-disabled { color: var(--text-disabled); cursor: not-allowed; }
.sp-tabs__tab:disabled::after, .sp-tabs__tab.is-disabled::after { background: transparent; }
.sp-tabs__tab .sp-counter { font-weight: 600; }
.sp-tabs__panel { padding-top: var(--space-4); }
.sp-tabs__panel:focus-visible { outline-offset: 4px; border-radius: var(--radius-sm); }

/* Плашки */
.sp-tabs--pills { gap: var(--space-2); border-bottom: 0; padding: 4px; margin: -4px; }
.sp-tabs--pills .sp-tabs__tab { height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); font-size: 14px; }
.sp-tabs--pills .sp-tabs__tab::after { display: none; }
.sp-tabs--pills .sp-tabs__tab:hover, .sp-tabs--pills .sp-tabs__tab.is-hover { background: var(--bg-surface-3); }
.sp-tabs--pills .sp-tabs__tab:focus-visible, .sp-tabs--pills .sp-tabs__tab.is-focus { outline-offset: 2px; }
.sp-tabs--pills .sp-tabs__tab.is-active, .sp-tabs--pills .sp-tabs__tab[aria-selected="true"] { background: var(--primary); color: var(--on-primary); font-weight: 500; }
.sp-tabs--pills .sp-tabs__tab.is-active .sp-counter--muted, .sp-tabs--pills .sp-tabs__tab[aria-selected="true"] .sp-counter--muted { background: var(--bg-surface); color: var(--text-primary); }
.sp-tabs--pills .sp-tabs__tab:disabled, .sp-tabs--pills .sp-tabs__tab.is-disabled { background: var(--bg-surface-2); color: var(--text-disabled); }

/* Вертикальные */
.sp-tabs--vertical { flex-direction: column; gap: 2px; border-bottom: 0; border-left: 1px solid var(--border); overflow: visible; }
.sp-tabs--vertical .sp-tabs__tab { height: 40px; padding: 0 var(--space-4); justify-content: flex-start; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.sp-tabs--vertical .sp-tabs__tab::after { left: -1px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; border-radius: 0; }
.sp-tabs--vertical .sp-tabs__tab:hover, .sp-tabs--vertical .sp-tabs__tab.is-hover { background: var(--bg-surface-2); }
.sp-tabs--vertical .sp-tabs__tab .sp-counter { margin-left: auto; }

/* Скролл-контейнер с «затуханием» справа (мобильные) */
.sp-tabs--scroll { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: var(--space-8); }
@media (max-width: 767px) {
  .sp-tabs { gap: var(--space-5); }
  .sp-tabs__tab { height: 48px; }
  .sp-tabs--pills .sp-tabs__tab { height: 40px; }
  .sp-tabs--vertical .sp-tabs__tab { height: 44px; }
}

/* ---------- Breadcrumbs ---------- */
.sp-breadcrumbs { font-size: 13px; line-height: 18px; }
.sp-breadcrumbs__list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.sp-breadcrumbs__item { position: relative; display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; }
.sp-breadcrumbs__sep { width: 14px; height: 14px; color: var(--text-tertiary); flex: none; }
.sp-breadcrumbs__link { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px; border-radius: var(--radius-xs); color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.sp-breadcrumbs__link .sp-i { width: 16px; height: 16px; }
.sp-breadcrumbs__link:hover, .sp-breadcrumbs__link.is-hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.sp-breadcrumbs__current { padding: 2px 4px; color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.sp-breadcrumbs__more { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; border: 0; border-radius: var(--radius-xs); background: transparent; color: var(--text-secondary); cursor: pointer; }
.sp-breadcrumbs__more .sp-i { width: 16px; height: 16px; }
.sp-breadcrumbs__more:hover, .sp-breadcrumbs__more.is-hover, .sp-breadcrumbs__more[aria-expanded="true"] { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-breadcrumbs__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-dropdown); min-width: 220px; padding: var(--space-1); list-style: none; margin: 0; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); animation: sp-nav-pop var(--duration-fast) var(--ease-enter); }
.sp-breadcrumbs__menu a { display: flex; align-items: center; min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-sm); color: var(--text-primary); text-decoration: none; font-size: 14px; }
.sp-breadcrumbs__menu a:hover, .sp-breadcrumbs__menu a:focus-visible { background: var(--bg-surface-2); outline-offset: -2px; }
.sp-breadcrumbs__back { display: none; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-1); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 15px; font-weight: 500; text-decoration: none; }
.sp-breadcrumbs__back .sp-i { width: 20px; height: 20px; }
.sp-breadcrumbs__back:hover, .sp-breadcrumbs__back.is-hover { color: var(--text-link); }
.sp-breadcrumbs--back .sp-breadcrumbs__list { display: none; }
.sp-breadcrumbs--back .sp-breadcrumbs__back { display: inline-flex; }
@media (max-width: 767px) {
  .sp-breadcrumbs--auto .sp-breadcrumbs__list { display: none; }
  .sp-breadcrumbs--auto .sp-breadcrumbs__back { display: inline-flex; }
}

/* ---------- Pagination ---------- */
.sp-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); font-size: 14px; line-height: 20px; color: var(--text-primary); }
.sp-pagination__pages { display: flex; align-items: center; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.sp-pagination__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-width: 36px; height: 36px; padding: 0 var(--space-2);
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-primary);
  font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; text-decoration: none; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.sp-pagination__btn .sp-i { width: 18px; height: 18px; }
.sp-pagination__btn:hover, .sp-pagination__btn.is-hover { background: var(--bg-surface-2); }
.sp-pagination__btn:active, .sp-pagination__btn.is-active { background: var(--bg-surface-3); }
.sp-pagination__btn.is-current, .sp-pagination__btn[aria-current="page"] { background: var(--primary); color: var(--on-primary); cursor: default; }
.sp-pagination__btn:disabled, .sp-pagination__btn.is-disabled { background: transparent; color: var(--text-disabled); cursor: not-allowed; }
.sp-pagination__gap { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 36px; color: var(--text-tertiary); user-select: none; }
.sp-pagination__info { display: flex; align-items: center; gap: var(--space-4); color: var(--text-secondary); flex-wrap: wrap; }
.sp-pagination__size { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.sp-pagination__size .sp-control { width: 76px; }
.sp-pagination__range { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-pagination--compact { justify-content: space-between; flex-wrap: nowrap; gap: var(--space-2); }
.sp-pagination--compact .sp-pagination__btn { min-width: 40px; height: 40px; }
.sp-pagination__status { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-pagination__status span { color: var(--text-secondary); font-weight: 400; }
.sp-pagination--more { flex-direction: column; align-items: stretch; gap: var(--space-2); text-align: center; }
.sp-pagination--more .sp-pagination__range { color: var(--text-secondary); font-size: 13px; }
@media (max-width: 767px) {
  .sp-pagination__btn { min-width: 40px; height: 40px; }
  .sp-pagination__pages .sp-pagination__page:not(.is-current):not([aria-current="page"]) { display: none; }
  .sp-pagination__pages .sp-pagination__gap { display: none; }
}

/* ---------- Stepper ---------- */
.sp-stepper { display: flex; align-items: flex-start; gap: var(--space-3); list-style: none; margin: 0; padding: 0; counter-reset: sp-step; }
.sp-stepper__step { display: flex; align-items: center; gap: var(--space-3); flex: 1 1 auto; min-width: 0; }
.sp-stepper__step:last-child { flex: none; }
.sp-stepper__step::after { content: ""; flex: 1 1 auto; min-width: 16px; height: 2px; border-radius: min(var(--radius-xs), 2px); background: var(--border-strong); }
.sp-stepper__step:last-child::after { display: none; }
.sp-stepper__step.is-done::after { background: var(--primary); }
.sp-stepper__dot {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-full);
  background: var(--bg-surface-2); color: var(--text-secondary); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 2px transparent;
}
.sp-stepper__dot .sp-i { width: 16px; height: 16px; stroke-width: 2.5; }
.sp-stepper__text { display: flex; flex-direction: column; min-width: 0; }
.sp-stepper__label { font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.sp-stepper__desc { font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.sp-stepper__step.is-done .sp-stepper__dot { background: var(--primary); color: var(--on-primary); }
.sp-stepper__step.is-done .sp-stepper__label { color: var(--text-primary); }
.sp-stepper__step.is-current .sp-stepper__dot { background: var(--bg-surface); color: var(--primary-ink); box-shadow: inset 0 0 0 2px var(--primary); }
.sp-stepper__step.is-current .sp-stepper__label { color: var(--text-primary); font-weight: 600; }
.sp-stepper__step.is-error .sp-stepper__dot { background: var(--danger-soft); color: var(--danger-ink); }
.sp-stepper__step.is-error .sp-stepper__label, .sp-stepper__step.is-error .sp-stepper__desc { color: var(--danger-ink); }
.sp-stepper__hit { all: unset; display: inline-flex; align-items: center; gap: var(--space-3); border-radius: var(--radius-sm); cursor: pointer; }
.sp-stepper__hit:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Вертикальный */
.sp-stepper--vertical { flex-direction: column; gap: 0; }
.sp-stepper--vertical .sp-stepper__step { position: relative; align-items: flex-start; flex: none; padding-bottom: var(--space-6); }
.sp-stepper--vertical .sp-stepper__step:last-child { padding-bottom: 0; }
.sp-stepper--vertical .sp-stepper__step::after { position: absolute; left: 15px; top: 38px; bottom: 6px; width: 2px; height: auto; min-width: 0; }
.sp-stepper--vertical .sp-stepper__text { flex: 1 1 auto; padding-top: 5px; }
.sp-stepper--vertical .sp-stepper__label { white-space: normal; }
.sp-stepper--vertical .sp-stepper__desc { margin-top: 2px; font-size: 13px; line-height: 18px; }
/* Слот содержимого шага (только вертикальный): текст, кнопки, форма под заголовком шага */
.sp-stepper__content { display: none; margin-top: var(--space-3); font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.sp-stepper--vertical .sp-stepper__content { display: block; }
.sp-stepper__content > p { margin: 0 0 var(--space-3); }
.sp-stepper__content > p:last-child { margin-bottom: 0; }
.sp-stepper__content .sp-row { margin-top: var(--space-3); }
.sp-stepper--vertical .sp-stepper__step.is-current .sp-stepper__content { color: var(--text-secondary); }
.sp-stepper--vertical .sp-stepper__step.is-upcoming .sp-stepper__label { color: var(--text-secondary); }

/* Компактный мобильный */
.sp-stepper-compact { display: flex; flex-direction: column; gap: var(--space-2); }
.sp-stepper-compact__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.sp-stepper-compact__count { font-size: 13px; line-height: 18px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-stepper-compact__title { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--text-primary); }
.sp-stepper-compact__next { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-stepper-compact__track { height: 6px; border-radius: var(--radius-full); background: var(--bg-surface-2); overflow: hidden; }
.sp-stepper-compact__fill { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width var(--duration-slow) var(--ease-standard); }
.sp-stepper-compact.is-error .sp-stepper-compact__fill { background: var(--danger); }
@media (max-width: 767px) {
  .sp-stepper:not(.sp-stepper--vertical) .sp-stepper__text { display: none; }
  .sp-stepper:not(.sp-stepper--vertical) .sp-stepper__step.is-current .sp-stepper__text { display: flex; }
}

/* ---------- CommandPalette ---------- */
.sp-cmdk-overlay { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: flex-start; justify-content: center; padding: 12vh var(--space-4) var(--space-4); background: var(--bg-overlay); animation: sp-nav-fade var(--duration-fast) var(--ease-enter); }
.sp-cmdk { display: flex; flex-direction: column; min-width: 0; width: 640px; max-width: 100%; max-height: min(560px, 80vh); background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; animation: sp-nav-pop var(--duration-base) var(--ease-enter); }
.sp-cmdk__search { display: flex; align-items: center; gap: var(--space-3); height: 60px; padding: 0 var(--space-5); border-bottom: 1px solid var(--border); flex: none; }
.sp-cmdk__search > .sp-i { color: var(--text-tertiary); }
.sp-cmdk__input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 17px; color: var(--text-primary); }
.sp-cmdk__input::placeholder { color: var(--text-tertiary); }
.sp-cmdk__list { flex: 1 1 auto; overflow-y: auto; padding: var(--space-2); }
.sp-cmdk__options { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-cmdk__group + .sp-cmdk__group { margin-top: var(--space-2); }
.sp-cmdk__group-title { padding: var(--space-2) var(--space-3) var(--space-1); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.sp-cmdk__item { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 44px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); font-size: 15px; text-align: left; cursor: pointer; }
.sp-cmdk__item > .sp-i { color: var(--text-secondary); }
.sp-cmdk__item:hover, .sp-cmdk__item.is-hover { background: var(--bg-sunken); }
.sp-cmdk__item.is-selected, .sp-cmdk__item[aria-selected="true"] { background: var(--bg-surface-2); }
.sp-cmdk__item.is-selected > .sp-i, .sp-cmdk__item[aria-selected="true"] > .sp-i { color: var(--text-primary); }
.sp-cmdk__item-logo { flex: none; width: 24px; height: 24px; border-radius: var(--radius-xs); }
.sp-cmdk__label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-cmdk__label mark { background: none; color: inherit; font-weight: 700; }
.sp-cmdk__hint { flex: none; font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.sp-cmdk__keys { display: inline-flex; gap: 4px; flex: none; }
.sp-cmdk__kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-xs); background: var(--bg-surface-2); box-shadow: inset 0 -1px 0 var(--border-strong); color: var(--text-secondary); font-family: var(--font-mono); font-size: 12px; line-height: 1; font-weight: 500; white-space: nowrap; }
.sp-cmdk__empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-10) var(--space-6); text-align: center; color: var(--text-secondary); }
.sp-cmdk__empty .sp-i { width: 32px; height: 32px; color: var(--text-tertiary); margin-bottom: var(--space-1); }
.sp-cmdk__empty b { color: var(--text-primary); font-weight: 600; font-size: 15px; }
.sp-cmdk__foot { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); background: var(--bg-sunken); font-size: 12px; line-height: 16px; color: var(--text-secondary); flex: none; }
.sp-cmdk__foot .sp-cmdk__kbd { min-width: 20px; height: 20px; font-size: 11px; background: var(--bg-surface); }
@media (max-width: 767px) {
  .sp-cmdk-overlay { padding: var(--space-2); }
  .sp-cmdk { border-radius: var(--radius-lg); max-height: calc(100vh - 16px); }
  .sp-cmdk__item { min-height: 48px; }
  .sp-cmdk__keys, .sp-cmdk__foot { display: none; }
}

/* ---------- ThemeToggle ---------- */
.sp-theme-toggle { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius-md); background: var(--bg-surface-2); }
.sp-theme-toggle__opt { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.sp-theme-toggle__opt .sp-i { width: 16px; height: 16px; }
.sp-theme-toggle__opt:hover, .sp-theme-toggle__opt.is-hover { color: var(--text-primary); background: var(--bg-surface-3); }
.sp-theme-toggle__opt.is-selected, .sp-theme-toggle__opt[aria-checked="true"] { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.sp-theme-toggle__opt:disabled { color: var(--text-disabled); cursor: not-allowed; background: transparent; }
.sp-theme-toggle--icons .sp-theme-toggle__opt { width: 34px; padding: 0; }
.sp-theme-toggle--s .sp-theme-toggle__opt { height: 28px; font-size: 13px; }
.sp-theme-toggle--s.sp-theme-toggle--icons .sp-theme-toggle__opt { width: 28px; }
.sp-theme-toggle--block { display: flex; }
.sp-theme-toggle--block .sp-theme-toggle__opt { flex: 1; }
.sp-theme-toggle-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); cursor: pointer; }
.sp-theme-toggle-btn:hover, .sp-theme-toggle-btn.is-hover { background: var(--bg-surface-2); }
.sp-theme-toggle-btn:active, .sp-theme-toggle-btn.is-active { background: var(--bg-surface-3); }
.sp-theme-toggle-btn--outline { box-shadow: inset 0 0 0 1px var(--border-strong); }
@media (max-width: 767px) {
  .sp-theme-toggle__opt { height: 40px; }
  .sp-theme-toggle--icons .sp-theme-toggle__opt { width: 40px; }
  .sp-theme-toggle--s .sp-theme-toggle__opt { height: 36px; }
  .sp-theme-toggle--s.sp-theme-toggle--icons .sp-theme-toggle__opt { width: 36px; }
}

/* ---------- Modal ---------- */
.sp-modal-overlay { position: fixed; inset: 0; z-index: var(--z-modal); display: flex; align-items: center; justify-content: center; padding: var(--space-6); background: var(--bg-overlay); overflow-y: auto; animation: sp-nav-fade var(--duration-base) var(--ease-enter); }
.sp-modal {
  --w: 560px;
  position: relative; display: flex; flex-direction: column; width: var(--w); max-width: 100%; max-height: calc(100vh - 48px);
  background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  animation: sp-nav-pop var(--duration-base) var(--ease-enter);
}
.sp-modal--s { --w: 400px; } .sp-modal--m { --w: 560px; } .sp-modal--l { --w: 800px; }
.sp-modal__handle { display: none; width: 36px; height: 4px; margin: var(--space-2) auto 0; border-radius: var(--radius-full); background: var(--border-strong); flex: none; }
.sp-modal__head { display: flex; align-items: flex-start; gap: var(--space-4); padding: var(--space-6) var(--space-6) 0; flex: none; }
.sp-modal__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.sp-modal__title { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.sp-modal__subtitle { font-size: 14px; line-height: 20px; color: var(--text-secondary); margin: 0; }
.sp-modal__close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px -8px 0 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); cursor: pointer; }
.sp-modal__close:hover, .sp-modal__close.is-hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-modal__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--primary-soft); color: var(--primary-ink); }
.sp-modal__icon .sp-i { width: 24px; height: 24px; }
.sp-modal__icon--danger { background: var(--danger-soft); color: var(--danger-ink); }
.sp-modal__icon--success { background: var(--success-soft); color: var(--success-ink); }
.sp-modal__icon--warning { background: var(--warning-soft); color: var(--warning-ink); }
.sp-modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-3) var(--space-6) 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-modal__body > p { margin: 0 0 var(--space-3); }
.sp-modal__body > p:last-child { margin-bottom: 0; }
.sp-modal__body strong { color: var(--text-primary); font-weight: 600; }
.sp-modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-3); flex-wrap: wrap; padding: var(--space-6); flex: none; }
.sp-modal__foot-start { margin-right: auto; }
.sp-modal__details { margin-top: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--bg-sunken); box-shadow: inset 0 0 0 1px var(--border); font-family: var(--font-mono); font-size: 12px; line-height: 18px; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.sp-modal__form { display: flex; flex-direction: column; gap: var(--space-4); padding-top: var(--space-2); color: var(--text-primary); }
.sp-modal__loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); min-height: 160px; color: var(--text-secondary); font-size: 14px; }
.sp-modal.is-loading .sp-modal__body { pointer-events: none; }
/* Модалка-подтверждение: иконка + текст по центру */
.sp-modal--center .sp-modal__head { flex-direction: column; align-items: center; text-align: center; padding-top: var(--space-8); }
.sp-modal--center .sp-modal__close { position: absolute; top: var(--space-4); right: var(--space-4); margin: 0; }
.sp-modal--center .sp-modal__body { text-align: center; }
.sp-modal--center .sp-modal__foot { justify-content: center; }
.sp-modal--center .sp-modal__foot .sp-btn { flex: 1; }
/* Ввод кода */
.sp-modal__code { display: flex; justify-content: center; gap: var(--space-2); margin: var(--space-4) 0 var(--space-2); }
.sp-modal__code-cell { width: 48px; height: 56px; padding: 0; border: 1px solid var(--border-control); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); text-align: center; font-family: var(--font-mono); font-size: 24px; font-weight: 500; line-height: 54px; caret-color: var(--focus-ring); }
.sp-modal__code-cell:focus, .sp-modal__code-cell.is-focus { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); }
.sp-modal__code-cell.is-error, .sp-modal__code.is-error .sp-modal__code-cell { border-color: var(--danger); }
.sp-modal__code-gap { width: var(--space-2); }
.sp-modal__code-note { text-align: center; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-modal__code-note.is-error { color: var(--danger-ink); }
@media (max-width: 767px) {
  .sp-modal-overlay { align-items: flex-end; padding: 0; }
  .sp-modal, .sp-modal--s, .sp-modal--m, .sp-modal--l { --w: 100%; max-height: 92vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation: sp-nav-in-up var(--duration-slow) var(--ease-enter); }
  .sp-modal__handle { display: block; }
  .sp-modal__head { padding: var(--space-4) var(--space-5) 0; }
  .sp-modal__body { padding: var(--space-3) var(--space-5) 0; }
  .sp-modal__foot { flex-direction: column-reverse; align-items: stretch; padding: var(--space-5); padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); }
  .sp-modal .sp-modal__foot .sp-btn { width: 100%; flex: none; }
  .sp-modal__foot-start { margin-right: 0; }
  .sp-modal__code { gap: 6px; }
  .sp-modal__code-cell { width: 42px; height: 52px; line-height: 50px; }
  .sp-modal__code-gap { width: 6px; }
}
/* Принудительный вид bottom sheet (для витрины и мобильных веб-вью) */
.sp-modal--sheet { --w: 100%; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.sp-modal--sheet .sp-modal__handle { display: block; }
.sp-modal--sheet .sp-modal__head { padding: var(--space-4) var(--space-5) 0; }
.sp-modal--sheet .sp-modal__body { padding: var(--space-3) var(--space-5) 0; }
.sp-modal--sheet .sp-modal__foot { flex-direction: column-reverse; align-items: stretch; padding: var(--space-5); }
.sp-modal.sp-modal--sheet .sp-modal__foot .sp-btn { width: 100%; flex: none; }
.sp-modal--sheet .sp-modal__code-cell { width: 44px; height: 52px; line-height: 50px; }

/* ---------- Drawer ---------- */
.sp-drawer-overlay { position: fixed; inset: 0; z-index: var(--z-modal); background: var(--bg-overlay); animation: sp-nav-fade var(--duration-base) var(--ease-enter); }
.sp-drawer {
  --w: 480px;
  position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-modal);
  display: flex; flex-direction: column; width: var(--w); max-width: 100%;
  background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-lg);
  animation: sp-nav-in-right var(--duration-slow) var(--ease-enter);
}
.sp-drawer--left { --w: 320px; right: auto; left: 0; animation-name: sp-nav-in-left; }
.sp-drawer--bottom { top: auto; left: 0; right: 0; width: auto; max-height: 90vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; animation-name: sp-nav-in-up; }
.sp-drawer__handle { display: none; width: 36px; height: 4px; margin: var(--space-2) auto 0; border-radius: var(--radius-full); background: var(--border-strong); flex: none; }
.sp-drawer--bottom .sp-drawer__handle { display: block; }
.sp-drawer__head { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border); flex: none; }
.sp-drawer--bottom .sp-drawer__head { border-bottom: 0; padding: var(--space-3) var(--space-5) var(--space-2); }
.sp-drawer__titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-drawer__title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-drawer__subtitle { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-drawer__close { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -8px -8px -8px 0; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); cursor: pointer; }
.sp-drawer__close:hover, .sp-drawer__close.is-hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-drawer__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-6); overscroll-behavior: contain; }
.sp-drawer--bottom .sp-drawer__body { padding: var(--space-2) var(--space-3) var(--space-3); }
.sp-drawer__foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-6); padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--bg-surface); flex: none; }
.sp-drawer__foot .sp-btn--primary { margin-left: auto; }
.sp-drawer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-drawer__link { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 48px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-primary); font-size: 15px; text-decoration: none; text-align: left; cursor: pointer; }
.sp-drawer__link .sp-i { color: var(--text-secondary); }
.sp-drawer__link:hover, .sp-drawer__link.is-hover { background: var(--bg-surface-2); }
.sp-drawer__link.is-active, .sp-drawer__link[aria-current="page"] { background: var(--bg-surface-2); font-weight: 600; }
.sp-drawer__link.is-active .sp-i, .sp-drawer__link[aria-current="page"] .sp-i { color: var(--text-primary); }
.sp-drawer__link--danger, .sp-drawer__link--danger .sp-i { color: var(--danger-ink); }
@media (max-width: 767px) {
  .sp-drawer:not(.sp-drawer--left):not(.sp-drawer--bottom) { --w: 100%; }
  .sp-drawer__head { padding: var(--space-4) var(--space-5); }
  .sp-drawer__body { padding: var(--space-5); }
  .sp-drawer__foot { padding: var(--space-3) var(--space-5); }
  .sp-drawer__foot .sp-btn { flex: 1; }
}

/* ==========================================================================
   40 — Обратная связь: Popover, Tooltip, DropdownMenu, Toast, Alert, Banner,
   Progress, Loading (пресеты скелетонов), EmptyState, ErrorPage
   ========================================================================== */

/* ---------- Общие ключевые кадры ---------- */
@keyframes sp-fb-in { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sp-fb-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes sp-fb-indeterminate { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes sp-fb-pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.6); opacity: 0; } }

/* ---------- Popover ---------- */
.sp-popover-wrap { position: relative; display: inline-flex; vertical-align: middle; }
.sp-popover {
  position: absolute; z-index: var(--z-dropdown);
  width: 300px; max-width: calc(100vw - 32px);
  padding: var(--space-4) var(--space-5) var(--space-5);
  background: var(--bg-surface); color: var(--text-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  text-align: left; white-space: normal; font-size: 15px; line-height: 22px; font-weight: 400; letter-spacing: 0;
  animation: sp-fb-in var(--duration-base) var(--ease-enter);
}
.sp-popover__arrow { position: absolute; width: 12px; height: 12px; background: var(--bg-surface); transform: rotate(45deg); box-shadow: 1px 1px 0 0 var(--border); }
.sp-popover__head { display: flex; align-items: flex-start; gap: var(--space-2); margin-bottom: var(--space-1); }
.sp-popover__title { flex: 1; font-size: 15px; line-height: 22px; font-weight: 600; margin: 0; }
.sp-popover__body { font-size: 13px; line-height: 18px; color: var(--text-secondary); margin: 0; }
.sp-popover__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.sp-popover__close { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -2px -8px 0 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-secondary); cursor: pointer; }
.sp-popover__close:hover, .sp-popover__close.is-hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-popover__close .sp-i { width: 16px; height: 16px; }
/* позиции (относительно триггера) */
.sp-popover--bottom { top: calc(100% + 12px); left: 50%; transform: translateX(-50%); }
.sp-popover--top { bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); }
.sp-popover--right { left: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
.sp-popover--left { right: calc(100% + 12px); top: 50%; transform: translateY(-50%); }
.sp-popover--bottom .sp-popover__arrow { top: -6px; left: calc(50% - 6px); box-shadow: -1px -1px 0 0 var(--border); }
.sp-popover--top .sp-popover__arrow { bottom: -6px; left: calc(50% - 6px); }
.sp-popover--right .sp-popover__arrow { left: -6px; top: calc(50% - 6px); box-shadow: -1px 1px 0 0 var(--border); }
.sp-popover--left .sp-popover__arrow { right: -6px; top: calc(50% - 6px); box-shadow: 1px -1px 0 0 var(--border); }
/* статичный — для витрины и документации */
.sp-popover--static { position: relative; inset: auto; transform: none; animation: none; }
@media (max-width: 767px) {
  .sp-popover__close { width: 40px; height: 40px; margin: -10px -14px 0 0; }
}

/* ---------- Tooltip (инверсный) ---------- */
.sp-tooltip-wrap { position: relative; display: inline-flex; vertical-align: middle; }
.sp-tooltip {
  position: absolute; z-index: var(--z-tooltip);
  display: inline-flex; align-items: center; gap: var(--space-2);
  width: max-content; max-width: 240px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--bg-inverse); color: var(--text-inverse);
  font-size: 13px; line-height: 18px; font-weight: 500;
  box-shadow: var(--shadow-md); pointer-events: none; text-align: left; letter-spacing: 0; text-transform: none; white-space: normal;
  animation: sp-fb-in var(--duration-fast) var(--ease-enter);
}
.sp-tooltip__arrow { position: absolute; width: 8px; height: 8px; background: var(--bg-inverse); transform: rotate(45deg); }
.sp-tooltip__kbd {
  display: inline-flex; align-items: center; gap: 2px; height: 20px; padding: 0 5px; border-radius: var(--radius-xs);
  font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 500;
  background: color-mix(in srgb, var(--text-inverse) 16%, transparent); color: var(--text-inverse);
}
.sp-tooltip--multiline { display: block; max-width: 260px; padding: 8px 12px; font-weight: 400; }
.sp-tooltip--multiline .sp-tooltip__title { display: block; font-weight: 600; margin-bottom: 2px; }
.sp-tooltip--top { bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.sp-tooltip--bottom { top: calc(100% + 8px); left: 50%; transform: translateX(-50%); }
.sp-tooltip--right { left: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
.sp-tooltip--left { right: calc(100% + 8px); top: 50%; transform: translateY(-50%); }
.sp-tooltip--top .sp-tooltip__arrow { bottom: -4px; left: calc(50% - 4px); }
.sp-tooltip--bottom .sp-tooltip__arrow { top: -4px; left: calc(50% - 4px); }
.sp-tooltip--right .sp-tooltip__arrow { left: -4px; top: calc(50% - 4px); }
.sp-tooltip--left .sp-tooltip__arrow { right: -4px; top: calc(50% - 4px); }
.sp-tooltip--static { position: relative; inset: auto; transform: none; animation: none; }

/* ---------- DropdownMenu ---------- */
.sp-menu-wrap { position: relative; display: inline-flex; vertical-align: middle; }
.sp-menu {
  position: absolute; z-index: var(--z-dropdown);
  min-width: 232px; max-width: calc(100vw - 32px);
  padding: 6px; margin: 0; list-style: none;
  background: var(--bg-surface); color: var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border);
  animation: sp-fb-in var(--duration-fast) var(--ease-enter);
}
.sp-menu--bottom-start { top: calc(100% + 6px); left: 0; }
.sp-menu--bottom-end { top: calc(100% + 6px); right: 0; }
.sp-menu--top-start { bottom: calc(100% + 6px); left: 0; }
.sp-menu--top-end { bottom: calc(100% + 6px); right: 0; }
.sp-menu--static { position: relative; inset: auto; animation: none; }
.sp-menu--sub { top: -6px; left: calc(100% + 4px); }
.sp-menu__item {
  position: relative; display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-primary); text-align: left; text-decoration: none;
  font-size: 14px; line-height: 20px; cursor: pointer; user-select: none;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.sp-menu__item:hover, .sp-menu__item.is-hover, .sp-menu__item.is-open { background: var(--bg-surface-2); }
.sp-menu__item:focus-visible, .sp-menu__item.is-focus { background: var(--bg-surface-2); outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sp-menu__item:active, .sp-menu__item.is-active { background: var(--bg-surface-3); }
.sp-menu__icon { width: 18px; height: 18px; color: var(--text-secondary); }
.sp-menu__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-menu__kbd { margin-left: auto; padding-left: var(--space-4); font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--text-tertiary); white-space: nowrap; }
.sp-menu__chev { margin-left: auto; width: 16px; height: 16px; color: var(--text-tertiary); }
.sp-menu__check { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; color: var(--primary-ink); }
.sp-menu__check .sp-i { width: 16px; height: 16px; }
.sp-menu__radio { display: inline-flex; flex: none; width: 18px; height: 18px; align-items: center; justify-content: center; }
.sp-menu__radio::before { content: ""; width: 16px; height: 16px; border-radius: var(--radius-full); box-shadow: inset 0 0 0 1.5px var(--border-control); }
.sp-menu__item[aria-checked="true"] .sp-menu__radio::before { box-shadow: inset 0 0 0 5px var(--primary); }
.sp-menu__desc { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-menu__item--danger { color: var(--danger-ink); }
.sp-menu__item--danger .sp-menu__icon { color: var(--danger-ink); }
.sp-menu__item--danger:hover, .sp-menu__item--danger.is-hover, .sp-menu__item--danger:focus-visible, .sp-menu__item--danger.is-focus { background: var(--danger-soft); }
.sp-menu__item:disabled, .sp-menu__item[aria-disabled="true"], .sp-menu__item.is-disabled { color: var(--text-disabled); background: none; cursor: not-allowed; }
.sp-menu__item:disabled .sp-menu__icon, .sp-menu__item[aria-disabled="true"] .sp-menu__icon, .sp-menu__item.is-disabled .sp-menu__icon, .sp-menu__item.is-disabled .sp-menu__kbd { color: var(--text-disabled); }
.sp-menu__sep { height: 1px; margin: 6px 4px; background: var(--border); border: 0; }
.sp-menu__group { padding: 8px 10px 4px; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.sp-menu__header { display: flex; align-items: center; gap: var(--space-3); padding: 10px 10px 12px; }
.sp-menu__header-name { font-size: 14px; line-height: 20px; font-weight: 600; }
.sp-menu__header-meta { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
@media (max-width: 767px) {
  .sp-menu__item { min-height: 44px; font-size: 15px; }
  .sp-menu__kbd { display: none; }
}

/* ---------- Toast ---------- */
.sp-toast {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  width: max-content; min-width: 320px; max-width: min(480px, calc(100vw - 32px)); min-height: 52px;
  padding: 10px 8px 10px 14px; border-radius: var(--radius-md); overflow: hidden;
  background: var(--bg-inverse); color: var(--text-inverse);
  font-size: 14px; line-height: 20px;
  box-shadow: var(--shadow-lg);
  animation: sp-fb-toast-in var(--duration-slow) var(--ease-enter);
}
.sp-toast__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--text-inverse) 16%, transparent); color: var(--text-inverse); }
.sp-toast__icon .sp-i { width: 14px; height: 14px; }
.sp-toast__icon .sp-i svg { stroke-width: 2.5; }
.sp-toast--success .sp-toast__icon { background: var(--success); color: var(--text-inverse); }
.sp-toast--danger .sp-toast__icon { background: var(--danger); color: var(--text-inverse); }
.sp-toast--info .sp-toast__icon { background: var(--info); color: var(--text-inverse); }
.sp-toast--warning .sp-toast__icon { background: var(--warning); color: var(--text-inverse); }
.sp-toast__spinner { flex: none; width: 20px; height: 20px; margin: 2px; border-radius: var(--radius-full); border: 2px solid color-mix(in srgb, var(--text-inverse) 28%, transparent); border-top-color: var(--text-inverse); animation: sp-spin .8s linear infinite; }
.sp-toast__body { flex: 1; min-width: 0; padding: 4px 0; }
.sp-toast__title { display: block; font-weight: 600; }
.sp-toast__text { display: block; }
.sp-toast__title + .sp-toast__text { opacity: .82; font-size: 13px; line-height: 18px; }
.sp-toast__action {
  flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--text-inverse) 14%, transparent); color: var(--text-inverse);
  font-size: 13px; line-height: 18px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.sp-toast__action:hover, .sp-toast__action.is-hover { background: color-mix(in srgb, var(--text-inverse) 24%, transparent); }
.sp-toast__close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-inverse); opacity: .8; cursor: pointer; }
.sp-toast__close:hover, .sp-toast__close.is-hover { opacity: 1; background: color-mix(in srgb, var(--text-inverse) 14%, transparent); }
.sp-toast__close .sp-i { width: 18px; height: 18px; }
.sp-toast :focus-visible, .sp-toast .is-focus { outline-color: var(--focus-ring-inverse); }
.sp-toast__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--text-inverse) 18%, transparent); }
.sp-toast__progress-bar { display: block; height: 100%; background: var(--accent); transition: width var(--duration-base) var(--ease-standard); }
.sp-toast__meta { font-family: var(--font-mono); font-size: 12px; opacity: .82; font-variant-numeric: tabular-nums; }

/* Стопка тостов: справа снизу на десктопе, снизу по центру на мобильных */
.sp-toast-stack { position: fixed; z-index: var(--z-toast); right: var(--space-6); bottom: var(--space-6); display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); pointer-events: none; }
.sp-toast-stack > * { pointer-events: auto; }
.sp-toast-stack--bottom-center { right: auto; left: 50%; transform: translateX(-50%); align-items: center; }
.sp-toast-stack--static { position: relative; right: auto; bottom: auto; left: auto; transform: none; }
.sp-toast-stack--collapsed { display: grid; align-items: end; justify-items: end; }
.sp-toast-stack--collapsed > .sp-toast { grid-area: 1 / 1; width: 100%; transform-origin: 50% 0; transition: transform var(--duration-base) var(--ease-standard), opacity var(--duration-base) var(--ease-standard); }
.sp-toast-stack--collapsed > .sp-toast:nth-last-child(2) { transform: translateY(-12px) scale(.95); opacity: .9; }
.sp-toast-stack--collapsed > .sp-toast:nth-last-child(3) { transform: translateY(-24px) scale(.9); opacity: .75; }
.sp-toast-stack--collapsed > .sp-toast:nth-last-child(n+4) { display: none; }
.sp-toast-stack--collapsed > .sp-toast:not(:last-child) > * { visibility: hidden; }
@media (max-width: 767px) {
  .sp-toast-stack { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); align-items: center; transform: none; }
  .sp-toast-stack--static { left: auto; right: auto; bottom: auto; }
  .sp-toast-stack--collapsed { justify-items: center; }
  .sp-toast { width: 100%; min-width: 0; }
  .sp-toast__close { width: 40px; height: 40px; }
  .sp-toast__action { height: 40px; }
}

/* ---------- Alert (встроенное уведомление) ---------- */
.sp-alert {
  --tone-bg: var(--bg-surface-2); --tone-ink: var(--text-secondary);
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--tone-bg); color: var(--text-primary);
  font-size: 14px; line-height: 20px;
}
.sp-alert--info { --tone-bg: var(--info-soft); --tone-ink: var(--info-ink); }
.sp-alert--success { --tone-bg: var(--success-soft); --tone-ink: var(--success-ink); }
.sp-alert--warning { --tone-bg: var(--warning-soft); --tone-ink: var(--warning-ink); }
.sp-alert--danger { --tone-bg: var(--danger-soft); --tone-ink: var(--danger-ink); }
.sp-alert__icon { flex: none; width: 20px; height: 20px; color: var(--tone-ink); }
.sp-alert__body { flex: 1; min-width: 0; }
.sp-alert__title { display: block; font-size: 15px; line-height: 20px; font-weight: 600; margin: 0 0 2px; }
.sp-alert__text { margin: 0; }
.sp-alert__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-3); }
.sp-alert__link { color: var(--tone-ink); font-weight: 600; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-size: 14px; }
.sp-alert__link:hover, .sp-alert__link.is-hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-alert__close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; margin: -4px -4px -4px 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-secondary); cursor: pointer; }
.sp-alert__close:hover, .sp-alert__close.is-hover { color: var(--text-primary); background: color-mix(in srgb, var(--text-primary) 8%, transparent); }
.sp-alert__close .sp-i { width: 16px; height: 16px; }
.sp-alert--compact { align-items: center; padding: 10px var(--space-3); border-radius: var(--radius-md); gap: 10px; }
.sp-alert--compact .sp-alert__icon { width: 18px; height: 18px; }
.sp-alert--compact .sp-alert__body { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.sp-alert--compact .sp-alert__text { flex: 1; min-width: 0; }
.sp-alert--compact .sp-alert__actions { margin: 0; }
.sp-alert--compact .sp-alert__close { margin: -6px -4px; }
@media (max-width: 767px) {
  .sp-alert__close { width: 40px; height: 40px; margin: -10px -10px -10px 0; }
  .sp-alert__actions .sp-btn { flex: 1 1 auto; }
}

/* ---------- Banner (полноширинный) ---------- */
.sp-banner {
  --tone-bg: var(--bg-inverse); --tone-fg: var(--text-inverse); --tone-ink: var(--text-inverse);
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  width: 100%; min-height: 48px; padding: 10px var(--space-6);
  background: var(--tone-bg); color: var(--tone-fg);
  font-size: 14px; line-height: 20px;
}
.sp-banner--info { --tone-bg: var(--info-soft); --tone-fg: var(--text-primary); --tone-ink: var(--info-ink); }
.sp-banner--warning { --tone-bg: var(--warning-soft); --tone-fg: var(--text-primary); --tone-ink: var(--warning-ink); }
.sp-banner--danger { --tone-bg: var(--danger-soft); --tone-fg: var(--text-primary); --tone-ink: var(--danger-ink); }
.sp-banner--trial { --tone-bg: var(--primary-soft); --tone-fg: var(--text-primary); --tone-ink: var(--primary-ink); }
.sp-banner--accent { --tone-bg: var(--accent); --tone-fg: var(--on-accent); --tone-ink: var(--on-accent); min-height: 64px; overflow: hidden; }
.sp-banner__icon { flex: none; width: 20px; height: 20px; color: var(--tone-ink); }
.sp-banner__content { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-3); }
.sp-banner__title { font-weight: 600; }
.sp-banner__text { opacity: 1; }
.sp-banner--inverse .sp-banner__text { opacity: .82; }
.sp-banner__action {
  display: inline-flex; align-items: center; gap: 4px; flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-sm);
  background: var(--bg-surface); color: var(--text-primary); font-size: 13px; line-height: 18px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.sp-banner__action:hover, .sp-banner__action.is-hover { background: var(--bg-surface-2); }
.sp-banner--inverse .sp-banner__action { background: color-mix(in srgb, var(--text-inverse) 14%, transparent); color: var(--text-inverse); }
.sp-banner--inverse .sp-banner__action:hover, .sp-banner--inverse .sp-banner__action.is-hover { background: color-mix(in srgb, var(--text-inverse) 24%, transparent); }
.sp-banner--accent .sp-banner__action { background: var(--primary); color: var(--on-primary); height: 36px; padding: 0 16px; }
.sp-banner--accent .sp-banner__action:hover, .sp-banner--accent .sp-banner__action.is-hover { background: var(--primary-hover); }
.sp-banner__link { color: var(--tone-ink); font-weight: 600; text-decoration: none; }
.sp-banner__link:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-banner__close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 32px; height: 32px; margin-right: -8px; border: 0; border-radius: var(--radius-sm); background: none; color: inherit; opacity: .8; cursor: pointer; }
.sp-banner__close:hover, .sp-banner__close.is-hover { opacity: 1; background: color-mix(in srgb, currentColor 10%, transparent); }
.sp-banner__close .sp-i { width: 18px; height: 18px; }
.sp-banner--inverse :focus-visible, .sp-banner--inverse .is-focus { outline-color: var(--focus-ring-inverse); }
/* акцентная геометрия промо-баннера */
.sp-banner__geo { position: absolute; right: 28%; top: -28px; width: 96px; height: 96px; border-radius: var(--radius-full); background: var(--sun-300); pointer-events: none; }
.sp-banner__geo::after { content: ""; position: absolute; left: -64px; top: 52px; width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--sun-500); transform: rotate(18deg); }
.sp-banner--accent > :not(.sp-banner__geo) { position: relative; }
.sp-banner--center .sp-banner__content { justify-content: center; }
/* мобильная раскладка: медиа-запрос + модификатор --stacked */
.sp-banner--stacked { padding: 10px var(--space-4) 12px; align-items: flex-start; flex-wrap: wrap; }
.sp-banner--stacked .sp-banner__content { flex-basis: calc(100% - 40px); }
.sp-banner--stacked .sp-banner__action { height: 40px; margin-left: 32px; }
.sp-banner--stacked .sp-banner__close { position: absolute; right: 6px; top: 4px; width: 40px; height: 40px; margin: 0; }
.sp-banner--stacked.sp-banner--dismissible { padding-right: 52px; }
.sp-banner--stacked .sp-banner__geo { display: none; }
@media (max-width: 767px) {
  .sp-banner { padding: 10px var(--space-4) 12px; align-items: flex-start; flex-wrap: wrap; }
  .sp-banner__content { flex-basis: calc(100% - 40px); }
  .sp-banner__action { height: 40px; margin-left: 32px; }
  .sp-banner__close { position: absolute; right: 6px; top: 4px; width: 40px; height: 40px; margin: 0; }
  .sp-banner--dismissible { padding-right: 52px; }
  .sp-banner__geo { display: none; }
}

/* ---------- Progress ---------- */
.sp-progress { --h: 8px; --bar: var(--primary); display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.sp-progress--s { --h: 4px; } .sp-progress--l { --h: 12px; }
.sp-progress--accent { --bar: var(--accent); }
.sp-progress--info { --bar: var(--info); }
.sp-progress--success { --bar: var(--success); }
.sp-progress--warning { --bar: var(--warning); }
.sp-progress--danger { --bar: var(--danger); }
.sp-progress__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); font-size: 13px; line-height: 18px; }
.sp-progress__label { color: var(--text-primary); font-weight: 500; }
.sp-progress__value { color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-progress__value b { color: var(--text-primary); font-weight: 600; }
.sp-progress__track { position: relative; height: var(--h); border-radius: var(--radius-full); background: var(--bg-surface-2); overflow: hidden; }
.sp-progress__bar { display: block; height: 100%; border-radius: inherit; background: var(--bar); transition: width var(--duration-slow) var(--ease-standard); }
.sp-progress--indeterminate .sp-progress__bar { position: absolute; top: 0; width: 40%; animation: sp-fb-indeterminate 1.4s var(--ease-standard) infinite; }
.sp-progress__hint { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-progress__hint--danger { color: var(--danger-ink); }
/* сегментированный: заполненность профиля, шаги */
.sp-progress__segs { display: flex; gap: 4px; }
.sp-progress__seg { flex: 1; height: var(--h); border-radius: var(--radius-full); background: var(--bg-surface-3); }
.sp-progress__seg.is-done { background: var(--bar); }
.sp-progress__seg.is-current { background: linear-gradient(90deg, var(--bar) 50%, var(--bg-surface-3) 50%); }
/* круговой */
.sp-ring { --size: 64px; --bar: var(--primary); position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--size); height: var(--size); }
.sp-ring--s { --size: 40px; } .sp-ring--l { --size: 96px; }
.sp-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sp-ring__track { fill: none; stroke: var(--bg-surface-2); }
.sp-ring__bar { fill: none; stroke: var(--bar); stroke-linecap: round; transition: stroke-dashoffset var(--duration-slow) var(--ease-standard); }
.sp-ring__value { position: relative; font-size: 15px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-ring--s .sp-ring__value { font-size: 11px; }
.sp-ring--l .sp-ring__value { font-size: 22px; line-height: 28px; }
.sp-ring__unit { font-size: .7em; font-weight: 500; color: var(--text-secondary); }
.sp-ring--accent { --bar: var(--accent); } .sp-ring--success { --bar: var(--success); } .sp-ring--warning { --bar: var(--warning); } .sp-ring--danger { --bar: var(--danger); }
/* статус-точка */
.sp-status-dot { --dot: var(--text-tertiary); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; line-height: 18px; color: var(--text-primary); }
.sp-status-dot__dot { position: relative; flex: none; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--dot); }
.sp-status-dot--online { --dot: var(--success); }
.sp-status-dot--warning { --dot: var(--warning); }
.sp-status-dot--error { --dot: var(--danger); }
.sp-status-dot--busy { --dot: var(--accent); }
.sp-status-dot--offline .sp-status-dot__dot { background: transparent; box-shadow: inset 0 0 0 2px var(--text-tertiary); }
.sp-status-dot--pulse .sp-status-dot__dot::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-full); background: var(--dot); animation: sp-fb-pulse 1.6s var(--ease-exit) infinite; }
.sp-status-dot__meta { color: var(--text-secondary); }

/* ---------- Loading: полноэкранная загрузка и пресеты скелетонов ---------- */
.sp-spinner--on-inverse { border-color: color-mix(in srgb, var(--text-inverse) 28%, transparent); border-top-color: var(--text-inverse); }
.sp-loading-screen { position: fixed; inset: 0; z-index: var(--z-overlay); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-4); padding: var(--space-6); background: var(--bg-page); color: var(--text-secondary); font-size: 14px; line-height: 20px; text-align: center; }
.sp-loading-screen--overlay { background: color-mix(in srgb, var(--bg-page) 80%, transparent); }
.sp-loading-screen--static { position: relative; inset: auto; z-index: auto; }
.sp-loading-screen__mark { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--radius-lg); background: var(--primary); color: var(--on-primary); }
.sp-loading-inline { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-skel { display: flex; flex-direction: column; gap: var(--space-3); background: var(--bg-surface); border-radius: var(--radius-lg); padding: var(--space-5); }
.sp-skel__row { display: flex; align-items: center; gap: var(--space-3); }
.sp-skel__grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-skel--row { flex-direction: row; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); border-radius: 0; box-shadow: inset 0 -1px 0 var(--border); }
.sp-skel--flush { padding: 0; background: none; }
.sp-skel .sp-skeleton { margin: 0; }

/* ---------- EmptyState ---------- */
.sp-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-12) var(--space-6); color: var(--text-primary); }
.sp-empty__art { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 88px; height: 88px; margin-bottom: var(--space-3); border-radius: var(--radius-xl); background: var(--bg-surface-2); color: var(--text-secondary); }
.sp-empty__art .sp-i { width: 36px; height: 36px; }
.sp-empty__art .sp-i svg { stroke-width: 1.5; }
.sp-empty__art::after { content: ""; position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: var(--radius-full); background: var(--accent); box-shadow: 0 0 0 4px var(--bg-surface); }
.sp-empty__title { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.sp-empty__text { max-width: 400px; margin: 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-empty__text q { quotes: "«" "»"; color: var(--text-primary); font-weight: 500; }
.sp-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-4); }
.sp-empty__steps { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-4) 0 0; padding: 0; list-style: none; text-align: left; font-size: 14px; line-height: 20px; }
.sp-empty__steps li { display: flex; align-items: center; gap: var(--space-3); }
.sp-empty__step-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--bg-surface-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-empty__steps li.is-done .sp-empty__step-n { background: var(--success-soft); color: var(--success-ink); }
.sp-empty__steps li.is-done { color: var(--text-secondary); }
.sp-empty--compact { padding: var(--space-8) var(--space-4); gap: var(--space-1); }
.sp-empty--compact .sp-empty__art { width: 56px; height: 56px; border-radius: var(--radius-lg); margin-bottom: var(--space-2); }
.sp-empty--compact .sp-empty__art .sp-i { width: 24px; height: 24px; }
.sp-empty--compact .sp-empty__art::after { width: 12px; height: 12px; right: -3px; top: -3px; box-shadow: 0 0 0 3px var(--bg-surface); }
.sp-empty--compact .sp-empty__title { font-size: 15px; line-height: 22px; }
.sp-empty--compact .sp-empty__text { font-size: 13px; line-height: 18px; }
.sp-empty--compact .sp-empty__actions { margin-top: var(--space-3); }
.sp-empty--danger .sp-empty__art { background: var(--danger-soft); color: var(--danger-ink); }
.sp-empty--danger .sp-empty__art::after, .sp-empty--muted .sp-empty__art::after { display: none; }
.sp-empty--accent .sp-empty__art { background: var(--accent-soft); color: var(--accent-ink); }
.sp-empty--accent .sp-empty__art::after { background: var(--primary); }
.sp-empty--on-page .sp-empty__art::after { box-shadow: 0 0 0 4px var(--bg-page); }
@media (max-width: 767px) {
  .sp-empty { padding: var(--space-10) var(--space-4); }
  .sp-empty__actions { flex-direction: column; align-self: stretch; }
  .sp-empty__actions .sp-btn { width: 100%; }
}

/* ---------- ErrorPage ---------- */
.sp-error-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: var(--space-16) var(--space-6); background: var(--bg-page); color: var(--text-primary); }
.sp-error-page--inline { min-height: 0; }
.sp-error-page__inner { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 560px; width: 100%; }
.sp-error-page__code { position: relative; display: inline-flex; align-items: center; margin: 0 0 var(--space-6); font-size: 144px; line-height: 1; font-weight: 700; letter-spacing: -0.05em; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.sp-error-page__code { isolation: isolate; }
.sp-error-page__code span { position: relative; }
.sp-error-page__code span:nth-child(2) { color: var(--on-accent); }
.sp-error-page__code--500 span:nth-child(2) { color: var(--text-primary); }
/* акцентная геометрия: жёлтый круг за цифрой и повернутая плашка */
.sp-error-page__code::before { content: ""; position: absolute; left: 50%; top: 50%; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: var(--radius-full); background: var(--accent); }
.sp-error-page__code::after { content: ""; position: absolute; right: -28px; top: -6px; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--primary-soft); transform: rotate(16deg); z-index: -1; }
.sp-error-page__code--500::before { background: var(--bg-surface-3); }
.sp-error-page__art { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 120px; height: 120px; margin-bottom: var(--space-6); border-radius: var(--radius-2xl); background: var(--bg-surface); color: var(--text-primary); }
.sp-error-page__art .sp-i { width: 48px; height: 48px; position: relative; }
.sp-error-page__art .sp-i svg { stroke-width: 1.5; }
.sp-error-page__art::before { content: ""; position: absolute; right: -10px; top: -10px; width: 36px; height: 36px; border-radius: var(--radius-full); background: var(--accent); }
.sp-error-page__title { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 var(--space-3); }
.sp-error-page__text { font-size: 17px; line-height: 26px; color: var(--text-secondary); margin: 0; max-width: 460px; }
.sp-error-page__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); margin-top: var(--space-8); }
.sp-error-page__search { width: 100%; max-width: 400px; margin-top: var(--space-6); }
.sp-error-page__meta { display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-6); padding: 4px 4px 4px 12px; border-radius: var(--radius-full); background: var(--bg-surface-2); font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-error-page__meta code { font-family: var(--font-mono); font-size: 12px; color: var(--text-primary); }
.sp-error-page__copy { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 0; border-radius: var(--radius-full); background: none; color: var(--text-secondary); cursor: pointer; }
.sp-error-page__copy:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.sp-error-page__copy .sp-i { width: 14px; height: 14px; }
.sp-error-page__foot { margin-top: var(--space-6); font-size: 14px; line-height: 20px; color: var(--text-secondary); }
/* мобильная раскладка: медиа-запрос + модификатор --compact для витрины */
@media (max-width: 767px) {
  .sp-error-page { padding: var(--space-10) var(--space-4); align-items: flex-start; }
  .sp-error-page__code { font-size: 96px; }
  .sp-error-page__code::before { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
  .sp-error-page__title { font-size: 24px; line-height: 32px; }
  .sp-error-page__text { font-size: 15px; line-height: 22px; }
  .sp-error-page__actions { flex-direction: column; align-self: stretch; }
  .sp-error-page__actions .sp-btn { width: 100%; }
  .sp-error-page__art { width: 96px; height: 96px; }
}
.sp-error-page--compact { padding: var(--space-10) var(--space-4); }
.sp-error-page--compact .sp-error-page__code { font-size: 96px; }
.sp-error-page--compact .sp-error-page__code::before { width: 76px; height: 76px; margin: -38px 0 0 -38px; }
.sp-error-page--compact .sp-error-page__title { font-size: 24px; line-height: 32px; }
.sp-error-page--compact .sp-error-page__text { font-size: 15px; line-height: 22px; }
.sp-error-page--compact .sp-error-page__actions { flex-direction: column; align-self: stretch; }
.sp-error-page--compact .sp-error-page__actions .sp-btn { width: 100%; }
.sp-error-page--compact .sp-error-page__art { width: 96px; height: 96px; }

/* ---------- Tour — экскурсия: затемнение с вырезом под элемент + поповер с шагами ---------- */
.sp-tour { position: fixed; inset: 0; z-index: var(--z-modal); pointer-events: none; }
.sp-tour__hole {
  position: absolute; pointer-events: auto; border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px var(--bg-overlay), 0 0 0 3px var(--accent);
  animation: sp-fb-in var(--duration-base) var(--ease-enter);
}
.sp-tour__hole--round { border-radius: var(--radius-full); }
.sp-tour .sp-popover { position: absolute; pointer-events: auto; width: 320px; }
.sp-tour__count { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-tertiary); font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.sp-tour__actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.sp-tour__actions .sp-btn--ghost { margin-right: auto; }
.sp-tour__dots { display: inline-flex; gap: 6px; margin-right: var(--space-2); }
.sp-tour__dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--bg-surface-3); }
.sp-tour__dot.is-active { background: var(--primary); }
.sp-tour--static { position: relative; inset: auto; pointer-events: auto; }
.sp-tour--static .sp-tour__hole { box-shadow: 0 0 0 3px var(--accent); }

/* ==========================================================================
   50 — Данные и графики: Table, DataList, Card, MetricCard, Calendar,
   MediaGrid, Tree, LineChart, BarChart, PieChart, Sparkline, ChartKit.
   Цвета серий — только --data-1…8 (через .sp-s1…8 → --c), сетка --data-grid,
   подписи осей --text-tertiary.
   ========================================================================== */

/* ---------- Общий чекбокс выбора (строки, плитки, узлы дерева) ---------- */
.sp-selbox { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; cursor: pointer; }
.sp-selbox input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.sp-selbox__box { width: 18px; height: 18px; border-radius: min(var(--radius-sm), 5px); border: 1.5px solid var(--border-control); background: var(--bg-surface); display: inline-flex; align-items: center; justify-content: center; transition: background-color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); }
.sp-selbox__box::after { content: ""; width: 5px; height: 9px; border: solid var(--on-primary); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); opacity: 0; }
.sp-selbox:hover .sp-selbox__box, .sp-selbox.is-hover .sp-selbox__box { border-color: var(--text-secondary); }
.sp-selbox input:checked + .sp-selbox__box, .sp-selbox.is-checked .sp-selbox__box,
.sp-selbox.is-indeterminate .sp-selbox__box { background: var(--primary); border-color: var(--primary); }
.sp-selbox input:checked + .sp-selbox__box::after, .sp-selbox.is-checked .sp-selbox__box::after { opacity: 1; }
.sp-selbox.is-indeterminate .sp-selbox__box::after { opacity: 1; width: 10px; height: 0; border-width: 0 0 2px 0; transform: none; }
.sp-selbox input:focus-visible + .sp-selbox__box, .sp-selbox.is-focus .sp-selbox__box { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-selbox.is-focus { outline: none; }
.sp-selbox input:disabled + .sp-selbox__box, .sp-selbox.is-disabled .sp-selbox__box { background: var(--bg-surface-2); border-color: var(--border); cursor: not-allowed; }
@media (max-width: 767px) { .sp-selbox { width: 40px; height: 40px; margin: -10px; } }

/* ---------- Иконочная кнопка в данных ---------- */
.sp-dbtn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--control-s); height: var(--control-s); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.sp-dbtn .sp-i { width: 18px; height: 18px; }
.sp-dbtn:hover, .sp-dbtn.is-hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-dbtn:active, .sp-dbtn.is-active { background: var(--bg-surface-3); }
.sp-dbtn:disabled, .sp-dbtn.is-disabled { color: var(--text-disabled); background: transparent; cursor: not-allowed; }
.sp-dbtn--danger:hover, .sp-dbtn--danger.is-hover { background: var(--danger-soft); color: var(--danger-ink); }
@media (max-width: 767px) { .sp-dbtn { width: var(--control-m); height: var(--control-m); } }

/* ---------- Сегментный переключатель (Месяц/Неделя/Список, Неделя/Месяц/Год) ---------- */
.sp-chart-period, .sp-calendar__views { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-md); background: var(--bg-surface-2); }
.sp-chart-period__btn, .sp-calendar__view { height: 30px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.sp-chart-period__btn:hover, .sp-calendar__view:hover, .sp-chart-period__btn.is-hover, .sp-calendar__view.is-hover { color: var(--text-primary); }
.sp-chart-period__btn[aria-pressed="true"], .sp-calendar__view[aria-pressed="true"], .sp-chart-period__btn.is-selected, .sp-calendar__view.is-selected { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.sp-chart-period__btn:disabled, .sp-chart-period__btn.is-disabled { color: var(--text-disabled); cursor: not-allowed; }
@media (max-width: 767px) { .sp-chart-period__btn, .sp-calendar__view { height: 36px; } }

/* ==========================================================================
   Table
   ========================================================================== */
.sp-table { background: var(--bg-surface); border-radius: var(--radius-xl); color: var(--text-primary); overflow: hidden; }
.sp-table__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-5) var(--space-6) var(--space-4); }
.sp-table__search { flex: 0 1 280px; }
.sp-table__chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sp-table__chip { display: inline-flex; align-items: center; gap: 6px; height: var(--control-s); padding: 0 var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: var(--bg-surface); color: var(--text-primary); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.sp-table__chip:hover, .sp-table__chip.is-hover { background: var(--bg-sunken); border-color: var(--border-control); }
.sp-table__chip[aria-pressed="true"], .sp-table__chip.is-selected { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sp-table__chip .sp-counter { background: var(--bg-surface-3); color: var(--text-secondary); }
.sp-table__chip[aria-pressed="true"] .sp-counter, .sp-table__chip.is-selected .sp-counter { background: var(--accent); color: var(--on-accent); }
.sp-table__select { width: auto; min-width: 150px; }
.sp-table__reset { margin-left: auto; }
.sp-table__bulk { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin: 0 var(--space-4) var(--space-3); padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); }
.sp-table__bulk-count { font-weight: 600; font-size: 14px; margin-right: auto; }
.sp-table__scroll { overflow: auto; max-height: var(--table-max-h, none); }
.sp-table__table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
.sp-table__th { position: sticky; top: 0; z-index: var(--z-raised); background: var(--bg-surface); text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-secondary); padding: 10px var(--space-3); border-bottom: 1px solid var(--border); white-space: nowrap; }
.sp-table__th:first-child, .sp-table__td:first-child { padding-left: var(--space-6); }
.sp-table__th:last-child, .sp-table__td:last-child { padding-right: var(--space-6); }
.sp-table__th--num, .sp-table__td--num { text-align: right; }
.sp-table__th--check, .sp-table__td--check { width: 44px; padding-right: 0; }
.sp-table__th--tight, .sp-table__td--tight { width: 1%; white-space: nowrap; }
.sp-table__sort { display: inline-flex; align-items: center; gap: 4px; margin: -4px -6px; padding: 4px 6px; border: 0; border-radius: var(--radius-xs); background: none; color: inherit; font: inherit; cursor: pointer; }
.sp-table__sort .sp-i { width: 14px; height: 14px; color: var(--text-tertiary); }
.sp-table__sort:hover, .sp-table__sort.is-hover { color: var(--text-primary); background: var(--bg-surface-2); }
.sp-table__th[aria-sort="ascending"] .sp-table__sort, .sp-table__th[aria-sort="descending"] .sp-table__sort { color: var(--text-primary); }
.sp-table__th[aria-sort="ascending"] .sp-table__sort .sp-i, .sp-table__th[aria-sort="descending"] .sp-table__sort .sp-i { color: var(--text-primary); }
.sp-table__td { padding: 14px var(--space-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.sp-table__td--num { font-family: var(--font-mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-table__row { transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-table__row:hover, .sp-table__row.is-hover { background: var(--bg-sunken); }
.sp-table__row.is-selected { background: var(--primary-soft); }
.sp-table__row.is-disabled { color: var(--text-disabled); }
/* Правка по месту: строка на --bg-sunken, в ячейках поля S, справа «Сохранить» и «Отмена» */
.sp-table__row.is-editing { background: var(--bg-sunken); box-shadow: inset 3px 0 0 var(--primary); }
.sp-table__row.is-editing > .sp-table__td { vertical-align: middle; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.sp-table__row.is-editing .sp-control { --h: var(--control-s); background: var(--bg-surface); font-size: 14px; }
.sp-table__row.is-editing .sp-control--s { padding: 0 var(--space-2); }
.sp-table__row.is-editing .sp-table__edit-actions { display: inline-flex; gap: var(--space-1); justify-content: flex-end; }
.sp-table__body > .sp-table__row:last-child > .sp-table__td { border-bottom: 0; }
.sp-table__media { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.sp-table__thumb { flex: none; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--bg-surface-2); background-size: cover; background-position: center; }
.sp-table__title { font-weight: 500; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-table__td--primary { min-width: 240px; }
.sp-table__sub { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-table__actions { display: inline-flex; gap: 2px; justify-content: flex-end; }
.sp-table__expander .sp-i { transition: transform var(--duration-base) var(--ease-standard); }
.sp-table__row.is-open .sp-table__expander .sp-i { transform: rotate(180deg); }
.sp-table__details > .sp-table__td { background: var(--bg-sunken); padding-top: var(--space-4); padding-bottom: var(--space-5); }
.sp-table__row.is-open > .sp-table__td { border-bottom-color: transparent; }
.sp-table__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
/* плотность */
.sp-table--compact .sp-table__td { padding-top: 8px; padding-bottom: 8px; }
.sp-table--compact .sp-table__th { padding-top: 8px; padding-bottom: 8px; }
.sp-table--compact .sp-table__thumb { width: 32px; height: 32px; }
.sp-table--compact .sp-table__table { font-size: 13px; }
/* скелетон и пустое */
.sp-table__row.is-loading .sp-skeleton { height: 12px; }
.sp-table__empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-2); padding: var(--space-12) var(--space-6); }
.sp-table__empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-secondary); margin-bottom: var(--space-2); }
.sp-table__empty-icon .sp-i { width: 26px; height: 26px; }
.sp-table__empty-title { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0; }
.sp-table__empty-text { color: var(--text-secondary); margin: 0 0 var(--space-3); max-width: 360px; }
/* карточки: принудительно (--cards) и на мобильных (--stack) */
.sp-table--cards .sp-table__table, .sp-table--cards .sp-table__body { display: block; }
.sp-table--cards .sp-table__head { display: none; }
.sp-table--cards .sp-table__row { display: grid; grid-template-columns: auto 1fr auto; gap: 6px var(--space-3); padding: var(--space-4); margin: 0 var(--space-3) var(--space-3); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border); }
.sp-table--cards .sp-table__td { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); grid-column: 1 / -1; padding: 0 !important; border: 0; font-size: 14px; }
.sp-table--cards .sp-table__td[data-label]::before { content: attr(data-label); color: var(--text-secondary); font-family: var(--font-sans); font-size: 13px; }
.sp-table--cards .sp-table__td--check { grid-column: 1; grid-row: 1; width: auto; }
.sp-table--cards .sp-table__td--primary { grid-column: 2; grid-row: 1; padding-bottom: 6px !important; min-width: 0; }
.sp-table--cards .sp-table__td--actions { grid-column: 3; grid-row: 1; }
.sp-table--cards .sp-table__td--primary::before, .sp-table--cards .sp-table__td--actions::before { display: none; }
.sp-table--cards .sp-table__td--expand { width: auto; justify-content: center; border-top: 1px solid var(--border); padding-top: 4px !important; margin-top: 4px; }
.sp-table--cards .sp-table__td--actions .sp-dbtn:not(:last-child) { display: none; }
.sp-table--cards .sp-table__details { display: block; margin: -12px var(--space-3) var(--space-3); }
.sp-table--cards .sp-table__details > .sp-table__td { display: block; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: var(--space-4) !important; }
@media (max-width: 767px) {
  .sp-table { border-radius: var(--radius-lg); }
  .sp-table__toolbar { padding: var(--space-4); }
  .sp-table__search { flex: 1 1 100%; }
  .sp-table__chips { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .sp-table__chip { height: var(--control-m); }
  .sp-table__reset { margin-left: 0; }
  .sp-table--stack .sp-table__table, .sp-table--stack .sp-table__body { display: block; }
  .sp-table--stack .sp-table__head { display: none; }
  .sp-table--stack .sp-table__row { display: grid; grid-template-columns: auto 1fr auto; gap: 6px var(--space-3); padding: var(--space-4); margin: 0 var(--space-3) var(--space-3); border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border); }
  .sp-table--stack .sp-table__td { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); grid-column: 1 / -1; padding: 0 !important; border: 0; font-size: 14px; }
  .sp-table--stack .sp-table__td[data-label]::before { content: attr(data-label); color: var(--text-secondary); font-family: var(--font-sans); font-size: 13px; }
  .sp-table--stack .sp-table__td--check { grid-column: 1; grid-row: 1; width: auto; }
  .sp-table--stack .sp-table__td--primary { grid-column: 2; grid-row: 1; padding-bottom: 6px !important; min-width: 0; }
  .sp-table--stack .sp-table__td--actions { grid-column: 3; grid-row: 1; }
  .sp-table--stack .sp-table__td--primary::before, .sp-table--stack .sp-table__td--actions::before { display: none; }
  .sp-table--stack .sp-table__td--expand { width: auto; justify-content: center; border-top: 1px solid var(--border); padding-top: 4px !important; margin-top: 4px; }
  .sp-table--stack .sp-table__td--actions .sp-dbtn:not(:last-child) { display: none; }
  .sp-table--stack .sp-table__details { display: block; margin: -12px var(--space-3) var(--space-3); }
  .sp-table--stack .sp-table__details > .sp-table__td { display: block; border-radius: 0 0 var(--radius-lg) var(--radius-lg); padding: var(--space-4) !important; }
  .sp-table__foot { padding: var(--space-3) var(--space-4); }
}

/* ==========================================================================
   DataList
   ========================================================================== */
.sp-datalist { list-style: none; margin: 0; padding: 0; background: var(--bg-surface); border-radius: var(--radius-xl); color: var(--text-primary); }
.sp-datalist--plain { background: transparent; border-radius: 0; }
.sp-datalist__item { position: relative; display: flex; align-items: center; gap: var(--space-3); min-height: 64px; padding: var(--space-3) var(--space-5); border-radius: var(--radius-md); }
.sp-datalist--divided .sp-datalist__item { border-radius: 0; }
.sp-datalist--divided .sp-datalist__item + .sp-datalist__item::before { content: ""; position: absolute; top: 0; left: var(--space-5); right: var(--space-5); height: 1px; background: var(--border); }
.sp-datalist--divided .sp-datalist__item:has(.sp-datalist__lead)+.sp-datalist__item::before { left: 72px; }
.sp-datalist--compact .sp-datalist__item { min-height: 48px; padding-top: var(--space-2); padding-bottom: var(--space-2); }
.sp-datalist__lead { flex: none; display: inline-flex; }
.sp-datalist__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-secondary); }
.sp-datalist__body { flex: 1 1 auto; min-width: 0; }
.sp-datalist__title { font-size: 15px; line-height: 20px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-datalist__meta { display: flex; flex-wrap: wrap; gap: 2px var(--space-2); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-datalist__meta > * + *::before { content: "·"; margin-right: var(--space-2); color: var(--text-tertiary); }
.sp-datalist__aside { flex: none; display: flex; align-items: center; gap: var(--space-2); color: var(--text-secondary); font-size: 13px; }
.sp-datalist__check { display: none; color: var(--primary-ink); }
.sp-datalist--interactive .sp-datalist__item { cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-datalist--interactive .sp-datalist__item:hover, .sp-datalist__item.is-hover { background: var(--bg-sunken); }
.sp-datalist__item:focus-visible, .sp-datalist__item.is-focus { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sp-datalist__item.is-selected, .sp-datalist__item[aria-selected="true"] { background: var(--primary-soft); }
.sp-datalist__item.is-selected .sp-datalist__check, .sp-datalist__item[aria-selected="true"] .sp-datalist__check { display: inline-flex; }
.sp-datalist__item.is-selected .sp-datalist__title, .sp-datalist__item[aria-selected="true"] .sp-datalist__title { color: var(--primary-ink); }
.sp-datalist__item.is-disabled, .sp-datalist__item[aria-disabled="true"] { cursor: not-allowed; background: transparent; }
.sp-datalist__item.is-disabled .sp-datalist__title, .sp-datalist__item.is-disabled .sp-datalist__meta, .sp-datalist__item[aria-disabled="true"] .sp-datalist__title { color: var(--text-disabled); }
.sp-datalist__item.is-disabled .sp-datalist__lead { opacity: var(--opacity-disabled); }
/* Выполнено: галочка успеха, текст приглушён, действие скрыто — для чек-листов и очередей задач */
.sp-datalist__item.is-done .sp-datalist__title { color: var(--text-secondary); font-weight: 400; }
.sp-datalist__item.is-done .sp-datalist__meta { color: var(--text-tertiary); }
.sp-datalist__item.is-done .sp-datalist__icon { background: var(--success-soft); color: var(--success-ink); }
.sp-datalist__item.is-done .sp-datalist__aside > .sp-btn { display: none; }
.sp-datalist__done { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--success-ink); }
.sp-datalist__done .sp-i { width: 16px; height: 16px; }
@media (max-width: 767px) { .sp-datalist__item { min-height: 56px; } .sp-datalist--compact .sp-datalist__item { min-height: var(--control-touch); } .sp-datalist__title { white-space: normal; } }
@media (max-width: 767px) { .sp-datalist { border-radius: var(--radius-lg); } .sp-datalist__item { padding-left: var(--space-4); padding-right: var(--space-3); } }

/* ==========================================================================
   Card (дополняет базовую .sp-card)
   ========================================================================== */
.sp-card__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.sp-card--s .sp-card__title { font-size: 17px; line-height: 24px; }
.sp-card__head > .sp-btn, .sp-card__head > .sp-card__action { flex: none; }
.sp-card__head:has(+ .sp-card__body) { margin-bottom: var(--space-4); }
.sp-card--interactive { display: block; width: 100%; text-align: left; border: 0; font: inherit; color: inherit; }
.sp-card--interactive:focus-visible, .sp-card--interactive.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-card--interactive:active, .sp-card--interactive.is-active { transform: translateY(1px); }
.sp-card--selected .sp-card__selmark { display: inline-flex; }
.sp-card__selmark { display: none; position: absolute; top: var(--space-4); right: var(--space-4); width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); align-items: center; justify-content: center; }
.sp-card__selmark .sp-i { width: 14px; height: 14px; }
.sp-card--selected { position: relative; }
.sp-card--media { padding: 0; overflow: hidden; }
.sp-card__media { aspect-ratio: 16 / 9; background: var(--bg-surface-2); background-size: cover; background-position: center; }
.sp-card__content { padding: var(--space-5) var(--space-6) var(--space-6); }
.sp-card--promo { display: flex; align-items: center; gap: var(--space-6); }
.sp-card__promo-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-ink); }
.sp-card__promo-icon .sp-i { width: 30px; height: 30px; }
.sp-card--promo .sp-card__body { flex: 1 1 auto; min-width: 0; }
.sp-card--promo .sp-card__desc { margin-bottom: 0; }
.sp-card--horizontal { display: flex; padding: 0; overflow: hidden; }
.sp-card--horizontal .sp-card__media { flex: 0 0 38%; aspect-ratio: auto; min-height: 160px; }
.sp-card--horizontal .sp-card__content { flex: 1 1 auto; padding: var(--space-5) var(--space-6); }
.sp-card.is-disabled { cursor: not-allowed; box-shadow: none; transform: none; }
.sp-card.is-disabled > * { opacity: var(--opacity-disabled); }
.sp-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; font-size: 13px; color: var(--text-secondary); }
@media (max-width: 767px) {
  .sp-card--promo { flex-direction: column; align-items: flex-start; gap: var(--space-4); }
  .sp-card--horizontal { flex-direction: column; }
  .sp-card--horizontal .sp-card__media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .sp-card__content { padding: var(--space-4) var(--space-5) var(--space-5); }
  .sp-card__title { font-size: 17px; line-height: 24px; }
}

/* ==========================================================================
   MetricCard
   ========================================================================== */
.sp-metric-row { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.sp-metric { position: relative; display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; padding: var(--space-5); border-radius: var(--radius-xl); background: var(--bg-surface); color: var(--text-primary); }
.sp-metric--sunken { background: var(--bg-sunken); border-radius: var(--radius-lg); }
.sp-metric__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sp-metric__icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-secondary); margin-bottom: var(--space-2); }
.sp-metric__icon .sp-i { width: 18px; height: 18px; }
.sp-metric__value { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -0.01em; }
.sp-metric__unit { font-size: 17px; font-weight: 500; color: var(--text-secondary); margin-left: 2px; }
.sp-metric__label { font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.sp-metric__foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); }
.sp-metric__delta { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.sp-metric__delta--up { color: var(--success-ink); }
.sp-metric__delta--down { color: var(--danger-ink); }
.sp-metric__delta-note { color: var(--text-tertiary); font-weight: 400; margin-left: 4px; }
.sp-metric__stars { display: inline-flex; gap: 2px; color: var(--accent); }
.sp-metric__stars .sp-i { width: 16px; height: 16px; }
.sp-metric__stars .sp-i svg { fill: currentColor; }
.sp-metric__stars .is-empty { color: var(--bg-surface-3); }
.sp-metric__empty { color: var(--text-tertiary); font-size: 28px; line-height: 36px; font-weight: 600; }
.sp-metric__hint { font-size: 13px; color: var(--text-tertiary); }
.sp-metric--interactive { cursor: pointer; border: 0; text-align: left; font: inherit; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-metric--interactive:hover, .sp-metric--interactive.is-hover { background: var(--bg-sunken); }
.sp-metric.is-loading .sp-skeleton { margin: 4px 0; }
@media (max-width: 767px) { .sp-metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); } .sp-metric { padding: var(--space-4); border-radius: var(--radius-lg); } .sp-metric__value { font-size: 24px; line-height: 32px; } }

/* ==========================================================================
   Calendar
   ========================================================================== */
.sp-calendar { background: var(--bg-surface); border-radius: var(--radius-xl); color: var(--text-primary); padding: var(--space-5) var(--space-6) var(--space-6); }
.sp-calendar__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.sp-calendar__title { margin: 0 var(--space-2) 0 0; font-size: 20px; line-height: 28px; font-weight: 600; min-width: 150px; }
.sp-calendar__nav { display: inline-flex; gap: 2px; }
.sp-calendar__views { margin-left: auto; }
.sp-calendar__weekdays, .sp-calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sp-calendar__weekday { padding: 0 var(--space-2) var(--space-2); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-secondary); }
.sp-calendar__weekday.is-weekend { color: var(--text-tertiary); }
.sp-calendar__grid { border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.sp-calendar__day { position: relative; display: flex; flex-direction: column; gap: 3px; min-height: 112px; min-width: 0; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.sp-calendar__grid .sp-calendar__day:nth-child(7) { border-top-right-radius: var(--radius-md); }
.sp-calendar__day.is-weekend { background: var(--bg-sunken); }
.sp-calendar__day.is-outside .sp-calendar__date { color: var(--text-disabled); }
.sp-calendar__day.is-past .sp-calendar__date { color: var(--text-tertiary); }
.sp-calendar__day-head { display: flex; align-items: center; justify-content: space-between; min-height: 26px; }
.sp-calendar__date { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: var(--radius-full); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-calendar__day.is-today .sp-calendar__date { background: var(--primary); color: var(--on-primary); }
.sp-calendar__day.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.sp-calendar__add { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 0; border-radius: var(--radius-sm); background: var(--bg-surface-2); color: var(--text-secondary); cursor: pointer; opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-calendar__add .sp-i { width: 16px; height: 16px; }
.sp-calendar__day:hover .sp-calendar__add, .sp-calendar__day.is-hover .sp-calendar__add, .sp-calendar__add:focus-visible { opacity: 1; }
.sp-calendar__add:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.sp-calendar__day.is-drop { background: var(--info-soft); box-shadow: inset 0 0 0 2px var(--focus-ring); }
.sp-calendar__more { align-self: flex-start; margin-top: 1px; padding: 1px 6px; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text-link); font-size: 12px; line-height: 16px; font-weight: 500; cursor: pointer; }
.sp-calendar__more:hover { background: var(--bg-surface-2); }
/* пост-чип */
.sp-calendar__event { --dot: var(--text-tertiary); display: flex; align-items: center; gap: 5px; min-width: 0; height: 22px; padding: 0 6px; border: 0; border-radius: min(var(--radius-sm), 6px); background: var(--bg-surface-2); color: var(--text-primary); font-size: 12px; line-height: 16px; text-align: left; cursor: pointer; transition: box-shadow var(--duration-fast) var(--ease-standard); }
.sp-calendar__event::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--dot); }
.sp-calendar__event-time { flex: none; font-variant-numeric: tabular-nums; font-weight: 500; }
.sp-calendar__event-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-calendar__event.is-extra { display: none; }
.sp-calendar__event:hover, .sp-calendar__event.is-hover { box-shadow: inset 0 0 0 1px currentColor; }
.sp-calendar__event--scheduled { background: var(--info-soft); color: var(--info-ink); --dot: var(--info); }
.sp-calendar__event--published { background: var(--success-soft); color: var(--success-ink); --dot: var(--success); }
.sp-calendar__event--review { background: var(--warning-soft); color: var(--warning-ink); --dot: var(--warning); }
.sp-calendar__event--error { background: var(--danger-soft); color: var(--danger-ink); --dot: var(--danger); }
.sp-calendar__event--draft { background: var(--bg-surface-2); color: var(--text-primary); --dot: var(--text-tertiary); }
.sp-calendar__event.is-dragging { box-shadow: var(--shadow-md); transform: rotate(-2deg); position: relative; z-index: var(--z-raised); cursor: grabbing; }
.sp-calendar__event.is-ghost { opacity: .4; box-shadow: inset 0 0 0 1px currentColor; }
.sp-calendar__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); font-size: 12px; color: var(--text-secondary); }
.sp-calendar__legend-item { display: inline-flex; align-items: center; gap: 6px; }
.sp-calendar__legend-item::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--dot); }
/* неделя */
.sp-calendar__week { position: relative; display: grid; grid-template-columns: 56px repeat(7, minmax(96px, 1fr)); overflow: auto; max-height: var(--calendar-week-h, 560px); border-top: 1px solid var(--border); }
.sp-calendar__wk-head { position: sticky; top: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; padding: var(--space-2) 0; background: var(--bg-surface); border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-secondary); }
.sp-calendar__wk-head .sp-calendar__date { font-size: 15px; color: var(--text-primary); }
.sp-calendar__wk-head.is-today .sp-calendar__date { background: var(--primary); color: var(--on-primary); }
.sp-calendar__wk-head.is-weekend { color: var(--text-tertiary); }
.sp-calendar__hours { grid-column: 1; }
.sp-calendar__hour { height: 48px; padding: 4px var(--space-2) 0 0; text-align: right; font-size: 11px; line-height: 1; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sp-calendar__col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% 48px; }
.sp-calendar__col.is-weekend { background-color: var(--bg-sunken); }
.sp-calendar__slot-event { position: absolute; left: 3px; right: 3px; display: flex; flex-direction: column; align-items: stretch; gap: 1px; height: auto; padding: 4px 6px; border-radius: min(var(--radius-sm), 6px); overflow: hidden; }
.sp-calendar__slot-event::before { display: none; }
.sp-calendar__slot-event .sp-calendar__event-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-calendar__slot-event.is-long .sp-calendar__event-text { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sp-calendar__slot-event { box-shadow: inset 3px 0 0 var(--dot); }
.sp-calendar__now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 1; pointer-events: none; }
.sp-calendar__now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: var(--radius-full); background: var(--danger); }
/* список (вид «Список» и мобильная версия месяца) */
.sp-calendar--list .sp-calendar__weekdays { display: none; }
.sp-calendar--list .sp-calendar__grid { display: block; border: 0; }
.sp-calendar--list .sp-calendar__day { flex-direction: row; align-items: flex-start; gap: var(--space-3); min-height: 0; padding: var(--space-3) 0; border-right: 0; background: none; box-shadow: none; }
.sp-calendar--list .sp-calendar__day.is-empty, .sp-calendar--list .sp-calendar__day.is-outside { display: none; }
.sp-calendar--list .sp-calendar__day-head { flex: none; width: 56px; flex-direction: column; align-items: flex-start; }
.sp-calendar--list .sp-calendar__day-head::after { content: attr(data-weekday); font-size: 12px; color: var(--text-secondary); }
.sp-calendar--list .sp-calendar__add, .sp-calendar--list .sp-calendar__more { display: none; }
.sp-calendar--list .sp-calendar__event.is-extra { display: flex; }
.sp-calendar--list .sp-calendar__events { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-calendar--list .sp-calendar__event { height: auto; min-height: 40px; padding: 8px 10px; font-size: 14px; line-height: 20px; }
.sp-calendar--list .sp-calendar__day.is-today .sp-calendar__date { background: var(--primary); }
.sp-calendar__events { display: contents; }
@media (max-width: 767px) {
  .sp-calendar { padding: var(--space-4); border-radius: var(--radius-lg); }
  .sp-calendar__title { flex: 1 1 100%; }
  .sp-calendar__views { margin-left: 0; }
  .sp-calendar__add { opacity: 1; }
  .sp-calendar--month .sp-calendar__weekdays { display: none; }
  .sp-calendar--month .sp-calendar__grid { display: block; border: 0; }
  .sp-calendar--month .sp-calendar__day { flex-direction: row; align-items: flex-start; gap: var(--space-3); min-height: 0; padding: var(--space-3) 0; border-right: 0; background: none; box-shadow: none; }
  .sp-calendar--month .sp-calendar__day.is-empty, .sp-calendar--month .sp-calendar__day.is-outside { display: none; }
  .sp-calendar--month .sp-calendar__day-head { flex: none; width: 56px; flex-direction: column; align-items: flex-start; }
  .sp-calendar--month .sp-calendar__day-head::after { content: attr(data-weekday); font-size: 12px; color: var(--text-secondary); }
  .sp-calendar--month .sp-calendar__add, .sp-calendar--month .sp-calendar__more { display: none; }
  .sp-calendar--month .sp-calendar__events { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .sp-calendar--month .sp-calendar__event { display: flex; height: auto; min-height: 40px; padding: 8px 10px; font-size: 14px; line-height: 20px; }
  .sp-calendar--month .sp-calendar__event.is-extra { display: flex; }
  .sp-calendar__week { grid-template-columns: 44px repeat(7, 120px); }
}

/* ==========================================================================
   MediaGrid
   ========================================================================== */
.sp-media { container-type: inline-size; color: var(--text-primary); }
.sp-media__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4); }
.sp-media__toolbar .sp-control { flex: 0 1 260px; }
.sp-media__viewtoggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-md); background: var(--bg-surface-2); }
.sp-media__viewtoggle .sp-dbtn { width: 30px; height: 30px; }
.sp-media__viewtoggle .sp-dbtn[aria-pressed="true"] { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.sp-media__spacer { flex: 1 1 auto; }
.sp-media__grid { display: grid; gap: var(--space-4) var(--space-3); grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; }
@container (min-width: 520px) { .sp-media__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 760px) { .sp-media__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@container (min-width: 1100px) { .sp-media__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.sp-media__item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-media__tile { position: relative; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface-2); cursor: pointer; }
.sp-media__thumb { position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform var(--duration-slow) var(--ease-standard); }
.sp-media__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(19, 20, 29, .45) 0%, rgba(19, 20, 29, 0) 45%); opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-media__check { position: absolute; top: 8px; left: 8px; z-index: 1; opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-media__check .sp-selbox__box { border-color: var(--gray-0); background: rgba(19, 20, 29, .3); box-shadow: 0 0 0 1px rgba(19, 20, 29, .35); }
.sp-media__actions { position: absolute; top: 6px; right: 6px; z-index: 1; display: flex; gap: 4px; opacity: 0; transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-media__act { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; box-shadow: var(--shadow-xs); }
.sp-media__act .sp-i { width: 16px; height: 16px; }
.sp-media__act:hover { background: var(--bg-surface-2); }
.sp-media__tile:hover .sp-media__overlay, .sp-media__tile.is-hover .sp-media__overlay,
.sp-media__tile:hover .sp-media__check, .sp-media__tile.is-hover .sp-media__check, .sp-media__tile:focus-within .sp-media__check,
.sp-media__tile:hover .sp-media__actions, .sp-media__tile.is-hover .sp-media__actions, .sp-media__tile:focus-within .sp-media__actions { opacity: 1; }
.sp-media__tile:hover .sp-media__thumb, .sp-media__tile.is-hover .sp-media__thumb { transform: scale(1.03); }
.sp-media__tile:focus-visible, .sp-media__tile.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-media__tile.is-selected { box-shadow: 0 0 0 2px var(--bg-page), 0 0 0 4px var(--primary); }
.sp-media__tile.is-selected .sp-media__check { opacity: 1; }
.sp-media__tile.is-selected .sp-media__check .sp-selbox__box { background: var(--primary); border-color: var(--primary); }
.sp-media__tile.is-selected .sp-media__check .sp-selbox__box::after { opacity: 1; }
.sp-media--selecting .sp-media__check { opacity: 1; }
.sp-media__badge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: var(--radius-full); background: rgba(19, 20, 29, .72); color: var(--gray-0); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-media__badge .sp-i { width: 12px; height: 12px; }
.sp-media__badge .sp-i svg { fill: currentColor; }
.sp-media__name { font-size: 13px; line-height: 18px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-media__meta { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-media__meta .sp-i { width: 12px; height: 12px; }
.sp-media__meta--used { color: var(--success-ink); }
/* состояния загрузки и ошибки */
.sp-media__tile.is-loading { cursor: default; }
.sp-media__tile.is-loading .sp-skeleton { position: absolute; inset: 0; height: auto; border-radius: 0; }
.sp-media__progress { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-3); background: var(--bg-surface-2); color: var(--text-secondary); font-size: 12px; font-variant-numeric: tabular-nums; }
.sp-media__bar { width: 80%; height: 4px; border-radius: min(var(--radius-xs), 2px); background: var(--bg-surface-3); overflow: hidden; }
.sp-media__bar > span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.sp-media__tile.is-error { cursor: default; background: var(--danger-soft); }
.sp-media__error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: var(--space-3); text-align: center; color: var(--danger-ink); font-size: 12px; line-height: 16px; }
.sp-media__retry { border: 0; background: none; padding: 2px 4px; border-radius: var(--radius-xs); color: var(--danger-ink); font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* вид списком */
.sp-media--list .sp-media__grid { grid-template-columns: 1fr; gap: 0; }
.sp-media--list .sp-media__item { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 2px var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.sp-media--list .sp-media__tile { grid-row: span 2; width: 56px; border-radius: var(--radius-sm); }
.sp-media--list .sp-media__name, .sp-media--list .sp-media__meta { grid-column: 2; }
.sp-media--list .sp-media__check, .sp-media--list .sp-media__actions, .sp-media--list .sp-media__badge { display: none; }
@media (max-width: 767px) {
  .sp-media__toolbar .sp-control { flex: 1 1 100%; }
  .sp-media__check, .sp-media__actions { opacity: 1; }
  .sp-media__act { width: 36px; height: 36px; }
  .sp-media__actions .sp-media__act + .sp-media__act { display: none; }
}

/* ==========================================================================
   Tree
   ========================================================================== */
.sp-tree { list-style: none; margin: 0; padding: 0; color: var(--text-primary); font-size: 14px; line-height: 20px; }
.sp-tree__group { list-style: none; margin: 0; padding: 0; }
.sp-tree__item { position: relative; }
.sp-tree__row { --level: 0; position: relative; display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--space-2) 0 calc(var(--space-2) + var(--level) * 20px); border-radius: var(--radius-sm); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-tree__row:hover, .sp-tree__row.is-hover { background: var(--bg-surface-2); }
.sp-tree__item:focus-visible > .sp-tree__row, .sp-tree__row.is-focus { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sp-tree__item:focus-visible { outline: none; }
.sp-tree__row.is-selected, .sp-tree__item[aria-selected="true"] > .sp-tree__row { background: var(--primary-soft); color: var(--primary-ink); font-weight: 500; }
.sp-tree__row.is-disabled { color: var(--text-disabled); cursor: not-allowed; background: none; }
.sp-tree__toggle { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; margin: 0; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text-tertiary); cursor: pointer; }
.sp-tree__toggle .sp-i { width: 16px; height: 16px; transition: transform var(--duration-base) var(--ease-standard); }
.sp-tree__toggle:hover { color: var(--text-primary); background: var(--bg-surface-3); }
.sp-tree__item[aria-expanded="true"] > .sp-tree__row .sp-tree__toggle .sp-i, .sp-tree__row.is-open .sp-tree__toggle .sp-i { transform: rotate(90deg); }
.sp-tree__spacer { flex: none; width: 20px; }
.sp-tree__icon { flex: none; display: inline-flex; color: var(--text-secondary); }
.sp-tree__icon .sp-i { width: 18px; height: 18px; }
.sp-tree__row.is-selected .sp-tree__icon, .sp-tree__item[aria-selected="true"] > .sp-tree__row .sp-tree__icon { color: var(--primary-ink); }
.sp-tree__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-tree__count { flex: none; font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; font-weight: 400; }
.sp-tree__row.is-selected .sp-tree__count { color: var(--primary-ink); }
.sp-tree__grip { flex: none; display: inline-flex; color: var(--text-tertiary); opacity: 0; cursor: grab; }
.sp-tree__grip .sp-i { width: 14px; height: 14px; }
.sp-tree__row:hover .sp-tree__grip, .sp-tree__row.is-hover .sp-tree__grip, .sp-tree__row.is-dragging .sp-tree__grip { opacity: 1; }
.sp-tree__row.is-dragging { background: var(--bg-surface); box-shadow: var(--shadow-md); opacity: .92; }
.sp-tree__row.is-drop-inside { background: var(--info-soft); box-shadow: inset 0 0 0 2px var(--focus-ring); }
.sp-tree__row.is-drop-before::before, .sp-tree__row.is-drop-after::after { content: ""; position: absolute; left: calc(var(--space-2) + var(--level) * 20px); right: 0; height: 2px; border-radius: min(var(--radius-xs), 1px); background: var(--focus-ring); }
.sp-tree__row.is-drop-before::before { top: -1px; }
.sp-tree__row.is-drop-after::after { bottom: -1px; }
.sp-tree--lines .sp-tree__group { position: relative; }
@media (max-width: 767px) { .sp-tree__row { min-height: 44px; } .sp-tree__toggle { width: 32px; height: 32px; margin: 0 -6px; } .sp-tree__grip { opacity: 1; } }

/* ==========================================================================
   Графики: общий каркас
   ========================================================================== */
.sp-s1 { --c: var(--data-1); } .sp-s2 { --c: var(--data-2); } .sp-s3 { --c: var(--data-3); } .sp-s4 { --c: var(--data-4); }
.sp-s5 { --c: var(--data-5); } .sp-s6 { --c: var(--data-6); } .sp-s7 { --c: var(--data-7); } .sp-s8 { --c: var(--data-8); }
.sp-chart { position: relative; color: var(--text-primary); min-width: 0; }
.sp-chart--card { background: var(--bg-surface); border-radius: var(--radius-xl); padding: var(--space-6); }
.sp-chart__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.sp-chart__title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-chart__sub { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-chart__plot { position: relative; }
.sp-chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
.sp-chart__grid { stroke: var(--data-grid); stroke-width: 1; shape-rendering: crispEdges; }
.sp-chart__baseline { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.sp-chart__tick { fill: var(--text-tertiary); font-family: var(--font-sans); font-size: 12px; font-variant-numeric: tabular-nums; }
.sp-chart__cat { fill: var(--text-secondary); font-family: var(--font-sans); font-size: 13px; }
.sp-chart__value { fill: var(--text-primary); font-family: var(--font-sans); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-chart__line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sp-chart__area { fill: var(--c); fill-opacity: .1; stroke: none; }
.sp-chart--stacked .sp-chart__area { fill-opacity: .22; }
.sp-chart__dot { fill: var(--c); stroke: var(--bg-surface); stroke-width: 2; }
.sp-chart__cursor { stroke: var(--border-control); stroke-width: 1; shape-rendering: crispEdges; }
.sp-chart__bar { fill: var(--c); transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-chart__hit { fill: transparent; cursor: pointer; }
.sp-chart__hit:focus-visible { outline: none; stroke: var(--focus-ring); stroke-width: 2; }
.sp-chart.is-hovering .sp-chart__bar:not(.is-active) { opacity: .4; }
.sp-chart__bar.is-active { opacity: 1; }
.sp-chart__label { fill: var(--text-primary); font-family: var(--font-sans); font-size: 12px; font-weight: 500; }
.sp-chart__foot { margin-top: var(--space-3); }
.sp-chart__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-chart__table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-secondary); padding: 8px 0; border-bottom: 1px solid var(--border); }
.sp-chart__table td { padding: 10px 0; border-bottom: 1px solid var(--border); }
.sp-chart__table tr:last-child td { border-bottom: 0; }
.sp-chart__table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-chart__table-key { display: inline-flex; align-items: center; gap: var(--space-2); }
.sp-chart__table-key::before { content: ""; width: 10px; height: 10px; border-radius: min(var(--radius-xs), 3px); background: var(--c); }
.sp-chart__up { color: var(--success-ink); } .sp-chart__down { color: var(--danger-ink); }
/* тултип графика */
.sp-chart-tooltip { position: absolute; z-index: var(--z-tooltip); min-width: 160px; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border); font-size: 13px; line-height: 18px; pointer-events: none; }
.sp-chart-tooltip--static { position: relative; display: inline-block; }
.sp-chart-tooltip__date { font-size: 12px; line-height: 16px; color: var(--text-secondary); margin-bottom: 4px; }
.sp-chart-tooltip__row { display: flex; align-items: center; gap: var(--space-2); padding: 2px 0; }
.sp-chart-tooltip__key { flex: none; width: 12px; height: 2px; border-radius: min(var(--radius-xs), 1px); background: var(--c); }
.sp-chart-tooltip__key--rect { width: 10px; height: 10px; border-radius: min(var(--radius-xs), 3px); }
.sp-chart-tooltip__value { font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-chart-tooltip__name { color: var(--text-secondary); margin-left: auto; padding-left: var(--space-3); }
.sp-chart-tooltip__row .sp-chart-tooltip__value { order: 1; } .sp-chart-tooltip__row .sp-chart-tooltip__key { order: 0; } .sp-chart-tooltip__row .sp-chart-tooltip__name { order: 2; }
/* легенда */
.sp-chart-legend { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 18px; }
.sp-chart-legend--vertical { flex-direction: column; gap: var(--space-2); }
.sp-chart-legend__item { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 24px; padding: 2px 4px; margin: -2px -4px; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text-primary); font: inherit; text-align: left; }
button.sp-chart-legend__item { cursor: pointer; }
button.sp-chart-legend__item:hover, .sp-chart-legend__item.is-hover { background: var(--bg-surface-2); }
.sp-chart-legend__key { flex: none; width: 10px; height: 10px; border-radius: min(var(--radius-xs), 3px); background: var(--c); }
.sp-chart-legend__key--line { width: 14px; height: 2px; border-radius: min(var(--radius-xs), 1px); }
.sp-chart-legend__key--dot { border-radius: var(--radius-full); }
.sp-chart-legend__value { margin-left: auto; padding-left: var(--space-4); font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-chart-legend__pct { min-width: 44px; text-align: right; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sp-chart-legend__item.is-off, .sp-chart-legend__item[aria-pressed="false"] { color: var(--text-tertiary); }
.sp-chart-legend__item.is-off .sp-chart-legend__key, .sp-chart-legend__item[aria-pressed="false"] .sp-chart-legend__key { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-control); }
.sp-chart-legend__item.is-off .sp-chart-legend__key--line, .sp-chart-legend__item[aria-pressed="false"] .sp-chart-legend__key--line { height: 2px; box-shadow: none; background: var(--border-control); }
.sp-chart-legend--vertical .sp-chart-legend__item { display: flex; width: 100%; margin: 0; padding: 4px 6px; }
.sp-chart-legend__item.is-active { background: var(--bg-surface-2); }
/* состояния графика */
.sp-chart-state { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); min-height: var(--chart-h, 240px); padding: var(--space-6); text-align: center; color: var(--text-secondary); font-size: 14px; }
.sp-chart-state__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-secondary); }
.sp-chart-state__title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.sp-chart-state__text { margin: 0; max-width: 320px; }
.sp-chart-state--error .sp-chart-state__icon { background: var(--danger-soft); color: var(--danger-ink); }
.sp-chart-state--loading { align-items: stretch; justify-content: flex-end; padding: 0; }
.sp-chart-state__bars { display: flex; align-items: flex-end; gap: 12px; height: calc(var(--chart-h, 240px) - 24px); padding: 0 var(--space-2); border-bottom: 1px solid var(--data-grid); }
.sp-chart-state__bars .sp-skeleton { flex: 1; max-width: 24px; border-radius: var(--radius-xs) var(--radius-xs) 0 0; height: auto; }
.sp-chart-state__over { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: var(--shadow-sm); color: var(--text-secondary); white-space: nowrap; }
/* палитра */
.sp-chart-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-3); list-style: none; margin: 0; padding: 0; }
.sp-chart-palette__item { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; }
.sp-chart-palette__sw { flex: none; width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--c); }
.sp-chart-palette__name { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
/* кольцевая */
.sp-pie { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6) var(--space-8); }
.sp-pie__ring { position: relative; flex: none; width: var(--pie-size, 200px); }
.sp-pie__slice { fill: var(--c); stroke: var(--bg-surface); stroke-width: 2; stroke-linejoin: round; cursor: pointer; transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-pie.is-hovering .sp-pie__slice:not(.is-active) { opacity: .4; }
.sp-pie__slice:focus-visible { outline: none; stroke: var(--focus-ring); }
.sp-pie__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.sp-pie__total { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.01em; }
.sp-pie__caption { font-size: 12px; line-height: 16px; color: var(--text-secondary); max-width: 60%; }
.sp-pie .sp-chart-legend { flex: 1 1 240px; min-width: 0; }
.sp-chart__plot .sp-chart-tooltip { transform: translate(-50%, calc(-100% - 12px)); }
.sp-chart__plot .sp-chart-tooltip--right { transform: translate(12px, -50%); }
/* спарклайн */
.sp-spark { display: inline-block; vertical-align: middle; width: var(--spark-w, 96px); height: var(--spark-h, 28px); overflow: visible; }
.sp-spark .sp-chart__line { stroke-width: 1.5; }
.sp-spark .sp-chart__dot { stroke-width: 1.5; }
.sp-spark--muted { --c: var(--data-8); }
.sp-spark .sp-chart__bar.is-muted { fill: var(--data-8); opacity: .55; }
@media (max-width: 767px) {
  .sp-chart--card { padding: var(--space-4); border-radius: var(--radius-lg); }
  .sp-chart__tick { font-size: 11px; }
  .sp-pie { justify-content: center; }
}

/* ==========================================================================
   60-product — продуктовые компоненты «Умного постинга»:
   PostPreview, StoryPreview, LayoutEditor, PublicationCard, StatusBadge,
   Rating, CookieBanner, Accordion, StatsBlock.
   ========================================================================== */

/* ---------- Заглушки фото (превью-картинки; литеральные цвета допустимы) ---------- */
.sp-ph { position: relative; display: block; background-color: #c9b8a6; background-size: cover; background-position: center; }
.sp-ph--1 { background-image: radial-gradient(circle at 70% 30%, #ffd9a0 0 14%, transparent 15%), linear-gradient(160deg, #f6b17a 0%, #e0795a 45%, #6b3f5e 100%); }
.sp-ph--2 { background-image: radial-gradient(ellipse at 30% 80%, #9fd6b9 0 30%, transparent 31%), linear-gradient(200deg, #bfe3e8 0%, #7fb6c7 50%, #3d6a82 100%); }
.sp-ph--3 { background-image: radial-gradient(circle at 50% 60%, #f3e3c7 0 22%, transparent 23%), linear-gradient(135deg, #d9c2a7 0%, #a98467 60%, #6c4f3d 100%); }
.sp-ph--4 { background-image: radial-gradient(circle at 25% 35%, #ffe6ef 0 16%, transparent 17%), linear-gradient(170deg, #f0b8cc 0%, #b98ad0 55%, #5b4c8f 100%); }
.sp-ph--5 { background-image: linear-gradient(180deg, transparent 55%, #3c5a3a 56%), radial-gradient(circle at 60% 30%, #fff1b8 0 12%, transparent 13%), linear-gradient(180deg, #a8d0f0 0%, #d8ecf7 100%); }
.sp-ph--6 { background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 10px, transparent 10px 20px), linear-gradient(135deg, #3b3e68 0%, #1e1f2b 100%); }

/* ---------- Рамка телефона (общая для PostPreview / StoryPreview) ---------- */
.sp-phone { position: relative; display: inline-block; flex: none; width: var(--phone-w, 300px); padding: 10px; border-radius: var(--radius-2xl); background: var(--gray-900); box-shadow: inset 0 0 0 1px var(--gray-700), var(--shadow-md); }
.sp-phone__screen { position: relative; overflow: hidden; border-radius: max(0px, calc(var(--radius-2xl) - 10px)); background: var(--bg-page); color: var(--text-primary); min-height: 200px; }
.sp-phone__notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 72px; height: 20px; border-radius: var(--radius-full); background: var(--gray-900); z-index: 3; }
.sp-phone__bar { display: flex; align-items: center; gap: var(--space-2); height: 48px; padding: 24px var(--space-3) 0; margin-bottom: var(--space-2); font-size: 13px; font-weight: 600; box-sizing: content-box; background: var(--bg-surface); }
.sp-phone__bar .sp-i { width: 18px; height: 18px; }
.sp-phone__body { padding: 0 var(--space-2) var(--space-3); }

/* ---------- PostPreview ---------- */
.sp-post { position: relative; display: flex; flex-direction: column; gap: var(--space-3); width: 100%; max-width: 420px; padding: var(--space-5); background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); }
.sp-post__head { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.sp-post__logo { --s: 40px; border-radius: var(--radius-md); background: var(--primary); color: var(--on-primary); font-size: 15px; }
.sp-post__who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-post__org { font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-post__date { font-size: 13px; line-height: 18px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sp-post__text { margin: 0; font-size: 15px; line-height: 22px; white-space: pre-line; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 4); overflow: hidden; }
.sp-post--expanded .sp-post__text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.sp-post__more { align-self: flex-start; display: inline-flex; align-items: center; gap: 2px; margin-top: calc(var(--space-2) * -1); padding: 0; border: 0; background: none; color: var(--text-link); font-size: 15px; line-height: 22px; font-weight: 500; cursor: pointer; border-radius: min(var(--radius-xs), 2px); }
.sp-post__more .sp-i { width: 16px; height: 16px; }
.sp-post__more:hover, .sp-post__more.is-hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-post__media { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; }
.sp-post__media > .sp-ph { width: 100%; height: 100%; }
.sp-post__gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border-radius: var(--radius-lg); overflow: hidden; }
.sp-post__gallery > .sp-ph { aspect-ratio: 1; }
.sp-post__rest { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(19, 20, 29, .56); color: var(--gray-0); font-size: 24px; line-height: 32px; font-weight: 600; }
.sp-post__actions { display: flex; align-items: center; gap: var(--space-2); }
.sp-post__react { display: inline-flex; align-items: center; gap: 6px; height: var(--control-s); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); font-size: 13px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-post__react .sp-i { width: 16px; height: 16px; }
.sp-post__react:hover, .sp-post__react.is-hover { background: var(--bg-surface-3); }
.sp-post__react[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-ink); }
.sp-post__draft { position: absolute; top: var(--space-4); right: var(--space-4); }
.sp-post--draft { box-shadow: inset 0 0 0 2px var(--bg-surface); outline: 2px dashed var(--border-control); outline-offset: -2px; }
.sp-post--draft .sp-post__head { padding-right: 88px; }
.sp-post--skeleton .sp-skeleton { width: 100%; }
.sp-phone .sp-post { border-radius: var(--radius-lg); padding: var(--space-4); }
@media (max-width: 767px) {
  .sp-post { padding: var(--space-4); border-radius: var(--radius-lg); }
  .sp-post__react { height: var(--control-m); }
  .sp-post__more { min-height: 40px; }
}

/* ---------- StoryPreview ---------- */
.sp-story-frame { display: inline-flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.sp-story-frame__cap { display: flex; gap: var(--space-2); align-items: baseline; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-story-frame__cap b { color: var(--text-primary); font-weight: 600; }
.sp-story { position: relative; flex: none; width: var(--story-w, 216px); aspect-ratio: 9 / 16; border-radius: var(--radius-lg); overflow: hidden; color: var(--gray-0); isolation: isolate; container-type: inline-size; }
.sp-story--4x5 { aspect-ratio: 4 / 5; }
.sp-story--1x1 { aspect-ratio: 1 / 1; }
.sp-story__bg { position: absolute; inset: 0; z-index: -2; }
.sp-story__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(19, 20, 29, .5) 0%, rgba(19, 20, 29, 0) 24%, rgba(19, 20, 29, 0) 42%, rgba(19, 20, 29, .78) 100%); }
.sp-story__progress { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 4px; }
.sp-story__seg { flex: 1; height: 3px; border-radius: var(--radius-full); background: rgba(255, 255, 255, .38); overflow: hidden; }
.sp-story__seg::before { content: ""; display: block; height: 100%; width: var(--p, 0%); background: var(--gray-0); border-radius: inherit; }
.sp-story__seg.is-done { --p: 100%; }
.sp-story__head { position: absolute; top: 18px; left: 10px; right: 10px; display: flex; align-items: center; gap: var(--space-2); font-size: 13px; line-height: 16px; }
.sp-story__avatar { --s: 28px; background: var(--gray-0); color: var(--navy-800); font-size: 11px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.sp-story__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sp-story__time { color: rgba(255, 255, 255, .82); white-space: nowrap; }
.sp-story__body { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: var(--space-2); }
.sp-story__title { margin: 0; font-size: 20px; line-height: 24px; font-weight: 700; letter-spacing: -0.01em; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.sp-story__text { margin: 0; font-size: 13px; line-height: 18px; color: rgba(255, 255, 255, .92); }
.sp-story__cta { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; margin-top: var(--space-1); border: 0; border-radius: var(--radius-md); background: var(--gray-0); color: var(--gray-900); font-size: 15px; font-weight: 600; cursor: pointer; }
.sp-story__cta:hover, .sp-story__cta.is-hover { background: var(--gray-50); }
.sp-story__safe { position: absolute; top: 13%; bottom: 13%; left: 6%; right: 6%; border: 1px dashed rgba(255, 255, 255, .8); border-radius: var(--radius-xs); pointer-events: none; }
.sp-story__safe::before { content: attr(data-label); position: absolute; top: 4px; left: 6px; padding: 1px 6px; border-radius: var(--radius-xs); background: rgba(19, 20, 29, .6); color: var(--gray-0); font-size: 10px; line-height: 14px; }
.sp-story--4x5 .sp-story__safe, .sp-story--1x1 .sp-story__safe { top: 6%; bottom: 6%; }
.sp-story--1x1 .sp-story__title { font-size: 17px; line-height: 22px; }
@container (max-width: 160px) {
  .sp-story__title { font-size: 15px; line-height: 20px; }
  .sp-story__text { display: none; }
  .sp-story__cta { height: 32px; font-size: 13px; }
}
/* Лента слайдов */
.sp-story-strip { display: flex; gap: var(--space-2); align-items: center; overflow-x: auto; padding: 4px; margin: -4px; max-width: calc(100% + 8px); }
.sp-story-strip__item { position: relative; flex: none; width: 56px; aspect-ratio: 9 / 16; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: none; }
.sp-story-strip__item > .sp-ph { position: absolute; inset: 0; }
.sp-story-strip__num { position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-full); background: rgba(19, 20, 29, .64); color: var(--gray-0); font-size: 11px; line-height: 18px; font-weight: 600; text-align: center; }
.sp-story-strip__item:hover, .sp-story-strip__item.is-hover { box-shadow: 0 0 0 2px var(--border-strong); }
.sp-story-strip__item.is-selected, .sp-story-strip__item[aria-current="true"] { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--primary); }
.sp-story-strip__add { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 56px; aspect-ratio: 9 / 16; border: 1px dashed var(--border-control); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-secondary); font-size: 11px; cursor: pointer; }
.sp-story-strip__add:hover, .sp-story-strip__add.is-hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-story-strip__add .sp-i { width: 20px; height: 20px; }

/* ---------- LayoutEditor ---------- */
.sp-editor { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: var(--editor-h, 720px); background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); container-type: inline-size; container-name: sp-editor; }
.sp-editor__toolbar { min-width: 0; display: flex; align-items: center; gap: var(--space-2); min-height: 56px; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.sp-editor__tb-sep { width: 1px; align-self: stretch; margin: 6px var(--space-1); background: var(--border); }
.sp-editor__zoom { display: inline-flex; align-items: center; gap: 2px; height: var(--control-s); padding: 0 var(--space-1); border-radius: var(--radius-sm); background: var(--bg-surface-2); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-editor__zoom b { min-width: 40px; text-align: center; font-weight: 500; }
.sp-editor__zoom .sp-btn { --h: 26px; background: transparent; }
.sp-editor__zoom .sp-btn:hover { background: var(--bg-surface-3); }
.sp-editor__title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-editor__saved { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.sp-editor__body { display: grid; grid-template-columns: 232px minmax(0, 1fr) 272px; min-height: 0; }
.sp-editor__stub { display: none; }
@container sp-editor (max-width: 719px) {
  .sp-editor__body, .sp-editor__toolbar { display: none; }
  .sp-editor { grid-template-rows: 1fr; }
  .sp-editor__stub { display: flex; }
}
.sp-editor--stub { height: auto; grid-template-rows: 1fr; }
.sp-editor--stub .sp-editor__body, .sp-editor--stub .sp-editor__toolbar { display: none; }
.sp-editor--stub .sp-editor__stub { display: flex; }
.sp-editor__stub { flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); padding: var(--space-8) var(--space-5); text-align: center; }
.sp-editor__stub-icon { display: flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: var(--radius-lg); background: var(--primary-soft); color: var(--primary-ink); }
.sp-editor__stub p { margin: 0; max-width: 300px; color: var(--text-secondary); font-size: 13px; line-height: 18px; }

/* Слои */
.sp-layers { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.sp-layers__head, .sp-props__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); height: 44px; padding: 0 var(--space-3) 0 var(--space-4); flex: none; }
.sp-layers__title, .sp-props__title { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); margin: 0; }
.sp-layers__list { list-style: none; margin: 0; padding: 0 var(--space-2) var(--space-3); overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.sp-layers__list .sp-layers__list { padding: 2px 0 0 20px; overflow: visible; }
.sp-layer { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 4px 0 2px; border-radius: var(--radius-sm); font-size: 13px; line-height: 18px; cursor: pointer; color: var(--text-primary); }
.sp-layer:hover, .sp-layer.is-hover { background: var(--bg-surface-2); }
.sp-layer.is-selected { background: var(--primary-soft); color: var(--primary-ink); font-weight: 500; }
.sp-layer__grip { display: inline-flex; color: var(--text-tertiary); cursor: grab; opacity: 0; }
.sp-layer:hover .sp-layer__grip, .sp-layer.is-hover .sp-layer__grip, .sp-layer.is-selected .sp-layer__grip, .sp-layer.is-dragging .sp-layer__grip { opacity: 1; }
.sp-layer__grip .sp-i, .sp-layer__type .sp-i, .sp-layer__btn .sp-i { width: 16px; height: 16px; }
.sp-layer__type { display: inline-flex; color: var(--text-secondary); }
.sp-layer.is-selected .sp-layer__type { color: inherit; }
.sp-layer__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-layer__btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; color: var(--text-tertiary); cursor: pointer; opacity: 0; }
.sp-layer:hover .sp-layer__btn, .sp-layer.is-hover .sp-layer__btn, .sp-layer.is-selected .sp-layer__btn, .sp-layer__btn[aria-pressed="true"] { opacity: 1; }
.sp-layer__btn:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.sp-layer.is-hidden .sp-layer__name, .sp-layer.is-hidden .sp-layer__type { color: var(--text-tertiary); }
.sp-layer.is-dragging { background: var(--bg-surface); box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border); transform: rotate(-1deg); }
.sp-layer__caret { display: inline-flex; color: var(--text-secondary); }
.sp-layer__caret .sp-i { width: 14px; height: 14px; }
.sp-layers__drop { height: 2px; margin: -1px 8px; border-radius: min(var(--radius-xs), 2px); background: var(--focus-ring); }

/* Холст */
.sp-editor__canvas { position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; overflow: hidden; background: var(--bg-sunken); background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 16px 16px; }
.sp-artboard { position: relative; width: var(--artboard-w, 300px); aspect-ratio: var(--artboard-ratio, 9 / 16); max-height: calc(100% - 64px); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.sp-artboard__label { position: absolute; bottom: 100%; left: 0; margin-bottom: 6px; font-size: 12px; line-height: 16px; color: var(--text-secondary); white-space: nowrap; }
.sp-artboard__el { position: absolute; }
.sp-artboard__el--text { color: var(--gray-0); font-weight: 700; font-size: 34px; line-height: 40px; letter-spacing: -0.01em; }
.sp-artboard__el--shape { background: var(--sun-400); border-radius: var(--radius-md); }
.sp-artboard__el--logo { display: flex; align-items: center; justify-content: center; border-radius: var(--radius-full); background: var(--gray-0); color: var(--navy-800); font-weight: 700; font-size: 13px; }
.sp-selection { position: absolute; outline: 1.5px solid var(--focus-ring); pointer-events: none; }
.sp-selection__h { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--gray-0); border: 1.5px solid var(--focus-ring); border-radius: min(var(--radius-xs), 2px); pointer-events: auto; }
.sp-selection__h--nw { left: 0; top: 0; cursor: nwse-resize; } .sp-selection__h--n { left: 50%; top: 0; cursor: ns-resize; } .sp-selection__h--ne { left: 100%; top: 0; cursor: nesw-resize; }
.sp-selection__h--e { left: 100%; top: 50%; cursor: ew-resize; } .sp-selection__h--se { left: 100%; top: 100%; cursor: nwse-resize; } .sp-selection__h--s { left: 50%; top: 100%; cursor: ns-resize; }
.sp-selection__h--sw { left: 0; top: 100%; cursor: nesw-resize; } .sp-selection__h--w { left: 0; top: 50%; cursor: ew-resize; }
.sp-selection__rot { position: absolute; left: 50%; top: -30px; width: 12px; height: 12px; margin-left: -6px; border-radius: var(--radius-full); background: var(--gray-0); border: 1.5px solid var(--focus-ring); cursor: grab; pointer-events: auto; }
.sp-selection__rot::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 17px; margin-left: -.75px; background: var(--focus-ring); }
.sp-selection__size { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 10px; padding: 2px 6px; border-radius: var(--radius-xs); background: var(--primary); color: var(--on-primary); font-size: 11px; line-height: 16px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sp-guide { position: absolute; background: var(--danger); pointer-events: none; }
.sp-guide--v { top: -12px; bottom: -12px; width: 1px; }
.sp-guide--h { left: -12px; right: -12px; height: 1px; }
.sp-guide__tag { position: absolute; padding: 0 4px; border-radius: min(var(--radius-xs), 3px); background: var(--danger); color: var(--on-danger); font-size: 10px; line-height: 14px; font-weight: 600; white-space: nowrap; }

/* Свойства */
.sp-props { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--border); }
.sp-props__scroll { overflow: auto; padding: 0 var(--space-4) var(--space-4); }
.sp-props__section { padding: var(--space-3) 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-2); }
.sp-props__section:first-child { border-top: 0; padding-top: 0; }
.sp-props__stitle { font-size: 13px; line-height: 18px; font-weight: 600; margin: 0 0 2px; }
.sp-props__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.sp-props__grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-props .sp-control { min-width: 0; --h: var(--control-s); padding: 0 var(--space-2); font-size: 13px; border-color: var(--border-strong); }
.sp-props .sp-control:hover { border-color: var(--border-control); }
.sp-props .sp-control__affix { font-size: 12px; color: var(--text-tertiary); min-width: 12px; }
.sp-props .sp-control input { width: 100%; font-variant-numeric: tabular-nums; }
.sp-props__row { display: flex; align-items: center; gap: var(--space-2); }
.sp-props__row > .sp-control { flex: 1; min-width: 0; }
.sp-props__label { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-sm); background: var(--bg-surface-2); }
.sp-seg__btn { display: inline-flex; align-items: center; justify-content: center; flex: 1; min-width: 32px; height: 28px; padding: 0 6px; border: 0; border-radius: min(var(--radius-sm), 6px); background: none; color: var(--text-secondary); cursor: pointer; font-size: 13px; }
.sp-seg__btn .sp-i { width: 16px; height: 16px; }
.sp-seg__btn:hover, .sp-seg__btn.is-hover { color: var(--text-primary); }
.sp-seg__btn[aria-pressed="true"], .sp-seg__btn.is-selected { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.sp-swatch { flex: none; width: 24px; height: 24px; border-radius: var(--radius-xs); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); border: 0; padding: 0; cursor: pointer; }
.sp-props__range { display: flex; align-items: center; gap: var(--space-3); }
.sp-props__range input[type="range"] { flex: 1; min-width: 0; accent-color: var(--primary); height: 20px; margin: 0; }
.sp-props__range output { min-width: 40px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }

/* ---------- PublicationCard ---------- */
.sp-pubcard { position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--space-4); padding: var(--space-4); background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-lg); transition: box-shadow var(--duration-fast) var(--ease-standard); }
.sp-pubcard:hover, .sp-pubcard.is-hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-pubcard__thumb { position: relative; width: 112px; height: 112px; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-surface-2); color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; }
.sp-pubcard__thumb > .sp-ph { position: absolute; inset: 0; }
.sp-pubcard__kind { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: rgba(19, 20, 29, .64); color: var(--gray-0); font-size: 11px; font-weight: 500; }
.sp-pubcard__kind .sp-i { width: 12px; height: 12px; }
.sp-pubcard__main { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.sp-pubcard__top { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; min-width: 0; }
.sp-pubcard__org { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 600; }
.sp-pubcard__org span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-pubcard__status { margin-left: auto; }
.sp-pubcard__text { margin: 0; font-size: 15px; line-height: 22px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.sp-pubcard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-pubcard__meta > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sp-pubcard__meta .sp-i { width: 16px; height: 16px; }
.sp-pubcard__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-1); }
.sp-pubcard__actions { display: flex; gap: var(--space-1); align-items: center; }
.sp-pubcard__error { display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--danger-soft); color: var(--danger-ink); font-size: 13px; line-height: 18px; }
.sp-pubcard__error .sp-i { width: 16px; height: 16px; margin-top: 1px; }
.sp-pubcard__error p { margin: 0; flex: 1; }
.sp-pubcard__error .sp-btn { flex: none; margin: -4px -4px -4px 0; }
.sp-pubcard__reject { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--bg-surface-2); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-pubcard__reject b { color: var(--text-primary); font-weight: 500; }
/* компактная строка */
.sp-pubcard--row { grid-template-columns: 48px minmax(0, 1fr) 128px 168px 124px auto; align-items: center; gap: var(--space-4); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); }
.sp-pubcard--row .sp-pubcard__thumb { width: 48px; height: 48px; border-radius: var(--radius-sm); }
.sp-pubcard--row .sp-pubcard__main { gap: 2px; }
.sp-pubcard--row .sp-pubcard__text { -webkit-line-clamp: 1; font-size: 13px; line-height: 18px; font-weight: 500; }
.sp-pubcard--row .sp-pubcard__org { font-weight: 400; color: var(--text-secondary); font-size: 12px; line-height: 16px; }
.sp-pubcard__cell { font-size: 13px; line-height: 18px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
  .sp-pubcard { grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3); }
  .sp-pubcard__thumb { width: 72px; height: 72px; }
  .sp-pubcard__foot { grid-column: 1 / -1; }
  .sp-pubcard__main { display: contents; }
  .sp-pubcard__top, .sp-pubcard__text, .sp-pubcard__meta, .sp-pubcard__error, .sp-pubcard__reject { grid-column: 2; }
  .sp-pubcard__error, .sp-pubcard__reject, .sp-pubcard__foot { grid-column: 1 / -1; }
  .sp-pubcard--row { grid-template-columns: 48px minmax(0, 1fr) auto; row-gap: var(--space-1); }
  .sp-pubcard--row .sp-pubcard__thumb { grid-row: 1 / span 3; }
  .sp-pubcard--row .sp-pubcard__main { display: flex; grid-column: 2; }
  .sp-pubcard--row .sp-pubcard__main > * { grid-column: auto; }
  .sp-pubcard--row .sp-pubcard__text { -webkit-line-clamp: 2; }
  .sp-pubcard--row .sp-pubcard__rate { display: none; }
  .sp-pubcard--row .sp-pubcard__cell { grid-column: 2; grid-row: 2; white-space: normal; }
  .sp-pubcard--row .sp-pubcard__stat { grid-column: 2; grid-row: 3; }
  .sp-pubcard--row .sp-pubcard__actions { grid-column: 3; grid-row: 1 / span 3; }
  .sp-pubcard--row .sp-pubcard__actions .sp-btn:not(:last-child) { display: none; }
}

/* ---------- StatusBadge ---------- */
.sp-status { --dot: var(--text-tertiary); display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap; vertical-align: middle; }
.sp-status__dot { flex: none; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--dot); }
.sp-status--s { height: 20px; padding: 0 8px 0 6px; gap: 5px; font-size: 12px; line-height: 16px; }
.sp-status--s .sp-status__dot { width: 6px; height: 6px; }
.sp-status--active { --dot: var(--success); background: var(--success-soft); color: var(--success-ink); }
.sp-status--pending { --dot: var(--warning); background: var(--warning-soft); color: var(--warning-ink); }
.sp-status--archived { --dot: var(--text-tertiary); background: var(--bg-surface-2); color: var(--text-secondary); }
.sp-status--error { --dot: var(--danger); background: var(--danger-soft); color: var(--danger-ink); }
.sp-status--trial { --dot: var(--info); background: var(--info-soft); color: var(--info-ink); }
.sp-status--paused { --dot: transparent; background: var(--bg-surface-2); color: var(--text-primary); }
.sp-status--paused .sp-status__dot { box-shadow: inset 0 0 0 2px var(--text-secondary); }
.sp-status--plain { background: none; padding: 0; height: auto; }
.sp-status-tip { position: relative; display: inline-flex; }
.sp-status-tip > .sp-status { cursor: help; }
.sp-status-tip > .sp-status:focus-visible, .sp-status-tip > .sp-status.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-status__hint { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); z-index: var(--z-tooltip); width: max-content; max-width: 240px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--bg-inverse); color: var(--text-inverse); font-size: 12px; line-height: 16px; font-weight: 400; white-space: normal; text-align: left; box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-status__hint::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--bg-inverse); }
.sp-status-tip:hover .sp-status__hint, .sp-status-tip:focus-within .sp-status__hint, .sp-status-tip.is-open .sp-status__hint { opacity: 1; visibility: visible; }

/* ---------- Rating ---------- */
.sp-rating { --star: 20px; display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-primary); vertical-align: middle; }
.sp-rating--s { --star: 16px; gap: 6px; }
.sp-rating--l { --star: 28px; gap: var(--space-3); }
.sp-rating__stars { --gap: 2px; position: relative; display: inline-flex; gap: var(--gap); border-radius: var(--radius-xs); }
.sp-rating--l .sp-rating__stars { --gap: 4px; }
.sp-rating__star { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--star); height: var(--star); padding: 0; border: 0; background: none; color: var(--border-control); cursor: pointer; border-radius: min(var(--radius-xs), 3px); transition: transform var(--duration-fast) var(--ease-spring), color var(--duration-fast) var(--ease-standard); }
.sp-rating__star .sp-i { width: 100%; height: 100%; }
.sp-rating .sp-i svg { stroke-width: 1.75; }
.sp-rating__star.is-on { color: var(--accent); }
.sp-rating__star.is-on .sp-i svg { fill: currentColor; }
.sp-rating__star.is-preview { color: var(--accent); }
.sp-rating__star.is-preview .sp-i svg { fill: var(--accent-soft); }
.sp-rating__star:hover, .sp-rating__star.is-hover { transform: scale(1.15); }
.sp-rating__star:focus-visible, .sp-rating__star.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.sp-rating.is-disabled .sp-rating__star, .sp-rating__star:disabled { color: var(--text-disabled); cursor: not-allowed; transform: none; }
.sp-rating.is-disabled .sp-rating__star .sp-i svg { fill: none; }
.sp-rating.is-disabled .sp-rating__value, .sp-rating.is-disabled .sp-rating__count, .sp-rating.is-disabled .sp-rating__label { color: var(--text-disabled); }
/* только чтение, дробное значение */
.sp-rating--readonly .sp-rating__star { cursor: default; }
.sp-rating--readonly .sp-rating__star:hover { transform: none; }
.sp-rating__fill { position: absolute; inset: 0 auto 0 0; display: inline-flex; gap: inherit; overflow: hidden; width: var(--fill, 0%); pointer-events: none; }
.sp-rating__fill .sp-rating__star { flex: none; color: var(--accent); }
.sp-rating__fill .sp-i svg { fill: currentColor; }
.sp-rating__value { font-size: 15px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-rating--s .sp-rating__value { font-size: 13px; line-height: 18px; }
.sp-rating--l .sp-rating__value { font-size: 20px; line-height: 28px; }
.sp-rating__count, .sp-rating__label { font-size: 13px; line-height: 18px; color: var(--text-secondary); white-space: nowrap; }
.sp-rating--s .sp-rating__count, .sp-rating--s .sp-rating__label { font-size: 12px; line-height: 16px; }
@media (max-width: 767px) {
  .sp-rating:not(.sp-rating--readonly) .sp-rating__stars { gap: 0; }
  .sp-rating:not(.sp-rating--readonly) .sp-rating__star { width: max(var(--star), 40px); height: max(var(--star), 40px); padding: calc((max(var(--star), 40px) - var(--star)) / 2); }
}

/* ---------- CookieBanner ---------- */
.sp-cookie { position: fixed; left: var(--space-6); bottom: var(--space-6); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--space-4); width: calc(100% - 2 * var(--space-6)); max-width: 400px; padding: var(--space-5); background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg), 0 0 0 1px var(--border); }
.sp-cookie--static { position: relative; left: auto; bottom: auto; width: 100%; }
.sp-cookie__head { display: flex; gap: var(--space-3); align-items: flex-start; }
.sp-cookie__icon { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent-ink); }
.sp-cookie__title { margin: 0 0 2px; font-size: 15px; line-height: 20px; font-weight: 600; }
.sp-cookie__text { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-cookie__actions { display: flex; gap: var(--space-2); }
.sp-cookie__actions .sp-btn { flex: 1; }
.sp-cookie__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.sp-cookie__opt { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.sp-cookie__opt-text { flex: 1; min-width: 0; }
.sp-cookie__opt-name { display: block; font-size: 13px; line-height: 18px; font-weight: 600; }
.sp-cookie__opt-desc { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-cookie__always { font-size: 12px; line-height: 24px; color: var(--text-secondary); white-space: nowrap; }
/* switch (локальный, чтобы не зависеть от форм) */
.sp-cookie__switch { position: relative; flex: none; width: 40px; height: 24px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--border-control); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-cookie__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: var(--radius-full); background: var(--gray-0); box-shadow: var(--shadow-xs); transition: transform var(--duration-base) var(--ease-standard); }
.sp-cookie__switch[aria-checked="true"] { background: var(--primary); }
.sp-cookie__switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--bg-surface); }
.sp-cookie__switch:hover, .sp-cookie__switch.is-hover { filter: brightness(1.08); }
.sp-cookie__switch:disabled { opacity: var(--opacity-muted); cursor: not-allowed; filter: none; }
.sp-cookie--full { left: 0; right: 0; bottom: 0; width: 100%; max-width: none; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-4); }
@media (max-width: 767px) {
  .sp-cookie:not(.sp-cookie--static) { left: 0; right: 0; bottom: 0; width: 100%; max-width: none; border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: var(--space-4) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom)); }
  .sp-cookie__icon { display: none; }
  .sp-cookie__switch { margin: 8px 0; }
}

/* ---------- Accordion ---------- */
.sp-accordion { display: flex; flex-direction: column; color: var(--text-primary); }
.sp-accordion__item { border-bottom: 1px solid var(--border); }
.sp-accordion__item:first-child { border-top: 1px solid var(--border); }
.sp-accordion__heading { margin: 0; font: inherit; }
.sp-accordion__trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); width: 100%; min-height: 64px; padding: var(--space-4) 0; border: 0; background: none; color: inherit; font-size: 17px; line-height: 24px; font-weight: 600; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.sp-accordion__icon { flex: none; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); transition: background-color var(--duration-fast) var(--ease-standard), transform var(--duration-base) var(--ease-standard); }
.sp-accordion__icon .sp-i { width: 18px; height: 18px; }
.sp-accordion__trigger:hover .sp-accordion__icon, .sp-accordion__trigger.is-hover .sp-accordion__icon { background: var(--bg-surface-3); }
.sp-accordion__trigger:hover, .sp-accordion__trigger.is-hover { color: var(--primary-ink); }
.sp-accordion__item.is-open .sp-accordion__icon { background: var(--primary); color: var(--on-primary); }
.sp-accordion--chevron .sp-accordion__icon { background: none; width: 24px; height: 24px; }
.sp-accordion--chevron .sp-accordion__item.is-open .sp-accordion__icon { background: none; color: var(--text-primary); transform: rotate(180deg); }
.sp-accordion--chevron .sp-accordion__trigger:hover .sp-accordion__icon { background: none; }
.sp-accordion__panel { padding: 0 var(--space-12) var(--space-5) 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-accordion__panel p { margin: 0 0 var(--space-2); } .sp-accordion__panel p:last-child { margin: 0; }
.sp-accordion__panel[hidden] { display: none; }
.sp-accordion__trigger:disabled, .sp-accordion__trigger.is-disabled { color: var(--text-disabled); cursor: not-allowed; }
.sp-accordion__trigger:disabled .sp-accordion__icon, .sp-accordion__trigger.is-disabled .sp-accordion__icon { color: var(--text-disabled); background: var(--bg-surface-2); }
.sp-accordion--chevron .sp-accordion__trigger:disabled .sp-accordion__icon { background: none; }
/* в карточках */
.sp-accordion--cards { gap: var(--space-2); }
.sp-accordion--cards .sp-accordion__item, .sp-accordion--cards .sp-accordion__item:first-child { border: 0; background: var(--bg-surface); border-radius: var(--radius-lg); transition: box-shadow var(--duration-fast) var(--ease-standard); }
.sp-accordion--cards .sp-accordion__item:hover, .sp-accordion--cards .sp-accordion__item.is-hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-accordion--cards .sp-accordion__trigger { padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); }
.sp-accordion--cards .sp-accordion__panel { padding: 0 var(--space-16) var(--space-5) var(--space-5); }
@media (max-width: 767px) {
  .sp-accordion__trigger { font-size: 15px; line-height: 22px; min-height: 56px; }
  .sp-accordion__panel { padding-right: 0; }
  .sp-accordion--cards .sp-accordion__panel { padding-right: var(--space-5); }
}

/* ---------- StatsBlock ---------- */
.sp-stats { background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); padding: var(--space-6); }
.sp-stats__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); flex-wrap: wrap; }
.sp-stats__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.sp-stats__period { display: inline-flex; align-items: center; gap: 6px; height: var(--control-s); padding: 0 var(--space-3); border: 0; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); font-size: 13px; font-weight: 500; cursor: pointer; }
.sp-stats__period .sp-i { width: 16px; height: 16px; }
.sp-stats__period:hover { background: var(--bg-surface-3); }
.sp-stats__delta { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; line-height: 18px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-stats__delta .sp-i { width: 14px; height: 14px; }
.sp-stats__delta--positive { color: var(--success-ink); }
.sp-stats__delta--negative { color: var(--danger-ink); }
.sp-stats__delta--neutral { color: var(--text-secondary); }
/* список показателей */
.sp-stats__list { list-style: none; margin: 0; padding: 0; }
.sp-stats__row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.sp-stats__row:first-child { border-top: 0; }
.sp-stats__ico { flex: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-secondary); }
.sp-stats__ico .sp-i { width: 18px; height: 18px; }
.sp-stats__label { flex: 1; min-width: 0; font-size: 15px; line-height: 20px; }
.sp-stats__label small { display: block; font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-stats__val { font-size: 17px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
/* сводка — плитки */
.sp-stats__tiles { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--space-3); }
.sp-stats__tile { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--bg-sunken); box-shadow: inset 0 0 0 1px var(--border); min-width: 0; }
.sp-stats__big { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.sp-stats__cap { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-stats__line { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.sp-stats__bars { display: flex; align-items: flex-end; gap: 3px; height: 32px; margin-top: var(--space-2); }
.sp-stats__bars span { flex: 1; min-height: 2px; border-radius: min(var(--radius-xs), 2px) min(var(--radius-xs), 2px) 0 0; background: var(--accent); }
/* промо KPI */
.sp-stats--promo { background: none; padding: 0; }
.sp-stats__kpis { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: var(--space-6); }
.sp-stats__kpi { display: flex; flex-direction: column; gap: var(--space-1); padding-left: var(--space-5); border-left: 4px solid var(--accent); }
.sp-stats__kpi .sp-stats__big { font-size: 48px; line-height: 56px; letter-spacing: -0.02em; }
.sp-stats__kpi .sp-stats__cap { font-size: 15px; line-height: 22px; }
/* таблица */
.sp-stats__table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 20px; }
.sp-stats__table th { padding: 0 0 var(--space-2); text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.sp-stats__table td { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.sp-stats__table tr:last-child td { border-bottom: 0; }
.sp-stats__table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: var(--space-4); }
.sp-stats__table td.is-num { font-weight: 600; }
.sp-stats__svc { display: inline-flex; align-items: center; gap: var(--space-2); }
.sp-stats__svc .sp-i { width: 18px; height: 18px; color: var(--text-secondary); }
@media (max-width: 767px) {
  .sp-stats { padding: var(--space-5); border-radius: var(--radius-lg); }
  .sp-stats--promo { padding: 0; }
  .sp-stats__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-stats__kpis { grid-template-columns: 1fr; gap: var(--space-4); }
  .sp-stats__kpi .sp-stats__big { font-size: 36px; line-height: 44px; }
  .sp-stats__big { font-size: 26px; line-height: 32px; }
}

/* ==========================================================================
   70 — Маркетинг и сообщения: Pricing, Testimonials, Hero, Features, HowItWorks,
   Footer, CTASection, EmailTemplate, MessengerMessage.
   Адаптив секций — container queries (контейнер = сама секция), поэтому
   раскладка верна и в узкой колонке, и на мобильном вьюпорте.
   ========================================================================== */

/* ---------- Общее: секция промо ---------- */
.sp-section-head { display: flex; flex-direction: column; gap: var(--space-3); max-width: 720px; margin: 0 0 var(--space-10); }
.sp-section-head--center { margin-left: auto; margin-right: auto; text-align: center; align-items: center; }
.sp-section-head__title { font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; margin: 0; color: var(--text-primary); }
.sp-section-head__lead { font-size: 17px; line-height: 26px; margin: 0; color: var(--text-secondary); }
.sp-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.sp-checklist__item { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; line-height: 22px; color: var(--text-primary); }
.sp-checklist__mark { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: var(--radius-full); background: var(--success-soft); color: var(--success-ink); }
.sp-checklist__mark .sp-i { width: 14px; height: 14px; }
.sp-checklist__item--off { color: var(--text-tertiary); }
.sp-checklist__item--off .sp-checklist__mark { background: var(--bg-surface-2); color: var(--text-tertiary); }

/* ========================== Pricing ========================== */
.sp-pricing { container-type: inline-size; container-name: sp-pricing; display: flex; flex-direction: column; gap: var(--space-8); }
.sp-pricing__head { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); text-align: center; }
.sp-pricing__trial { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-pricing__trial .sp-i { color: var(--accent-ink); width: 18px; height: 18px; }
/* переключатель периода — сегменты-пилюли */
.sp-period { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--radius-full); background: var(--bg-surface-2); }
.sp-period__opt { display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-5); border: 0; border-radius: var(--radius-full); background: transparent; color: var(--text-secondary); font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.sp-period__opt:hover, .sp-period__opt.is-hover { color: var(--text-primary); }
.sp-period__opt.is-selected, .sp-period__opt[aria-checked="true"] { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.sp-period__save { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; }
.sp-pricing__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); align-items: stretch; }
@container sp-pricing (max-width: 767px) { .sp-pricing__grid { grid-template-columns: 1fr; } }

/* Карточка тарифа */
.sp-plan { position: relative; display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-8); background: var(--bg-surface); border-radius: var(--radius-xl); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border); }
.sp-plan--popular { box-shadow: inset 0 0 0 2px var(--primary); }
.sp-plan--current { background: var(--bg-sunken); }
.sp-plan__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 28px; }
.sp-plan__name { font-size: 20px; line-height: 28px; font-weight: 600; margin: 0; }
.sp-plan__badge { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 12px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font-size: 13px; font-weight: 600; white-space: nowrap; }
.sp-plan__badge--current { background: var(--success-soft); color: var(--success-ink); }
.sp-plan__desc { margin: -12px 0 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-plan__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.sp-plan__amount { font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.sp-plan__per { font-size: 15px; color: var(--text-secondary); }
.sp-plan__old { font-size: 15px; color: var(--text-tertiary); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.sp-plan__billing { margin: -16px 0 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-plan__features { list-style: none; margin: 0; padding: var(--space-5) 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.sp-plan__feat { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 15px; line-height: 22px; }
.sp-plan__feat .sp-i { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--success-ink); }
.sp-plan__feat--off { color: var(--text-tertiary); }
.sp-plan__feat--off .sp-i { color: var(--text-tertiary); }
.sp-plan__cta { width: 100%; }
.sp-plan__note { margin: -8px 0 0; text-align: center; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
@container sp-pricing (max-width: 767px) { .sp-plan { padding: var(--space-6); border-radius: var(--radius-lg); } }

/* Таблица сравнения */
.sp-pricing-table { background: var(--bg-surface); border-radius: var(--radius-xl); padding: var(--space-2) 0; color: var(--text-primary); }
.sp-pricing-table__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sp-pricing-table table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.sp-pricing-table th, .sp-pricing-table td { padding: 14px var(--space-5); text-align: center; border-bottom: 1px solid var(--border); }
.sp-pricing-table tr:last-child td { border-bottom: 0; }
.sp-pricing-table th:first-child, .sp-pricing-table td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg-surface); }
.sp-pricing-table thead th { font-size: 17px; line-height: 24px; font-weight: 600; vertical-align: bottom; }
.sp-pricing-table thead th small { display: block; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-secondary); }
.sp-pricing-table__group td { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); padding-top: var(--space-6); text-align: left; }
.sp-pricing-table .is-popular { background: var(--primary-soft); }
.sp-pricing-table .is-current { background: var(--bg-sunken); }
.sp-pricing-table__yes { color: var(--success-ink); display: inline-flex; }
.sp-pricing-table__no { color: var(--text-tertiary); display: inline-flex; }
.sp-pricing-table .sp-i { width: 20px; height: 20px; }

/* Оплата: способы + сводка */
.sp-checkout { container-type: inline-size; container-name: sp-checkout; }
.sp-checkout__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); align-items: start; }
@container sp-checkout (max-width: 767px) { .sp-checkout__grid { grid-template-columns: 1fr; } }
.sp-paymethods { display: flex; flex-direction: column; gap: var(--space-3); border: 0; margin: 0; padding: 0; min-width: 0; }
.sp-paymethods__legend { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0 0 var(--space-3); padding: 0; }
.sp-paymethod { position: relative; display: flex; align-items: center; gap: var(--space-4); min-height: 72px; padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-strong); cursor: pointer; transition: box-shadow var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }
.sp-paymethod:hover, .sp-paymethod.is-hover { box-shadow: inset 0 0 0 1px var(--border-control); }
.sp-paymethod.is-selected, .sp-paymethod:has(input:checked) { box-shadow: inset 0 0 0 2px var(--primary); }
.sp-paymethod:has(input:focus-visible), .sp-paymethod.is-focus { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-paymethod.is-disabled, .sp-paymethod:has(input:disabled) { background: var(--bg-surface-2); box-shadow: none; cursor: not-allowed; }
.sp-paymethod.is-disabled .sp-paymethod__title, .sp-paymethod:has(input:disabled) .sp-paymethod__title { color: var(--text-secondary); }
.sp-paymethod input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.sp-paymethod__radio { flex: none; width: 20px; height: 20px; border-radius: var(--radius-full); box-shadow: inset 0 0 0 2px var(--border-control); background: var(--bg-surface); transition: box-shadow var(--duration-fast) var(--ease-standard); }
.sp-paymethod.is-selected .sp-paymethod__radio, .sp-paymethod:has(input:checked) .sp-paymethod__radio { box-shadow: inset 0 0 0 6px var(--primary); }
.sp-paymethod.is-disabled .sp-paymethod__radio, .sp-paymethod:has(input:disabled) .sp-paymethod__radio { box-shadow: inset 0 0 0 2px var(--border-strong); background: transparent; }
.sp-paymethod__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); }
.sp-paymethod__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sp-paymethod__title { font-size: 15px; line-height: 22px; font-weight: 500; color: var(--text-primary); }
.sp-paymethod__desc { font-size: 13px; line-height: 18px; color: var(--text-secondary); }

.sp-checkout-summary { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-6); background: var(--bg-surface); border-radius: var(--radius-xl); color: var(--text-primary); }
.sp-checkout-summary__title { font-size: 17px; line-height: 24px; font-weight: 600; margin: 0; }
.sp-checkout-summary__rows { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.sp-checkout-summary__row { display: flex; justify-content: space-between; gap: var(--space-4); font-size: 15px; line-height: 22px; }
.sp-checkout-summary__row dt { color: var(--text-secondary); }
.sp-checkout-summary__row dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.sp-checkout-summary__row--discount dd { color: var(--success-ink); }
.sp-checkout-summary__promo { display: flex; gap: var(--space-2); align-items: flex-start; }
.sp-checkout-summary__promo .sp-field { flex: 1; }
.sp-checkout-summary__total { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.sp-checkout-summary__total-label { font-size: 17px; font-weight: 600; }
.sp-checkout-summary__total-value { font-size: 24px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-checkout-summary__legal { margin: 0; font-size: 12px; line-height: 16px; color: var(--text-secondary); }

/* ========================== Testimonials ========================== */
.sp-testimonials { container-type: inline-size; container-name: sp-testimonials; }
.sp-testimonials__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
@container sp-testimonials (max-width: 767px) { .sp-testimonials__grid { grid-template-columns: 1fr; } }
.sp-testimonial { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; padding: var(--space-6); background: var(--bg-surface); border-radius: var(--radius-xl); color: var(--text-primary); }
.sp-testimonial__stars { display: inline-flex; gap: 2px; color: var(--accent); }
.sp-testimonial__stars .sp-i { width: 18px; height: 18px; }
.sp-testimonial__stars .sp-i svg { fill: currentColor; }
.sp-testimonial__stars .is-empty { color: var(--bg-surface-3); }
.sp-testimonial__text { margin: 0; font-size: 15px; line-height: 24px; flex: 1; }
.sp-testimonial__author { display: flex; align-items: center; gap: var(--space-3); }
.sp-testimonial__name { font-size: 15px; line-height: 20px; font-weight: 600; font-style: normal; }
.sp-testimonial__role { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-testimonial--quote { padding: var(--space-12) var(--space-12); gap: var(--space-6); align-items: flex-start; }
.sp-testimonial--quote .sp-testimonial__mark { font-size: 72px; line-height: 64px; height: 32px; margin-bottom: -16px; font-weight: 700; color: var(--accent); font-family: Georgia, serif; }
.sp-testimonial--quote .sp-testimonial__text { font-size: 24px; line-height: 34px; font-weight: 500; letter-spacing: -0.005em; }
@container sp-testimonials (max-width: 767px) { .sp-testimonial--quote { padding: var(--space-6); } .sp-testimonial--quote .sp-testimonial__text { font-size: 19px; line-height: 28px; } }
.sp-logos { display: flex; flex-wrap: wrap; gap: var(--space-3); justify-content: center; margin-top: var(--space-8); }
.sp-logos__item { display: inline-flex; align-items: center; justify-content: center; height: 48px; min-width: 148px; padding: 0 var(--space-5); border-radius: var(--radius-md); border: 1px dashed var(--border-strong); color: var(--text-secondary); font-size: 13px; font-weight: 500; }

/* ========================== Hero ========================== */
.sp-hero { container-type: inline-size; container-name: sp-hero; background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl); overflow: hidden; }
.sp-hero__inner { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; padding: var(--space-16) var(--space-12); }
.sp-hero__content { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-6); min-width: 0; }
.sp-hero__eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 14px 0 6px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.sp-hero__eyebrow-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-full); background: var(--accent); color: var(--on-accent); font-size: 12px; }
.sp-hero__title { margin: 0; font-size: 56px; line-height: 64px; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.sp-hero__lead { margin: 0; font-size: 19px; line-height: 28px; color: var(--text-secondary); max-width: 560px; }
.sp-hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.sp-hero__trust { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-hero__trust span { display: inline-flex; align-items: center; gap: 6px; }
.sp-hero__trust .sp-i { width: 16px; height: 16px; color: var(--success-ink); }
.sp-hero__form { display: flex; gap: var(--space-3); width: 100%; max-width: 520px; }
.sp-hero__form .sp-field { flex: 1; }
.sp-hero__form .sp-control { --h: var(--control-xl); border-radius: var(--radius-lg); padding: 0 var(--space-5); font-size: 17px; }
/* Композиция из элементов системы */
.sp-hero__visual { display: grid; grid-template-columns: 1.1fr 1fr; grid-template-rows: auto auto; gap: var(--space-4); padding: var(--space-6); background: var(--bg-page); border-radius: var(--radius-xl); min-width: 0; }
.sp-hero-mini { background: var(--bg-surface); border-radius: var(--radius-lg); padding: var(--space-4); color: var(--text-primary); box-shadow: var(--shadow-sm); min-width: 0; }
.sp-hero-post { grid-row: span 2; display: flex; flex-direction: column; gap: var(--space-3); }
.sp-hero-post__head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.sp-hero-post__org { font-size: 13px; line-height: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-hero-post__time { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-hero-post__img { aspect-ratio: 4 / 3; border-radius: var(--radius-md); background: radial-gradient(circle at 70% 30%, var(--sun-200) 0 18%, transparent 19%), linear-gradient(135deg, var(--sun-400), var(--orange-300) 60%, var(--red-300)); }
.sp-hero-post__text { margin: 0; font-size: 13px; line-height: 18px; }
.sp-hero-cal__head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: var(--space-2); }
.sp-hero-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-size: 11px; line-height: 22px; font-variant-numeric: tabular-nums; }
.sp-hero-cal__wd { color: var(--text-secondary); font-weight: 600; }
.sp-hero-cal__d { position: relative; border-radius: min(var(--radius-sm), 6px); }
.sp-hero-cal__d.is-post::after { content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: var(--radius-full); background: var(--accent); }
.sp-hero-cal__d.is-today { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.sp-hero-cal__d.is-muted { color: var(--text-tertiary); }
.sp-hero-metric__label { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
.sp-hero-metric__value { display: flex; align-items: baseline; gap: var(--space-2); font-size: 24px; line-height: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-hero-metric__delta { font-size: 12px; font-weight: 600; color: var(--success-ink); }
.sp-hero-metric__bars { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-top: var(--space-2); }
.sp-hero-metric__bars i { flex: 1; border-radius: min(var(--radius-xs), 3px) min(var(--radius-xs), 3px) 0 0; background: var(--accent); }
.sp-hero-metric__bars i:nth-child(-n+4) { background: var(--bg-surface-3); }
/* Варианты */
.sp-hero--center .sp-hero__inner { grid-template-columns: 1fr; text-align: center; justify-items: center; }
.sp-hero--center .sp-hero__content { align-items: center; max-width: 820px; }
.sp-hero--center .sp-hero__actions, .sp-hero--center .sp-hero__trust { justify-content: center; }
.sp-hero--center .sp-hero__visual { width: 100%; max-width: 760px; grid-template-columns: 1fr 1fr 1fr; grid-template-rows: auto; text-align: left; }
.sp-hero--center .sp-hero-post { grid-row: auto; }
.sp-hero--dark { background: var(--bg-sidebar); color: var(--text-sidebar); }
.sp-hero--dark .sp-hero__lead, .sp-hero--dark .sp-hero__trust { color: var(--text-sidebar-muted); }
.sp-hero--dark .sp-hero__trust .sp-i { color: var(--accent); }
.sp-hero--dark .sp-hero__visual { background: var(--bg-sidebar-active); }
.sp-hero--dark .sp-hero__eyebrow { background: var(--bg-sidebar-active); color: var(--text-sidebar); }
.sp-hero--dark :focus-visible, .sp-hero--dark .is-focus { outline-color: var(--focus-ring-inverse); }
.sp-hero--dark .sp-btn--secondary { background: var(--bg-sidebar-active); color: var(--text-sidebar); box-shadow: inset 0 0 0 1px var(--text-sidebar-muted); }
.sp-hero--dark .sp-btn--secondary:hover, .sp-hero--dark .sp-btn--secondary.is-hover { box-shadow: inset 0 0 0 1px var(--text-sidebar); }
/* Мобильная раскладка */
@container sp-hero (max-width: 767px) {
  .sp-hero__inner { grid-template-columns: 1fr; gap: var(--space-8); padding: var(--space-10) var(--space-5) var(--space-6); }
  .sp-hero__title { font-size: 36px; line-height: 42px; }
  .sp-hero__lead { font-size: 17px; line-height: 26px; }
  .sp-hero__actions { flex-direction: column; width: 100%; }
  .sp-hero__actions .sp-btn { width: 100%; }
  .sp-hero .sp-btn--xl { --h: 56px; }
  .sp-hero__form { flex-direction: column; }
  .sp-hero__visual, .sp-hero--center .sp-hero__visual { grid-template-columns: 1fr 1fr; padding: var(--space-3); gap: var(--space-3); }
  .sp-hero-post, .sp-hero--center .sp-hero-post { grid-row: auto; grid-column: 1 / -1; }
  .sp-hero-post__img { aspect-ratio: 16 / 9; }
  .sp-hero-mini { padding: var(--space-3); }
}
@container sp-hero (max-width: 1023px) and (min-width: 768px) {
  .sp-hero__inner { padding: var(--space-12) var(--space-8); gap: var(--space-8); }
  .sp-hero__title { font-size: 44px; line-height: 52px; }
  .sp-hero__inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .sp-hero .sp-btn--xl { padding: 0 var(--space-6); }
}

/* ========================== Features ========================== */
.sp-features { container-type: inline-size; container-name: sp-features; }
.sp-features__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
@container sp-features (max-width: 719px) { .sp-features__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container sp-features (max-width: 559px) { .sp-features__grid { grid-template-columns: 1fr; } .sp-section-head__title { font-size: 26px; line-height: 32px; } }
.sp-feature { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-6); background: var(--bg-surface); border-radius: var(--radius-xl); color: var(--text-primary); }
.sp-feature__icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: var(--space-2); border-radius: var(--radius-md); background: var(--primary-soft); color: var(--primary-ink); }
.sp-feature__icon .sp-i { width: 24px; height: 24px; }
.sp-feature__title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-feature__text { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
/* Чередование */
.sp-feature-row { container-type: inline-size; container-name: sp-frow; }
.sp-feature-row__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-12); align-items: center; }
.sp-feature-row--reverse .sp-feature-row__content { order: 2; }
.sp-feature-row__content { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.sp-feature-row__title { margin: 0; font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; }
.sp-feature-row__text { margin: 0; font-size: 17px; line-height: 26px; color: var(--text-secondary); }
.sp-feature-row__media { padding: var(--space-6); border-radius: var(--radius-xl); background: var(--bg-surface-2); min-width: 0; }
@container sp-frow (max-width: 767px) {
  .sp-feature-row__inner { grid-template-columns: 1fr; gap: var(--space-6); }
  .sp-feature-row--reverse .sp-feature-row__content { order: 0; }
  .sp-feature-row__title { font-size: 26px; line-height: 32px; }
}
/* Макет-заглушка внутри media: список постов плана */
.sp-mock { display: flex; flex-direction: column; gap: var(--space-2); }
.sp-mock__row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-surface); font-size: 13px; line-height: 18px; }
.sp-mock__thumb { flex: none; width: 40px; height: 40px; border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--sun-300), var(--orange-300)); }
.sp-mock__thumb--b { background: linear-gradient(135deg, var(--blue-300), var(--violet-400)); }
.sp-mock__thumb--c { background: linear-gradient(135deg, var(--green-300), var(--teal-400)); }
.sp-mock__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sp-mock__title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-mock__meta { color: var(--text-secondary); font-size: 12px; line-height: 16px; }

/* ========================== HowItWorks ========================== */
.sp-steps { container-type: inline-size; container-name: sp-steps; }
.sp-steps__list { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 3), minmax(0, 1fr)); gap: var(--space-6); counter-reset: sp-step; }
.sp-step { position: relative; display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; min-width: 0; }
.sp-step__marker { position: relative; display: flex; align-items: center; width: 100%; gap: var(--space-4); margin-bottom: var(--space-2); }
.sp-step__num { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; width: 64px; height: 64px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); font-size: 28px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-step__line { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 8px, transparent 8px 14px); }
.sp-step:last-child .sp-step__line { display: none; }
.sp-step__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--accent-ink); }
.sp-step__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.sp-step__text { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-step__head { display: flex; align-items: center; gap: var(--space-3); }
/* вертикальный — явно или на узком контейнере */
.sp-steps--vertical .sp-steps__list { grid-template-columns: 1fr; gap: 0; }
.sp-steps--vertical .sp-step { flex-direction: row; gap: var(--space-4); padding-bottom: var(--space-6); }
.sp-steps--vertical .sp-step__marker { flex-direction: column; width: auto; align-self: stretch; margin: 0; gap: 0; }
.sp-steps--vertical .sp-step__num { width: 48px; height: 48px; font-size: 22px; }
.sp-steps--vertical .sp-step__line { flex: 1; width: 2px; height: auto; min-height: 24px; margin-bottom: calc(var(--space-6) * -1); background: repeating-linear-gradient(180deg, var(--border-strong) 0 8px, transparent 8px 14px); }
.sp-steps--vertical .sp-step__body { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-2); min-width: 0; }
.sp-steps--vertical .sp-step:last-child { padding-bottom: 0; }
.sp-step__body { display: flex; flex-direction: column; gap: var(--space-3); }
@container sp-steps (max-width: 767px) {
  .sp-steps__list { grid-template-columns: 1fr; gap: 0; }
  .sp-step { flex-direction: row; gap: var(--space-4); padding-bottom: var(--space-6); }
  .sp-step:last-child { padding-bottom: 0; }
  .sp-step__marker { flex-direction: column; width: auto; align-self: stretch; margin: 0; gap: 0; }
  .sp-step__num { width: 48px; height: 48px; font-size: 22px; }
  .sp-step__line { flex: 1; width: 2px; height: auto; min-height: 24px; margin-bottom: calc(var(--space-6) * -1); background: repeating-linear-gradient(180deg, var(--border-strong) 0 8px, transparent 8px 14px); }
  .sp-step__body { gap: var(--space-2); padding-top: var(--space-2); min-width: 0; }
}

/* ========================== Footer ========================== */
.sp-footer { container-type: inline-size; container-name: sp-footer; background: var(--bg-surface); color: var(--text-primary); border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.sp-footer__inner { padding: var(--space-12) var(--space-12) var(--space-8); display: flex; flex-direction: column; gap: var(--space-10); }
.sp-footer__top { display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(0, 1fr)); gap: var(--space-8); }
.sp-footer__brand { display: flex; flex-direction: column; gap: var(--space-4); align-items: flex-start; }
.sp-footer__logo { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 20px; line-height: 28px; font-weight: 700; color: var(--text-primary); text-decoration: none; }
.sp-footer__logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); }
.sp-footer__logo-mark .sp-i { width: 18px; height: 18px; }
.sp-footer__tagline { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); max-width: 260px; }
.sp-footer__contacts { display: flex; flex-direction: column; gap: var(--space-2); font-size: 15px; line-height: 22px; }
.sp-footer__contacts a { color: var(--text-primary); text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 500; }
.sp-footer__contacts a:hover { color: var(--text-link); }
.sp-footer__contacts .sp-i { width: 16px; height: 16px; color: var(--text-secondary); }
.sp-footer__social { display: flex; gap: var(--space-2); }
.sp-footer__soc { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-footer__soc:hover, .sp-footer__soc.is-hover { background: var(--bg-surface-3); }
.sp-footer__col { min-width: 0; }
.sp-footer__col summary { list-style: none; pointer-events: none; }
.sp-footer__col summary::-webkit-details-marker { display: none; }
.sp-footer__title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 var(--space-4); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-secondary); }
.sp-footer__title .sp-i { display: none; width: 18px; height: 18px; transition: transform var(--duration-base) var(--ease-standard); }
.sp-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.sp-footer__links a { color: var(--text-primary); text-decoration: none; font-size: 15px; line-height: 22px; border-radius: min(var(--radius-xs), 2px); }
.sp-footer__links a:hover, .sp-footer__links a.is-hover { color: var(--text-link); text-decoration: underline; text-underline-offset: 3px; }
.sp-footer__subscribe { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4) var(--space-8); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--bg-sunken); }
.sp-footer__sub-text { display: flex; flex-direction: column; gap: 4px; }
.sp-footer__sub-title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-footer__sub-desc { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-footer__sub-form { display: flex; gap: var(--space-2); flex: 1; max-width: 460px; min-width: 260px; }
.sp-footer__sub-form .sp-field { flex: 1; }
.sp-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--border); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.sp-footer__legal a { color: var(--text-secondary); text-decoration: none; }
.sp-footer__legal a:hover { color: var(--text-link); text-decoration: underline; }
@container sp-footer (max-width: 879px) { .sp-footer__top { grid-template-columns: repeat(4, minmax(0, 1fr)); } .sp-footer__brand { grid-column: 1 / -1; } }
@container sp-footer (max-width: 767px) {
  .sp-footer__inner { padding: var(--space-8) var(--space-5) var(--space-6); gap: var(--space-6); }
  .sp-footer__top { grid-template-columns: 1fr; gap: 0; }
  .sp-footer__brand { margin-bottom: var(--space-4); }
  .sp-footer__col { border-bottom: 1px solid var(--border); }
  .sp-footer__col summary { cursor: pointer; pointer-events: auto; }
  .sp-footer__title { margin: 0; min-height: 48px; }
  .sp-footer__title .sp-i { display: inline-flex; }
  .sp-footer__col[open] .sp-footer__title .sp-i { transform: rotate(180deg); }
  .sp-footer__col .sp-footer__links { padding-bottom: var(--space-4); }
  .sp-footer__links a { display: inline-flex; min-height: 32px; align-items: center; }
  .sp-footer__sub-form { flex-direction: column; min-width: 0; max-width: none; }
  .sp-footer__bottom { flex-direction: column; }
}
/* Компактный подвал кабинета */
.sp-app-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-6); padding: var(--space-5) var(--space-8); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-app-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.sp-app-footer__links a { color: var(--text-secondary); text-decoration: none; border-radius: min(var(--radius-xs), 2px); }
.sp-app-footer__links a:hover, .sp-app-footer__links a.is-hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.sp-app-footer__support { display: inline-flex; align-items: center; gap: var(--space-2); }
.sp-app-footer__phone { color: var(--text-primary); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.sp-app-footer__phone:hover { color: var(--text-link); }
@media (max-width: 767px) {
  .sp-app-footer { flex-direction: column; align-items: flex-start; padding: var(--space-5) var(--space-4); }
  .sp-app-footer__links a { display: inline-flex; min-height: 40px; align-items: center; }
}

/* ========================== CTASection ========================== */
.sp-cta { container-type: inline-size; container-name: sp-cta; background: var(--bg-sidebar); color: var(--text-sidebar); border-radius: var(--radius-xl); overflow: hidden; position: relative; }
.sp-cta__inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); padding: var(--space-12); }
.sp-cta__inner::after { content: ""; position: absolute; right: -80px; top: -120px; width: 320px; height: 320px; border-radius: var(--radius-full); border: 40px solid var(--bg-sidebar-active); pointer-events: none; }
.sp-cta__content { position: relative; z-index: 1; display: flex; flex-direction: column; gap: var(--space-3); max-width: 620px; }
.sp-cta__title { margin: 0; font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-sidebar); }
.sp-cta__text { margin: 0; font-size: 17px; line-height: 26px; color: var(--text-sidebar-muted); }
.sp-cta__actions { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); flex: none; }
.sp-cta__note { font-size: 13px; line-height: 18px; color: var(--text-sidebar-muted); }
.sp-cta :focus-visible, .sp-cta .is-focus { outline-color: var(--focus-ring-inverse); }
.sp-cta--center .sp-cta__inner { flex-direction: column; text-align: center; }
.sp-cta--center .sp-cta__content { align-items: center; }
.sp-cta__form { display: flex; gap: var(--space-2); width: 100%; max-width: 480px; }
.sp-cta__form .sp-field { flex: 1; }
.sp-cta__form .sp-control { --h: var(--control-l); }
.sp-cta__form .sp-field { text-align: left; }
.sp-cta__form .sp-field__error { color: var(--focus-ring-inverse); }
@container sp-cta (max-width: 767px) {
  .sp-cta__inner { flex-direction: column; align-items: stretch; padding: var(--space-8) var(--space-5); gap: var(--space-6); }
  .sp-cta__title { font-size: 26px; line-height: 32px; }
  .sp-cta__inner::after { display: none; }
  .sp-cta__actions { align-items: stretch; }
  .sp-cta__actions .sp-btn { width: 100%; }
  .sp-cta__form { flex-direction: column; max-width: none; }
}

/* ========================== EmailTemplate ========================== */
/* В продакшене те же значения переносятся в инлайн-стили; см. README EmailTemplate. */
.sp-email { background: var(--bg-surface-2); padding: var(--space-6) var(--space-4); font-family: Arial, Helvetica, sans-serif; color: var(--text-primary); }
.sp-email__preheader { display: none; }
.sp-email__container { width: 100%; max-width: 600px; margin: 0 auto; }
.sp-email__header { padding: 0 var(--space-2) var(--space-4); }
.sp-email__logo { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; line-height: 24px; font-weight: 700; color: var(--text-primary); text-decoration: none; }
.sp-email__logo-mark { display: inline-block; width: 24px; height: 24px; border-radius: min(var(--radius-sm), 6px); background: var(--accent); color: var(--on-accent); text-align: center; line-height: 24px; font-size: 13px; }
.sp-email__body { background: var(--bg-surface); border-radius: var(--radius-lg); padding: 40px; }
.sp-email__body > :last-child { margin-bottom: 0; }
.sp-email__title { margin: 0 0 16px; font-size: 24px; line-height: 32px; font-weight: 700; color: var(--text-primary); }
.sp-email__text { margin: 0 0 16px; font-size: 16px; line-height: 24px; color: var(--text-primary); }
.sp-email__muted { margin: 0 0 16px; font-size: 14px; line-height: 20px; color: var(--text-secondary); }
.sp-email__alert { margin: 0 0 24px; padding: 16px 20px; border-radius: var(--radius-md); background: var(--warning-soft); color: var(--warning-ink); font-size: 15px; line-height: 22px; border-left: 4px solid var(--warning); }
.sp-email__alert strong { display: block; margin-bottom: 2px; }
.sp-email__details { width: 100%; margin: 0 0 24px; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.sp-email__details td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.sp-email__details td:first-child { color: var(--text-secondary); }
.sp-email__details td:last-child { text-align: right; font-weight: 600; }
.sp-email__footer { padding: 24px var(--space-2) 0; font-size: 12px; line-height: 18px; color: var(--text-secondary); }
.sp-email__footer p { margin: 0 0 8px; }
.sp-email__footer a { color: var(--text-secondary); text-decoration: underline; }
/* Bulletproof-кнопка: table > td с фоном, ссылка с паддингом */
.sp-email-btn { border-collapse: separate; margin: 8px 0 24px; }
.sp-email-btn td { border-radius: var(--radius-md); background: var(--primary); }
.sp-email-btn a { display: inline-block; padding: 14px 28px; border-radius: var(--radius-md); font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 20px; font-weight: 700; color: var(--on-primary); text-decoration: none; }
.sp-email-btn--accent td { background: var(--accent); }
.sp-email-btn--accent a { color: var(--on-accent); }
.sp-email-btn--block { width: 100%; }
.sp-email-btn--block a { display: block; text-align: center; }
/* Код подтверждения */
.sp-email-code { display: flex; gap: 8px; margin: 8px 0 24px; }
.sp-email-code__d { display: inline-block; width: 52px; height: 64px; border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-primary); font-family: "Courier New", Courier, monospace; font-size: 36px; line-height: 64px; font-weight: 700; text-align: center; }
/* Карточка поста в письме */
.sp-email-post { margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.sp-email-post__img { height: 220px; background: radial-gradient(circle at 75% 35%, var(--sun-200) 0 14%, transparent 15%), linear-gradient(135deg, var(--sun-400), var(--orange-300) 60%, var(--red-300)); }
.sp-email-post__body { padding: 16px 20px 20px; }
.sp-email-post__org { margin: 0 0 4px; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-email-post__title { margin: 0 0 6px; font-size: 17px; line-height: 24px; font-weight: 700; }
.sp-email-post__text { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-primary); }
@media (max-width: 620px) {
  .sp-email { padding: var(--space-3) 0; }
  .sp-email__body { padding: 24px 20px; border-radius: 0; }
  .sp-email__header, .sp-email__footer { padding-left: 20px; padding-right: 20px; }
  .sp-email-code__d { width: 40px; height: 52px; line-height: 52px; font-size: 28px; }
  .sp-email-btn a { display: block; text-align: center; }
  .sp-email-btn { width: 100%; }
}

/* ========================== MessengerMessage ========================== */
.sp-msg-chat { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); background: var(--bg-surface-2); border-radius: var(--radius-xl); }
.sp-msg-chat__date { align-self: center; padding: 2px 10px; border-radius: var(--radius-full); background: var(--bg-surface); color: var(--text-secondary); font-size: 12px; line-height: 18px; }
.sp-msg { display: flex; gap: var(--space-2); align-items: flex-end; max-width: 440px; }
.sp-msg__avatar { flex: none; }
.sp-msg__col { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.sp-msg__bubble { position: relative; padding: 8px 12px 6px; border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) var(--radius-xs); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); overflow: hidden; }
.sp-msg__sender { display: block; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--primary-ink); margin-bottom: 2px; }
.sp-msg__overline { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; padding: 0 8px; height: 22px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.sp-msg__overline .sp-i { width: 14px; height: 14px; }
.sp-msg__text { margin: 0; font-size: 15px; line-height: 21px; white-space: pre-line; overflow-wrap: anywhere; }
.sp-msg__text b, .sp-msg__text strong { font-weight: 600; }
.sp-msg__text a { color: var(--text-link); text-decoration: none; }
.sp-msg__text a:hover { text-decoration: underline; }
.sp-msg__image { display: block; margin: 0 -12px 8px; aspect-ratio: 16 / 10; background: radial-gradient(circle at 70% 30%, var(--sun-200) 0 14%, transparent 15%), linear-gradient(135deg, var(--sun-400), var(--orange-300) 60%, var(--red-300)); }
.sp-msg__bubble > .sp-msg__image:first-child { margin-top: -8px; }
.sp-msg__image--b { background: linear-gradient(135deg, var(--blue-300), var(--violet-400)); }
.sp-msg__meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 6px 0 0 10px; font-size: 12px; line-height: 16px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.sp-msg__meta .sp-i { width: 14px; height: 14px; }
.sp-msg__bubble::after { content: ""; display: block; clear: both; }
/* исходящее — справа */
.sp-msg--out { align-self: flex-end; flex-direction: row-reverse; }
.sp-msg--out .sp-msg__bubble { background: var(--primary); color: var(--on-primary); border-radius: var(--radius-lg) var(--radius-lg) var(--radius-xs) var(--radius-lg); }
.sp-msg--out .sp-msg__meta { color: var(--on-primary); }
.sp-msg--out .sp-msg__text a { color: var(--on-primary); text-decoration: underline; }
/* ошибка */
.sp-msg--error .sp-msg__bubble { box-shadow: inset 4px 0 0 var(--danger), var(--shadow-xs); padding-left: 16px; }
.sp-msg__alert-title { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 15px; line-height: 21px; font-weight: 600; color: var(--danger-ink); }
.sp-msg__alert-title .sp-i { width: 18px; height: 18px; }
/* inline-кнопки */
.sp-msg__buttons { display: flex; flex-direction: column; gap: 4px; }
.sp-msg__btn-row { display: flex; gap: 4px; }
.sp-msg__btn { position: relative; flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 var(--space-3); border: 0; border-radius: min(var(--radius-md), 10px); background: var(--bg-surface); color: var(--primary-ink); font-size: 14px; line-height: 18px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-msg__btn .sp-i { width: 16px; height: 16px; }
.sp-msg__btn:hover, .sp-msg__btn.is-hover { background: var(--bg-surface-3); }
.sp-msg__btn:active, .sp-msg__btn.is-active { background: var(--border-strong); }
.sp-msg__btn.is-loading { color: transparent; pointer-events: none; }
.sp-msg__btn.is-loading .sp-i { visibility: hidden; }
.sp-msg__btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: var(--radius-full); border: 2px solid var(--primary-ink); border-right-color: transparent; animation: sp-spin .7s linear infinite; }
.sp-msg__btn:disabled, .sp-msg__btn.is-disabled { color: var(--text-disabled); cursor: not-allowed; background: var(--bg-surface); }
.sp-msg__btn--done, .sp-msg__btn--done:disabled, .sp-msg__btn--done.is-disabled { color: var(--success-ink); cursor: default; }
@media (max-width: 767px) { .sp-msg { max-width: 92%; } .sp-msg__btn { height: 44px; padding: 0 var(--space-2); } }



/* ==========================================================================
   Дополнение: градиентная кнопка, магазин, блог, общие блоки сайта
   ========================================================================== */

/* ---------- Кнопка: градиент основного цвета ---------- */
.sp-btn--gradient { background-color: var(--primary); background-image: var(--primary-gradient); background-origin: border-box; background-repeat: no-repeat; background-size: 200% 100%; background-position: 100% 0; color: var(--on-primary); transition: background-position var(--duration-base) var(--ease-standard), transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard); }
.sp-btn--gradient:hover, .sp-btn--gradient.is-hover { background-position: 0 0; }
.sp-btn--gradient:active, .sp-btn--gradient.is-active { background-position: 100% 0; box-shadow: inset 0 0 0 100px rgba(0, 0, 0, 0.08); }
.sp-fab--gradient { background-color: var(--primary); background-image: var(--primary-gradient); background-origin: border-box; background-repeat: no-repeat; background-size: 200% 100%; background-position: 100% 0; color: var(--on-primary); }
.sp-fab--gradient:hover, .sp-fab--gradient.is-hover { background-position: 0 0; }

/* ---------- Цена ---------- */
.sp-price { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 2px var(--space-2); font-variant-numeric: tabular-nums; }
.sp-price__now { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.sp-price--sale .sp-price__now { color: var(--danger-ink); }
.sp-price__old { font-size: 13px; line-height: 18px; color: var(--text-tertiary); text-decoration: line-through; white-space: nowrap; }
.sp-price__off { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--radius-xs); background: var(--danger-soft); color: var(--danger-ink); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.sp-price__unit { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-price--s .sp-price__now { font-size: 15px; line-height: 22px; }
.sp-price--l .sp-price__now { font-size: 32px; line-height: 40px; letter-spacing: -0.01em; }
.sp-price--l .sp-price__old { font-size: 17px; line-height: 24px; }

/* ---------- Наличие ---------- */
.sp-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--success-ink); }
.sp-stock::before { content: ""; width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--success); flex: none; }
.sp-stock--low { color: var(--warning-ink); } .sp-stock--low::before { background: var(--warning); }
.sp-stock--out { color: var(--text-secondary); } .sp-stock--out::before { background: var(--text-tertiary); }
.sp-stock--order { color: var(--info-ink); } .sp-stock--order::before { background: var(--info); }

/* ---------- Карточка товара ---------- */
.sp-product { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); transition: box-shadow var(--duration-fast) var(--ease-standard); }
.sp-product:hover, .sp-product.is-hover { box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--border); }
.sp-product__media { position: relative; display: block; aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-sunken); }
.sp-product__media > .sp-ph, .sp-product__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration-slow) var(--ease-standard); }
.sp-product:hover .sp-product__media > .sp-ph, .sp-product.is-hover .sp-product__media > .sp-ph { transform: scale(1.03); }
.sp-product__badges { position: absolute; top: var(--space-2); left: var(--space-2); z-index: 1; display: flex; flex-wrap: wrap; gap: 4px; }
.sp-product__fav { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-xs); cursor: pointer; transition: color var(--duration-fast) var(--ease-standard); }
.sp-product__fav:hover, .sp-product__fav.is-hover { color: var(--danger); }
.sp-product__fav.is-on { color: var(--danger); }
.sp-product__fav.is-on svg { fill: currentColor; }
.sp-product__fav .sp-i { width: 20px; height: 20px; }
.sp-product__dots { position: absolute; left: 0; right: 0; bottom: var(--space-2); z-index: 1; display: flex; justify-content: center; gap: 4px; }
.sp-product__dots span { width: 6px; height: 6px; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.6); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.sp-product__dots span.is-active { background: var(--gray-0); }
.sp-product__body { display: flex; flex-direction: column; gap: var(--space-1); flex: 1; min-width: 0; padding: 0 var(--space-1); }
.sp-product__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 15px; line-height: 20px; font-weight: 500; color: inherit; text-decoration: none; }
.sp-product__title::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.sp-product__title:hover { color: var(--text-link); }
.sp-product__title:focus-visible { outline: none; }
.sp-product__title:focus-visible::after { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-product__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-product__meta .sp-rating { gap: 4px; }
.sp-product__foot { position: relative; z-index: 1; display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-1) var(--space-1); }
.sp-product__foot > .sp-btn:first-child, .sp-product__foot > .sp-qty:first-child { flex: 1; }
.sp-product__foot > .sp-qty:first-child { justify-content: space-between; }
.sp-product__foot .sp-btn:not(.sp-btn--icon) { min-width: 0; height: auto; min-height: var(--h); padding-top: 6px; padding-bottom: 6px; white-space: normal; text-align: center; line-height: 18px; }
.sp-product--out .sp-product__media > .sp-ph, .sp-product--out .sp-product__media > img { filter: grayscale(0.7); }
.sp-product--row { flex-direction: row; align-items: stretch; gap: var(--space-4); }
.sp-product--row .sp-product__media { width: 160px; flex: none; }
.sp-product--row .sp-product__main { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; min-width: 0; padding: var(--space-1) 0; }
.sp-product--row .sp-product__body, .sp-product--row .sp-product__foot { padding: 0; }
.sp-product--row .sp-product__foot > .sp-btn:first-child { flex: none; }
.sp-product--compact { padding: 0; background: transparent; gap: var(--space-2); }
.sp-product--compact:hover, .sp-product--compact.is-hover { box-shadow: none; }
.sp-product--compact .sp-product__body { padding: 0; }
.sp-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--product-min, 220px), 1fr)); gap: var(--space-4); }
@media (max-width: 767px) {
  .sp-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .sp-product { padding: var(--space-2); gap: var(--space-2); }
  .sp-product__title { font-size: 14px; line-height: 18px; }
  .sp-product--row .sp-product__media { width: 112px; }
}

/* ---------- Галерея товара ---------- */
.sp-gallery { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.sp-gallery__thumbs { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.sp-gallery__thumb { position: relative; display: block; width: 72px; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-sunken); box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.sp-gallery__thumb > .sp-ph { position: absolute; inset: 0; }
.sp-gallery__thumb:hover, .sp-gallery__thumb.is-hover { box-shadow: inset 0 0 0 1px var(--border-control); }
.sp-gallery__thumb.is-selected { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--primary); }
.sp-gallery__thumb--video::after { content: ""; position: absolute; inset: 0; margin: auto; width: 24px; height: 24px; border-radius: var(--radius-full); background: var(--gray-0) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l8 5-8 5z' fill='%231e1f2b'/%3E%3C/svg%3E") center / 16px no-repeat; }
.sp-gallery__main { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-sunken); cursor: zoom-in; }
.sp-gallery__main > .sp-ph { position: absolute; inset: 0; transition: transform var(--duration-slow) var(--ease-standard); transform-origin: var(--zx, 50%) var(--zy, 50%); }
.sp-gallery__main.is-zoomed { cursor: zoom-out; }
.sp-gallery__main.is-zoomed > .sp-ph { transform: scale(2.2); }
.sp-gallery__nav { position: absolute; top: calc(50% - var(--h) / 2); z-index: 1; }
.sp-gallery__nav--prev { left: var(--space-3); } .sp-gallery__nav--next { right: var(--space-3); }
.sp-gallery__count { position: absolute; left: var(--space-3); bottom: var(--space-3); z-index: 1; height: 24px; padding: 0 var(--space-2); display: inline-flex; align-items: center; border-radius: var(--radius-full); background: var(--bg-inverse); color: var(--text-inverse); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-gallery__tools { position: absolute; right: var(--space-3); bottom: var(--space-3); z-index: 1; display: flex; gap: var(--space-2); }
.sp-gallery .sp-btn--float { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); border-radius: var(--radius-full); }
.sp-gallery .sp-btn--float:hover { background: var(--bg-surface-2); }
@media (max-width: 767px) {
  .sp-gallery { grid-template-columns: minmax(0, 1fr); }
  .sp-gallery__thumbs { order: 2; flex-direction: row; overflow-x: auto; padding: 4px; }
  .sp-gallery__thumb { width: 56px; flex: none; }
  .sp-gallery__main { border-radius: var(--radius-md); }
  .sp-gallery__nav { display: none; }
}

/* ---------- Выбор варианта: размер, цвет ---------- */
.sp-variant { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.sp-variant > legend.sp-variant__head { width: 100%; margin-bottom: var(--space-2); }
.sp-variant__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); font-size: 13px; line-height: 18px; padding: 0; }
.sp-variant__label { font-weight: 600; color: var(--text-primary); }
.sp-variant__value { color: var(--text-secondary); font-weight: 400; }
.sp-variant__options { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sp-variant__hint { font-size: 13px; line-height: 18px; color: var(--warning-ink); }
.sp-size { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; height: 44px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--text-primary); font-size: 14px; line-height: 18px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; transition: box-shadow var(--duration-fast) var(--ease-standard); }
.sp-size small { font-size: 11px; line-height: 14px; font-weight: 400; color: var(--text-secondary); }
.sp-size:hover, .sp-size.is-hover { box-shadow: inset 0 0 0 1px var(--border-control); }
.sp-size.is-selected, .sp-size[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--primary); }
.sp-size.is-disabled, .sp-size:disabled { color: var(--text-disabled); cursor: not-allowed; background-image: linear-gradient(to top right, transparent calc(50% - 0.5px), var(--border-strong) calc(50% - 0.5px), var(--border-strong) calc(50% + 0.5px), transparent calc(50% + 0.5px)); }
.sp-size.is-disabled small, .sp-size:disabled small { color: var(--text-disabled); }
.sp-color-opt { position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--c, var(--gray-300)); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); cursor: pointer; transition: box-shadow var(--duration-fast) var(--ease-standard); }
.sp-color-opt:hover, .sp-color-opt.is-hover { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--border-control); }
.sp-color-opt.is-selected, .sp-color-opt[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--primary); }
.sp-color-opt.is-disabled, .sp-color-opt:disabled { cursor: not-allowed; }
.sp-color-opt.is-disabled::after, .sp-color-opt:disabled::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--text-secondary); transform: rotate(45deg); box-shadow: 0 0 0 1px var(--bg-surface); }
.sp-variant-thumb { position: relative; width: 56px; height: 56px; padding: 0; border: 0; border-radius: var(--radius-md); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); cursor: pointer; }
.sp-variant-thumb > .sp-ph { position: absolute; inset: 0; }
.sp-variant-thumb.is-selected { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--primary); }

/* ---------- Счётчик количества ---------- */
.sp-qty { --h: var(--control-m); display: inline-flex; align-items: center; height: var(--h); border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-primary); }
.sp-qty__btn { display: inline-flex; align-items: center; justify-content: center; width: var(--h); height: var(--h); padding: 0; border: 0; border-radius: var(--radius-md); background: transparent; color: inherit; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-qty__btn:hover, .sp-qty__btn.is-hover { background: var(--bg-surface-3); }
.sp-qty__btn:disabled, .sp-qty__btn.is-disabled { color: var(--text-disabled); background: transparent; cursor: not-allowed; }
.sp-qty__btn .sp-i { width: 18px; height: 18px; }
.sp-qty__input { width: 40px; height: 100%; padding: 0; border: 0; background: transparent; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: inherit; -moz-appearance: textfield; appearance: textfield; }
.sp-qty__input::-webkit-outer-spin-button, .sp-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sp-qty--s { --h: var(--control-s); border-radius: var(--radius-sm); } .sp-qty--s .sp-qty__btn { border-radius: var(--radius-sm); } .sp-qty--s .sp-qty__input { width: 32px; font-size: 14px; }
.sp-qty--l { --h: var(--control-l); } .sp-qty--l .sp-qty__input { width: 48px; font-size: 17px; }
.sp-qty--outline { background: var(--bg-surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-qty--outline .sp-qty__btn:hover { background: var(--bg-surface-2); }
.sp-qty--primary { background: var(--primary); color: var(--on-primary); }
.sp-qty--primary .sp-qty__btn:hover, .sp-qty--primary .sp-qty__btn.is-hover { background: var(--primary-hover); }
.sp-qty.is-disabled { background: var(--bg-surface-2); color: var(--text-disabled); }
@media (max-width: 767px) { .sp-qty--s { --h: var(--control-m); } }

/* ---------- Корзина ---------- */
.sp-cart-item { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); align-items: start; padding: var(--space-4) 0; }
.sp-cart-item + .sp-cart-item { border-top: 1px solid var(--border); }
.sp-cart-item__media { position: relative; width: 88px; aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-sunken); }
.sp-cart-item__media > .sp-ph { position: absolute; inset: 0; }
.sp-cart-item__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-cart-item__title { margin: 0; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text-primary); text-decoration: none; }
a.sp-cart-item__title:hover { color: var(--text-link); }
.sp-cart-item__meta { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-cart-item__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.sp-cart-item__price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.sp-cart-item__price .sp-price { justify-content: flex-end; }
.sp-cart-item.is-unavailable .sp-cart-item__title { color: var(--text-secondary); }
.sp-cart-item.is-unavailable .sp-cart-item__media > .sp-ph { filter: grayscale(0.8); }
.sp-cart-item--compact { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 4px var(--space-3); padding: var(--space-3) 0; }
.sp-cart-item--compact .sp-cart-item__media { width: 64px; }
.sp-cart-item--compact .sp-cart-item__title { font-size: 14px; line-height: 18px; }
.sp-cart-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.sp-cart-free { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--bg-sunken); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-cart-free strong { color: var(--text-primary); font-weight: 600; }
.sp-cart-total { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); font-size: 17px; line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-cart-total small { font-size: 13px; line-height: 18px; font-weight: 400; color: var(--text-secondary); }
.sp-cart { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-5); align-items: start; container-type: inline-size; }
@media (max-width: 1023px) { .sp-cart { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 767px) { .sp-cart-item { grid-template-columns: 72px minmax(0, 1fr); } .sp-cart-item__media { width: 72px; } .sp-cart-item__price { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; gap: var(--space-2); align-items: baseline; } }

/* ---------- Фильтры каталога и сортировка ---------- */
.sp-filters { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.sp-filters__group { padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.sp-filters__group:first-child { border-top: 0; padding-top: 0; }
.sp-filters__title { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text-primary); cursor: pointer; border-radius: var(--radius-xs); }
.sp-filters__title:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-filters__title .sp-i { width: 16px; height: 16px; color: var(--text-secondary); transition: transform var(--duration-base) var(--ease-standard); }
.sp-filters__group.is-closed .sp-filters__title .sp-i { transform: rotate(-90deg); }
.sp-filters__group.is-closed .sp-filters__body { display: none; }
.sp-filters__body { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-3); }
.sp-filters__opt { display: flex; align-items: center; gap: var(--space-2); }
.sp-filters__opt .sp-checkbox, .sp-filters__opt .sp-radio { flex: 1; min-width: 0; }
.sp-filters__count { margin-left: auto; font-size: 13px; line-height: 18px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.sp-filters__range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-2); align-items: center; color: var(--text-tertiary); }
.sp-filters__range .sp-control { min-width: 0; }
.sp-filters__foot { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.sp-applied { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sp-catalog-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.sp-catalog-bar__count { font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-catalog-bar__count strong { color: var(--text-primary); font-weight: 600; }
.sp-catalog-bar__tools { display: flex; align-items: center; gap: var(--space-2); }
.sp-catalog-bar__sort { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--text-secondary); }
.sp-catalog-bar__sort .sp-select { min-width: 200px; }
.sp-catalog { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-8); align-items: start; }
@media (max-width: 1023px) { .sp-catalog { grid-template-columns: minmax(0, 1fr); } .sp-catalog > .sp-filters { display: none; } }

/* ---------- Сводка отзывов и отзыв ---------- */
.sp-review-sum { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4) var(--space-8); align-items: center; }
.sp-review-sum__score { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); }
.sp-review-sum__value { font-size: 48px; line-height: 56px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.sp-review-sum__count { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-review-sum__bars { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.sp-review-sum__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sp-review-bar { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 36px minmax(0, 1fr) 44px; gap: var(--space-3); align-items: center; width: 100%; padding: 2px 4px; border-radius: var(--radius-xs); font-size: 13px; line-height: 18px; color: var(--text-secondary); cursor: pointer; font-variant-numeric: tabular-nums; }
.sp-review-bar:hover, .sp-review-bar.is-hover { color: var(--text-primary); background: var(--bg-surface-2); }
.sp-review-bar:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sp-review-bar.is-selected { color: var(--text-primary); font-weight: 600; }
.sp-review-bar__star { display: inline-flex; align-items: center; gap: 4px; }
.sp-review-bar__star .sp-i { width: 14px; height: 14px; color: var(--accent); }
.sp-review-bar__star .sp-i svg { fill: currentColor; }
.sp-review-bar__track { height: 8px; border-radius: var(--radius-full); background: var(--bg-surface-2); overflow: hidden; }
.sp-review-bar:hover .sp-review-bar__track { background: var(--bg-surface-3); }
.sp-review-bar__fill { display: block; height: 100%; width: var(--v, 0%); border-radius: inherit; background: var(--accent); }
.sp-review-bar__n { text-align: right; }
.sp-review { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5) 0; border-top: 1px solid var(--border); }
.sp-review:first-child { border-top: 0; }
.sp-review__head { display: flex; align-items: center; gap: var(--space-3); }
.sp-review__who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sp-review__name { font-size: 15px; line-height: 20px; font-weight: 600; }
.sp-review__date { font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
.sp-review__rate { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 13px; color: var(--text-secondary); }
.sp-review__text { margin: 0; font-size: 15px; line-height: 22px; }
.sp-review__text b { font-weight: 600; }
.sp-review__photos { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.sp-review__photo { position: relative; width: 64px; height: 64px; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; }
.sp-review__photo > .sp-ph { position: absolute; inset: 0; }
.sp-review__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.sp-review__reply { padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--bg-sunken); font-size: 14px; line-height: 20px; }
.sp-review__reply-head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 4px; font-size: 13px; font-weight: 600; }
@media (max-width: 767px) { .sp-review-sum { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Доставка ---------- */
.sp-delivery { display: flex; flex-direction: column; border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border); background: var(--bg-surface); color: var(--text-primary); }
.sp-delivery__city { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-delivery__city strong { color: var(--text-primary); font-weight: 600; }
.sp-delivery__row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.sp-delivery__row > .sp-i { width: 20px; height: 20px; color: var(--text-secondary); margin-top: 1px; }
.sp-delivery__title { font-size: 15px; line-height: 22px; font-weight: 500; }
.sp-delivery__meta { grid-column: 2 / -1; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-delivery__price { font-size: 15px; line-height: 22px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sp-delivery__price--free { color: var(--success-ink); }
.sp-delivery__row.is-unavailable .sp-delivery__title, .sp-delivery__row.is-unavailable .sp-delivery__price { color: var(--text-secondary); font-weight: 400; }

/* ---------- Таймер акции ---------- */
.sp-countdown { display: inline-flex; align-items: flex-start; gap: 6px; font-variant-numeric: tabular-nums; }
.sp-countdown__unit { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sp-countdown__num { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 48px; padding: 0 6px; border-radius: var(--radius-md); background: var(--bg-inverse); color: var(--text-inverse); font-size: 22px; line-height: 28px; font-weight: 700; }
.sp-countdown__label { font-size: 11px; line-height: 14px; color: var(--text-secondary); }
.sp-countdown__sep { height: 48px; display: inline-flex; align-items: center; font-size: 20px; font-weight: 700; color: var(--text-tertiary); }
.sp-countdown--accent .sp-countdown__num { background: var(--accent); color: var(--on-accent); }
.sp-countdown--s .sp-countdown__num { min-width: 32px; height: 32px; font-size: 15px; line-height: 20px; border-radius: var(--radius-sm); }
.sp-countdown--s .sp-countdown__sep { height: 32px; font-size: 15px; }
.sp-countdown--inline { align-items: center; gap: 6px; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--danger-ink); }
.sp-countdown--inline .sp-i { width: 16px; height: 16px; }
.sp-promo-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--text-primary); }
.sp-promo-strip__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-promo-strip__title { font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-promo-strip__sub { font-size: 13px; line-height: 18px; color: var(--text-secondary); }

/* ---------- Липкая панель покупки ---------- */
.sp-buybar { position: sticky; bottom: 0; z-index: var(--z-raised); display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); background: var(--bg-surface); border-top: 1px solid var(--border); color: var(--text-primary); }
.sp-buybar__price { display: flex; flex-direction: column; flex: none; min-width: 0; }
.sp-buybar__price .sp-price__now { font-size: 17px; line-height: 22px; }
.sp-buybar > .sp-btn:not(.sp-btn--icon), .sp-buybar > .sp-qty { flex: 1; }
.sp-buybar > .sp-qty { justify-content: space-between; }
.sp-buybar > .sp-btn:not(.sp-btn--icon) { min-width: 0; white-space: normal; line-height: 18px; text-align: center; }

/* ---------- Шапка магазина и мега-меню ---------- */
.sp-shophead { background: var(--bg-surface); color: var(--text-primary); border-bottom: 1px solid var(--border); }
.sp-shophead__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 36px; padding: 0 var(--space-6); font-size: 13px; line-height: 18px; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.sp-shophead__top a { color: inherit; text-decoration: none; } .sp-shophead__top a:hover { color: var(--text-primary); }
.sp-shophead__links { display: flex; gap: var(--space-5); }
.sp-shophead__city { display: inline-flex; align-items: center; gap: 4px; color: var(--text-primary); font-weight: 500; }
.sp-shophead__city .sp-i { width: 16px; height: 16px; }
.sp-shophead__main { display: flex; align-items: center; gap: var(--space-4); height: 72px; padding: 0 var(--space-6); }
.sp-shophead__logo { flex: none; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.sp-shophead__search { flex: 1; min-width: 0; display: flex; gap: 2px; }
.sp-shophead__search .sp-search { flex: 1; border-radius: var(--radius-md) 0 0 var(--radius-md); }
.sp-shophead__search .sp-btn { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.sp-shophead__actions { display: flex; align-items: center; gap: var(--space-1); }
.sp-shophead__action { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 4px var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-secondary); font-size: 12px; line-height: 16px; text-decoration: none; cursor: pointer; }
.sp-shophead__action .sp-i { width: 24px; height: 24px; color: var(--text-primary); }
.sp-shophead__action:hover, .sp-shophead__action.is-hover { background: var(--bg-surface-2); color: var(--text-primary); }
.sp-shophead__action .sp-counter { position: absolute; top: 0; left: calc(50% + 6px); }
.sp-shophead__nav { display: flex; align-items: center; gap: var(--space-1); height: 48px; padding: 0 var(--space-4); overflow-x: auto; scrollbar-width: none; }
.sp-shophead__nav a { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-md); font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-primary); text-decoration: none; }
.sp-shophead__nav a:hover { background: var(--bg-surface-2); }
.sp-shophead__nav a.is-sale { color: var(--danger-ink); }
.sp-shophead--mobile .sp-shophead__main { height: 56px; padding: 0 var(--space-3); gap: var(--space-2); }
.sp-shophead--mobile .sp-shophead__logo { flex: 1; font-size: 17px; }
.sp-shophead--mobile .sp-shophead__searchrow { padding: 0 var(--space-3) var(--space-3); }
.sp-shophead--mobile .sp-shophead__action { min-width: 44px; height: 44px; padding: 0; justify-content: center; }
.sp-shophead--mobile .sp-shophead__action .sp-counter { top: 4px; left: auto; right: 2px; }
.sp-mega { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 440px; background: var(--bg-surface); color: var(--text-primary); border-radius: 0 0 var(--radius-xl) var(--radius-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.sp-mega__cats { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: var(--space-3); list-style: none; background: var(--bg-sunken); }
.sp-mega__cat { display: flex; align-items: center; gap: var(--space-3); height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); font-size: 15px; line-height: 20px; color: var(--text-primary); text-decoration: none; }
.sp-mega__cat > .sp-i:first-child { color: var(--text-secondary); }
.sp-mega__cat > span { flex: 1; min-width: 0; }
.sp-mega__cat > .sp-i:last-child { width: 16px; height: 16px; color: var(--text-tertiary); }
.sp-mega__cat:hover, .sp-mega__cat.is-hover { background: var(--bg-surface-2); }
.sp-mega__cat.is-active { background: var(--bg-surface); font-weight: 600; box-shadow: var(--shadow-xs); }
.sp-mega__cat.is-active > .sp-i { color: var(--text-primary); }
.sp-mega__panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 220px; gap: var(--space-6); padding: var(--space-6) var(--space-8); align-content: start; }
.sp-mega__col h4 { margin: 0 0 var(--space-2); font-size: 15px; line-height: 20px; font-weight: 600; }
.sp-mega__col h4 a { color: inherit; text-decoration: none; } .sp-mega__col h4 a:hover { color: var(--text-link); }
.sp-mega__col ul { display: flex; flex-direction: column; gap: 6px; margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.sp-mega__col li a { font-size: 14px; line-height: 20px; color: var(--text-secondary); text-decoration: none; }
.sp-mega__col li a:hover { color: var(--text-primary); }
.sp-mega__promo { position: relative; display: flex; align-items: flex-end; min-height: 280px; padding: var(--space-4); border-radius: var(--radius-lg); overflow: hidden; color: var(--gray-0); text-decoration: none; }
.sp-mega__promo > .sp-ph { position: absolute; inset: 0; }
.sp-mega__promo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(19, 20, 29, 0.72) 100%); }
.sp-mega__promo-text { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.sp-mega__promo-text strong { font-size: 17px; line-height: 22px; }
.sp-mega__promo-text span { font-size: 13px; line-height: 18px; }

/* ---------- Отслеживание заказа ---------- */
.sp-order { display: flex; flex-direction: column; gap: var(--space-5); padding: var(--space-6); border-radius: var(--radius-xl); background: var(--bg-surface); color: var(--text-primary); }
.sp-order__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.sp-order__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; }
.sp-order__sub { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-order__eta { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--bg-sunken); }
.sp-order__eta span { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-order__eta strong { font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-order__items { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.sp-order__thumb { position: relative; width: 56px; height: 56px; border-radius: var(--radius-sm); overflow: hidden; flex: none; }
.sp-order__thumb > .sp-ph { position: absolute; inset: 0; }
.sp-order__more { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--radius-sm); background: var(--bg-surface-2); font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.sp-order__foot { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sp-order__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); }
@media (max-width: 767px) { .sp-order { padding: var(--space-5); } .sp-order__grid { grid-template-columns: minmax(0, 1fr); } }
.sp-track { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.sp-track__step { position: relative; display: flex; flex-direction: column; gap: 2px; padding-top: var(--space-4); font-size: 13px; line-height: 18px; color: var(--text-secondary); min-width: 0; }
.sp-track__step::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: var(--radius-full); background: var(--bg-surface-2); }
.sp-track__step.is-done::before { background: var(--primary); }
.sp-track__step.is-current::before { background: linear-gradient(90deg, var(--primary) 50%, var(--bg-surface-2) 50%); }
.sp-track__step.is-error::before { background: var(--danger); }
.sp-track__label { font-weight: 500; color: var(--text-secondary); }
.sp-track__step.is-done .sp-track__label { color: var(--text-primary); }
.sp-track__step.is-current .sp-track__label { color: var(--text-primary); font-weight: 600; }
.sp-track__step.is-error .sp-track__label { color: var(--danger-ink); }
.sp-track__time { color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
@media (max-width: 767px) { .sp-track { grid-template-columns: minmax(0, 1fr); gap: 0; } .sp-track__step { padding: 0 0 var(--space-3) var(--space-5); } .sp-track__step::before { top: 2px; bottom: 0; left: 0; right: auto; width: 4px; height: auto; } .sp-track__step.is-current::before { background: linear-gradient(180deg, var(--primary) 50%, var(--bg-surface-2) 50%); } }

/* ---------- Карточка статьи ---------- */
.sp-acard { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; color: var(--text-primary); }
.sp-acard__media { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-sunken); }
.sp-acard__media > .sp-ph, .sp-acard__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--duration-slow) var(--ease-standard); }
.sp-acard:hover .sp-acard__media > .sp-ph, .sp-acard.is-hover .sp-acard__media > .sp-ph { transform: scale(1.03); }
.sp-acard__body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.sp-acard__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); position: relative; z-index: 1; }
.sp-acard__title { margin: 0; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.005em; text-wrap: pretty; }
.sp-acard__title a { color: inherit; text-decoration: none; }
.sp-acard__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.sp-acard__title a:focus-visible { outline: none; }
.sp-acard__title a:focus-visible::after { outline: 2px solid var(--focus-ring); outline-offset: 4px; border-radius: var(--radius-lg); }
.sp-acard:hover .sp-acard__title a, .sp-acard.is-hover .sp-acard__title a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.sp-acard__excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-acard__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-acard__meta > span { display: inline-flex; align-items: center; gap: 4px; }
.sp-acard__meta .sp-i { width: 14px; height: 14px; }
.sp-acard__meta-sep::before { content: "·"; }
.sp-acard__author { color: var(--text-primary); font-weight: 500; }
.sp-acard--row { flex-direction: row; gap: var(--space-6); align-items: flex-start; }
.sp-acard--row .sp-acard__media { width: 40%; max-width: 320px; flex: none; }
.sp-acard--compact .sp-acard__title { font-size: 17px; line-height: 24px; }
.sp-acard--compact.sp-acard--row { gap: var(--space-4); }
.sp-acard--compact.sp-acard--row .sp-acard__media { width: 112px; aspect-ratio: 1 / 1; border-radius: var(--radius-md); }
.sp-acard--overlay { min-height: 420px; justify-content: flex-end; padding: var(--space-8); border-radius: var(--radius-xl); overflow: hidden; color: var(--gray-0); }
.sp-acard--overlay .sp-acard__media { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.sp-acard--overlay .sp-acard__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(19, 20, 29, 0) 30%, rgba(19, 20, 29, 0.8) 100%); }
.sp-acard--overlay .sp-acard__body { position: relative; z-index: 1; max-width: 640px; pointer-events: none; }
.sp-acard--overlay .sp-acard__body a, .sp-acard--overlay .sp-acard__top { pointer-events: auto; }
.sp-acard--overlay .sp-acard__title { font-size: 32px; line-height: 40px; font-weight: 700; }
.sp-acard--overlay .sp-acard__excerpt, .sp-acard--overlay .sp-acard__meta, .sp-acard--overlay .sp-acard__author { color: var(--gray-0); }
.sp-acard--overlay .sp-acard__title a::after { z-index: 0; }
@media (max-width: 767px) {
  .sp-acard--row:not(.sp-acard--compact) { flex-direction: column; }
  .sp-acard--row:not(.sp-acard--compact) .sp-acard__media { width: 100%; max-width: none; }
  .sp-acard--overlay { min-height: 360px; padding: var(--space-5); }
  .sp-acard--overlay .sp-acard__title { font-size: 24px; line-height: 32px; }
}
.sp-acard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--acard-min, 260px), 1fr)); gap: var(--space-8) var(--space-6); }

/* ---------- Статья: шапка, оглавление, прогресс чтения ---------- */
.sp-article-head { display: flex; flex-direction: column; gap: var(--space-4); max-width: 760px; }
.sp-article-head__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.sp-article-head__title { margin: 0; font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
.sp-article-head__lead { margin: 0; font-size: 19px; line-height: 28px; color: var(--text-secondary); text-wrap: pretty; }
.sp-article-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); padding-top: var(--space-2); font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-article-head__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.sp-article-head__meta .sp-i { width: 16px; height: 16px; }
.sp-article-head__by { display: inline-flex; align-items: center; gap: var(--space-3); }
.sp-article-head__by b { display: block; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text-primary); }
.sp-article-head__cover { margin: var(--space-4) 0 0; }
@media (max-width: 767px) { .sp-article-head__title { font-size: 30px; line-height: 36px; } .sp-article-head__lead { font-size: 17px; line-height: 26px; } }
.sp-article { display: grid; grid-template-columns: minmax(0, 720px) 240px; gap: var(--space-12); justify-content: center; align-items: start; }
.sp-article__aside { position: sticky; top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-6); }
@media (max-width: 1023px) { .sp-article { grid-template-columns: minmax(0, 1fr); } .sp-article__aside { display: none; } }
.sp-toc { display: flex; flex-direction: column; }
.sp-toc__title { margin: 0 0 var(--space-3); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.sp-toc__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; border-left: 2px solid var(--border); }
.sp-toc__link { display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; font-size: 14px; line-height: 20px; color: var(--text-secondary); text-decoration: none; transition: color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard); }
.sp-toc__link:hover { color: var(--text-primary); }
.sp-toc__link.is-active, .sp-toc__link[aria-current="true"] { color: var(--text-primary); font-weight: 500; border-left-color: var(--primary); }
.sp-toc__link--sub { padding-left: 28px; font-size: 13px; line-height: 18px; }
.sp-toc--mobile { border-radius: var(--radius-lg); background: var(--bg-surface-2); }
.sp-toc--mobile > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-4); font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.sp-toc--mobile > summary::-webkit-details-marker { display: none; }
.sp-toc--mobile > summary .sp-i { transition: transform var(--duration-base) var(--ease-standard); }
.sp-toc--mobile[open] > summary .sp-i { transform: rotate(180deg); }
.sp-toc--mobile .sp-toc__list { margin: 0 var(--space-4) var(--space-4); }
.sp-readbar { position: sticky; top: 0; z-index: var(--z-header); height: 3px; background: transparent; }
.sp-readbar__fill { display: block; height: 100%; width: var(--p, 0%); background: var(--primary); transition: width var(--duration-fast) linear; }
.sp-readbar--titled { height: auto; display: flex; flex-direction: column; background: var(--bg-surface); border-bottom: 1px solid var(--border); }
.sp-readbar__row { display: flex; align-items: center; gap: var(--space-4); height: 52px; padding: 0 var(--space-6); }
.sp-readbar__title { flex: 1; min-width: 0; font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-readbar__time { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.sp-readbar--titled .sp-readbar__fill { height: 3px; }

/* ---------- Автор ---------- */
.sp-author { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-4); align-items: start; padding: var(--space-6); border-radius: var(--radius-xl); background: var(--bg-surface); color: var(--text-primary); }
.sp-author__kicker { margin: 0 0 2px; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.sp-author__name { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-author__name a { color: inherit; text-decoration: none; } .sp-author__name a:hover { color: var(--text-link); }
.sp-author__role { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-author__bio { margin: var(--space-2) 0 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-author__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); font-size: 13px; color: var(--text-secondary); }
.sp-author--inline { padding: 0; background: transparent; align-items: center; gap: var(--space-3); }
.sp-author--center { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
.sp-author--center .sp-author__foot { justify-content: center; }

/* ---------- Соцсети и «Поделиться» ---------- */
.sp-social { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.sp-social__btn { --s: 40px; display: inline-flex; align-items: center; justify-content: center; width: var(--s); height: var(--s); padding: 0; border: 0; border-radius: var(--radius-full); background: var(--bg-surface-2); color: var(--text-primary); font-size: 12px; line-height: 1; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.sp-social__btn:hover, .sp-social__btn.is-hover { background: var(--bg-surface-3); }
.sp-social__btn .sp-i { width: 18px; height: 18px; }
.sp-social__btn.is-copied { background: var(--success-soft); color: var(--success-ink); }
.sp-social--s .sp-social__btn { --s: 32px; font-size: 11px; } .sp-social--s .sp-social__btn .sp-i { width: 16px; height: 16px; }
.sp-social--l .sp-social__btn { --s: 48px; font-size: 14px; } .sp-social--l .sp-social__btn .sp-i { width: 22px; height: 22px; }
.sp-social--square .sp-social__btn { border-radius: var(--radius-md); }
.sp-social--outline .sp-social__btn { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.sp-social--outline .sp-social__btn:hover { background: var(--bg-surface-2); }
.sp-social--brand .sp-social__btn { background: var(--brand, var(--primary)); color: var(--gray-0); }
.sp-social--brand .sp-social__btn:hover { box-shadow: inset 0 0 0 100px rgba(0, 0, 0, 0.12); }
.sp-social--inverse .sp-social__btn { background: rgba(255, 255, 255, 0.12); color: var(--gray-0); }
.sp-social--inverse .sp-social__btn:hover { background: rgba(255, 255, 255, 0.2); }
.sp-share { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.sp-share__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-secondary); }
.sp-share--rail { flex-direction: column; align-items: center; gap: var(--space-2); }
.sp-share--rail .sp-social { flex-direction: column; }

/* ---------- Комментарии ---------- */
.sp-comments { display: flex; flex-direction: column; gap: var(--space-6); color: var(--text-primary); }
.sp-comments__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.sp-comments__title { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; display: inline-flex; align-items: baseline; gap: var(--space-2); }
.sp-comments__title span { font-size: 17px; color: var(--text-tertiary); font-weight: 500; }
.sp-comments__list { display: flex; flex-direction: column; gap: var(--space-6); margin: 0; padding: 0; list-style: none; }
.sp-comment-form { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.sp-comment-form__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
.sp-comment-form__hint { margin-right: auto; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.sp-comment { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 var(--space-3); }
.sp-comment__main { min-width: 0; }
.sp-comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); }
.sp-comment__name { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text-primary); text-decoration: none; }
.sp-comment__time { font-size: 13px; line-height: 18px; color: var(--text-tertiary); }
.sp-comment__text { margin: 4px 0 0; font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.sp-comment__text .sp-comment__to { color: var(--text-link); font-weight: 500; }
.sp-comment__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: var(--space-1) 0 0 calc(var(--space-2) * -1); }
.sp-comment__actions .sp-btn.is-on { color: var(--text-link); }
.sp-comment__replies { grid-column: 2; display: flex; flex-direction: column; gap: var(--space-5); margin: var(--space-4) 0 0; padding: 0 0 0 var(--space-4); list-style: none; border-left: 2px solid var(--border); }
.sp-comment__replies .sp-comment { grid-template-columns: 32px minmax(0, 1fr); }
.sp-comment.is-deleted .sp-comment__text { color: var(--text-tertiary); font-style: italic; }
.sp-comment.is-deleted .sp-comment__actions { display: none; }
.sp-comment.is-deleted .sp-comment__name { color: var(--text-secondary); font-weight: 500; }
.sp-comment.is-new > .sp-comment__main { position: relative; }
.sp-comment.is-new > .sp-comment__main::before { content: ""; position: absolute; inset: calc(var(--space-2) * -1) calc(var(--space-3) * -1); z-index: -1; border-radius: var(--radius-md); background: var(--accent-soft); }
.sp-comment.is-new { position: relative; z-index: 0; }

/* ---------- Медиа в тексте: фото с подписью, видео ---------- */
.sp-figure { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; }
.sp-figure__media { position: relative; aspect-ratio: var(--ar, 16 / 9); border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-sunken); }
.sp-figure__media > .sp-ph, .sp-figure__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sp-figure__caption { font-size: 13px; line-height: 18px; color: var(--text-secondary); text-wrap: pretty; }
.sp-figure__credit { color: var(--text-tertiary); }
.sp-figure--wide { margin-inline: calc(var(--space-12) * -1); }
.sp-figure--pair .sp-figure__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
@media (max-width: 1023px) { .sp-figure--wide { margin-inline: 0; } }
.sp-video { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: var(--gray-950); color: var(--gray-0); }
.sp-video > .sp-ph { position: absolute; inset: 0; }
.sp-video__play { position: absolute; inset: 0; z-index: 1; margin: auto; display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--gray-0); color: var(--gray-900); box-shadow: var(--shadow-md); cursor: pointer; transition: transform var(--duration-fast) var(--ease-standard); }
.sp-video__play:hover, .sp-video__play.is-hover { transform: scale(1.06); }
.sp-video__play .sp-i { width: 28px; height: 28px; margin-left: 3px; }
.sp-video__play .sp-i svg { fill: currentColor; }
.sp-video__dur { position: absolute; right: var(--space-3); bottom: var(--space-3); z-index: 1; padding: 2px 6px; border-radius: var(--radius-xs); background: var(--gray-950); color: var(--gray-0); font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-video__label { position: absolute; left: var(--space-4); bottom: var(--space-3); right: 80px; z-index: 1; font-size: 15px; line-height: 20px; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.sp-video__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-6) var(--space-4) var(--space-3); background: linear-gradient(180deg, transparent, rgba(19, 20, 29, 0.8)); font-size: 12px; font-variant-numeric: tabular-nums; }
.sp-video__btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--gray-0); cursor: pointer; }
.sp-video__btn:hover { background: rgba(255, 255, 255, 0.16); }
.sp-video__btn .sp-i { width: 18px; height: 18px; }
.sp-video__seek { position: relative; flex: 1; height: 4px; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.3); }
.sp-video__seek span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%); border-radius: inherit; background: var(--gray-0); }
.sp-video__seek span::after { content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: var(--radius-full); background: var(--gray-0); }

/* ---------- Лайтбокс ---------- */
.sp-lightbox { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: rgba(12, 13, 20, 0.94); color: var(--gray-0); }
.sp-lightbox__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-6); }
.sp-lightbox__count { font-size: 15px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sp-lightbox__tools { display: flex; gap: var(--space-2); }
.sp-lightbox__btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.1); color: var(--gray-0); cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard); }
.sp-lightbox__btn:hover, .sp-lightbox__btn.is-hover { background: rgba(255, 255, 255, 0.2); }
.sp-lightbox__btn:focus-visible { outline-color: var(--focus-ring-inverse); }
.sp-lightbox__btn:disabled { opacity: 0.35; cursor: default; }
.sp-lightbox__stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 96px; }
.sp-lightbox__img { position: relative; width: min(100%, 900px); max-height: 100%; aspect-ratio: 3 / 2; border-radius: var(--radius-md); overflow: hidden; }
.sp-lightbox__img > .sp-ph, .sp-lightbox__img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sp-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.sp-lightbox__nav--prev { left: var(--space-6); } .sp-lightbox__nav--next { right: var(--space-6); }
.sp-lightbox__caption { padding: var(--space-3) var(--space-6) 0; text-align: center; font-size: 15px; line-height: 22px; color: var(--gray-200); }
.sp-lightbox__thumbs { display: flex; justify-content: center; gap: var(--space-2); padding: var(--space-4) var(--space-6) var(--space-6); overflow-x: auto; }
.sp-lightbox__thumb { position: relative; flex: none; width: 56px; height: 56px; padding: 0; border: 0; border-radius: var(--radius-sm); overflow: hidden; opacity: 0.5; cursor: pointer; transition: opacity var(--duration-fast) var(--ease-standard); }
.sp-lightbox__thumb > .sp-ph { position: absolute; inset: 0; }
.sp-lightbox__thumb:hover { opacity: 0.8; }
.sp-lightbox__thumb.is-selected { opacity: 1; box-shadow: 0 0 0 2px var(--gray-0); }
@media (max-width: 767px) { .sp-lightbox__stage { padding: 0; } .sp-lightbox__img { border-radius: 0; } .sp-lightbox__nav { display: none; } .sp-lightbox__top { padding: var(--space-3) var(--space-4); } }

/* ---------- Шапка рубрики / архива ---------- */
.sp-cat-head { display: flex; flex-direction: column; gap: var(--space-4); color: var(--text-primary); }
.sp-cat-head__row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.sp-cat-head__title { margin: 0; display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--space-3); font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.015em; }
.sp-cat-head__count { font-size: 17px; line-height: 24px; font-weight: 500; color: var(--text-tertiary); letter-spacing: 0; }
.sp-cat-head__desc { margin: 0; max-width: 640px; font-size: 17px; line-height: 26px; color: var(--text-secondary); }
.sp-cat-head .sp-chip-group { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.sp-cat-head--cover { position: relative; justify-content: flex-end; min-height: 300px; padding: var(--space-10); border-radius: var(--radius-xl); overflow: hidden; color: var(--gray-0); }
.sp-cat-head--cover > .sp-ph { position: absolute; inset: 0; }
.sp-cat-head--cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(19, 20, 29, 0.1) 0%, rgba(19, 20, 29, 0.78) 100%); }
.sp-cat-head--cover > :not(.sp-ph) { position: relative; z-index: 1; }
.sp-cat-head--cover .sp-cat-head__desc, .sp-cat-head--cover .sp-cat-head__count { color: var(--gray-0); }
.sp-cat-head--cover .sp-breadcrumbs__link, .sp-cat-head--cover .sp-breadcrumbs__current, .sp-cat-head--cover .sp-breadcrumbs__sep { color: var(--gray-0); }
@media (max-width: 767px) { .sp-cat-head__title { font-size: 30px; line-height: 36px; } .sp-cat-head--cover { padding: var(--space-5); min-height: 240px; } }

/* ---------- Карусель ---------- */
.sp-carousel { position: relative; min-width: 0; }
.sp-carousel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.sp-carousel__heading { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; }
.sp-carousel__arrows { display: flex; gap: var(--space-2); }
.sp-carousel__viewport { overflow: hidden; border-radius: var(--radius-xl); }
.sp-carousel__track { display: flex; gap: var(--gap, 0px); margin: 0; padding: 0; list-style: none; transform: translateX(var(--x, 0)); transition: transform var(--duration-slower) var(--ease-standard); }
.sp-carousel__slide { position: relative; flex: 0 0 var(--per, 100%); min-width: 0; }
.sp-carousel--items .sp-carousel__viewport { border-radius: 0; overflow: hidden; }
.sp-carousel--items { --gap: var(--space-4); --per: calc((100% - var(--gap) * 3) / 4); }
.sp-carousel__nav { position: absolute; top: 50%; z-index: 2; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-md); cursor: pointer; }
.sp-carousel__nav:hover, .sp-carousel__nav.is-hover { background: var(--bg-surface-2); }
.sp-carousel__nav:disabled { color: var(--text-disabled); cursor: default; box-shadow: var(--shadow-xs); }
.sp-carousel__nav--prev { left: var(--space-4); } .sp-carousel__nav--next { right: var(--space-4); }
.sp-carousel__dots { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: var(--space-4); }
.sp-carousel__dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: var(--radius-full); background: var(--border-strong); cursor: pointer; transition: width var(--duration-base) var(--ease-standard), background-color var(--duration-base) var(--ease-standard); }
.sp-carousel__dot.is-active, .sp-carousel__dot[aria-current="true"] { width: 24px; background: var(--primary); }
.sp-carousel--overlay-dots .sp-carousel__dots { position: absolute; left: 0; right: 0; bottom: var(--space-4); margin: 0; z-index: 2; }
.sp-carousel--overlay-dots .sp-carousel__dot { background: rgba(255, 255, 255, 0.5); }
.sp-carousel--overlay-dots .sp-carousel__dot.is-active { background: var(--gray-0); }
.sp-carousel__progress { position: absolute; left: var(--space-10); right: var(--space-10); bottom: var(--space-4); z-index: 2; display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 6px; }
.sp-carousel__progress span { height: 3px; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.35); overflow: hidden; }
.sp-carousel__progress span::after { content: ""; display: block; height: 100%; width: var(--p, 0%); background: var(--gray-0); }
.sp-slide-banner { position: relative; display: flex; align-items: flex-end; min-height: 360px; padding: var(--space-10) var(--space-20); overflow: hidden; color: var(--gray-0); }
.sp-slide-banner > .sp-ph { position: absolute; inset: 0; }
.sp-slide-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(19, 20, 29, 0.72) 0%, rgba(19, 20, 29, 0.2) 60%, transparent 100%); }
.sp-slide-banner__body { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); max-width: 520px; padding-bottom: var(--space-6); }
.sp-slide-banner__kicker { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.sp-slide-banner__title { margin: 0; font-size: 40px; line-height: 48px; font-weight: 700; letter-spacing: -0.015em; text-wrap: balance; }
.sp-slide-banner__text { margin: 0; font-size: 17px; line-height: 26px; }
.sp-slide-banner .sp-btn { margin-top: var(--space-2); }
@media (max-width: 767px) {
  .sp-carousel--items { --per: 70%; --gap: var(--space-3); }
  .sp-carousel--items .sp-carousel__viewport { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .sp-carousel--items .sp-carousel__slide { scroll-snap-align: start; }
  .sp-carousel__nav { display: none; }
  .sp-slide-banner { min-height: 420px; padding: var(--space-5); }
  .sp-slide-banner::after { background: linear-gradient(180deg, transparent 20%, rgba(19, 20, 29, 0.8) 100%); }
  .sp-slide-banner__title { font-size: 28px; line-height: 34px; }
}

/* ---------- Шапка публичного сайта ---------- */
.sp-sitehead { position: relative; z-index: var(--z-header); background: var(--bg-surface); color: var(--text-primary); border-bottom: 1px solid var(--border); }
.sp-sitehead--sticky { position: sticky; top: 0; }
.sp-sitehead__inner { display: flex; align-items: center; gap: var(--space-8); height: 72px; max-width: var(--container-max, 1440px); margin: 0 auto; padding: 0 var(--space-8); }
.sp-sitehead__logo { flex: none; font-size: 20px; line-height: 28px; font-weight: 700; color: inherit; text-decoration: none; white-space: nowrap; }
.sp-sitehead__nav { display: flex; align-items: center; gap: var(--space-1); flex: 1; min-width: 0; margin: 0; padding: 0; list-style: none; }
.sp-sitehead__link { position: relative; display: inline-flex; align-items: center; gap: 4px; height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-md); background: transparent; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--text-secondary); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard); }
.sp-sitehead__link .sp-i { width: 16px; height: 16px; transition: transform var(--duration-base) var(--ease-standard); }
.sp-sitehead__link:hover, .sp-sitehead__link.is-hover { color: var(--text-primary); background: var(--bg-surface-2); }
.sp-sitehead__link.is-active, .sp-sitehead__link[aria-current="page"] { color: var(--text-primary); font-weight: 600; }
.sp-sitehead__link[aria-expanded="true"] { color: var(--text-primary); background: var(--bg-surface-2); }
.sp-sitehead__link[aria-expanded="true"] .sp-i { transform: rotate(180deg); }
.sp-sitehead__actions { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.sp-sitehead__burger { display: none; }
.sp-sitehead--transparent { background: transparent; border-bottom-color: transparent; color: var(--gray-0); }
.sp-sitehead--transparent .sp-sitehead__link { color: rgba(255, 255, 255, 0.82); }
.sp-sitehead--transparent .sp-sitehead__link:hover, .sp-sitehead--transparent .sp-sitehead__link.is-active { color: var(--gray-0); background: rgba(255, 255, 255, 0.12); }
.sp-sitehead--transparent .sp-btn--ghost { color: var(--gray-0); } .sp-sitehead--transparent .sp-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.sp-sitehead--blur { background: color-mix(in srgb, var(--bg-surface) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.sp-sitehead--mobile .sp-sitehead__inner { height: 56px; padding: 0 var(--space-4); gap: var(--space-2); }
.sp-sitehead--mobile .sp-sitehead__nav { display: none; }
.sp-sitehead--mobile .sp-sitehead__logo { flex: 1; font-size: 17px; }
.sp-sitehead--mobile .sp-sitehead__burger { display: inline-flex; }
.sp-sitehead--mobile .sp-sitehead__hide-m { display: none; }
@media (max-width: 1023px) { .sp-sitehead__inner { padding: 0 var(--space-4); height: 56px; gap: var(--space-2); } .sp-sitehead__nav, .sp-sitehead__hide-m { display: none; } .sp-sitehead__logo { flex: 1; font-size: 17px; } .sp-sitehead__burger { display: inline-flex; } }
.sp-navpanel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; width: 560px; max-width: 100%; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border); color: var(--text-primary); }
.sp-navpanel__item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px var(--space-3); align-items: start; padding: var(--space-3); border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.sp-navpanel__item:hover, .sp-navpanel__item.is-hover { background: var(--bg-surface-2); }
.sp-navpanel__icon { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-primary); }
.sp-navpanel__item:hover .sp-navpanel__icon { background: var(--bg-surface); }
.sp-navpanel__title { font-size: 15px; line-height: 20px; font-weight: 600; }
.sp-navpanel__desc { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-navpanel__foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-1); border-top: 1px solid var(--border); font-size: 13px; color: var(--text-secondary); }
.sp-mobnav { display: flex; flex-direction: column; background: var(--bg-surface); color: var(--text-primary); }
.sp-mobnav__list { display: flex; flex-direction: column; margin: 0; padding: var(--space-2) var(--space-2); list-style: none; }
.sp-mobnav__link { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 56px; padding: 0 var(--space-3); border-radius: var(--radius-md); font-size: 17px; line-height: 24px; font-weight: 500; color: inherit; text-decoration: none; }
.sp-mobnav__link:hover { background: var(--bg-surface-2); }
.sp-mobnav__link .sp-i { color: var(--text-tertiary); }
.sp-mobnav__foot { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); border-top: 1px solid var(--border); }

/* ---------- Вход и регистрация ---------- */
.sp-auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100%; background: var(--bg-surface); color: var(--text-primary); }
.sp-auth__main { display: flex; flex-direction: column; padding: var(--space-8) var(--space-10); }
.sp-auth__logo { font-size: 20px; line-height: 28px; font-weight: 700; color: inherit; text-decoration: none; }
.sp-auth__center { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--space-10) 0; }
.sp-auth__legal-foot { font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.sp-auth__aside { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-4); padding: var(--space-12); overflow: hidden; background: var(--bg-sidebar); color: var(--text-sidebar); }
.sp-auth__aside > .sp-ph { position: absolute; inset: 0; opacity: 0.35; }
.sp-auth__aside > :not(.sp-ph) { position: relative; z-index: 1; }
.sp-auth__quote { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; text-wrap: pretty; }
.sp-auth__who { font-size: 15px; line-height: 22px; color: var(--text-sidebar-muted); }
.sp-auth-form { display: flex; flex-direction: column; gap: var(--space-4); width: 100%; max-width: 400px; }
.sp-auth-form__head { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-2); }
.sp-auth-form__title { margin: 0; font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.01em; }
.sp-auth-form__sub { margin: 0; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-auth-form__providers { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.sp-auth-form__providers--row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-auth-form__mark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: var(--radius-xs); background: var(--brand, var(--text-primary)); color: var(--gray-0); font-size: 11px; font-weight: 700; flex: none; }
.sp-auth-form__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.sp-auth-form__alt { margin: 0; text-align: center; font-size: 15px; line-height: 22px; color: var(--text-secondary); }
.sp-auth-form__legal { margin: 0; font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.sp-auth-form__legal a { color: inherit; }
.sp-auth-card { padding: var(--space-8); border-radius: var(--radius-xl); background: var(--bg-surface); }
.sp-auth-card .sp-auth-form { max-width: none; }
.sp-auth-card .sp-auth-form__title { font-size: 24px; line-height: 32px; }
.sp-strength { display: flex; flex-direction: column; gap: 6px; }
.sp-strength__bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.sp-strength__bars span { height: 4px; border-radius: var(--radius-full); background: var(--bg-surface-2); }
.sp-strength--1 .sp-strength__bars span:nth-child(-n+1) { background: var(--danger); }
.sp-strength--2 .sp-strength__bars span:nth-child(-n+2) { background: var(--warning); }
.sp-strength--3 .sp-strength__bars span:nth-child(-n+3) { background: var(--success); }
.sp-strength--4 .sp-strength__bars span { background: var(--success); }
.sp-strength__text { font-size: 12px; line-height: 16px; color: var(--text-secondary); }
@media (max-width: 1023px) { .sp-auth { grid-template-columns: minmax(0, 1fr); } .sp-auth__aside { display: none; } .sp-auth__main { padding: var(--space-5) var(--space-4); } .sp-auth-form__title { font-size: 26px; line-height: 32px; } .sp-auth-form__providers--row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Центр уведомлений ---------- */
.sp-notices { display: flex; flex-direction: column; width: 400px; max-width: 100%; max-height: 600px; border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-md), inset 0 0 0 1px var(--border); overflow: hidden; }
.sp-notices__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5) var(--space-3); }
.sp-notices__title { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.sp-notices__tools { display: flex; align-items: center; gap: var(--space-1); }
.sp-notices__tabs { padding: 0 var(--space-5) var(--space-2); }
.sp-notices__list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: var(--space-1) var(--space-2) var(--space-2); list-style: none; }
.sp-notices__group { padding: var(--space-3) var(--space-3) var(--space-1); font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); }
.sp-notices__foot { padding: var(--space-3); border-top: 1px solid var(--border); text-align: center; }
.sp-notices--page { width: 100%; max-height: none; box-shadow: none; border-radius: var(--radius-xl); }
.sp-notice { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-3); padding: var(--space-3); padding-right: var(--space-8); border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.sp-notice:hover, .sp-notice.is-hover { background: var(--bg-surface-2); }
.sp-notice__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--bg-surface-2); color: var(--text-secondary); }
.sp-notice:hover .sp-notice__icon { background: var(--bg-surface); }
.sp-notice__icon--success { background: var(--success-soft); color: var(--success-ink); }
.sp-notice__icon--warning { background: var(--warning-soft); color: var(--warning-ink); }
.sp-notice__icon--danger { background: var(--danger-soft); color: var(--danger-ink); }
.sp-notice__icon--info { background: var(--info-soft); color: var(--info-ink); }
.sp-notice__icon--accent { background: var(--accent-soft); color: var(--accent-ink); }
.sp-notice:hover .sp-notice__icon[class*="--"] { filter: none; }
.sp-notice__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-notice__title { font-size: 14px; line-height: 20px; font-weight: 500; }
.sp-notice__text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-notice__time { font-size: 12px; line-height: 16px; color: var(--text-tertiary); }
.sp-notice__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.sp-notice.is-unread .sp-notice__title { font-weight: 600; }
.sp-notice.is-unread::after { content: ""; position: absolute; top: 18px; right: var(--space-3); width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--info); }

/* ---------- Карта с точками ---------- */
.sp-map { position: relative; display: grid; grid-template-columns: 360px minmax(0, 1fr); height: var(--map-h, 520px); border-radius: var(--radius-xl); overflow: hidden; background: var(--bg-surface); color: var(--text-primary); }
.sp-map__side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.sp-map__search { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.sp-map__count { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-map__list { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.sp-map-item { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--space-3); width: 100%; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); cursor: pointer; }
.sp-map-item:hover, .sp-map-item.is-hover { background: var(--bg-surface-2); }
.sp-map-item:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.sp-map-item.is-selected { background: var(--primary-soft); }
.sp-map-item__title { font-size: 15px; line-height: 20px; font-weight: 600; }
.sp-map-item__dist { font-size: 13px; line-height: 18px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; text-align: right; }
.sp-map-item__addr { grid-column: 1 / -1; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-map-item__hours { grid-column: 1 / -1; font-size: 13px; line-height: 18px; color: var(--success-ink); }
.sp-map-item__hours.is-closed { color: var(--text-secondary); }
.sp-map__canvas { position: relative; min-width: 0; overflow: hidden; background-color: var(--bg-sunken); background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 48px 48px; }
.sp-map__stub { position: absolute; left: var(--space-4); top: var(--space-4); padding: 4px 8px; border-radius: var(--radius-xs); background: var(--bg-surface); font-family: var(--font-mono); font-size: 12px; line-height: 16px; color: var(--text-secondary); box-shadow: var(--shadow-xs); }
.sp-map__controls { position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%); z-index: 2; display: flex; flex-direction: column; gap: var(--space-2); }
.sp-map__ctrl { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); cursor: pointer; }
.sp-map__ctrl:hover { background: var(--bg-surface-2); }
.sp-map__zoom { display: flex; flex-direction: column; border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.sp-map__zoom .sp-map__ctrl { box-shadow: none; border-radius: 0; }
.sp-map__zoom .sp-map__ctrl + .sp-map__ctrl { border-top: 1px solid var(--border); }
.sp-map-pin { position: absolute; left: var(--x, 50%); top: var(--y, 50%); z-index: 1; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.sp-map-pin__head { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--radius-full); background: var(--primary); color: var(--on-primary); font-size: 13px; line-height: 1; font-weight: 700; white-space: nowrap; box-shadow: 0 0 0 2px var(--bg-surface), var(--shadow-sm); transition: transform var(--duration-fast) var(--ease-standard); }
.sp-map-pin__head .sp-i { width: 16px; height: 16px; }
.sp-map-pin::after { content: ""; width: 0; height: 0; margin-top: -1px; border: 6px solid transparent; border-top-color: var(--primary); border-bottom: 0; }
.sp-map-pin:hover .sp-map-pin__head, .sp-map-pin.is-hover .sp-map-pin__head { transform: scale(1.08); }
.sp-map-pin.is-selected { z-index: 3; }
.sp-map-pin.is-selected .sp-map-pin__head { background: var(--accent); color: var(--on-accent); transform: scale(1.12); }
.sp-map-pin.is-selected::after { border-top-color: var(--accent); }
.sp-map-pin--cluster { transform: translate(-50%, -50%); }
.sp-map-pin--cluster::after { display: none; }
.sp-map-pin--cluster .sp-map-pin__head { width: 44px; height: 44px; background: var(--bg-surface); color: var(--text-primary); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent), var(--shadow-sm); }
.sp-map-pop { position: absolute; left: var(--x, 50%); top: var(--y, 50%); z-index: 4; transform: translate(-50%, calc(-100% - 52px)); width: 280px; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--bg-surface); box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 4px; }
.sp-map-pop__title { font-size: 15px; line-height: 20px; font-weight: 600; padding-right: var(--space-6); }
.sp-map-pop__meta { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.sp-map-pop__actions { display: flex; gap: var(--space-2); margin-top: var(--space-2); }
.sp-map-pop__close { position: absolute; top: var(--space-2); right: var(--space-2); }
@media (max-width: 767px) { .sp-map { grid-template-columns: minmax(0, 1fr); grid-template-rows: 280px minmax(0, 1fr); height: auto; } .sp-map__side { order: 2; border-right: 0; border-top: 1px solid var(--border); } .sp-map__canvas { order: 1; } .sp-map-pop { width: 240px; } }
