/* ── Chat Consultant — Yandex-style Design System ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ys-bg: #f3f3f6;
  --ys-surface: #ffffff;
  --ys-sidebar: #ececf0;
  --ys-sidebar-hover: #e2e2e8;
  --ys-border: rgba(0, 0, 0, 0.08);
  --ys-border-strong: rgba(0, 0, 0, 0.12);
  --ys-text: #1f1f24;
  --ys-text-secondary: #6d6d78;
  --ys-text-muted: #9b9ba4;
  --ys-accent: #7b61ff;
  --ys-accent-hover: #6a4ff5;
  --ys-accent-soft: rgba(123, 97, 255, 0.12);
  --ys-accent-text: #5b45e0;
  --ys-success: #22c55e;
  --ys-danger: #ef4444;
  /* Строгая геометрия 2026: лёгкий радиус, без «пилюль» */
  --ys-radius: 6px;
  --ys-radius-sm: 4px;
  --ys-radius-xs: 3px;
  --ys-radius-lg: 8px;
  --ys-radius-pill: 4px;
  --ys-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --ys-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  --ys-rail-w: 56px;
  --ys-shutter-w: 168px;
  --ys-sidebar-w: calc(var(--ys-rail-w) + var(--ys-shutter-w));
  --panel-pad: 0.75rem;
  --panel-brand-h: 36px;
  --panel-head-h: calc(var(--panel-pad) * 2 + var(--panel-brand-h));
  --panel-row-h: 44px;
  --panel-row-divider: rgba(15, 23, 42, 0.06);
  --ys-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ys-transition: 0.18s ease;
}

.dark {
  --ys-bg: #121218;
  --ys-surface: #1c1c24;
  --ys-sidebar: #16161d;
  --ys-sidebar-hover: #22222c;
  --ys-border: rgba(255, 255, 255, 0.08);
  --ys-border-strong: rgba(255, 255, 255, 0.12);
  --ys-text: #f0f0f5;
  --ys-text-secondary: #a0a0ad;
  --ys-text-muted: #6d6d78;
  --ys-accent-soft: rgba(123, 97, 255, 0.18);
  --ys-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --ys-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --panel-row-divider: rgba(255, 255, 255, 0.07);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--ys-font);
  background: var(--ys-bg);
  color: var(--ys-text);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--ys-bg) 0%, #e8e4ff 100%);
}
.dark .auth-page { background: linear-gradient(135deg, var(--ys-bg) 0%, #1a1530 100%); }

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--ys-surface);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius);
  padding: 2rem 2rem 1.75rem;
  box-shadow: var(--ys-shadow);
}
.auth-card__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
}
.auth-card__logo-icon {
  width: 36px; height: 36px;
  background: var(--ys-accent-soft);
  border-radius: var(--ys-radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: var(--ys-accent);
  overflow: hidden; flex-shrink: 0;
}
.auth-card__logo-icon img,
.auth-card__logo-icon svg { width: 100%; height: 100%; display: block; object-fit: contain; }
.auth-card__logo-icon--img { background: transparent; }
.auth-card__title { font-size: 1.375rem; font-weight: 700; margin: 0 0 0.25rem; }
.auth-card__subtitle { font-size: 0.875rem; color: var(--ys-text-secondary); margin: 0 0 1.5rem; }

/* ── Form controls ── */
.ys-label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--ys-text-secondary); margin-bottom: 0.375rem; }
.ys-input, .ys-textarea, .ys-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ys-text);
  background: var(--ys-surface);
  border: 1px solid var(--ys-border-strong);
  border-radius: var(--ys-radius-xs);
  outline: none;
  transition: border-color var(--ys-transition), box-shadow var(--ys-transition);
}
.ys-input:focus, .ys-textarea:focus, .ys-select:focus {
  border-color: var(--ys-accent);
  box-shadow: 0 0 0 3px var(--ys-accent-soft);
}
.ys-textarea { resize: vertical; min-height: 100px; }
.ys-select {
  appearance: auto;
  -webkit-appearance: menulist;
  cursor: pointer;
  min-height: 42px;
}
.ys-custom-select { position: relative; width: 100%; }
.ys-custom-select__native {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.ys-custom-select__trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  color: var(--ys-text);
  background: var(--ys-surface);
  border: 1px solid var(--ys-border-strong);
  border-radius: var(--ys-radius-xs);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--ys-transition), box-shadow var(--ys-transition);
}
.ys-custom-select__trigger::after {
  content: '';
  width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--ys-text-muted);
  border-bottom: 2px solid var(--ys-text-muted);
  transform: rotate(45deg) translateY(-2px);
  flex-shrink: 0;
  transition: transform var(--ys-transition);
}
.ys-custom-select.open .ys-custom-select__trigger {
  border-color: var(--ys-accent);
  box-shadow: 0 0 0 3px var(--ys-accent-soft);
}
.ys-custom-select.open .ys-custom-select__trigger::after {
  transform: rotate(-135deg) translateY(1px);
}
.ys-custom-select__menu {
  display: none;
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60;
  max-height: 240px; overflow-y: auto;
  background: var(--ys-surface);
  border: 1px solid var(--ys-border-strong);
  border-radius: var(--ys-radius-xs);
  box-shadow: var(--ys-shadow-md, 0 8px 24px rgba(15,23,42,.12));
  padding: 0.25rem;
}
.ys-custom-select.open .ys-custom-select__menu { display: block; }
.ys-custom-select__item {
  display: block; width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit; font-size: 0.875rem;
  color: var(--ys-text);
  background: transparent; border: none; border-radius: 6px;
  text-align: left; cursor: pointer;
  transition: background var(--ys-transition), color var(--ys-transition);
}
.ys-custom-select__item:hover {
  background: var(--ys-sidebar-hover);
  color: var(--ys-text);
}
.ys-custom-select__item.active {
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  font-weight: 500;
}
.ys-custom-select__item--multiline {
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: break-word;
}
.ys-custom-select__menu--floating {
  display: block !important;
  z-index: 100001;
}
.ys-custom-select--in-table { min-width: 9rem; }
.ys-table--admin-users .ys-table td:nth-child(6) { min-width: 11.5rem; white-space: nowrap; }
.ys-table--admin-users .ys-role-select { min-width: 10.5rem; max-width: 100%; }
.ys-form-group { margin-bottom: 1rem; }
.ys-form-error { font-size: 0.8125rem; color: var(--ys-danger); margin-top: 0.5rem; }

.ys-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: inherit; font-size: 0.9375rem; font-weight: 500;
  border-radius: var(--ys-radius-xs);
  border: none; cursor: pointer;
  transition: background var(--ys-transition), transform 0.1s, box-shadow var(--ys-transition);
}
.ys-btn:active { transform: scale(0.98); }
.ys-btn--primary { background: var(--ys-accent); color: #fff; }
.ys-btn--primary:hover { background: var(--ys-accent-hover); box-shadow: 0 4px 14px rgba(123,97,255,.35); }
.ys-btn--secondary { background: var(--ys-surface); color: var(--ys-text); border: 1px solid var(--ys-border-strong); }
.ys-btn--secondary:hover { background: var(--ys-sidebar-hover); }
.ys-btn--ghost { background: transparent; color: var(--ys-text-secondary); }
.ys-btn--ghost:hover { background: var(--ys-sidebar-hover); color: var(--ys-text); }
.ys-btn--block { width: 100%; }
.ys-btn--sm { padding: 0.4375rem 0.875rem; font-size: 0.8125rem; }
.ys-btn--danger { background: rgba(239,68,68,.1); color: var(--ys-danger); }
.ys-btn--danger:hover { background: rgba(239,68,68,.18); }

/* ── Panel layout (Yandex sidebar) ── */
.panel-layout {
  display: flex;
  min-height: 100vh;
}
.panel-sidebar {
  width: var(--ys-sidebar-w);
  flex-shrink: 0;
  background: var(--ys-sidebar);
  border-right: 1px solid var(--ys-border);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
.panel-sidebar:not(.panel-sidebar--grid) {
  display: flex;
  flex-direction: column;
}
/* Пока восстанавливаем сессию после F5 — не мигать пустым кадром */
.panel-layout.ys-session-restoring {
  min-height: 100vh;
  min-height: 100dvh;
}

.panel-sidebar--grid {
  display: grid;
  grid-template-columns: var(--ys-rail-w) var(--ys-shutter-w);
  grid-template-rows:
    var(--panel-head-h)
    repeat(6, var(--panel-row-h))
    1fr
    var(--panel-row-h)
    auto
    var(--panel-row-h);
  height: 100vh;
  height: 100dvh;
  align-content: start;
  padding-bottom: var(--panel-pad);
  transition: grid-template-columns 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Manager / shared accordion sidebar */
.panel-layout:has(.panel-sidebar--tree.panel-sidebar--manager) {
  --ys-sidebar-w: 268px;
}
.panel-sidebar--tree.panel-sidebar--manager {
  display: flex;
  flex-direction: column;
  width: var(--ys-sidebar-w);
  overflow: visible;
}
.panel-sidebar--tree.panel-sidebar--manager .panel-nav {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  overflow-x: hidden;
}
.panel-sidebar--tree.panel-sidebar--manager .panel-brand,
.panel-sidebar--tree.panel-sidebar--manager .panel-sidebar-footer {
  overflow: hidden;
}
.panel-sidebar-shutter-toggle {
  position: absolute;
  top: 5.25rem;
  right: -13px;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--ys-border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  background: var(--ys-surface, #fff);
  color: var(--ys-text-secondary);
  cursor: pointer;
  box-shadow: 2px 2px 8px rgba(15, 23, 42, 0.08);
  transition: background var(--ys-transition, 0.15s ease), color var(--ys-transition, 0.15s ease), left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel-sidebar-shutter-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.panel-sidebar-shutter-toggle:hover {
  background: color-mix(in srgb, var(--ys-accent) 10%, #fff);
  color: var(--ys-accent-text, var(--ys-text));
}
.panel-sidebar-shutter-toggle.is-closed {
  position: fixed;
  left: 0;
  right: auto;
  border-left: 1px solid var(--ys-border);
  border-radius: 0 10px 10px 0;
}
.panel-sidebar-shutter-toggle.is-closed svg {
  transform: rotate(180deg);
}
.panel-layout.panel-shutter-closed:has(.panel-sidebar--tree.panel-sidebar--manager) {
  --ys-sidebar-w: 0px;
}
.panel-layout.panel-shutter-closed .panel-sidebar--tree.panel-sidebar--manager {
  width: 0;
  border-right-color: transparent;
  pointer-events: none;
}
.panel-layout.panel-shutter-closed .panel-sidebar--tree.panel-sidebar--manager .panel-brand,
.panel-layout.panel-shutter-closed .panel-sidebar--tree.panel-sidebar--manager .panel-nav,
.panel-layout.panel-shutter-closed .panel-sidebar--tree.panel-sidebar--manager .panel-sidebar-footer {
  opacity: 0;
  visibility: hidden;
}
.panel-layout.panel-shutter-closed .panel-sidebar--tree.panel-sidebar--manager .panel-sidebar-shutter-toggle {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}
.panel-sidebar--tree .panel-nav-item--top {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 1rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ys-text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}
.panel-sidebar--tree .panel-nav-item--top svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--ys-text-secondary);
}
.panel-sidebar--tree .panel-nav-item--top:hover {
  background: color-mix(in srgb, var(--ys-accent) 8%, transparent);
}
.panel-sidebar--tree .panel-nav-item--top.active {
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  font-weight: 650;
  box-shadow: inset 3px 0 0 var(--ys-accent);
}
.panel-sidebar--tree .panel-nav-item--top.active svg {
  color: var(--ys-accent);
}
.mgr-site-nav-mount:not([hidden]) {
  display: contents;
}
.mgr-site-nav-mount .panel-nav-group__site-label {
  padding: 0.45rem 1rem 0.2rem 1rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ys-accent) 45%, var(--ys-text-muted));
}
.panel-sidebar--tree .panel-sidebar-footer {
  flex-shrink: 0;
}
html.dark .panel-rail__brand-tile {
  background: color-mix(in srgb, var(--ys-accent) 28%, #1a1a22);
  border-color: color-mix(in srgb, var(--ys-accent) 30%, transparent);
}
html.dark .panel-sidebar--main.panel-sidebar--grid {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ys-accent) 10%, var(--ys-sidebar)) 0%, var(--ys-sidebar) 48%);
}
.panel-layout.panel-shutter-closed {
  --ys-sidebar-w: var(--ys-rail-w);
}
.panel-layout.panel-shutter-closed .panel-sidebar--grid {
  grid-template-columns: var(--ys-rail-w) 0;
}
.panel-layout.panel-shutter-closed .panel-sidebar__cell:nth-child(2n) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.panel-sidebar__cell {
  min-width: 0;
  min-height: 0;
}
.panel-sidebar__cell:nth-child(odd):not(.panel-sidebar__spacer):not(.panel-sidebar__cell--rail-gap) {
  border-right: 1px solid var(--panel-row-divider);
}
.panel-sidebar__cell:nth-child(odd) {
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-sidebar__cell:nth-child(even) {
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: opacity 0.2s ease;
}
.panel-sidebar__cell--rail-gap {
  display: block !important;
  min-height: 0;
}
.panel-sidebar__spacer {
  grid-column: 1 / -1;
  min-height: 0.5rem;
}
.panel-rail__brand {
  width: var(--panel-brand-h);
  height: var(--panel-brand-h);
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ys-accent) 12%, var(--ys-border));
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-rail__brand-tile {
  width: 34px;
  height: 34px;
  border-radius: var(--ys-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--ys-accent) 22%, #fff), color-mix(in srgb, var(--ys-accent) 8%, #fff));
  border: 1px solid color-mix(in srgb, var(--ys-accent) 18%, transparent);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ys-accent) 12%, transparent);
}
.panel-rail__brand img { width: 22px; height: 22px; object-fit: contain; display: block; }
.panel-rail__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--panel-row-h);
  height: 100%;
  min-height: var(--panel-row-h);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--ys-text-secondary);
  cursor: pointer;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ys-border) 70%, transparent);
  transition: background var(--ys-transition), color var(--ys-transition);
}
.panel-rail__btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.panel-rail__btn:hover { background: color-mix(in srgb, var(--ys-accent) 8%, transparent); color: var(--ys-text); }
.panel-rail__btn.active {
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  box-shadow: inset 3px 0 0 var(--ys-accent), inset 0 -1px 0 color-mix(in srgb, var(--ys-border) 50%, transparent);
}
.panel-rail__btn.panel-sidebar__foot-start {
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ys-accent) 10%, var(--ys-border)), inset 0 -1px 0 color-mix(in srgb, var(--ys-border) 70%, transparent);
}
.panel-rail__btn.panel-sidebar__foot-end,
.panel-nav-item--label.panel-sidebar__cell.panel-sidebar__foot-end {
  box-shadow: inset 0 -1px 0 transparent;
}
.panel-nav-item--label.panel-sidebar__cell.panel-sidebar__foot-end {
  color: var(--ys-text-secondary);
}
.panel-nav-item--label.panel-sidebar__cell.panel-sidebar__foot-end:hover {
  color: var(--ys-text);
}
.panel-shutter__head {
  position: relative;
  height: 100%;
  min-height: var(--panel-head-h);
  padding: 0 2rem 0 0.875rem;
  display: flex;
  align-items: center;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ys-accent) 12%, var(--ys-border));
  background: color-mix(in srgb, var(--ys-accent) 4%, transparent);
}
.panel-shutter__brand { min-width: 0; }
.panel-shutter__title {
  font-weight: 650;
  font-size: 0.9rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-shutter__sub {
  font-size: 0.7rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--ys-accent) 50%, var(--ys-text-muted));
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-shutter__close {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ys-text-muted);
  cursor: pointer;
  transition: background var(--ys-transition), color var(--ys-transition);
}
.panel-shutter__close svg { width: 18px; height: 18px; }
.panel-shutter__close:hover {
  background: color-mix(in srgb, var(--ys-accent) 10%, transparent);
  color: var(--ys-text);
}
.panel-nav-item--label.panel-sidebar__cell {
  width: 100%;
  height: 100%;
  min-height: var(--panel-row-h);
  padding: 0 0.875rem;
  margin: 0;
  gap: 0;
  border: none;
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ys-border) 70%, transparent);
  transition: background var(--ys-transition), color var(--ys-transition), box-shadow var(--ys-transition);
}
.panel-nav-item--label.panel-sidebar__cell:hover {
  background: color-mix(in srgb, var(--ys-accent) 8%, transparent);
  color: var(--ys-text);
}
.panel-nav-item--label.panel-sidebar__cell.active {
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  font-weight: 650;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--ys-border) 40%, transparent);
}
.panel-nav-item--label.panel-sidebar__cell.panel-sidebar__foot-start {
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ys-accent) 10%, var(--ys-border)), inset 0 -1px 0 color-mix(in srgb, var(--ys-border) 70%, transparent);
}
.panel-nav-item--label.panel-sidebar__cell.panel-sidebar__foot-start.active {
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ys-accent) 10%, var(--ys-border)), inset 0 -1px 0 color-mix(in srgb, var(--ys-border) 40%, transparent);
}
.nav-item--pulse,
.panel-rail__btn.nav-item--pulse {
  animation: nav-pulse 0.9s ease-in-out 4;
}
@keyframes nav-pulse {
  0%, 100% { background: transparent; }
  50% { background: var(--ys-accent-soft); color: var(--ys-accent-text); }
}
.panel-rail__btn.nav-item--pulse {
  box-shadow: inset 0 0 0 2px rgba(123, 97, 255, 0.35);
}
.panel-nav-item--subtle {
  height: auto;
  min-height: 2.25rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--ys-text-muted);
  box-shadow: none !important;
  text-decoration: none;
}
.panel-nav-item--subtle:hover { color: var(--ys-text); background: var(--ys-sidebar-hover); }
.panel-user--shutter {
  margin: 0.375rem 0.625rem 0.25rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--ys-radius-xs);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--ys-border);
  align-self: stretch;
}
.dark .panel-user--shutter { background: rgba(255, 255, 255, 0.04); }
.panel-user__meta { min-width: 0; }
.panel-user__name {
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.panel-brand {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 1.125rem 1rem;
  border-bottom: 1px solid var(--ys-border);
}
.panel-brand__icon {
  width: 32px; height: 32px;
  background: var(--ys-accent);
  border-radius: var(--ys-radius-xs);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.875rem;
  overflow: hidden; flex-shrink: 0;
}
.panel-brand__icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.panel-brand__icon--img { background: transparent; padding: 0; }
.panel-brand__text { font-weight: 600; font-size: 0.9375rem; line-height: 1.2; }
.panel-brand__sub { font-size: 0.6875rem; color: var(--ys-text-muted); font-weight: 400; }

.panel-nav { flex: 1; overflow-y: auto; padding: 0.75rem 0.625rem; }
.panel-nav-label {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ys-text-muted);
  padding: 0.75rem 0.625rem 0.375rem;
}
.panel-nav-item {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; padding: 0.5625rem 0.75rem;
  font-family: inherit; font-size: 0.875rem; font-weight: 500;
  color: var(--ys-text-secondary);
  background: transparent; border: none; border-radius: var(--ys-radius-xs);
  cursor: pointer; text-align: left;
  transition: background var(--ys-transition), color var(--ys-transition);
}
.panel-nav-item:hover { background: var(--ys-sidebar-hover); color: var(--ys-text); }
.panel-nav-item.active {
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
}
.panel-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.85; }
.panel-nav-item.active svg { opacity: 1; }

.panel-sidebar-footer {
  padding: 0.75rem 0.625rem 1rem;
  border-top: 1px solid var(--ys-border);
}
.panel-user {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.625rem; border-radius: var(--ys-radius-xs);
}
.panel-user__avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ys-accent-soft); color: var(--ys-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8125rem; font-weight: 600;
}
.panel-user__email { font-size: 0.75rem; color: var(--ys-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }

.panel-main {
  flex: 1;
  margin-left: var(--ys-sidebar-w);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel-top-sticky {
  position: sticky;
  top: 0;
  z-index: 30;
}
.panel-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  padding: 0.875rem 1.75rem;
  background: var(--ys-surface);
  border-bottom: 1px solid var(--ys-border);
}
.panel-topbar__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}
.panel-topbar__titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}
.panel-topbar__title {
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ys-text, #1a1a1f);
}
.panel-topbar__tariff {
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  min-width: 0;
  max-width: 100%;
}
.panel-topbar__tariff.hidden {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}
.panel-topbar__tariff.hidden { display: none; }
.panel-topbar__actions {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
}
.panel-topbar__title { margin: 0; }
.panel-topbar__title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}
.panel-topbar__page-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.panel-topbar__page-actions[hidden] { display: none !important; }
.panel-topbar__page-actions .pcms-top-add {
  display: inline-flex;
  align-items: center;
  height: 1.75rem;
  padding: 0 0.65rem;
  border: 1px solid var(--ys-border-strong, #c3c4c7);
  border-radius: 3px;
  background: var(--ys-surface, #fff);
  color: #2271b1;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.panel-topbar__page-actions .pcms-top-add:hover {
  background: #f0f0f1;
  border-color: #8c8f94;
  color: #135e96;
}
.panel-topbar__breadcrumb { font-size: 0.8125rem; color: var(--ys-text-muted); margin-top: 0.125rem; }
.panel-topbar__actions { display: flex; align-items: center; gap: 0.5rem; }

.panel-balance-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.25rem;
  padding: 0 0.8rem;
  border-radius: var(--ys-radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(255, 255, 255, 0.9) 70%);
  color: var(--ys-text, #1e1e1e);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}
.panel-balance-btn:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18) 0%, rgba(255, 255, 255, 0.95) 70%);
}
.panel-balance-btn.hidden { display: none !important; }
.panel-balance-btn__label {
  color: #047857;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.panel-balance-btn__value {
  color: var(--ys-text, #111);
  font-variant-numeric: tabular-nums;
}
.balance-hero__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: space-between;
  align-items: flex-start;
}
.balance-hero__plan {
  min-width: 200px;
  padding: 0.75rem 1rem;
  border-radius: var(--ys-radius);
  background: var(--ys-bg, #f6f7f9);
  border: 1px solid var(--ys-border, #e5e7eb);
}
@media (max-width: 720px) {
  .panel-balance-btn__value { display: none; }
  .balance-hero__row { flex-direction: column; }
}

.balance-presets .ys-btn { cursor: pointer; }
.balance-preset--active {
  background: rgba(123, 97, 255, 0.12) !important;
  border-color: rgba(123, 97, 255, 0.35) !important;
  color: var(--ys-accent, #7b61ff) !important;
  font-weight: 600;
}

/* Тихая строка тарифа под заголовком — без «капсулы» и иконок */
.tariff-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  max-width: min(100%, 40rem);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: #8b8f98;
}
.tariff-meta__plan {
  font-weight: 600;
  color: #5c6370;
  letter-spacing: 0.01em;
}
.tariff-meta__item {
  font-weight: 450;
  color: #8b8f98;
  white-space: nowrap;
}
.tariff-meta__dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c9ccd3;
  flex-shrink: 0;
}
.tariff-meta__link {
  margin-left: 0.15rem;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  color: #7a8494;
  text-decoration: underline;
  text-decoration-color: rgba(122, 132, 148, 0.35);
  text-underline-offset: 0.18em;
  cursor: pointer;
  white-space: nowrap;
}
.tariff-meta__link:hover {
  color: #3f4654;
  text-decoration-color: rgba(63, 70, 84, 0.45);
}
.tariff-meta__tokens {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  max-width: min(100%, 18rem);
}
.tariff-meta__bar {
  display: inline-flex;
  width: 4.5rem;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}
.tariff-meta__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #10b981;
  transition: width 0.25s ease;
}
.tariff-meta__bar--warn > span { background: #d97706; }
.tariff-meta__bar--danger > span { background: #dc2626; }
.tariff-meta--low .tariff-meta__item:last-of-type,
.tariff-meta--low .tariff-meta__plan { color: #a16207; }
.tariff-meta--depleted .tariff-meta__item:last-of-type,
.tariff-meta--depleted .tariff-meta__plan { color: #b91c1c; }
.tariff-meta--low .tariff-meta__link,
.tariff-meta--depleted .tariff-meta__link {
  color: inherit;
  font-weight: 600;
  text-decoration-color: currentColor;
}

/* legacy selectors — чтобы старый HTML/кэш не показывал яркую капсулу */
.tariff-informer {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  max-width: min(100%, 40rem);
  font-size: 0.8125rem;
  color: #8b8f98;
}
.tariff-informer .tariff-icon { display: none !important; }
.tariff-informer__plan {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0 !important;
}
.tariff-informer__plan-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #5c6370;
}
.tariff-informer__chip,
.tariff-informer__money,
.tariff-informer__money-val,
.tariff-informer__money-sub {
  font-size: 0.8125rem;
  font-weight: 450;
  color: #8b8f98 !important;
}
.tariff-informer__chip-icon { display: none; }
.tariff-informer__bar { display: none !important; }
.tariff-informer__btn,
.tariff-informer__btn--ghost {
  margin-left: 0.15rem;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 0.8125rem !important;
  font-weight: 550;
  color: #7a8494 !important;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
@media (max-width: 960px) {
  .panel-topbar { flex-wrap: wrap; }
  .panel-topbar__head { width: 100%; }
  .panel-topbar__actions { margin-left: 0; }
}

.panel-topbar-alerts {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: var(--ys-radius-xs, 8px);
  background: transparent;
  color: var(--ys-text-secondary);
  cursor: pointer;
  transition: background var(--ys-transition), color var(--ys-transition);
}
.panel-topbar-alerts.hidden { display: none; }
.panel-topbar-alerts--idle {
  opacity: 0.42;
}
.panel-topbar-alerts--attention {
  background: #fef3c7;
  color: #b45309;
}
.panel-topbar-alerts--attention:hover {
  background: #fde68a;
  color: #92400e;
}
.panel-topbar-alerts svg { width: 18px; height: 18px; }
.panel-topbar-alerts:hover {
  background: var(--ys-sidebar-hover, rgba(0,0,0,.06));
  color: var(--ys-text);
}
.panel-topbar-alerts--open {
  background: #fef3c7;
  color: #b45309;
}
.panel-topbar-alerts__badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--ys-radius-pill);
  background: #ef4444;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--ys-surface, #fff);
}
.panel-topbar-alerts__badge.hidden { display: none; }
.panel-topbar-alerts__badge--dot {
  min-width: 8px;
  width: 8px;
  height: 8px;
  padding: 0;
  font-size: 0;
  line-height: 0;
  top: 6px;
  right: 6px;
}

/* ── Alerts shutter (top, mirrors sidebar shutter) ── */
.panel-alerts-zone {
  position: relative;
}
/* Временно скрыты панели «Новых сообщений / заявок» — убрать класс panel-alerts-zone--hidden чтобы вернуть */
.panel-alerts-zone.panel-alerts-zone--hidden,
#panel-alerts-zone[hidden],
.panel-alerts-zone--hidden #inbox-banner,
.panel-alerts-zone--hidden #callback-banner,
.panel-alerts-zone--hidden .panel-alerts-expand {
  display: none !important;
}
.panel-topbar-alerts.panel-topbar-alerts--suppressed,
#panel-alerts-toggle[hidden] {
  display: none !important;
}
.panel-alerts-zone.panel-alerts-empty {
  display: none;
}
.panel-alerts-shutter {
  position: relative;
  overflow: hidden;
  max-height: 240px;
  transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease;
}
.panel-alerts-zone.panel-alerts-closed .panel-alerts-shutter {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
.panel-alerts-expand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.4rem 1.75rem;
  border: none;
  border-bottom: 1px solid #fcd34d;
  background: linear-gradient(90deg, #fef9c3 0%, #fff7ed 100%);
  color: #92400e;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.panel-alerts-expand.hidden { display: none; }
.panel-alerts-expand:hover { background: linear-gradient(90deg, #fef08a 0%, #ffedd5 100%); }
.panel-alerts-expand__plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  background: rgba(146, 64, 14, 0.12);
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}
.panel-alerts-expand__badge {
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.3rem;
  border-radius: var(--ys-radius-pill);
  background: #ef4444;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.125rem;
  text-align: center;
}
.panel-alerts-expand__badge.hidden { display: none; }
.panel-alerts-shutter.hidden { display: none; }
.panel-alerts-shutter__close {
  position: absolute;
  top: 0.625rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.55);
  color: #92400e;
  cursor: pointer;
  transition: background var(--ys-transition), color var(--ys-transition);
}
.panel-alerts-shutter__close svg { width: 18px; height: 18px; }
.panel-alerts-shutter__close:hover {
  background: rgba(255, 255, 255, 0.9);
  color: #78350f;
}
.panel-alerts-zone.panel-alerts-closed .panel-alerts-shutter__close {
  display: none;
}
.panel-alerts-shutter .inbox-banner__inner,
.panel-alerts-shutter .callback-banner__inner {
  padding-right: 2.75rem;
}

.inbox-banner {
  background: linear-gradient(90deg, #fef3c7 0%, #fff7ed 100%);
  border-bottom: 1px solid #fcd34d;
  padding: 0.625rem 1.75rem;
}
.inbox-banner.hidden { display: none; }
.inbox-banner:not(.hidden) {
  animation: inbox-banner-in 0.35s ease;
}
@keyframes inbox-banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.callback-banner {
  background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
  border-bottom: 1px solid #fecdd3;
  padding: 0.625rem 1.25rem;
}
.callback-banner.hidden { display: none; }
.callback-banner:not(.hidden) {
  animation: inbox-banner-in 0.35s ease;
}
.callback-banner__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.callback-banner__icon { font-size: 1.125rem; line-height: 1; }
.callback-banner__text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #9f1239;
}
.callback-banner__inner .ys-btn { flex-shrink: 0; }

.callback-table-wrap { overflow-x: auto; }
.callback-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: var(--ys-radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
}
.callback-status--new { background: #fef3c7; color: #b45309; }
.callback-status--done { background: #dcfce7; color: #15803d; }
.callback-status--cancel { background: #f1f5f9; color: #64748b; }
.callback-page-cell { max-width: 220px; }
.callback-page-link {
  font-size: 0.8125rem;
  color: var(--ys-accent-text, #5b4cdb);
  text-decoration: none;
  word-break: break-word;
}
.callback-page-link:hover { text-decoration: underline; }
.callback-actions { white-space: nowrap; }

.inbox-banner__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.inbox-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
  animation: inbox-pulse 1.4s ease-in-out infinite;
}
@keyframes inbox-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}
.inbox-banner__text {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #92400e;
}
.inbox-banner__inner .ys-btn { flex-shrink: 0; }
.inbox-banner__actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-shrink: 0;
}

.dialogs-visitor--unread .dialogs-visitor__name { font-weight: 700; }
.dialogs-visitor--unread .dialogs-visitor__preview { color: var(--ys-text); }
.dialogs-visitor--unread {
  animation: dialog-unread-bg 2.4s ease-in-out infinite;
}
.dialogs-visitor--unread.dialogs-visitor--attention {
  animation: dialog-attention-bg 1.15s ease-in-out infinite;
  box-shadow: inset 3px 0 0 #f59e0b;
}
@keyframes dialog-unread-bg {
  0%, 100% { background: rgba(245, 158, 11, 0.04); }
  50% { background: rgba(245, 158, 11, 0.16); }
}
@keyframes dialog-attention-bg {
  0%, 100% { background: rgba(245, 158, 11, 0.12); }
  50% { background: rgba(245, 158, 11, 0.32); }
}
.dialogs-visitor__unread {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  border: 2px solid var(--ys-surface, #fff);
  animation: inbox-pulse 1.4s ease-in-out infinite;
}
.dialogs-visitor__avatar { position: relative; }

.panel-content {
  padding: 1.5rem 1.75rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.panel-content:has(> .panel-section--fill.active) {
  overflow: hidden;
}
.panel-section { display: none; animation: panelFadeIn 0.22s ease; }
.panel-section.active { display: block; }
.panel-section--fill.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@keyframes panelFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Cards & stats ── */
.ys-card {
  background: var(--ys-surface);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--ys-shadow-sm);
}
.ys-card__title { font-size: 1rem; font-weight: 600; margin: 0 0 0.25rem; }
.ys-card__desc { font-size: 0.8125rem; color: var(--ys-text-secondary); margin: 0 0 1.25rem; }

.ys-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.875rem; margin-bottom: 1.5rem; }
.ys-stat {
  background: var(--ys-surface);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-sm);
  padding: 1rem 1.125rem;
}
.ys-stat__value { font-size: 1.75rem; font-weight: 700; line-height: 1; color: var(--ys-text); }
.ys-stat__label { font-size: 0.8125rem; color: var(--ys-text-secondary); margin-top: 0.375rem; }

.ys-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (max-width: 900px) { .ys-grid-2 { grid-template-columns: 1fr; } }

.ys-code {
  display: block; padding: 0.875rem 1rem;
  background: var(--ys-sidebar);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-xs);
  font-size: 0.75rem; line-height: 1.5;
  overflow-x: auto; word-break: break-all;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.ys-table-wrap { overflow-x: auto; border: 1px solid var(--ys-border); border-radius: var(--ys-radius-sm); }
.ys-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.ys-table th {
  text-align: left; padding: 0.75rem 1rem;
  font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ys-text-muted); background: var(--ys-sidebar);
  border-bottom: 1px solid var(--ys-border);
}
.ys-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--ys-border); }
.ys-table tr:last-child td { border-bottom: none; }
.ys-table tr:hover td { background: var(--ys-accent-soft); }

.ys-list-item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 0.875rem 1rem;
  background: var(--ys-surface);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-xs);
  margin-bottom: 0.5rem;
}
.ys-list-item__text { font-size: 0.875rem; line-height: 1.45; flex: 1; }
.ys-empty { text-align: center; padding: 2.5rem 1rem; color: var(--ys-text-muted); font-size: 0.9375rem; }

.ys-tag {
  display: inline-block; padding: 0.1875rem 0.625rem;
  font-size: 0.75rem; font-weight: 500; border-radius: var(--ys-radius-pill);
  background: var(--ys-accent-soft); color: var(--ys-accent-text);
}

/* ── AI analytics filters (adm) ── */
.ai-logs-section { margin-top: 1.25rem; }
.ai-logs-section__title {
  font-size: 0.9375rem; font-weight: 600; margin: 0 0 0.75rem;
  color: var(--ys-text);
}
.ai-logs-filters {
  background: linear-gradient(180deg, var(--ys-surface) 0%, var(--ys-sidebar, #fafafa) 100%);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-sm);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  margin-bottom: 0.625rem;
}
.dark .ai-logs-filters {
  background: linear-gradient(180deg, var(--ys-surface) 0%, rgba(28, 28, 36, 0.6) 100%);
}
.ai-logs-filters__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ys-border);
  background: rgba(123, 97, 255, 0.04);
}
.ai-logs-filters__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.8125rem; font-weight: 600; color: var(--ys-text);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ai-logs-filters__icon {
  width: 1rem; height: 1rem; color: var(--ys-accent); flex-shrink: 0;
}
.ai-logs-filters__toolbar {
  display: flex; align-items: center; gap: 0.375rem; flex-shrink: 0;
}
.ai-logs-filters__apply { box-shadow: 0 2px 10px rgba(123, 97, 255, 0.28); }
.ai-logs-filters__reset { color: var(--ys-text-secondary); }
.ai-logs-filters__body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1rem 1.25rem;
  padding: 1rem;
  align-items: end;
}
@media (max-width: 900px) {
  .ai-logs-filters__body { grid-template-columns: 1fr; }
}
.ai-logs-filters__block-label,
.ai-logs-filters__field-label {
  display: block;
  font-size: 0.6875rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ys-text-muted);
  margin-bottom: 0.375rem;
}
.ai-logs-filters__dates {
  display: flex; align-items: center; gap: 0.5rem;
}
.ai-logs-filters__dates-sep {
  width: 0.75rem; height: 1px; background: var(--ys-border-strong);
  flex-shrink: 0;
}
.ys-date-wrap {
  display: flex; align-items: center; gap: 0.375rem;
  flex: 1; min-width: 0;
  background: var(--ys-surface);
  border: 1px solid var(--ys-border-strong);
  border-radius: var(--ys-radius-xs);
  padding: 0 0.625rem;
  min-height: 42px;
  transition: border-color var(--ys-transition), box-shadow var(--ys-transition);
}
.ys-date-wrap:focus-within {
  border-color: var(--ys-accent);
  box-shadow: 0 0 0 3px var(--ys-accent-soft);
}
.ys-date-wrap__hint {
  font-size: 0.75rem; font-weight: 500;
  color: var(--ys-text-muted);
  flex-shrink: 0;
  user-select: none;
}
.ys-date-wrap__input {
  flex: 1; min-width: 0;
  border: none; background: transparent;
  padding: 0.5625rem 0;
  font-family: inherit; font-size: 0.875rem;
  color: var(--ys-text);
  cursor: pointer;
}
.ys-date-wrap__input:focus { outline: none; }
.ys-date-wrap__input::-webkit-calendar-picker-indicator {
  opacity: 0.55; cursor: pointer;
  filter: none;
}
.dark .ys-date-wrap__input::-webkit-calendar-picker-indicator { filter: invert(0.85); }
.ai-logs-filters__block--fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
@media (max-width: 720px) {
  .ai-logs-filters__block--fields { grid-template-columns: 1fr; }
}
.ai-logs-filters__field .ys-custom-select { min-width: 0; }
.ai-logs-filters__chips {
  display: flex; flex-wrap: wrap; gap: 0.375rem;
  padding: 0 1rem 0.875rem;
}
.ai-logs-filters__chips.hidden { display: none; }
.ai-filter-chip {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem; font-weight: 500;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  border: 1px solid rgba(123, 97, 255, 0.2);
}
.ai-logs-filters__count {
  font-size: 0.8125rem; color: var(--ys-text-muted);
  margin: 0 0 0.625rem;
}
.ai-recent-logs-wrap {
  max-height: min(70vh, 720px);
  overflow-y: auto;
  overflow-x: auto;
}
.ai-recent-logs-wrap .ys-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--ys-surface);
  box-shadow: 0 1px 0 var(--ys-border);
}
.ai-recent-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ys-border);
}
.ai-recent-pagination:empty { display: none; }
.ai-recent-pagination__info {
  font-size: 0.8125rem;
  color: var(--ys-text-muted);
}
.ai-recent-pagination__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ai-recent-pagination__pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.ai-recent-pagination__page {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-xs);
  background: var(--ys-surface);
  color: var(--ys-text);
  font-size: 0.8125rem;
  cursor: pointer;
}
.ai-recent-pagination__page:hover { border-color: var(--ys-accent); color: var(--ys-accent-text); }
.ai-recent-pagination__page.is-active {
  background: var(--ys-accent-soft);
  border-color: rgba(123, 97, 255, 0.35);
  color: var(--ys-accent-text);
  font-weight: 600;
}
.ai-recent-pagination__page:disabled,
.ai-recent-pagination__page.is-gap {
  cursor: default;
  opacity: 0.55;
  pointer-events: none;
}

.brand-powered-setting {
  margin: 0.75rem 0 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-xs);
  background: linear-gradient(180deg, var(--ys-surface) 0%, rgba(123, 97, 255, 0.04) 100%);
}
.brand-powered-setting__toggle { border-bottom: none; padding: 0; }
.ws-switch--table { margin: 0 auto; }

.ws-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--ys-border);
}
.ws-toggle > div:first-child {
  flex: 1;
  min-width: 0;
}
.ws-toggle:has(.ws-toggle__hint) {
  align-items: flex-start;
}
.ws-toggle:has(.ws-toggle__hint) .ws-switch {
  margin-top: 0.125rem;
}
.ws-toggle:last-child { border-bottom: none; }
.ws-toggle--plain { border-bottom: none; padding: 0; }
.ws-toggle__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
}
.ws-toggle__hint {
  display: block;
  font-size: 0.75rem;
  color: var(--ys-text-muted);
  margin-top: 0.2rem;
  line-height: 1.45;
}

.ws-app-fields {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.ws-app-field {
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius);
  padding: 0.875rem;
  background: #f8fafc;
}
.ws-app-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.625rem;
}
.ws-app-field__name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ys-text, #1e293b);
}
.ws-app-field__toggles {
  display: flex;
  gap: 0.875rem;
  flex-wrap: wrap;
}
.ws-app-field__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--ys-text-muted);
  cursor: pointer;
  user-select: none;
}
.ws-app-field__toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--ys-primary, #7B61FF);
  cursor: pointer;
}
.ws-app-field.is-disabled {
  opacity: 0.55;
}
.ws-app-field.is-disabled .ws-app-field__inputs {
  pointer-events: none;
}

.ws-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
.ws-switch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.ws-switch__track {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: var(--ys-radius-pill);
  cursor: pointer;
  transition: background 0.2s ease;
}
.ws-switch__track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease;
}
.ws-switch input:checked + .ws-switch__track {
  background: var(--ys-accent, #7B61FF);
}
.ws-switch input:checked + .ws-switch__track::after {
  transform: translateX(20px);
}
.ws-switch--tariff input:checked + .ws-switch__track {
  background: #22c55e;
}
.ws-switch--tariff input:not(:checked) + .ws-switch__track {
  background: #cbd5e1;
}
.ws-switch--tariff input:focus-visible + .ws-switch__track {
  outline: 2px solid rgba(34, 197, 94, 0.35);
  outline-offset: 2px;
}

.ys-chat-card {
  background: var(--ys-surface);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-sm);
  margin-bottom: 0.875rem;
  overflow: hidden;
  transition: box-shadow var(--ys-transition), border-color var(--ys-transition);
}
.ys-chat-card--latest {
  border-color: rgba(123, 97, 255, 0.35);
  box-shadow: 0 8px 28px rgba(123, 97, 255, 0.1);
}
.ys-chat-card__head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.ys-chat-card--latest .ys-chat-card__head { cursor: default; }
.ys-chat-card__head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  min-width: 0;
  flex: 1;
}
.ys-chat-card__badge {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: var(--ys-radius-pill);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
}
.ys-chat-card__date { font-size: 0.8125rem; color: var(--ys-text-secondary); font-weight: 500; }
.ys-chat-card__count { font-size: 0.75rem; color: var(--ys-text-muted); }
.ys-chat-card__preview {
  font-size: 0.8125rem;
  color: var(--ys-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42%;
}
.ys-chat-card__chevron {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--ys-text-muted);
  border-bottom: 2px solid var(--ys-text-muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  transition: transform var(--ys-transition);
}
.ys-chat-card:not(.ys-chat-card--collapsed) .ys-chat-card__chevron {
  transform: rotate(-135deg) translateY(2px);
}
.ys-chat-card__body {
  padding: 0 1rem 1rem;
}
.ys-chat-card--collapsed .ys-chat-card__body { display: none; }
.ys-chat-card__messages {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.75rem;
  margin-bottom: 0.875rem;
  background: var(--ys-bg, #f8fafc);
  border-radius: var(--ys-radius-xs);
  border: 1px solid var(--ys-border);
}
.ys-chat-bubble {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  max-width: 92%;
}
.ys-chat-bubble--visitor { margin-left: auto; flex-direction: row-reverse; }
.ys-chat-bubble__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: var(--ys-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}
.ys-chat-bubble--visitor .ys-chat-bubble__avatar { background: #e0e7ff; color: #4338ca; }
.ys-chat-bubble--ai .ys-chat-bubble__avatar { background: #ede9fe; color: #6d28d9; }
.ys-chat-bubble--operator .ys-chat-bubble__avatar { background: #dcfce7; color: #15803d; }
.ys-chat-bubble__avatar-img {
  width: 2rem;
  height: 2rem;
  border-radius: var(--ys-radius-sm);
  flex-shrink: 0;
  object-fit: cover;
}
.ys-chat-bubble__body {
  min-width: 0;
  padding: 0.625rem 0.875rem;
  border-radius: var(--ys-radius);
  background: #fff;
  border: 1px solid var(--ys-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ys-chat-bubble--visitor .ys-chat-bubble__body {
  background: #eef2ff;
  border-color: #c7d2fe;
}
.ys-chat-bubble--operator .ys-chat-bubble__body {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.ys-chat-bubble__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.ys-chat-bubble__time {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ys-text-muted, #64748b);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}
.ys-chat-bubble--visitor .ys-chat-bubble__meta { flex-direction: row-reverse; }
.ys-chat-bubble__name { font-size: 0.6875rem; font-weight: 600; color: var(--ys-text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ys-chat-bubble__text { font-size: 0.875rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.ys-chat-bubble__attach {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(123, 97, 255, 0.08);
  border: 1px solid rgba(123, 97, 255, 0.18);
  color: var(--ys-accent-text, #5b4bdb);
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
}
.ys-chat-bubble__attach:hover { background: rgba(123, 97, 255, 0.14); }
.ys-chat-bubble--visitor .ys-chat-bubble__attach {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(67, 56, 202, 0.18);
}
.dialogs-chat__messages .ys-chat-bubble__text { max-height: none; overflow: visible; }
.ys-chat-bubble__text--rich { white-space: normal; }
.dialogs-ai-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}
.dialogs-ai-msg > .ys-chat-bubble {
  width: 100%;
}
.dialogs-teach {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px 44px;
  padding: 2px 0;
}
.dialogs-teach__label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ys-text-muted);
  letter-spacing: 0.02em;
  margin-right: 2px;
}
.dialogs-teach__btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--ys-border, #e5e7eb);
  background: #fff;
  color: var(--ys-text-muted);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.dialogs-teach__btn:hover:not(:disabled) {
  border-color: currentColor;
}
.dialogs-teach__btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
.dialogs-teach__btn--good:hover:not(:disabled),
.dialogs-teach__btn--good.is-active {
  color: #15803d;
  background: #dcfce7;
  border-color: #86efac;
}
.dialogs-teach__btn--bad:hover:not(:disabled),
.dialogs-teach__btn--bad.is-active {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
}
.ys-chat-bubble__text--rich .cc-reply { display: flex; flex-direction: column; gap: 12px; }
.ys-chat-bubble__text--rich .cc-reply__block { display: flex; gap: 10px; align-items: flex-start; }
.ys-chat-bubble__text--rich .cc-reply__icon { width: 32px; height: 32px; border-radius: var(--ys-radius-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.ys-chat-bubble__text--rich .cc-reply__block--answer .cc-reply__icon { background: #ede9fe; color: #6d28d9; }
.ys-chat-bubble__text--rich .cc-reply__block--tip .cc-reply__icon { background: #fef3c7; color: #b45309; }
.ys-chat-bubble__text--rich .cc-reply__block--action .cc-reply__icon { background: #dcfce7; color: #15803d; }
.ys-chat-bubble__text--rich .cc-reply__body { flex: 1; line-height: 1.45; }
.ys-chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.625rem;
  align-items: end;
}
.ys-chat-composer__input { min-height: 4.5rem; resize: vertical; }
.ys-chat-composer__send {
  min-height: 2.75rem;
  padding-inline: 1.125rem;
  box-shadow: 0 4px 14px rgba(123, 97, 255, 0.28);
}
.ys-chat-composer__send svg { flex-shrink: 0; }

.dialogs-root, .crm-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dialogs-root > .dialogs-workspace,
.crm-root > .crm-board {
  flex: 1;
  min-height: 0;
}

/* Видимые полосы прокрутки в стиле Знайки */
.ys-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 97, 255, 0.45) rgba(123, 97, 255, 0.08);
}
.ys-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.ys-scroll::-webkit-scrollbar-track {
  background: rgba(123, 97, 255, 0.06);
  border-radius: 4px;
}
.ys-scroll::-webkit-scrollbar-thumb {
  background: rgba(123, 97, 255, 0.38);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.ys-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(123, 97, 255, 0.55);
  background-clip: padding-box;
}

.dialogs-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  grid-template-areas: "list chat";
  gap: 0;
  flex: 1;
  min-height: 420px;
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius-lg, 12px);
  overflow: hidden;
  background: var(--ys-surface, #fff);
  box-shadow: var(--ys-shadow-sm);
  position: relative;
}
.dialogs-sidebar-backdrop {
  position: absolute;
  inset: 0;
  z-index: 18;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  cursor: default;
}
.dialogs-workspace--sidebar-open .dialogs-sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}
.dialogs-list {
  grid-area: list;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-bg-subtle, #f8fafc);
  min-height: 0;
}
.dialogs-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
}
.dialogs-list__stat {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ys-text-muted, #94a3b8);
  white-space: nowrap;
}
.dialogs-list__toolbar {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dialogs-list__filter {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ys-text-secondary, #64748b);
  cursor: pointer;
  user-select: none;
}
.dialogs-list__filter input {
  width: 14px;
  height: 14px;
  accent-color: var(--ys-accent, #7B61FF);
  cursor: pointer;
}
.dialogs-list__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ys-text, #1e293b);
}
.dialogs-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.75rem 0.5rem;
}
.dialogs-status-filter {
  border: 1px solid var(--ys-border, #e5e7eb);
  background: transparent;
  color: var(--ys-muted, #6b7280);
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--ys-radius-pill);
  cursor: pointer;
  line-height: 1.2;
}
.dialogs-status-filter--active {
  background: var(--ys-text, #111827);
  border-color: transparent;
  color: #fff;
}
.dialogs-list__sort {
  flex: 0 0 auto;
}
.dialogs-list__sort-select {
  min-width: 7.5rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
}
.dialogs-visitor--closed {
  opacity: 0.65;
}

/* Industry templates */
.it-page__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.it-page__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ys-text, #1e293b);
}
.it-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--ys-radius-pill);
  background: #ecfdf5;
  color: #047857;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}
.it-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}
.it-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius);
  background: var(--ys-surface, #fff);
}
.it-card--active {
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
}
.it-card__icon { line-height: 1; color: #2563eb; }
.it-card__ico {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
}
.it-card__ico svg { width: 100%; height: 100%; display: block; }
.it-card__ico--fallback {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.35rem;
  background: #dbeafe;
  border: 1.5px solid #60a5fa;
}
.it-card__title {
  font-weight: 700;
  font-size: 0.95rem;
}
.it-card__on {
  font-size: 0.72rem;
  font-weight: 600;
  color: #047857;
  text-transform: lowercase;
}
.it-card__desc {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--ys-muted, #64748b);
  line-height: 1.4;
}
.it-card__actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* Full-page template editor */
.it-editor-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.it-editor-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius, 12px);
  background: var(--ys-surface, #fff);
  position: sticky;
  top: 0.5rem;
  z-index: 5;
}
.it-editor-top__left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 240px;
}
.it-editor-top__title { min-width: 0; }
.it-editor-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
}
.it-editor-title .it-card__ico {
  width: 1.35rem;
  height: 1.35rem;
  color: #2563eb;
  flex-shrink: 0;
}
.it-editor-top__meta {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--ys-muted, #64748b);
}
.it-editor-top__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.it-editor__draft {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 600;
}
.it-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 1rem;
  align-items: start;
}
.it-editor-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.it-editor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.it-editor-nav__btn {
  border: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-surface, #fff);
  color: var(--ys-text-secondary, #475569);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  cursor: pointer;
}
.it-editor-nav__btn:hover { background: #f8fafc; }
.it-editor-nav__btn.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.it-editor-panels {
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius, 12px);
  background: var(--ys-surface, #fff);
  padding: 1rem 1.1rem 1.25rem;
}
.it-editor-panel { display: none; }
.it-editor-panel.is-active {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.it-field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.it-field__area {
  width: 100%;
  min-height: 7.5rem;
  line-height: 1.55;
  resize: vertical;
  flex-shrink: 0;
  field-sizing: content;
}
.it-field__area--sm { min-height: 4.5rem; }
.it-field__area--xl { min-height: 16rem; }
.it-editor-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.it-editor-section-title {
  font-weight: 700;
  font-size: 0.98rem;
}
.it-editor-preview-dock {
  position: sticky;
  top: 5.5rem;
  align-self: start;
}
.it-editor-preview-hint { margin: 0.65rem 0 0; }
.it-preview-chat {
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
}
.it-preview-chat__bar {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  background: #0f172a;
  color: #fff;
}
.it-preview-chat__dot {
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
}
.it-preview-chat__name { font-weight: 700; font-size: 0.88rem; }
.it-preview-chat__bio {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  opacity: 0.75;
  line-height: 1.35;
}
.it-preview-chat__msgs {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.85rem;
  min-height: 220px;
}
.it-preview-bubble {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.it-preview-bubble--ai {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
}
.it-preview-bubble--user {
  align-self: flex-end;
  background: #4f46e5;
  color: #fff;
}
.it-preview-bubble--muted {
  opacity: 0.8;
  font-size: 0.78rem;
  color: #475569;
}
.it-rules { display: flex; flex-direction: column; gap: 0.65rem; }
.it-rule-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(180px, 1.4fr) auto;
  gap: 0.5rem;
  align-items: start;
}
.it-rule-then { min-height: 4.5rem; }
.it-qr { display: flex; flex-direction: column; gap: 0.85rem; }
.it-qr-group {
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius, 10px);
  padding: 0.85rem;
  background: #f8fafc;
}
.it-qr-group__head {
  display: grid;
  grid-template-columns: 1fr 72px auto auto;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.it-qr-group__items { display: flex; flex-direction: column; gap: 0.65rem; }
.it-qr-item {
  background: #fff;
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.it-qr-item__head {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.it-qr-answer { min-height: 7rem; }
@media (max-width: 960px) {
  .it-editor-layout {
    grid-template-columns: 1fr;
  }
  .it-editor-preview-dock {
    position: static;
    order: -1;
  }
}
@media (max-width: 720px) {
  .it-rule-row,
  .it-qr-group__head {
    grid-template-columns: 1fr;
  }
  .it-editor-top { position: static; }
}


.dialogs-chat__head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.dialogs-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
}
.dialogs-channels--empty { padding: 0.5rem 0.75rem; }
.dialogs-channel-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--ys-radius-pill);
  border: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-surface, #fff);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ys-text-secondary, #64748b);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dialogs-channel-filter__count {
  opacity: 0.85;
  font-weight: 500;
}
.dialogs-channel-filter--active {
  color: #fff !important;
  border-color: transparent !important;
}
.dialogs-channel-filter--all.dialogs-channel-filter--active {
  background: var(--ys-accent, #7B61FF) !important;
}
.dialogs-channel-filter--chat:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #7B61FF 28%, #e2e8f0);
  color: #6d28d9;
  background: color-mix(in srgb, #7B61FF 8%, #fff);
}
.dialogs-channel-filter--chat.dialogs-channel-filter--active { background: #7B61FF !important; }
.dialogs-channel-filter--avito:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #16a34a 30%, #e2e8f0);
  color: #166534;
  background: #f0fdf4;
}
.dialogs-channel-filter--avito.dialogs-channel-filter--active { background: #16a34a !important; }
.dialogs-channel-filter--vk:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #2563eb 30%, #e2e8f0);
  color: #1d4ed8;
  background: #eff6ff;
}
.dialogs-channel-filter--vk.dialogs-channel-filter--active { background: #2563eb !important; }
.dialogs-channel-filter--telegram:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #229ED9 30%, #e2e8f0);
  color: #0369a1;
  background: #f0f9ff;
}
.dialogs-channel-filter--telegram.dialogs-channel-filter--active { background: #229ED9 !important; }
.dialogs-channel-filter--max:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #7c3aed 30%, #e2e8f0);
  color: #6d28d9;
  background: #f5f3ff;
}
.dialogs-channel-filter--max.dialogs-channel-filter--active { background: #7c3aed !important; }
.dialogs-channel-filter--profi:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #ea580c 30%, #e2e8f0);
  color: #c2410c;
  background: #fff7ed;
}
.dialogs-channel-filter--profi.dialogs-channel-filter--active { background: #ea580c !important; }
.dialogs-channel-filter--wildberries:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #cb11ab 30%, #e2e8f0);
  color: #a21caf;
  background: #fdf4ff;
}
.dialogs-channel-filter--wildberries.dialogs-channel-filter--active { background: #cb11ab !important; }
.dialogs-channel-filter--ozon:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #005bff 30%, #e2e8f0);
  color: #0057ff;
  background: #eff6ff;
}
.dialogs-channel-filter--ozon.dialogs-channel-filter--active { background: #005bff !important; }
.dialogs-channel-filter--ymarket:not(.dialogs-channel-filter--active) {
  border-color: color-mix(in srgb, #eab308 40%, #e2e8f0);
  color: #854d0e;
  background: #fefce8;
}
.dialogs-channel-filter--ymarket.dialogs-channel-filter--active { background: #fcde11 !important; color: #1a1a1f !important; }
.dialogs-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
}
.dialogs-tags--empty { padding: 0.5rem 0.75rem; }
.dialogs-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--ys-radius-pill);
  border: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-surface, #fff);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ys-text-secondary, #64748b);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.dialogs-tag:not([data-tag-id="0"]) {
  border-color: color-mix(in srgb, var(--tag-color, #7B61FF) 35%, #e2e8f0);
  color: var(--tag-color, #7B61FF);
  background: color-mix(in srgb, var(--tag-color, #7B61FF) 8%, #fff);
}
.dialogs-tag--active {
  background: var(--ys-accent, #7B61FF) !important;
  border-color: var(--ys-accent, #7B61FF) !important;
  color: #fff !important;
}
.dialogs-tag__count {
  opacity: 0.85;
  font-weight: 500;
}
.dialogs-list__search {
  padding: 0;
  border-bottom: none;
}
.dialogs-list__search-input {
  font-size: 0.8125rem;
  padding: 0.45rem 0.65rem;
}
.dialogs-list__items {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.dialogs-visitor--empty .dialogs-visitor__preview {
  color: var(--ys-text-muted, #94a3b8);
  font-style: italic;
}
.dialogs-visitor--empty .dialogs-visitor__avatar {
  opacity: 0.55;
}
.dialogs-visitor {
  display: flex;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: none;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
}
.dialogs-visitor:hover { background: rgba(123, 97, 255, 0.06); }
.dialogs-visitor--active {
  background: rgba(123, 97, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--ys-accent, #7B61FF);
}
.dialogs-visitor--operator {
  background: rgba(220, 38, 38, 0.04);
}
.dialogs-visitor--operator.dialogs-visitor--active {
  background: rgba(220, 38, 38, 0.08);
  box-shadow: inset 3px 0 0 #dc2626;
}
.dialogs-visitor__op {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  vertical-align: middle;
}
.dialogs-visitor__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--ys-accent-soft, #ede9fe);
  color: var(--ys-accent-text, #6d28d9);
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dialogs-visitor__body { flex: 1; min-width: 0; }
.dialogs-visitor__row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}
.dialogs-visitor__name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ys-text, #1e293b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}
.dialogs-channel {
  display: inline-flex;
  align-items: center;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.35rem;
  border-radius: var(--ys-radius-pill);
  flex-shrink: 0;
}
.dialogs-channel--avito {
  background: #dcfce7;
  color: #166534;
}
.dialogs-channel--vk {
  background: #dbeafe;
  color: #1d4ed8;
}
.dialogs-channel--telegram {
  background: #e0f2fe;
  color: #0369a1;
}
.dialogs-channel--max {
  background: #ede9fe;
  color: #6d28d9;
}
.dialogs-channel--profi {
  background: #ffedd5;
  color: #c2410c;
}
.dialogs-channel--wildberries {
  background: #fdf4ff;
  color: #a21caf;
}
.dialogs-channel--ozon {
  background: #eff6ff;
  color: #0057ff;
}
.dialogs-channel--ymarket {
  background: #fefce8;
  color: #854d0e;
}
.dialogs-visitor__time {
  font-size: 0.6875rem;
  color: var(--ys-text-muted, #94a3b8);
  flex-shrink: 0;
}
.dialogs-visitor__preview {
  font-size: 0.75rem;
  color: var(--ys-text-secondary, #64748b);
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dialogs-visitor__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.35rem;
}
.dialogs-visitor__tag {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: var(--ys-radius-pill);
  background: color-mix(in srgb, var(--tag-color, #7B61FF) 12%, #fff);
  color: var(--tag-color, #7B61FF);
}
.lead-score-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.lead-score-badge--hot {
  background: color-mix(in srgb, #dc2626 14%, #fff);
  color: #b91c1c;
}
.lead-score-badge--warm {
  background: color-mix(in srgb, #d97706 16%, #fff);
  color: #b45309;
}
.lead-score-badge--cold {
  background: color-mix(in srgb, #64748b 14%, #fff);
  color: #475569;
}
.lead-score-meter {
  position: relative;
  height: 1.6rem;
  border-radius: 8px;
  background: var(--ys-bg-subtle, #f1f5f9);
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.lead-score-meter__fill {
  height: 100%;
  border-radius: 8px;
  transition: width 0.25s ease;
}
.lead-score-meter--hot .lead-score-meter__fill { background: color-mix(in srgb, #dc2626 55%, #fecaca); }
.lead-score-meter--warm .lead-score-meter__fill { background: color-mix(in srgb, #d97706 50%, #fde68a); }
.lead-score-meter--cold .lead-score-meter__fill { background: color-mix(in srgb, #64748b 45%, #cbd5e1); }
.lead-score-meter__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--ys-text, #0f172a);
}
.dialogs-sidebar__sc-details { margin-top: 0.4rem; display: grid; gap: 0.25rem; }
.dialogs-sidebar__sc-factor { font-size: 0.8rem; }
.dialogs-sidebar__sc-manual { display: grid; gap: 0.4rem; margin-top: 0.6rem; }
.dialogs-sidebar__sc-manual.hidden { display: none; }
.sc-stat--hot { color: #b91c1c; }
.sc-stat--warm { color: #b45309; }
.sc-stat--cold { color: #475569; }

/* ——— Инфографика скоринга лидов ——— */
.sc-infograph {
  margin: 1.05rem 0 0.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sc-infograph__temps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}
.sc-infograph__temp {
  position: relative;
  overflow: hidden;
  padding: 0.95rem 0.9rem 0.9rem;
  border-radius: 14px;
  border: 1px solid transparent;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.sc-infograph__temp::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--sc-accent, #64748b);
}
.sc-infograph__temp--hot {
  --sc-accent: #dc2626;
  background: linear-gradient(165deg, #fff7f7 0%, #fff1f2 100%);
  border-color: #fecaca;
}
.sc-infograph__temp--warm {
  --sc-accent: #d97706;
  background: linear-gradient(165deg, #fffbeb 0%, #fff7ed 100%);
  border-color: #fde68a;
}
.sc-infograph__temp--cold {
  --sc-accent: #64748b;
  background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 100%);
  border-color: #e2e8f0;
}
.sc-infograph__temp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.sc-infograph__ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sc-accent, #475569);
  background: color-mix(in srgb, var(--sc-accent, #64748b) 14%, #fff);
  flex-shrink: 0;
}
.sc-infograph__ico svg {
  width: 18px;
  height: 18px;
  display: block;
}
.sc-infograph__ico--muted {
  --sc-accent: #64748b;
}
.sc-infograph__share {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--sc-accent, #64748b) 75%, #0f172a);
  background: color-mix(in srgb, var(--sc-accent, #64748b) 10%, #fff);
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  font-variant-numeric: tabular-nums;
}
.sc-infograph__val {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.sc-infograph__val--sm { font-size: 1.35rem; }
.sc-infograph__lbl {
  font-size: 0.78rem;
  line-height: 1.35;
  color: #64748b;
  font-weight: 550;
}
.sc-infograph__mix {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sc-infograph__mix-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}
.sc-infograph__mix-bar--empty { opacity: 0.55; }
.sc-infograph__seg { display: block; height: 100%; min-width: 0; transition: width 0.4s ease; }
.sc-infograph__seg--hot { background: linear-gradient(90deg, #ef4444, #dc2626); }
.sc-infograph__seg--warm { background: linear-gradient(90deg, #fbbf24, #d97706); }
.sc-infograph__seg--cold { background: linear-gradient(90deg, #94a3b8, #64748b); }
.sc-infograph__mix-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1rem;
  font-size: 0.75rem;
  color: #64748b;
}
.sc-infograph__mix-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.sc-infograph__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.sc-infograph__dot--hot { background: #dc2626; }
.sc-infograph__dot--warm { background: #d97706; }
.sc-infograph__dot--cold { background: #64748b; }
.sc-infograph__mix-total {
  margin-left: auto;
  color: #475569;
}
.sc-infograph__mix-total strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.sc-infograph__row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0.65rem;
  align-items: stretch;
}
.sc-infograph__row:not(:has(.sc-infograph__extras)) {
  grid-template-columns: 1fr;
}
.sc-infograph__avg {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid #e8e8ec;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
}
.sc-infograph__avg--hot { --sc-accent: #dc2626; }
.sc-infograph__avg--warm { --sc-accent: #d97706; }
.sc-infograph__avg--cold { --sc-accent: #64748b; }
.sc-infograph__gauge {
  --sc-avg: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    var(--sc-accent, #64748b) calc(var(--sc-avg) * 1%),
    #e2e8f0 0
  );
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}
.sc-infograph__gauge-inner {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.05rem;
}
.sc-infograph__gauge-inner .sc-infograph__val { font-size: 1.25rem; }
.sc-infograph__gauge-inner .sc-infograph__lbl { font-size: 0.62rem; line-height: 1.2; }
.sc-infograph__avg-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #64748b;
}
.sc-infograph__avg-note .sc-infograph__ico {
  margin-top: 0.05rem;
}
.sc-infograph__extras {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}
.sc-infograph__extra {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid #e8e8ec;
  background: linear-gradient(165deg, #fff 0%, #f7f8fb 100%);
  min-height: 72px;
}
.sc-infograph__limit {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #eef2f7;
}
.sc-infograph__limit-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: #64748b;
}
.sc-infograph__limit-top strong {
  color: #334155;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.sc-infograph__bar {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.sc-infograph__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #dc2626, #d97706 55%, #64748b);
  min-width: 0;
  transition: width 0.35s ease;
}
@media (max-width: 720px) {
  .sc-infograph__temps { grid-template-columns: 1fr; }
  .sc-infograph__row,
  .sc-infograph__row:not(:has(.sc-infograph__extras)) {
    grid-template-columns: 1fr;
  }
  .sc-infograph__mix-total { margin-left: 0; width: 100%; }
}

.crm-card__title .lead-score-badge { margin-left: 0.4rem; }
.dialogs-chat {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-bg-subtle, #f8fafc);
}
.dialogs-chat__pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.dialogs-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
  flex-shrink: 0;
  background: var(--ys-surface, #fff);
}
.dialogs-chat__head-main { min-width: 0; }
.dialogs-chat__head-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
.dialogs-chat__toggle-sidebar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: 8px;
  background: var(--ys-surface, #fff);
  color: var(--ys-text-secondary, #64748b);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dialogs-chat__toggle-sidebar:hover,
.dialogs-chat__toggle-sidebar.is-off {
  background: rgba(123, 97, 255, 0.08);
  border-color: rgba(123, 97, 255, 0.25);
  color: var(--ys-accent, #7B61FF);
}
.dialogs-chat__scroll-wrap {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.dialogs-chat__jump {
  position: absolute;
  right: 1rem;
  bottom: 0.75rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  background: var(--ys-accent, #7B61FF);
  color: #fff;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(123, 97, 255, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.dialogs-chat__jump:hover { transform: scale(1.06); }
.dialogs-chat__jump.hidden { opacity: 0; pointer-events: none; }
.dialogs-chat__title {
  font-size: 0.9375rem;
  font-weight: 700;
}
.dialogs-chat__meta {
  font-size: 0.75rem;
  color: var(--ys-text-muted, #94a3b8);
  margin-top: 0.15rem;
}
.dialogs-chat__messages {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.dialogs-chat__messages .ys-chat-bubble { max-width: min(92%, 640px); }
.dialogs-chat__messages .ys-chat-bubble--visitor { align-self: flex-end; }
.dialogs-chat__messages .ys-chat-bubble--ai,
.dialogs-chat__messages .ys-chat-bubble--operator { align-self: flex-start; }
.dialogs-chat__composer {
  flex-shrink: 0;
  padding: 0.625rem 1rem 0.875rem;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, var(--ys-bg-subtle, #f8fafc) 24%, var(--ys-surface, #fff) 100%);
  border-top: 1px solid var(--ys-border, #e2e8f0);
}
.dialogs-chat__composer-box {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.45rem 0.45rem 0.45rem 0.875rem;
  background: var(--ys-surface, #fff);
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius-lg);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(123, 97, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dialogs-chat__composer-box:focus-within {
  border-color: rgba(123, 97, 255, 0.45);
  box-shadow: 0 4px 20px rgba(123, 97, 255, 0.12), 0 0 0 3px rgba(123, 97, 255, 0.08);
}
.dialogs-chat__input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 160px;
  resize: none;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.45rem 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}
.dialogs-chat__input:focus { outline: none; }
.dialogs-chat__send {
  width: 2.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 !important;
  border-radius: var(--ys-radius) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dialogs-chat__send span { display: none; }
.dialogs-chat__readonly {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-surface, #fff);
  text-align: center;
}
.dialogs-chat__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialogs-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 92vw);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  min-height: 0;
  background: var(--ys-surface, #fff);
  border-left: 1px solid var(--ys-border, #e2e8f0);
  box-shadow: -8px 0 28px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  pointer-events: none;
}
.dialogs-workspace--sidebar-open .dialogs-sidebar {
  transform: translateX(0);
  pointer-events: auto;
}
.dialogs-sidebar__head {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
}
.dialogs-sidebar__head-text { flex: 1; min-width: 0; }
.dialogs-sidebar__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ys-text-muted, #94a3b8);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.dialogs-sidebar__close:hover {
  background: rgba(123, 97, 255, 0.08);
  color: var(--ys-text, #1e293b);
}
.dialogs-sidebar__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dialogs-sidebar__name { font-weight: 700; font-size: 0.9375rem; }
.dialogs-sidebar__sub { font-size: 0.75rem; color: var(--ys-text-muted); }
.dialogs-sidebar__section {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
}
.dialogs-sidebar__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ys-text-muted);
  margin-bottom: 0.5rem;
}
.dialogs-sidebar__contact {
  font-size: 0.8125rem;
  margin-bottom: 0.35rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.dialogs-sidebar__contact--muted { color: var(--ys-text-muted); font-style: italic; }
.dialogs-sidebar__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.dialogs-sidebar__tag-opt {
  padding: 0.2rem 0.55rem;
  border-radius: var(--ys-radius-pill);
  border: 1px solid color-mix(in srgb, var(--tag-color, #7B61FF) 35%, #e2e8f0);
  background: #fff;
  color: var(--tag-color, #7B61FF);
  font-size: 0.6875rem;
  font-weight: 600;
  cursor: pointer;
}
.dialogs-sidebar__tag-opt.is-on {
  background: var(--tag-color, #7B61FF);
  color: #fff;
  border-color: var(--tag-color, #7B61FF);
}
.dialogs-sidebar__tag-add {
  display: flex;
  gap: 0.35rem;
}
.dialogs-sidebar__tag-input { flex: 1; font-size: 0.8125rem; padding: 0.4rem 0.55rem; }
.dialogs-sidebar__note {
  width: 100%;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
  resize: vertical;
}
.dialogs-sidebar__empty {
  padding: 2rem 1rem;
  text-align: center;
}

.crm-board-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: calc(100dvh - 8.5rem);
}
.crm-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
}
.crm-board-toolbar__title {
  font-size: 1.125rem;
  font-weight: 700;
}
.crm-board {
  display: flex;
  gap: 0.875rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  flex: 1;
  align-items: flex-start;
}
.crm-column {
  flex: 0 0 280px;
  max-width: 280px;
  background: var(--ys-bg-subtle, #f1f5f9);
  border-radius: var(--ys-radius-lg, 12px);
  border: 1px solid var(--ys-border, #e2e8f0);
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 11rem);
}
.crm-column__head {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.625rem 0.625rem 0.5rem;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
}
.crm-column__name {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  background: transparent;
}
.crm-column__name:focus {
  border-color: var(--ys-border);
  background: var(--ys-surface);
}
.crm-column__badge {
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ys-accent-text);
  background: var(--ys-accent-soft);
  padding: 0.15rem 0.4rem;
  border-radius: var(--ys-radius-pill);
  white-space: nowrap;
}
.crm-column__del {
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  color: var(--ys-text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.1rem;
  line-height: 1;
}
.crm-column__del:hover { background: #fee2e2; color: #dc2626; }
.crm-column__cards {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
}
.crm-column__cards--over {
  background: rgba(123, 97, 255, 0.06);
  outline: 2px dashed var(--ys-accent);
  outline-offset: -4px;
  border-radius: 0 0 12px 12px;
}
.crm-card {
  position: relative;
  background: var(--ys-surface, #fff);
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius, 10px);
  padding: 0.75rem 2rem 0.75rem 0.75rem;
  cursor: grab;
  box-shadow: var(--ys-shadow-sm);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.crm-card:hover { border-color: var(--ys-accent); box-shadow: 0 4px 16px rgba(123, 97, 255, 0.12); }
.crm-card--dragging { opacity: 0.55; cursor: grabbing; }
.crm-card--highlight {
  border-color: var(--ys-accent);
  box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.25);
}
.crm-card__title {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.crm-card__preview {
  font-size: 0.75rem;
  color: var(--ys-text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.crm-card__meta {
  font-size: 0.6875rem;
  color: var(--ys-text-muted);
  margin-top: 0.35rem;
}
.crm-card__open {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: var(--ys-bg-subtle);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1;
}
.crm-card__open:hover { background: var(--ys-accent-soft); }

@media (max-width: 1100px) {
  .dialogs-workspace {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }
}
@media (max-width: 768px) {
  .dialogs-workspace {
    grid-template-columns: 1fr;
    grid-template-areas:
      "list"
      "chat";
    min-height: auto;
  }
  .dialogs-list { max-height: 220px; }
  .dialogs-chat__messages { max-height: 360px; }
  .dialogs-sidebar { width: min(300px, 100vw); }
  .crm-column { flex-basis: 240px; max-width: 240px; }
}

/* legacy aliases */
.ys-chat-reply {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--ys-border, #e2e8f0);
}
.ys-chat-reply__input { flex: 1; min-height: 2.5rem; resize: vertical; }
.ys-chat-reply__btn { flex-shrink: 0; }

/* ── Landing ── */
.landing-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ys-border);
}
.dark .landing-header { background: rgba(28,28,36,.9); }
.landing-header__inner {
  max-width: 1120px; margin: 0 auto;
  padding: 0.875rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.landing-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 1.125rem; color: var(--ys-text); text-decoration: none;
}
.landing-logo__mark {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.landing-logo__mark img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand-preview {
  display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 0 0 1.25rem;
  padding: 1rem; border: 1px solid var(--ys-border); border-radius: var(--ys-radius-sm);
  background: var(--ys-sidebar);
}
.brand-preview__item { text-align: center; }
.brand-preview__item img {
  display: block; margin: 0 auto 0.5rem;
  border-radius: 8px; background: #fff;
  border: 1px solid var(--ys-border);
}
.brand-preview__label { font-size: 0.75rem; color: var(--ys-text-muted); }
.landing-nav { display: flex; gap: 1.75rem; }
.landing-nav a { font-size: 0.875rem; color: var(--ys-text-secondary); text-decoration: none; transition: color var(--ys-transition); }
.landing-nav a:hover { color: var(--ys-accent); }
.landing-actions { display: flex; align-items: center; gap: 0.625rem; }

.landing-hero {
  max-width: 1120px; margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center;
}
@media (max-width: 768px) { .landing-hero { grid-template-columns: 1fr; padding-top: 2.5rem; } }
.landing-hero h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; line-height: 1.15; margin: 0 0 1.25rem; letter-spacing: -0.02em; }
.landing-hero p { font-size: 1.125rem; color: var(--ys-text-secondary); line-height: 1.6; margin: 0 0 2rem; }
.landing-hero__demo {
  background: linear-gradient(145deg, #7b61ff 0%, #9d8aff 50%, #c4b5fd 100%);
  border-radius: var(--ys-radius);
  padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(123,97,255,.25);
}
.landing-demo-chat {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border-radius: var(--ys-radius-sm);
  padding: 1.25rem;
}
.landing-demo-msg {
  padding: 0.625rem 0.875rem; border-radius: var(--ys-radius-xs);
  font-size: 0.875rem; margin-bottom: 0.5rem; color: #fff;
}
.landing-demo-msg--ai { background: rgba(255,255,255,.25); margin-left: 2rem; }

.landing-section { padding: 4rem 1.5rem; }
.landing-section--alt { background: var(--ys-surface); border-top: 1px solid var(--ys-border); border-bottom: 1px solid var(--ys-border); }
.landing-section__inner { max-width: 1120px; margin: 0 auto; }
.landing-section h2 { font-size: 1.75rem; font-weight: 700; text-align: center; margin: 0 0 2.5rem; letter-spacing: -0.02em; }

.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 768px) { .landing-features { grid-template-columns: 1fr; } }
.landing-feature {
  padding: 1.25rem; background: var(--ys-surface);
  border: 1px solid var(--ys-border); border-radius: var(--ys-radius-sm);
  transition: box-shadow var(--ys-transition), border-color var(--ys-transition);
}
.landing-feature:hover { box-shadow: var(--ys-shadow); border-color: var(--ys-accent-soft); }
.landing-feature__icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.landing-feature h3 { font-size: 0.9375rem; font-weight: 600; margin: 0 0 0.375rem; }
.landing-feature p { font-size: 0.8125rem; color: var(--ys-text-secondary); margin: 0; line-height: 1.5; }

.landing-pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
@media (max-width: 768px) { .landing-pricing { grid-template-columns: 1fr; } }
.landing-price-card {
  padding: 1.75rem; background: var(--ys-surface);
  border: 1px solid var(--ys-border); border-radius: var(--ys-radius);
  position: relative;
}
.landing-price-card--featured { border: 2px solid var(--ys-accent); box-shadow: 0 8px 32px rgba(123,97,255,.15); }
.landing-price-card__badge {
  position: absolute; top: -0.625rem; left: 50%; transform: translateX(-50%);
  background: var(--ys-accent); color: #fff; font-size: 0.6875rem; font-weight: 600;
  padding: 0.25rem 0.75rem; border-radius: var(--ys-radius-pill);
}
.landing-cta {
  text-align: center; padding: 4rem 1.5rem;
  background: linear-gradient(135deg, var(--ys-accent) 0%, #9d8aff 100%);
  color: #fff;
}
.landing-cta h2 { font-size: 1.75rem; margin: 0 0 1.5rem; }
.landing-footer { padding: 2rem 1.5rem; text-align: center; font-size: 0.8125rem; color: var(--ys-text-muted); border-top: 1px solid var(--ys-border); }
.landing-footer a { color: var(--ys-text-secondary); }

.hidden { display: none !important; }

/* ── Branded modal dialogs ── */
.ys-modal-backdrop {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 15, 20, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.ys-modal-backdrop--in { opacity: 1; }
.ys-modal-backdrop--out { opacity: 0; }
.ys-modal {
  display: flex;
  flex-direction: column;
  width: min(100%, 440px);
  max-height: min(90vh, 640px);
  overflow: hidden;
  background: var(--ys-surface);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}
.ys-modal__scroll {
  max-height: min(90vh, 640px);
  overflow-y: auto;
}
.ys-modal-backdrop--in .ys-modal { transform: translateY(0) scale(1); }
.ys-modal__head { flex-shrink: 0; padding: 1.25rem 1.25rem 0; }
.ys-modal__title { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
.ys-modal__message {
  flex-shrink: 0;
  margin: 0.75rem 1.25rem 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ys-text-secondary);
}
.ys-modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem 0;
}
.ys-modal__foot {
  flex-shrink: 0;
  display: flex; justify-content: flex-end; gap: 0.5rem;
  padding: 1.25rem;
}
.ys-btn--danger {
  background: #dc2626; color: #fff; border: none;
}
.ys-btn--danger:hover { background: #b91c1c; }

/* ── Toast notifications ── */
#toast-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 99999;
  display: flex; flex-direction: column; gap: 0.75rem;
  max-width: min(22rem, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
  position: relative; display: flex; align-items: flex-start; gap: 0.75rem;
  padding: 0.875rem 1rem 0.875rem 0.75rem;
  background: rgba(255,255,255,.97); border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-sm); box-shadow: var(--ys-shadow);
  backdrop-filter: blur(12px); pointer-events: auto; overflow: hidden;
  opacity: 0; transform: translateX(1.25rem) scale(0.96);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34,1.4,0.64,1);
}
.dark .toast { background: rgba(28,28,36,.95); }
.toast.toast-in { opacity: 1; transform: none; }
.toast.toast-out { opacity: 0; transform: translateX(1rem) scale(0.95); transition-duration: 0.22s; }
.toast-accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.toast-success .toast-accent { background: linear-gradient(180deg, #22c55e, #16a34a); }
.toast-error .toast-accent { background: linear-gradient(180deg, #ef4444, #dc2626); }
.toast-warning .toast-accent { background: linear-gradient(180deg, #f59e0b, #d97706); }
.toast-icon-wrap { flex-shrink: 0; width: 2rem; height: 2rem; border-radius: var(--ys-radius-xs); display: flex; align-items: center; justify-content: center; }
.toast-success .toast-icon-wrap { background: rgba(34,197,94,.12); color: #16a34a; }
.toast-error .toast-icon-wrap { background: rgba(239,68,68,.12); color: #dc2626; }
.toast-warning .toast-icon-wrap { background: rgba(245,158,11,.12); color: #d97706; }
.toast-icon { width: 1.125rem; height: 1.125rem; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 0.8125rem; font-weight: 600; color: var(--ys-text); margin-bottom: 0.125rem; }
.toast-message { font-size: 0.75rem; line-height: 1.45; color: var(--ys-text-secondary); }
.toast-close { flex-shrink: 0; width: 1.5rem; height: 1.5rem; border: none; background: transparent; color: var(--ys-text-muted); font-size: 1.25rem; cursor: pointer; border-radius: var(--ys-radius-xs); }
.toast-close:hover { background: var(--ys-sidebar-hover); color: var(--ys-text); }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 2px; width: 100%; transform-origin: left; animation: toast-progress linear forwards; }
.toast-success .toast-progress { background: #22c55e; }
.toast-error .toast-progress { background: #ef4444; }
.toast-warning .toast-progress { background: #f59e0b; }
@keyframes toast-progress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── Toast accent sync ── */
.toast-info .toast-accent { background: linear-gradient(180deg, var(--ys-accent), var(--ys-accent-hover)); }
.toast-info .toast-icon-wrap { background: var(--ys-accent-soft); color: var(--ys-accent); }
.toast-info .toast-progress { background: var(--ys-accent); }
.dark .toast-info .toast-icon-wrap { color: #a78bfa; }

@media (max-width: 768px) {
  .panel-sidebar {
    width: min(86vw, 300px);
    max-width: 300px;
    transform: translate3d(-105%, 0, 0);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease;
    z-index: 120;
    box-shadow: none;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .panel-sidebar.open,
  .panel-layout.panel-nav-open .panel-sidebar {
    transform: translate3d(0, 0, 0);
    box-shadow: 8px 0 32px rgba(15, 15, 18, 0.18);
  }
  /* На мобиле всегда полный список с подписями, не «только иконки» */
  .panel-layout.panel-nav-open {
    --ys-sidebar-w: min(86vw, 300px);
  }
  .panel-layout.panel-nav-open.panel-shutter-closed,
  .panel-layout.panel-nav-open {
    --ys-sidebar-w: min(86vw, 300px);
  }
  .panel-layout.panel-nav-open .panel-sidebar--grid {
    width: min(86vw, 300px);
    grid-template-columns: var(--ys-rail-w) 1fr;
  }
  .panel-layout.panel-nav-open .panel-sidebar__cell:nth-child(2n) {
    opacity: 1;
    pointer-events: auto;
  }
  .panel-shutter__close { display: none; }
  .panel-sidebar-shutter-toggle { display: none !important; }
  .panel-main { margin-left: 0; width: 100%; }
  .landing-nav { display: none; }
  .oauth-buttons { grid-template-columns: repeat(2, 1fr); }

  .panel-nav-burger {
    display: inline-flex;
  }
  .panel-topbar__head {
    gap: 0.5rem;
  }
  .panel-topbar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Бургер — в topbar, виден только на узких экранах */
.panel-nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius);
  background: var(--ys-surface);
  color: var(--ys-text);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.panel-nav-burger:hover,
.panel-nav-burger:focus-visible {
  background: var(--ys-sidebar-hover);
  border-color: color-mix(in srgb, var(--ys-accent) 35%, var(--ys-border));
  outline: none;
}
.panel-nav-burger:active { transform: scale(0.96); }
.panel-nav-burger__icon {
  display: block;
  width: 18px;
  height: 14px;
  position: relative;
}
.panel-nav-burger__icon span,
.panel-nav-burger__icon::before,
.panel-nav-burger__icon::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.22s ease, opacity 0.22s ease, top 0.22s ease;
}
.panel-nav-burger__icon span { top: 6px; }
.panel-nav-burger__icon::before { top: 0; }
.panel-nav-burger__icon::after { top: 12px; }
.panel-nav-burger.is-open .panel-nav-burger__icon span { opacity: 0; }
.panel-nav-burger.is-open .panel-nav-burger__icon::before {
  top: 6px;
  transform: rotate(45deg);
}
.panel-nav-burger.is-open .panel-nav-burger__icon::after {
  top: 6px;
  transform: rotate(-45deg);
}

.panel-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(15, 15, 18, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.panel-nav-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}
html.panel-nav-lock,
body.panel-nav-lock {
  overflow: hidden;
  touch-action: none;
}

@media (max-width: 480px) {
  .panel-topbar__title { font-size: 1.125rem; }
  .panel-content { padding: 0.75rem; }
}

/* OAuth buttons */
.oauth-row { margin-top: 1.25rem; }
.oauth-divider { display: flex; align-items: center; gap: 0.75rem; font-size: 0.75rem; color: var(--ys-text-muted); margin: 0 0 0.875rem; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--ys-border); }
.oauth-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.oauth-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem 0.375rem; font-size: 0.6875rem; font-weight: 600;
  border-radius: var(--ys-radius-xs); border: 1px solid var(--ys-border);
  background: var(--ys-surface); color: var(--ys-text);
  text-decoration: none; transition: border-color var(--ys-transition), box-shadow var(--ys-transition);
}
.oauth-btn:hover { border-color: var(--oauth-color, var(--ys-accent)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--oauth-color, var(--ys-accent)) 15%, transparent); }

/* ── Billing ── */
/* ── Billing (manager) ── */
.billing-page {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 960px;
}
.billing-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem !important;
  background: linear-gradient(135deg, var(--ys-surface) 0%, var(--ys-accent-soft) 100%);
}
.billing-hero__value--sm { font-size: 1.75rem; }
.billing-hero__value--warn { color: #d97706; }
.billing-hero__value--danger { color: #dc2626; }
.billing-meter__foot { margin: 0.5rem 0 0; font-size: 0.8125rem; }
.billing-usage-alert--warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: var(--ys-radius-sm, 10px);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.billing-usage-alert--danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: var(--ys-radius-sm, 10px);
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}
.billing-hero__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ys-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.billing-hero__value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-top: 0.25rem;
  color: var(--ys-text);
}
.billing-hero__hint {
  margin: 0.375rem 0 0;
  font-size: 0.8125rem;
  color: var(--ys-text-secondary);
}
.billing-hero__plan {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}
.billing-plan-pill {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
  max-width: 340px;
  padding: 1.1rem 1.2rem 1rem;
  border-radius: 16px;
  background:
    linear-gradient(165deg, rgba(123, 97, 255, 0.08) 0%, rgba(255, 255, 255, 0.95) 42%),
    var(--ys-surface);
  border: 1px solid rgba(123, 97, 255, 0.22);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  text-align: left;
}
.billing-plan-pill__top {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
}
.billing-plan-pill__body { flex: 1; min-width: 0; }
.billing-plan-pill__name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ys-text);
}
.billing-plan-pill__price {
  font-size: 1rem;
  color: var(--ys-accent);
  font-weight: 700;
  margin-top: 0.3rem;
}
.billing-plan-pill__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.65rem;
}
.billing-plan-pill__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.04);
  color: var(--ys-text-secondary);
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.billing-plan-pill__chip--ok {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.22);
  color: #047857;
}
.billing-plan-pill__chip--warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.28);
  color: #b45309;
}
.billing-plan-pill__exp { font-size: 0.75rem; color: var(--ys-text-muted); margin-top: 0.25rem; }
.billing-plan-pill__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.15rem;
}
.billing-auto-renew {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.8rem 0.85rem;
  border: 1px solid rgba(123, 97, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.billing-auto-renew:hover {
  border-color: rgba(123, 97, 255, 0.35);
  box-shadow: 0 4px 14px rgba(123, 97, 255, 0.08);
}
.billing-auto-renew--on {
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.1) 0%, rgba(255, 255, 255, 0.85) 70%);
  border-color: rgba(123, 97, 255, 0.32);
}
.billing-auto-renew__switch {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  margin-top: 0.1rem;
}
.billing-auto-renew__switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}
.billing-auto-renew__track {
  display: block;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: #d4d4d8;
  transition: background 0.18s ease;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
}
.billing-auto-renew__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s ease;
}
.billing-auto-renew__switch input:checked + .billing-auto-renew__track {
  background: #7B61FF;
}
.billing-auto-renew__switch input:checked + .billing-auto-renew__track::after {
  transform: translateX(16px);
}
.billing-auto-renew__switch input:disabled + .billing-auto-renew__track {
  opacity: 0.55;
}
.billing-auto-renew__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ys-text);
  line-height: 1.25;
}
.billing-auto-renew__hint {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ys-text-secondary);
}
.billing-auto-renew__card {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.45rem;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.04);
  color: var(--ys-text-secondary);
}
.billing-auto-renew__card--ok {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
}
.billing-auto-renew__card--miss {
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
}

/* Tariff tier icons */
.tariff-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--ys-radius);
  color: #fff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.tariff-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, transparent 55%);
  pointer-events: none;
}
.tariff-icon svg { position: relative; z-index: 1; display: block; }
.tariff-icon--sm { width: 36px; height: 36px; border-radius: 11px; }
.tariff-icon--sm svg { width: 18px; height: 18px; }
.tariff-icon--md { width: 48px; height: 48px; }
.tariff-icon--md svg { width: 24px; height: 24px; }
.tariff-icon--lg { width: 56px; height: 56px; border-radius: var(--ys-radius-lg); }
.tariff-icon--lg svg { width: 28px; height: 28px; }
.tariff-icon--start {
  background: linear-gradient(145deg, #38bdf8 0%, #2563eb 55%, #1d4ed8 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}
.tariff-icon--pro {
  background: linear-gradient(145deg, #c4b5fd 0%, #7c3aed 50%, #5b21b6 100%);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.38), inset 0 1px 0 rgba(255,255,255,0.25);
}
.tariff-icon--business {
  background: linear-gradient(145deg, #fbbf24 0%, #d97706 35%, #1e1b4b 100%);
  box-shadow: 0 6px 18px rgba(217, 119, 6, 0.32), inset 0 1px 0 rgba(255,255,255,0.2);
}
.tariff-icon--default {
  background: linear-gradient(145deg, #94a3b8 0%, #64748b 100%);
  box-shadow: 0 6px 16px rgba(100, 116, 139, 0.28);
}
.billing-tariff-card__top {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.875rem;
  padding-right: 3.5rem;
}
.billing-tariff-card__head { flex: 1; min-width: 0; }
.billing-tariff-card__name { font-size: 1.0625rem; font-weight: 700; margin-bottom: 0.125rem; padding-right: 0; }
.billing-shutter__head-left {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}
.billing-shutter__head-text { min-width: 0; }

.billing-usage-card__hint { margin: 0 0 1rem; }
.billing-usage-alert {
  margin-bottom: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--ys-radius-sm);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #9a3412;
}
.billing-usage-alert strong { color: #c2410c; }
.billing-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (max-width: 700px) {
  .billing-usage-grid { grid-template-columns: 1fr; }
}
.billing-meter {
  padding: 1rem 1.125rem;
  border-radius: var(--ys-radius-sm);
  background: var(--ys-bg, #f8fafc);
  border: 1px solid var(--ys-border);
}
.billing-meter__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.billing-meter__icon { font-size: 1.125rem; line-height: 1; }
.billing-meter__title { font-weight: 600; font-size: 0.9375rem; flex: 1; }
.billing-meter__pct, .billing-meter__tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
}
.billing-meter__tag { background: #dcfce7; color: #15803d; }
.billing-meter__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.billing-meter--unlimited .billing-meter__stats { grid-template-columns: repeat(2, 1fr); }
.billing-meter__stat { text-align: center; }
.billing-meter__stat-val {
  display: block;
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ys-text);
}
.billing-meter__stat-lbl {
  display: block;
  font-size: 0.6875rem;
  color: var(--ys-text-muted);
  margin-top: 0.125rem;
}
.billing-meter__bar {
  height: 8px;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-border);
  overflow: hidden;
}
.billing-meter__bar span {
  display: block;
  height: 100%;
  border-radius: var(--ys-radius-pill);
  background: linear-gradient(90deg, var(--ys-accent), #9b87f5);
  transition: width 0.4s ease;
}
.billing-meter__bar--warn span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.billing-meter__bar--danger span { background: linear-gradient(90deg, #ef4444, #f87171); }
.billing-meter--unlimited .billing-meter__bar span {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}

.billing-tariffs-card .ys-hint { margin-bottom: 1rem; }
.billing-tariffs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.billing-tariffs-head__title { margin-bottom: 0.25rem !important; }
.billing-tariffs-head__hint { margin: 0 !important; }
.billing-compare-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.billing-compare-btn__icon { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.billing-compare-btn--active {
  background: var(--ys-accent-soft);
  border-color: var(--ys-accent);
  color: var(--ys-accent-text);
}

.billing-compare__header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ys-border);
}
.billing-compare__title {
  margin: 0 0 0.375rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.billing-compare__subtitle {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ys-text-secondary);
  line-height: 1.5;
}
.billing-compare__table-wrap {
  overflow-x: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.billing-compare__table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}
.billing-compare__table th,
.billing-compare__table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--ys-border);
  vertical-align: middle;
  text-align: left;
}
.billing-compare__corner {
  width: 28%;
  min-width: 160px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ys-text-muted);
  background: var(--ys-surface);
  position: sticky;
  left: 0;
  z-index: 2;
}
.billing-compare__col {
  background: var(--ys-surface);
  text-align: center;
  min-width: 150px;
}
.billing-compare__col--current {
  background: var(--ys-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(123, 97, 255, 0.2);
}
.billing-compare__col--featured {
  background: linear-gradient(180deg, rgba(196, 181, 253, 0.12) 0%, var(--ys-surface) 100%);
}
.billing-compare__plan-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.billing-compare__plan-meta { text-align: center; }
.billing-compare__plan-name { font-weight: 700; font-size: 0.9375rem; }
.billing-compare__plan-price { font-size: 0.8125rem; color: var(--ys-accent); font-weight: 600; margin-top: 0.125rem; }
.billing-compare__plan-badge {
  display: inline-block;
  margin-top: 0.375rem;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-accent);
  color: #fff;
  text-transform: uppercase;
}
.billing-compare__plan-current {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ys-accent-text);
}
.billing-compare__feature {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--ys-text);
  background: var(--ys-bg, #f8fafc);
  position: sticky;
  left: 0;
  z-index: 1;
  white-space: nowrap;
}
.billing-compare__feature--sub {
  font-weight: 500;
  color: var(--ys-text-secondary);
  padding-left: 2rem;
  white-space: normal;
}
.billing-compare__feature-icon { margin-right: 0.375rem; }
.billing-compare__cell {
  text-align: center;
  color: var(--ys-text);
  background: var(--ys-surface);
}
.billing-compare__cell--current { background: var(--ys-accent-soft); }
.billing-compare__cell--center { text-align: center; }
.billing-compare__highlight { color: var(--ys-accent); font-weight: 600; }
.billing-compare__section th {
  padding: 0.625rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ys-text-muted);
  background: var(--ys-bg, #f1f5f9);
  border-bottom: 1px solid var(--ys-border);
  text-align: left;
}
.billing-compare__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--ys-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}
.billing-compare__check--yes {
  background: #dcfce7;
  color: #15803d;
}
.billing-compare__check--no {
  background: var(--ys-bg, #f1f5f9);
  color: var(--ys-text-muted);
}
.billing-compare__row:hover .billing-compare__feature,
.billing-compare__row:hover .billing-compare__cell {
  background: color-mix(in srgb, var(--ys-accent-soft) 35%, var(--ys-surface));
}
.billing-compare__footer {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ys-border);
}
.billing-compare__actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}
.billing-compare__action {
  padding: 1rem 1.125rem;
  border-radius: var(--ys-radius-sm);
  border: 1px solid var(--ys-border);
  background: var(--ys-surface);
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.billing-compare__action--current {
  border-color: var(--ys-accent);
  background: var(--ys-accent-soft);
}
.billing-compare__action-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.billing-compare__action-name { font-weight: 700; font-size: 0.9375rem; }
.billing-compare__action-price { font-size: 0.8125rem; color: var(--ys-accent); font-weight: 600; }
.billing-compare__action-desc {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ys-text-secondary);
  line-height: 1.45;
  flex: 1;
}
.billing-compare__action-status {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ys-accent-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.billing-compare__action-warn {
  display: block;
  font-size: 0.75rem;
  color: var(--ys-danger);
  margin-top: 0.25rem;
}
.billing-compare__notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.billing-compare__note {
  padding: 0.875rem 1rem;
  border-radius: var(--ys-radius-xs);
  background: var(--ys-bg, #f8fafc);
  border: 1px solid var(--ys-border);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ys-text-secondary);
}
.billing-compare__note strong { color: var(--ys-text); }

.billing-tariffs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
}
@media (max-width: 800px) {
  .billing-tariffs-grid { grid-template-columns: 1fr; }
}
.billing-tariff-card {
  position: relative;
  text-align: left;
  padding: 1.125rem 1.25rem;
  border-radius: var(--ys-radius);
  border: 1px solid var(--ys-border);
  background: var(--ys-surface);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  font-family: inherit;
}
.billing-tariff-card:hover {
  border-color: var(--ys-accent);
  box-shadow: var(--ys-shadow);
}
.billing-tariff-card--current {
  border-color: var(--ys-accent);
  background: var(--ys-accent-soft);
}
.billing-tariff-card--open {
  border-color: var(--ys-accent);
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.15);
}
.billing-tariff-card--featured { border-color: #c4b5fd; }
.billing-tariff-card__badge {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-accent);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.billing-tariff-card__price { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.375rem; }
.billing-tariff-card__desc {
  font-size: 0.8125rem;
  color: var(--ys-text-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.4;
  min-height: 2.25rem;
}
.billing-tariff-card__foot {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ys-accent);
}

.billing-tariff-shutter {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  margin-top: 0;
}
.billing-tariff-shutter.open {
  grid-template-rows: 1fr;
  margin-top: 1rem;
}
.billing-tariff-shutter__inner { overflow: hidden; min-height: 0; }
.billing-shutter__content {
  padding: 1.25rem 1.375rem;
  border-radius: var(--ys-radius);
  background: var(--ys-bg, #f8fafc);
  border: 1px solid var(--ys-border);
  border-top: 3px solid var(--ys-accent);
}
.billing-shutter__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.billing-shutter__title { font-size: 1.25rem; font-weight: 700; margin: 0 0 0.25rem; }
.billing-shutter__price { font-size: 1.125rem; font-weight: 700; color: var(--ys-accent); }
.billing-shutter__current-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  white-space: nowrap;
}
.billing-shutter__desc {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ys-text-secondary);
  margin-bottom: 1rem;
}
.billing-shutter__features {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  line-height: 1.75;
  font-size: 0.875rem;
}
.billing-limits-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.875rem;
  width: 100%;
  margin: 0 0 1.25rem;
}
@media (max-width: 760px) {
  .billing-limits-groups { grid-template-columns: 1fr; }
}
.billing-limits-group {
  background: var(--ys-surface);
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-sm);
  overflow: hidden;
  box-shadow: var(--ys-shadow-sm);
  min-width: 0;
}
.billing-limits-group__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: linear-gradient(90deg, rgba(123, 97, 255, 0.09) 0%, transparent 72%);
  border-bottom: 1px solid var(--ys-border);
}
.billing-limits-group__icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.billing-limits-group__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ys-text);
  letter-spacing: 0.01em;
}
.billing-limits-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.billing-limits-group__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.875rem;
  border-bottom: 1px solid var(--ys-border);
  font-size: 0.8125rem;
  transition: background 0.12s ease;
}
.billing-limits-group__row:last-child { border-bottom: none; }
.billing-limits-group__row:hover { background: var(--ys-accent-soft, rgba(123, 97, 255, 0.05)); }
.billing-limits-group__label {
  color: var(--ys-text-secondary);
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.billing-limits-group__value {
  flex-shrink: 0;
  text-align: right;
  font-weight: 600;
}
.billing-limits-table-wrap {
  margin: 0 0 1.25rem;
  width: 100%;
  border-radius: var(--ys-radius-sm);
  border: 1px solid var(--ys-border);
  overflow: hidden;
  background: var(--ys-surface);
  box-shadow: var(--ys-shadow-sm);
}
.billing-limits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.billing-limits-table thead th {
  padding: 0.55rem 1rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ys-text-secondary);
  background: var(--ys-bg, #f8fafc);
  border-bottom: 1px solid var(--ys-border);
}
.billing-limits-table thead th:last-child,
.billing-limits-table tbody td {
  text-align: right;
}
.billing-limits-table tbody th[scope="row"] {
  padding: 0.65rem 1rem;
  font-weight: 500;
  color: var(--ys-text);
  text-align: left;
  border-bottom: 1px solid var(--ys-border);
  width: 58%;
}
.billing-limits-table tbody td {
  padding: 0.65rem 1rem;
  font-weight: 600;
  border-bottom: 1px solid var(--ys-border);
  white-space: nowrap;
}
.billing-limits-table tbody tr:last-child th,
.billing-limits-table tbody tr:last-child td {
  border-bottom: none;
}
.billing-limits-table tbody tr:hover th,
.billing-limits-table tbody tr:hover td {
  background: var(--ys-accent-soft, rgba(123, 97, 255, 0.06));
}
.billing-limits-table__val {
  color: var(--ys-accent-text, #5b21b6);
  font-variant-numeric: tabular-nums;
}
.billing-limits-table__yes {
  color: #059669;
  font-weight: 600;
}
.billing-limits-table__no {
  color: var(--ys-text-muted, #94a3b8);
  font-weight: 500;
}
.billing-limits-table__unlim {
  color: var(--ys-accent);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
}
.billing-limits-table__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: var(--ys-radius-pill);
  background: rgba(123, 97, 255, 0.12);
  color: var(--ys-accent);
  font-size: 0.75rem;
  font-weight: 700;
}
.billing-shutter__limits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: var(--ys-text-secondary);
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--ys-surface);
  border-radius: var(--ys-radius-xs);
  border: 1px solid var(--ys-border);
}
.billing-shutter__actions { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.billing-shutter__error { font-size: 0.8125rem; color: var(--ys-danger); margin: 0; }

.billing-tx-wrap {
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-sm);
  overflow: hidden;
}
.billing-tx-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--ys-text-muted);
}
.billing-tx-empty__icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; opacity: 0.5; }
.billing-tx-empty p { margin: 0; font-size: 0.875rem; }
.billing-tx-plus { color: #15803d; font-weight: 600; }
.billing-tx-minus { color: #b91c1c; font-weight: 600; }

.billing-form .ys-form-group { margin-bottom: 0.875rem; }
.tariff-limits-preview {
  margin: 0.75rem 0 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-xs);
  background: var(--ys-surface);
}
.tariff-limits-preview__title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ys-text-secondary);
  margin-bottom: 0.5rem;
}
.tariff-limits-preview__list {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ys-text);
}

/* Analytics (manager) */
.analytics-page { max-width: 1200px; }
.analytics-page__top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.analytics-page__lead {
  margin: 0;
  flex: 1 1 220px;
  color: var(--ys-text-secondary, #6b6b76);
  font-size: 0.9375rem;
  line-height: 1.45;
  max-width: 40rem;
}
.analytics-page__site {
  flex: 0 0 auto;
  min-width: 220px;
}
.analytics-card--metrika {
  padding: 0;
  overflow: visible;
  border: none;
  box-shadow: none;
  background: transparent;
}
.mk-dashboard { display: flex; flex-direction: column; gap: 1rem; }

.mk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.25rem 0 0.5rem;
}
.mk-toolbar__left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.mk-toolbar__right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}
.mk-site-label { margin: 0; white-space: nowrap; font-size: 0.75rem; flex-shrink: 0; }
.mk-site-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.mk-site-field .ys-custom-select {
  width: auto;
  min-width: 13rem;
  max-width: 18.5rem;
  flex-shrink: 0;
}
.mk-site-select { min-width: 13rem; width: auto; }
.mk-site-field .ys-custom-select__trigger {
  display: block;
  position: relative;
  padding-right: 2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 38px;
  line-height: 1.35;
}
.mk-site-field .ys-custom-select__trigger::after {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  margin-top: -0.2rem;
}
.mk-site-field .ys-custom-select__item {
  white-space: nowrap;
}
.mk-site-field .ys-custom-select__item--multiline {
  white-space: normal;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.mk-pills { display: inline-flex; gap: 0.25rem; flex-wrap: wrap; }
.mk-pill {
  border: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-surface, #fff);
  color: var(--ys-text-secondary, #64748b);
  border-radius: var(--ys-radius-pill);
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.mk-pill--sm { padding: 0.35rem 0.7rem; font-size: 0.75rem; }
.mk-pill:hover { border-color: rgba(123, 97, 255, 0.35); color: var(--ys-accent, #7B61FF); }
.mk-pill--active {
  background: linear-gradient(135deg, rgba(123, 97, 255, 0.14), rgba(123, 97, 255, 0.06));
  border-color: var(--ys-accent, #7B61FF);
  color: var(--ys-accent-text, #5b21b6);
  box-shadow: 0 2px 10px rgba(123, 97, 255, 0.12);
}

.mk-select-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--ys-border, #e2e8f0);
  background: var(--ys-surface, #fff);
  border-radius: var(--ys-radius-pill);
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ys-text, #1e293b);
  cursor: default;
}
.mk-period-range {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mk-period-range.hidden { display: none; }
.mk-date {
  font-size: 0.8125rem;
  padding: 0.35rem 0.55rem;
  width: auto;
}
.mk-period-range__sep { color: var(--ys-text-muted); }

.mk-card {
  background: var(--ys-surface, #fff);
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius-lg, 14px);
  box-shadow: var(--ys-shadow-sm);
  overflow: hidden;
}
.mk-card__head {
  padding: 1rem 1.25rem 0.25rem;
}
.mk-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--ys-text, #1e293b);
}

.mk-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--ys-border, #e2e8f0);
}
.mk-metrics--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mk-metrics--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .mk-metrics--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .mk-metrics--3 { grid-template-columns: 1fr; }
  .mk-metrics--4 { grid-template-columns: 1fr; }
}
.mk-metric--static { cursor: default; }
.mk-metric--static:hover { background: transparent; }
.mk-card--widget { margin-top: 1rem; }
.mk-card__subtitle { margin: 0.25rem 0 0; font-size: 0.8125rem; }
.mk-card__chart-head {
  padding: 0.75rem 1.25rem 0.15rem;
  border-top: 1px solid var(--ys-border, #e2e8f0);
}
.mk-card__chart-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ys-text-secondary, #64748b);
}
@media (max-width: 1100px) {
  .mk-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mk-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mk-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.875rem 1rem;
  border: none;
  border-right: 1px solid var(--ys-border, #e2e8f0);
  border-bottom: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 0.15s ease;
  position: relative;
}
.mk-metric:nth-child(6n) { border-right: none; }
.mk-metric:hover { background: rgba(123, 97, 255, 0.04); }
.mk-metric--active {
  background: rgba(123, 97, 255, 0.07);
  box-shadow: inset 0 -3px 0 var(--ys-accent, #7B61FF);
}
.mk-metric__label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ys-text-muted, #94a3b8);
}
.mk-metric__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}
.mk-metric__val {
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ys-text, #1e293b);
}
.mk-delta {
  font-size: 0.6875rem;
  font-weight: 700;
  white-space: nowrap;
}
.mk-delta--up { color: #059669; }
.mk-delta--down { color: #dc2626; }

.mk-chart {
  position: relative;
  padding: 0.75rem 1rem 0.25rem;
  overflow: hidden;
}
.mk-chart__svg {
  width: 100%;
  min-width: 0;
  height: auto;
  display: block;
  max-width: 100%;
}
.mk-chart__grid {
  stroke: rgba(123, 97, 255, 0.08);
  stroke-width: 1;
}
.mk-chart__ylabel,
.mk-chart__xlabel {
  fill: var(--ys-text-muted, #94a3b8);
  font-size: 11px;
}
.mk-chart--empty {
  padding: 3rem 1rem;
  text-align: center;
}
.mk-chart__crosshair {
  stroke: rgba(123, 97, 255, 0.45);
  stroke-width: 1.5;
  stroke-dasharray: 4 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.mk-chart__crosshair--on { opacity: 1; }
.mk-chart__hit {
  fill: transparent;
  cursor: crosshair;
}
.mk-chart__line {
  fill: none;
  vector-effect: non-scaling-stroke;
}
.mk-chart__tooltip {
  position: absolute;
  z-index: 6;
  min-width: 148px;
  max-width: 240px;
  padding: 0.55rem 0.7rem;
  border-radius: var(--ys-radius-sm);
  background: var(--ys-surface, #fff);
  border: 1px solid var(--ys-border, #e2e8f0);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
}
.mk-chart__tooltip--visible {
  opacity: 1;
  visibility: visible;
}
.mk-chart__tooltip-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ys-text-secondary, #64748b);
  margin-bottom: 0.35rem;
}
.mk-chart__tooltip-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  line-height: 1.35;
}
.mk-chart__tooltip-row + .mk-chart__tooltip-row { margin-top: 0.2rem; }
.mk-chart__tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mk-chart__tooltip-label {
  flex: 1;
  color: var(--ys-text-secondary, #64748b);
  font-weight: 600;
}
.mk-chart__tooltip-val {
  font-weight: 800;
  color: var(--ys-text, #1e293b);
  font-variant-numeric: tabular-nums;
}

.mk-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.75rem 1.25rem 1.125rem;
  border-top: 1px solid var(--ys-border, #e2e8f0);
}
.mk-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
  font-family: inherit;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.mk-legend__item:hover {
  background: rgba(123, 97, 255, 0.07);
}
.mk-legend__item--off {
  opacity: 0.45;
}
.mk-legend__item--off .mk-legend__dot {
  background: #cbd5e1 !important;
}
.mk-legend__item--off .mk-legend__label,
.mk-legend__item--off .mk-legend__val {
  text-decoration: line-through;
  text-decoration-color: rgba(100, 116, 139, 0.55);
}
.mk-legend__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mk-legend__label { color: var(--ys-text-secondary, #64748b); font-weight: 600; }
.mk-legend__val { font-weight: 800; color: var(--ys-text, #1e293b); }

.mk-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--ys-surface, #fff);
  border: 1px dashed var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius-lg, 14px);
}
.mk-empty--connect .mk-empty__icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.mk-empty__title { margin: 0 0 0.5rem; font-size: 1.125rem; }

.analytics-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.analytics-tabs__btn {
  padding: 0.5rem 1rem;
  border-radius: var(--ys-radius-sm);
  border: 1px solid var(--ys-border);
  background: var(--ys-surface);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ys-text-secondary);
}
.analytics-tabs__btn--active {
  background: var(--ys-accent-soft);
  border-color: var(--ys-accent);
  color: var(--ys-accent-text);
}
.analytics-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.analytics-card__hint { margin: 0.25rem 0 0 !important; }
.analytics-filter { min-width: 200px; }
.analytics-filter .ys-custom-select,
.analytics-filter__select { margin-top: 0.25rem; min-width: 200px; }
.analytics-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.analytics-stats:has(> .kl-infograph),
.analytics-stats:has(> .sc-infograph) {
  display: block;
}
@media (max-width: 700px) { .analytics-stats { grid-template-columns: 1fr; } }
.analytics-stat {
  position: relative;
  overflow: hidden;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: linear-gradient(165deg, #ffffff 0%, #f7f8fb 100%);
  border: 1px solid #e8e8ec;
  text-align: left;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  min-height: 88px;
}
.analytics-stat::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: var(--an-accent, #64748b);
  opacity: 0.85;
}
.analytics-stat:nth-child(3n+1) { --an-accent: #4f46e5; }
.analytics-stat:nth-child(3n+2) { --an-accent: #0d9488; }
.analytics-stat:nth-child(3n+3) { --an-accent: #d97706; }
.analytics-stat__val {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.analytics-stat__lbl {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.28rem;
  font-weight: 500;
  line-height: 1.35;
}
.analytics-table-wrap { overflow-x: auto; }
.analytics-table { min-width: 720px; }
.analytics-muted { color: var(--ys-text-muted); }
.analytics-empty { padding: 2.5rem 1rem; text-align: center; color: var(--ys-text-muted); }
.ys-chat-card__visitor {
  font-size: 0.8125rem;
  color: var(--ys-text-secondary);
  margin-top: 0.375rem;
  line-height: 1.4;
}
.ys-chat-card__visitor--anon { font-style: italic; color: var(--ys-text-muted); }

.tariffs-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.tariff-editor-card { margin-top: 1rem; max-width: 720px; }
.tariff-form-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ys-border);
}
.ys-table--tariffs td:last-child { white-space: nowrap; }
.tariff-sort-th { width: 2.75rem; }
.tariff-sort-cell { width: 2.75rem; vertical-align: middle; }
.tariff-sort-controls {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.tariff-sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.5rem;
  padding: 0;
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-xs);
  background: var(--ys-surface);
  color: var(--ys-text-secondary);
  font-size: 0.8125rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.tariff-sort-btn:hover:not(:disabled) {
  border-color: var(--ys-accent);
  color: var(--ys-accent);
  background: var(--ys-accent-soft);
}
.tariff-sort-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.tariff-row--inactive { opacity: 0.72; }
.tariff-row--inactive .tariff-sort-cell + td strong { color: var(--ys-text-secondary); }
.tariff-status-badge {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--ys-radius-pill);
  background: #fee2e2;
  color: #b91c1c;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}
.tariff-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.tariff-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--ys-border);
  border-radius: var(--ys-radius-xs);
  background: var(--ys-surface);
  color: var(--ys-text-secondary);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.tariff-action svg { width: 1rem; height: 1rem; display: block; }
.tariff-action:hover {
  border-color: var(--ys-accent);
  color: var(--ys-accent);
  box-shadow: var(--ys-shadow-sm);
}
.tariff-action--edit:hover { background: var(--ys-accent-soft); }
.tariff-action--copy:hover { background: #eff6ff; border-color: #93c5fd; color: #2563eb; }
.tariff-action--delete:hover { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
.tariff-action:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.section-back-btn {
  flex-shrink: 0;
  border: none;
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: var(--ys-radius-xs);
  cursor: pointer;
  margin-right: 0.75rem;
  transition: background var(--ys-transition);
}
.section-back-btn:hover { background: var(--ys-accent); color: #fff; }
.panel-topbar__head {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 auto;
}
.analytics-source {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--ys-radius-pill);
  background: var(--ys-accent-soft);
  color: var(--ys-accent-text);
  white-space: nowrap;
}
.analytics-source--promotion { background: #fef3c7; color: #92400e; }
.analytics-source--quiz { background: #ede9fe; color: #5b21b6; }
.analytics-source--survey { background: #dbeafe; color: #1d4ed8; }
.analytics-source--callback { background: #fce7f3; color: #9d174d; }

.ys-role-select { padding: 0.375rem 0.625rem; font-size: 0.8125rem; border-radius: var(--ys-radius-xs); border: 1px solid var(--ys-border-strong); background: var(--ys-surface); font-family: inherit; }
.ys-hint { font-size: 0.8125rem; color: var(--ys-text-secondary); margin: 0 0 1rem; line-height: 1.5; }
.ys-badge { display: inline-block; padding: 0.125rem 0.5rem; font-size: 0.6875rem; font-weight: 600; border-radius: var(--ys-radius-pill); background: var(--ys-accent-soft); color: var(--ys-accent-text); }

.ys-perm-readonly-banner {
  margin: 0 0 1rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--ys-radius-xs);
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.8125rem;
  line-height: 1.45;
}
.ys-perm-hidden { display: none !important; }
.ys-perm-readonly input:not([type=hidden]):not([data-perm-allow="1"]),
.ys-perm-readonly select:not([data-perm-allow="1"]),
.ys-perm-readonly textarea:not([data-perm-allow="1"]) {
  background: var(--ys-surface-muted, #f8fafc);
  cursor: not-allowed;
}

/* ── Analytics Insights (12 blocks) ── */
.ai-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ys-border, #e2e8f0);
  overflow: visible;
}
.ai-section-head { margin-bottom: 0.25rem; }
.ai-section-head__title {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--ys-text, #1e293b);
}
.ai-loading { padding: 2rem 1rem; text-align: center; }

.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  overflow: visible;
}
.ai-grid__full { grid-column: 1 / -1; }
.ai-grid__half { min-width: 0; }
@media (max-width: 960px) {
  .ai-grid { grid-template-columns: 1fr; }
  .ai-grid__half { grid-column: 1 / -1; }
}

.ai-block {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--ys-surface, #fff);
  border: 1px solid var(--ys-border, #e2e8f0);
  border-radius: var(--ys-radius-lg, 14px);
  overflow: visible;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  height: 100%;
  position: relative;
  z-index: 0;
}
.ai-block:has(.ai-kpi-card:hover),
.ai-block:has(.ai-kpi-card:focus-visible) {
  z-index: 2;
}
.ai-block__head {
  padding: 0.875rem 1.125rem 0.5rem;
  border-bottom: 1px solid rgba(123, 97, 255, 0.08);
  background: linear-gradient(180deg, rgba(123, 97, 255, 0.04) 0%, transparent 100%);
  border-radius: var(--ys-radius-lg, 14px) var(--ys-radius-lg, 14px) 0 0;
}
.ai-block__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.35;
  color: var(--ys-text, #1e293b);
}
.ai-block__body {
  padding: 0.875rem 1.125rem 1rem;
  flex: 1;
  min-height: 0;
  overflow: visible;
}
.ai-block__body:has(.ai-kpi-grid) {
  padding-bottom: 0.5rem;
}
.ai-note {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  margin: 0;
  padding: 0.75rem 1.125rem 0.875rem;
  background: linear-gradient(180deg, rgba(123, 97, 255, 0.06) 0%, rgba(123, 97, 255, 0.03) 100%);
  border-top: 1px solid rgba(123, 97, 255, 0.12);
  border-radius: 0 0 var(--ys-radius-lg, 14px) var(--ys-radius-lg, 14px);
  position: relative;
  z-index: 1;
}
.ai-note__icon {
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: rgba(123, 97, 255, 0.15);
  color: var(--ys-accent, #7B61FF);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.125rem;
  text-align: center;
}
.ai-note__text {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ys-text-secondary, #64748b);
}

.ai-chart { width: 100%; overflow: hidden; }
.ai-chart .mk-chart__svg { width: 100%; height: auto; display: block; }
.ai-empty { margin: 0.5rem 0; }

.ai-mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
  color: var(--ys-text-secondary, #64748b);
}
.ai-mini-legend__item { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }
.ai-mini-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ai-funnel { display: flex; flex-direction: column; gap: 0.625rem; }
.ai-funnel__row {
  display: grid;
  grid-template-columns: minmax(0, 9.5rem) 1fr auto;
  gap: 0.625rem;
  align-items: center;
}
@media (max-width: 560px) {
  .ai-funnel__row { grid-template-columns: 1fr; gap: 0.25rem; }
}
.ai-funnel__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ys-text-secondary, #64748b);
}
.ai-funnel__bar-wrap {
  height: 0.625rem;
  background: var(--ys-surface-muted, #f1f5f9);
  border-radius: var(--ys-radius-pill);
  overflow: hidden;
}
.ai-funnel__bar {
  height: 100%;
  border-radius: var(--ys-radius-pill);
  background: linear-gradient(90deg, #7B61FF, #9d8cff);
  min-width: 4px;
  transition: width 0.35s ease;
}
.ai-funnel__val {
  font-size: 0.875rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ai-funnel__pct {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ys-text-secondary, #64748b);
}

.ai-donut {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.ai-donut__ring {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-donut__hole {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  background: var(--ys-surface, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-donut__total {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--ys-text, #1e293b);
}
.ai-donut-legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 10rem;
}
.ai-donut-legend__item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  color: var(--ys-text-secondary, #64748b);
}
.ai-donut-legend__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ai-dual-bar-list { display: flex; flex-direction: column; gap: 0.75rem; }
.ai-dual-bar {
  display: grid;
  grid-template-columns: minmax(0, 6.5rem) 1fr auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
@media (max-width: 560px) {
  .ai-dual-bar { grid-template-columns: 1fr; }
}
.ai-dual-bar__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ys-text-secondary, #64748b);
}
.ai-dual-bar__bars { display: flex; flex-direction: column; gap: 0.25rem; }
.ai-dual-bar__track {
  height: 0.45rem;
  background: var(--ys-surface-muted, #f1f5f9);
  border-radius: var(--ys-radius-pill);
  overflow: hidden;
}
.ai-dual-bar__fill { height: 100%; border-radius: var(--ys-radius-pill); min-width: 2px; }
.ai-dual-bar__fill--leads { background: #10b981; }
.ai-dual-bar__nums {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ys-text-secondary, #64748b);
  text-align: right;
  white-space: nowrap;
}
.ai-dual-bar-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.6875rem;
  color: var(--ys-text-secondary, #64748b);
}

.ai-hour-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 7rem;
  padding-top: 0.25rem;
}
.ai-hour-bar {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem;
}
.ai-hour-bar__fill {
  width: 100%;
  max-width: 1.125rem;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, #7B61FF, rgba(123, 97, 255, 0.45));
  min-height: 2px;
}
.ai-hour-bar__lbl {
  font-size: 0.5625rem;
  color: var(--ys-text-secondary, #94a3b8);
  line-height: 1;
}

.ai-stack-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 8rem;
  margin-bottom: 0.5rem;
}
.ai-stack-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.ai-stack-col__stack {
  width: 100%;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 3px 3px 0 0;
  overflow: hidden;
  min-height: 4px;
}
.ai-stack-col__seg { min-height: 1px; }
.ai-stack-col__seg--vis { background: #7B61FF; }
.ai-stack-col__seg--ai { background: #10b981; }
.ai-stack-col__seg--op { background: #E84855; }

.ai-hbar-list { display: flex; flex-direction: column; gap: 0.55rem; }
.ai-hbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  gap: 0.5rem 0.75rem;
  align-items: center;
}
@media (max-width: 640px) {
  .ai-hbar { grid-template-columns: 1fr; }
}
.ai-hbar__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ys-text, #334155);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-hbar__track {
  height: 0.5rem;
  background: var(--ys-surface-muted, #f1f5f9);
  border-radius: var(--ys-radius-pill);
  overflow: hidden;
}
.ai-hbar__fill {
  height: 100%;
  border-radius: var(--ys-radius-pill);
  background: linear-gradient(90deg, #7B61FF, #b4a5ff);
}
.ai-hbar__val {
  font-size: 0.8125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  overflow: visible;
}
.ai-kpi-grid--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 960px) {
  .ai-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-kpi-grid--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .ai-kpi-grid,
  .ai-kpi-grid--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ai-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--ys-radius-sm, 10px);
  background: var(--ys-surface-muted, #f8fafc);
  border: 1px solid var(--ys-border, #e2e8f0);
  position: relative;
  cursor: help;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.ai-kpi-card:hover,
.ai-kpi-card:focus-visible {
  border-color: rgba(123, 97, 255, 0.35);
  background: rgba(123, 97, 255, 0.04);
  box-shadow: 0 4px 14px rgba(123, 97, 255, 0.1);
  outline: none;
  z-index: 10;
}
.ai-kpi-card[data-hint]::after {
  content: attr(data-hint);
  position: absolute;
  left: 50%;
  top: calc(100% + 0.55rem);
  bottom: auto;
  transform: translateX(-50%) translateY(-4px);
  min-width: 11rem;
  max-width: 15rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--ys-radius-sm);
  background: var(--ys-surface, #fff);
  border: 1px solid rgba(123, 97, 255, 0.2);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.75rem;
  line-height: 1.45;
  font-weight: 500;
  color: var(--ys-text-secondary, #64748b);
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 40;
}
.ai-kpi-card[data-hint]::before {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(100% + 0.2rem);
  bottom: auto;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: rgba(123, 97, 255, 0.2);
  border-top-color: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  z-index: 39;
}
.ai-kpi-card[data-hint]:hover::after,
.ai-kpi-card[data-hint]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.ai-kpi-card[data-hint]:hover::before,
.ai-kpi-card[data-hint]:focus-visible::before {
  opacity: 1;
  visibility: visible;
}
.ai-block__body:has(.ai-kpi-grid) { overflow: visible; }
.ai-kpi-card__lbl {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ys-text-secondary, #64748b);
}
.ai-kpi-card__val {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ys-text, #1e293b);
  line-height: 1.2;
}
.ai-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
}
.ai-kpi-row--sm { font-size: 0.8125rem; }

.ai-nps { text-align: center; padding: 0.5rem 0; }
.ai-nps__score {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ys-accent, #7B61FF);
}
.ai-nps__meta {
  font-size: 0.8125rem;
  color: var(--ys-text-secondary, #64748b);
  margin: 0.35rem 0 0.75rem;
}
.ai-nps-spark {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 3rem;
}
.ai-nps-spark__bar {
  width: 0.5rem;
  border-radius: 2px 2px 0 0;
  background: rgba(123, 97, 255, 0.35);
  min-height: 4px;
}

.ai-sentiment__layout {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
@media (max-width: 720px) {
  .ai-sentiment__layout { grid-template-columns: 1fr; }
}
.ai-sentiment__donut .ai-donut { flex-direction: column; align-items: center; }
.ai-sentiment__chart { min-width: 0; }
.ai-sentiment-alert {
  margin-bottom: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--ys-radius-sm, 10px);
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 600;
}
.ai-sentiment-samples {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.625rem;
}
.ai-sentiment-sample {
  padding: 0.45rem 0.625rem;
  border-radius: 8px;
  background: rgba(232, 72, 85, 0.06);
  border: 1px solid rgba(232, 72, 85, 0.15);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--ys-text-secondary, #64748b);
}

