/*
 * ROPME - ЧИСТЫЙ МИНИМАЛИСТИЧНЫЙ ДИЗАЙН
 *
 * Принципы: простота, функциональность, читаемость
 * Цветовая схема: белый, серый, синий, зеленый
 * Вдохновение: GitHub, Linear, простые business tools
 */

/* ===========================
   БАЗОВЫЕ ЦВЕТА
   =========================== */

:root {
  /* ОСНОВНЫЕ ЦВЕТА */
  --color-white: #ffffff;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

  /* АКЦЕНТНЫЕ ЦВЕТА */
  --color-blue-500: #3b82f6;
  --color-blue-600: #2563eb;
  --color-green-500: #10b981;
  --color-green-600: #059669;
  --color-purple-500: #8b5cf6;
  --color-purple-600: #7c3aed;
  --color-yellow-500: #f59e0b;
  --color-amber-500: #f59e0b;

  /* СЕМАНТИЧЕСКИЕ ЦВЕТА */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* ТЕНИ */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

  /* РАДИУСЫ */
  --radius: 0.375rem;    /* 6px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */

  /* АНИМАЦИИ */
  --transition: all 0.15s ease-in-out;
}

/* ===========================
   БАЗОВЫЕ КОМПОНЕНТЫ
   =========================== */

/* Простые карточки */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: var(--shadow);
}

/* Простые кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-blue-500);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-blue-600);
}

.btn-secondary {
  background: var(--color-white);
  color: var(--color-gray-700);
  border-color: var(--color-gray-200);
}

.btn-secondary:hover {
  background: var(--color-gray-50);
}

/* Простые бейджи */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-error {
  background: #fee2e2;
  color: #991b1b;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* ===========================
   TIMELINE СТИЛИ
   =========================== */

/* Базовые стили для timeline без излишеств */
.timeline-event {
  position: relative;
  transition: var(--transition);
}

.timeline-event:hover {
  transform: translateX(2px);
}

/* Простые индикаторы */
.timeline-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-white);
  border: 2px solid var(--color-gray-300);
  border-radius: 50%;
  transition: var(--transition);
}

.timeline-indicator:hover {
  border-color: var(--color-blue-500);
}

/* Простые карточки событий */
.timeline-event-card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.timeline-event-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--color-gray-300);
}

/* Простые детали без анимаций */
.timeline-details {
  transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.timeline-details:not(.hidden) {
  opacity: 1;
}

.timeline-details.hidden {
  opacity: 0;
  max-height: 0;
}

/* Простые вкладки */
.timeline-tabs-content [data-timeline-tab-content] {
  background: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
}

/* Kanban по статусам: горизонтальное перетаскивание пустой области доски */
.kanban-drag-scroll {
  cursor: grab;
}

.kanban-drag-scroll.is-dragging {
  cursor: grabbing;
}

.kanban-drag-scroll.is-dragging,
.kanban-drag-scroll.is-dragging * {
  user-select: none;
}

/* Kanban quality: pinned details tooltip selected state */
[data-quality-card-tooltip-pinned="true"][data-testid="deal-quality-card"],
[data-quality-card-tooltip-pinned="true"][data-testid="call-quality-card"] {
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), var(--shadow-md);
}

.quality-card-pinned-overlay {
  align-items: center;
  background: rgba(17, 24, 39, 0.72);
  border-radius: var(--radius-md);
  bottom: 0;
  display: none;
  justify-content: center;
  left: 0;
  padding: 0.75rem;
  pointer-events: none;
  position: absolute;
  right: 0;
  text-align: center;
  top: 0;
  z-index: 20;
}

[data-quality-card-tooltip-pinned="true"] .quality-card-pinned-overlay {
  display: flex;
}

.quality-card-pinned-action {
  align-items: center;
  background: var(--color-white);
  border: 1px solid var(--color-blue-500);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  color: var(--color-gray-900);
  display: inline-flex;
  flex-direction: column;
  gap: 0.125rem;
  max-width: 100%;
  padding: 0.5rem 0.625rem;
}

.quality-card-pinned-kicker {
  color: var(--color-blue-600);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1rem;
}

/* Lead SLA schedule settings */
.lead-sla-calendar-scroll {
  overflow-x: auto;
  padding-bottom: 0.25rem;
}

.lead-sla-calendar-grid {
  align-items: start;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: 3.5rem repeat(7, minmax(7.25rem, 1fr));
  min-width: 57rem;
}

.lead-sla-day-header {
  align-items: center;
  color: var(--color-gray-700);
  display: flex;
  gap: 0.35rem;
  min-height: 2rem;
}

.lead-sla-day-header.is-disabled {
  color: var(--color-gray-500);
}

.lead-sla-day-header.is-disabled .lead-sla-day-label {
  color: var(--color-gray-500);
}

.lead-sla-day-header.is-disabled .lead-sla-day-name {
  color: var(--color-gray-400);
}

.lead-sla-day-heading {
  align-items: baseline;
  cursor: pointer;
  display: flex;
  gap: 0.25rem;
  min-width: 0;
}

.lead-sla-day-label {
  color: var(--color-gray-900);
  font-size: 0.875rem;
  font-weight: 700;
}

.lead-sla-day-name {
  color: var(--color-gray-500);
  font-size: 0.6875rem;
  line-height: 1rem;
}

.lead-sla-time-track {
  height: 32rem;
  position: relative;
}

.lead-sla-time-axis {
  color: var(--color-gray-400);
  font-size: 0.6875rem;
  line-height: 1rem;
}

.lead-sla-time-axis-label {
  margin-top: -0.5rem;
  position: absolute;
  right: 0.25rem;
}

.lead-sla-time-axis-label:first-child {
  margin-top: 0;
}

.lead-sla-time-axis-label:last-child {
  margin-top: -1rem;
}

.lead-sla-day-column {
  min-width: 0;
}

.lead-sla-day-track {
  background-color: var(--color-white);
  background-image: linear-gradient(
    to bottom,
    transparent calc(100% - 1px),
    var(--color-gray-100) calc(100% - 1px)
  );
  background-size: 100% 12.5%;
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.lead-sla-work-block {
  align-items: stretch;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: #1e3a8a;
  cursor: grab;
  display: flex;
  flex-direction: column;
  left: 0.35rem;
  min-height: 0;
  position: absolute;
  right: 0.35rem;
}

.lead-sla-work-block:active {
  cursor: grabbing;
}

.lead-sla-work-block.is-disabled {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
  border-style: dashed;
  color: var(--color-gray-600);
}

.lead-sla-work-block.is-invalid {
  background: var(--color-red-50);
  border-color: var(--color-red-300);
  height: 3rem;
  top: 0;
}

.lead-sla-work-block.is-unpositioned {
  height: 3rem;
  top: 0;
}

.lead-sla-work-block-body {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: 0.35rem;
  pointer-events: auto;
}

.lead-sla-work-block.is-compact .lead-sla-work-block-body {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #93c5fd;
  border-radius: 0.25rem;
  box-shadow: var(--shadow-sm);
  left: 0;
  min-height: 2rem;
  padding: 0.25rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 2;
}

.lead-sla-work-block.is-compact.is-compact-above .lead-sla-work-block-body {
  bottom: calc(100% + 0.35rem);
  top: auto;
}

.lead-sla-work-inputs {
  align-items: center;
  display: flex;
  gap: 0.12rem;
  margin-top: 0.2rem;
  max-width: 100%;
}

.lead-sla-time-input {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(147, 197, 253, 0.9);
  border-radius: 0.25rem;
  color: inherit;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  line-height: 1rem;
  padding: 0.125rem;
  text-align: center;
  width: 2.55rem;
}

.lead-sla-time-input:focus {
  border-color: var(--color-blue-500);
  outline: 2px solid rgba(59, 130, 246, 0.25);
}

.lead-sla-time-input:invalid {
  border-color: var(--color-error);
}

.lead-sla-resize-handle {
  background: transparent;
  border: 0;
  cursor: ns-resize;
  flex: 0 0 0.55rem;
  padding: 0;
  position: relative;
}

.lead-sla-work-block.is-compact .lead-sla-resize-handle {
  flex: none;
  height: 0.55rem;
  position: absolute;
  top: 0;
  width: 50%;
  z-index: 3;
}

.lead-sla-work-block.is-compact .lead-sla-resize-handle-top {
  left: 0;
}

.lead-sla-work-block.is-compact .lead-sla-resize-handle-bottom {
  left: 50%;
}

.lead-sla-work-block.is-compact.is-compact-above .lead-sla-resize-handle {
  top: -0.25rem;
}

.lead-sla-resize-handle::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 50%;
  opacity: 0.55;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 1.5rem;
}

.quality-card-pinned-title {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
}

/* Checklist analytics: row-level histogram fill for option distributions */
.checklist-option-histogram {
  background: var(--histogram-base, var(--color-white));
  border-color: var(--histogram-border, var(--color-gray-200));
  overflow: hidden;
  position: relative;
}

.checklist-option-histogram::before {
  background: var(--histogram-fill, rgba(148, 163, 184, 0.22));
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: var(--histogram-width, 0%);
  z-index: 0;
}

.checklist-option-histogram > * {
  position: relative;
  z-index: 1;
}

.checklist-option-histogram:hover::before {
  filter: saturate(1.15);
}

.checklist-option-histogram--critical {
  --histogram-base: #fff1f2;
  --histogram-border: #fca5a5;
  --histogram-fill: rgba(248, 113, 113, 0.34);
}

.checklist-option-histogram--low {
  --histogram-base: #fffbeb;
  --histogram-border: #facc15;
  --histogram-fill: rgba(250, 204, 21, 0.34);
}

.checklist-option-histogram--medium {
  --histogram-base: #eff6ff;
  --histogram-border: #93c5fd;
  --histogram-fill: rgba(96, 165, 250, 0.34);
}

.checklist-option-histogram--excellent {
  --histogram-base: #ecfdf5;
  --histogram-border: #86efac;
  --histogram-fill: rgba(74, 222, 128, 0.34);
}

.checklist-option-histogram--neutral {
  --histogram-base: var(--color-white);
  --histogram-border: var(--color-gray-300);
  --histogram-fill: rgba(148, 163, 184, 0.26);
}

.checklist-option-histogram--unfilled {
  --histogram-base: var(--color-gray-100);
  --histogram-border: var(--color-gray-300);
  --histogram-fill: rgba(107, 114, 128, 0.22);
}

/* ===========================
   УТИЛИТЫ
   =========================== */

/* Убираем все премиальные классы */
.premium-card,
.premium-button,
.premium-badge,
.premium-animate-pulse,
.premium-animate-fade-in,
.premium-animate-bounce {
  /* Сбрасываем все премиальные стили */
  animation: none !important;
  background: var(--color-white) !important;
  border: 1px solid var(--color-gray-200) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Убираем все градиенты в основном приложении, КРОМЕ кнопок и маркетинговых страниц */
/* ВАЖНО: Маркетинговые страницы используют градиенты для hero секций */
.app-layout *[class*="gradient"]:not(button):not([role="button"]):not(.marketing-gradient),
.app-layout *[style*="gradient"]:not(button):not([role="button"]):not(.marketing-gradient) {
  background: var(--color-white) !important;
}

/* ===========================
   KNOWLEDGE BASE EDITOR
   =========================== */

.knowledge-editor-shell .toastui-editor-defaultUI {
  border: 0;
  border-radius: 0;
  font-family: inherit;
}

.knowledge-editor-shell .toastui-editor-toolbar {
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
}

.knowledge-editor-shell .toastui-editor-mode-switch {
  display: none;
}

.knowledge-editor-shell .toastui-editor-md-container,
.knowledge-editor-shell .toastui-editor-ww-container {
  background: var(--color-white);
}

.knowledge-editor-shell .toastui-editor-md-tab-container,
.knowledge-editor-shell .toastui-editor-tabs {
  background: var(--color-gray-50);
}

.knowledge-editor-shell .toastui-editor-contents {
  font-size: 0.95rem;
  color: var(--color-gray-800);
}

.knowledge-editor-shell .toastui-editor-contents h1,
.knowledge-editor-shell .toastui-editor-contents h2,
.knowledge-editor-shell .toastui-editor-contents h3 {
  color: var(--color-gray-900);
}

@media print {
  html,
  body.app-layout {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    background: white !important;
  }

  .checklist-criteria-scroll {
    overflow: visible !important;
  }

  .checklist-criteria-table {
    table-layout: auto !important;
  }

  .checklist-criteria-col-name {
    width: 28% !important;
  }

  .checklist-criteria-col-distribution {
    width: 48% !important;
  }

  .checklist-criteria-name {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    word-break: break-word;
  }

  .checklist-criteria-block,
  .daily-chart-surface canvas {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .criteria-distribution-print,
  .print-only a {
    text-decoration: none !important;
    color: inherit !important;
  }

  .daily-heatmap-screen .hover\:scale-105:hover,
  .daily-heatmap-screen .hover\:shadow-lg:hover {
    transform: none !important;
    box-shadow: inherit !important;
  }

  .daily-heatmap-screen .transition-all,
  .daily-chart-surface,
  .manager-ranking,
  .top-bottom-performers {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .daily-chart-surface {
    height: 250px !important;
  }

  .daily-chart-surface canvas {
    width: 100% !important;
    height: 250px !important;
  }
}

/* ===========================
   KNOWLEDGE BASE LAYOUT
   =========================== */

@media (min-width: 900px) {
  .kb-two-column-layout {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .kb-editor-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

/* Простые прогресс-бары */
.progress-bar {
  background: var(--color-gray-200);
  border-radius: var(--radius);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius);
  transition: width 0.3s ease-in-out;
}

.progress-fill.blue { background: var(--color-blue-500); }
.progress-fill.green { background: var(--color-green-500); }
.progress-fill.yellow { background: var(--color-yellow-500); }
.progress-fill.purple { background: var(--color-purple-500); }

/* Индикатор выполнения на кнопках (индетерминированный прогресс) */
.btn-progress-indeterminate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.btn-progress-indeterminate::before {
  content: "";
  position: absolute;
  left: -40%;
  width: 40%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  animation: btn-progress-indeterminate 1.1s ease-in-out infinite;
}

@keyframes btn-progress-indeterminate {
  0% { transform: translateX(0); }
  100% { transform: translateX(350%); }
}

/* ===========================
   АДАПТИВНОСТЬ
   =========================== */

/* До 1200px полная навигация оставляет аналитическим экранам слишком мало места.
   До подключения Stimulus показываем безопасное компактное состояние без скачка layout. */
@media (max-width: 1199px) {
  .app-shell {
    min-width: 0;
  }

  .app-shell .app-chrome:not([data-sidebar-ready]) {
    width: 4rem !important;
    flex: 0 0 4rem;
  }

  .app-content {
    min-width: 0;
  }

  .app-chrome:not([data-sidebar-ready]) [data-sidebar-target="content"] {
    padding: 1rem 0.5rem !important;
  }

  .app-chrome:not([data-sidebar-ready]) [data-sidebar-target="subtitle"],
  .app-chrome:not([data-sidebar-ready]) [data-sidebar-target="label"],
  .app-chrome:not([data-sidebar-ready]) [data-sidebar-target="badge"] {
    display: none !important;
  }

  .app-chrome:not([data-sidebar-ready]) nav a,
  .app-chrome:not([data-sidebar-ready]) [data-turbo-method="delete"] {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 768px) {
  .timeline-event {
    margin-bottom: 1rem;
  }

  .timeline-indicator {
    width: 2rem;
    height: 2rem;
  }
}

.manual-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===========================
   СБРОС АНИМАЦИЙ
   =========================== */

/* Убираем все сложные анимации */
@keyframes none {
  0%, 100% { transform: none; opacity: 1; }
}

/* Отключаем анимации КРОМЕ спиннера (для производительности) */
*[class*="animate"]:not(.animate-spin),
*[class*="pulse"],
*[class*="bounce"] {
  animation: none !important;
}

/* Простой hover для интерактивных элементов */
button:hover,
a:hover,
[role="button"]:hover {
  transform: none;
  transition: var(--transition);
}

/* ===========================
   GRID RESPONSIVE UTILITIES (FIX для TailwindCSS v4)
   =========================== */

/* Базовые grid классы уже есть в Tailwind, добавляем responsive variants */
@media (min-width: 768px) {
  .md\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .md\:grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .md\:grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:col-span-6 {
    grid-column: span 6 / span 6;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lg\:col-span-2 {
    grid-column: span 2 / span 2;
  }
  .lg\:col-span-5 {
    grid-column: span 5 / span 5;
  }
  .lg\:col-span-7 {
    grid-column: span 7 / span 7;
  }
}

@media (min-width: 1280px) {
  .xl\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* TailwindCSS v4 иногда не генерирует цвет для divide-slate-* из ERB. */
.divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--color-slate-100);
}

.divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: var(--color-slate-200);
}

/* ===========================
   REPORTS: Stable filters layout
   Документация: /docs/ui/11-analytics-charts.md
   =========================== */
.sales-report-kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sales-report-kpi-grid.sales-report-kpi-grid--preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ===========================
   MARKETING LANDING
   Документация: /docs/features/marketing-pages.md
   =========================== */
.landing-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgb(203 213 225 / 0.8);
  background:
    radial-gradient(circle at 86% 18%, rgb(37 99 235 / 0.18), transparent 30rem),
    radial-gradient(circle at 8% 92%, rgb(14 165 233 / 0.1), transparent 26rem),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 52%, #eff6ff 100%);
}

.landing-hero::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.36;
  background-image:
    linear-gradient(rgb(148 163 184 / 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgb(148 163 184 / 0.14) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to right, transparent, black 55%, black);
}

.landing-hero__layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3rem;
  align-items: center;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

.landing-hero__eyebrow,
.landing-section-kicker {
  color: rgb(29 78 216);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1rem;
  text-transform: uppercase;
}

.landing-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid rgb(191 219 254);
  border-radius: 9999px;
  background: rgb(239 246 255 / 0.94);
  padding: 0.5rem 0.875rem;
}

.landing-hero__eyebrow-mark {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgb(37 99 235);
  box-shadow: 0 0 0 5px rgb(37 99 235 / 0.12);
}

.landing-hero__title {
  max-width: 44rem;
  margin-top: 1.25rem;
  color: rgb(15 23 42);
  font-size: clamp(2.65rem, 4.5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.landing-hero__title-accent {
  position: relative;
  display: inline-block;
  color: rgb(37 99 235);
  isolation: isolate;
}

.landing-hero__title-accent::after {
  position: absolute;
  z-index: -1;
  right: -0.08em;
  bottom: 0.06em;
  left: -0.04em;
  height: 0.18em;
  border-radius: 9999px;
  background: rgb(147 197 253 / 0.72);
  content: "";
  transform: rotate(-1deg);
}

.landing-hero__lead {
  max-width: 42rem;
  margin-top: 1.75rem;
  color: rgb(51 65 85);
  font-size: 1.125rem;
  line-height: 1.75;
}

.landing-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.landing-hero__primary-cta,
.landing-hero__secondary-cta {
  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  border-radius: 0.875rem;
  padding: 0.875rem 1.25rem;
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition);
}

.landing-hero__primary-cta {
  background: rgb(37 99 235);
  color: white;
  box-shadow: 0 14px 30px rgb(37 99 235 / 0.28);
}

.landing-hero__primary-cta:hover {
  background: rgb(29 78 216);
  transform: translateY(-1px);
}

.landing-hero__secondary-cta {
  border: 1px solid rgb(203 213 225);
  background: rgb(255 255 255 / 0.8);
  color: rgb(30 41 59);
}

.landing-hero__secondary-cta:hover {
  border-color: rgb(147 197 253);
  background: white;
  color: rgb(29 78 216);
}

.landing-hero__primary-cta:focus,
.landing-hero__secondary-cta:focus {
  outline: 3px solid rgb(147 197 253 / 0.72);
  outline-offset: 3px;
}

.landing-hero__demo-note {
  max-width: 38rem;
  margin-top: 0.875rem;
  color: rgb(71 85 105);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
}

.landing-hero__facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 1.5rem;
  color: rgb(51 65 85);
  font-size: 0.8125rem;
  font-weight: 600;
}

.landing-hero__facts li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.landing-hero__facts li > span {
  display: inline-flex;
  color: rgb(22 163 74);
}


@media (min-width: 640px) {
  .landing-hero__actions {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .landing-hero__layout {
    grid-template-columns: minmax(0, 0.92fr) minmax(31rem, 1.08fr);
    gap: 4rem;
    min-height: 43rem;
    padding-top: 5.25rem;
    padding-bottom: 5.25rem;
  }

  .landing-hero__lead {
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-hero__primary-cta,
  .landing-hero__secondary-cta {
    transition: none;
  }

  .landing-hero__primary-cta:hover {
    transform: none;
  }
}

/* ===========================
   MARKETING LANDING PRODUCT STORY
   Документация: /docs/features/marketing-pages.md
   =========================== */

.landing-showcase-shell {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
}

.landing-showcase-kicker {
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.landing-showcase-heading {
  max-width: 52rem;
}

.landing-showcase-heading--center {
  margin-inline: auto;
  text-align: center;
}

.landing-showcase-heading h2,
.landing-integrations h2,
.landing-checklist-section h2,
.landing-scheduled-section h2 {
  margin-top: 0.65rem;
  color: #0f172a;
  font-size: clamp(2.1rem, 4.5vw, 3.75rem);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 1;
}

.landing-showcase-heading > p:last-child {
  max-width: 43rem;
  margin-top: 1rem;
  color: #475569;
  font-size: 1.05rem;
  line-height: 1.7;
}

.landing-showcase-heading--center > p:last-child {
  margin-inline: auto;
}

.landing-showcase-heading--light h2 {
  color: white;
}

.landing-showcase-heading--light .landing-showcase-kicker {
  color: #93c5fd;
}

.landing-showcase-heading--light > p:last-child {
  color: #cbd5e1;
}

.landing-live-shot {
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 1.4rem;
  background: white;
  box-shadow: 0 24px 65px rgb(15 23 42 / 0.16);
}

.landing-live-shot__bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.15rem 0.75rem;
  align-items: center;
  min-height: 3.25rem;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  color: #64748b;
}

.landing-live-shot__bar > span {
  display: flex;
  grid-row: 1 / span 2;
  gap: 0.3rem;
}

.landing-live-shot__bar > span i {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #34d399;
}

.landing-live-shot__bar > span i:first-child {
  background: #f87171;
}

.landing-live-shot__bar > span i:nth-child(2) {
  background: #fbbf24;
}

.landing-live-shot__bar strong {
  min-width: 0;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landing-live-shot__bar small {
  grid-column: 2;
  font-size: 0.65rem;
}

.landing-live-shot > img {
  display: block;
  width: 100%;
  height: auto;
  background: #f1f5f9;
}

.landing-live-shot figcaption {
  display: grid;
  gap: 0.45rem;
  border-top: 1px solid #e2e8f0;
  padding: 0.75rem 0.9rem;
  background: white;
}

.landing-live-shot figcaption span,
.landing-live-shot figcaption small,
.landing-live-shot figcaption a {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.7rem;
  line-height: 1.4;
}

.landing-live-shot figcaption span {
  color: #334155;
  font-weight: 750;
}

.landing-live-shot figcaption small {
  color: #15803d;
  font-weight: 800;
}

.landing-live-shot figcaption a {
  min-height: 2.75rem;
  width: fit-content;
  border-radius: 0.65rem;
  padding-inline: 0.65rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 850;
}

.landing-live-shot figcaption a:hover {
  background: #dbeafe;
}

.landing-live-shot figcaption a:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 2px;
}

.landing-live-shot figcaption svg {
  flex: none;
}

.landing-live-shot--hero {
  align-self: center;
  border-color: rgb(147 197 253 / 0.6);
  transform: rotate(0.7deg);
  box-shadow: 0 30px 70px rgb(15 23 42 / 0.24);
}

.landing-live-shot--hero .landing-live-shot__bar {
  border-bottom-color: rgb(255 255 255 / 0.12);
  background: #0f1f3d;
}

.landing-live-shot--hero .landing-live-shot__bar strong {
  color: white;
}

.landing-live-shot--hero .landing-live-shot__bar small {
  color: #93c5fd;
}

.landing-live-shot--checklist {
  border-color: #bfdbfe;
  transform: rotate(0.35deg);
}

.landing-live-shot--analytics {
  margin-top: 1.5rem;
  border-color: rgb(148 163 184 / 0.5);
}

.landing-live-shot--call-report {
  margin-top: 1.4rem;
  border-color: #93c5fd;
  box-shadow: 0 28px 75px rgb(30 64 175 / 0.16);
}

.landing-live-shot--deal-assistant {
  margin-top: 1.4rem;
  border-color: #bfdbfe;
  box-shadow: 0 24px 60px rgb(30 64 175 / 0.14);
}


.landing-integrations {
  border-block: 1px solid #e2e8f0;
  padding-block: 4.5rem;
  background: white;
}

.landing-integrations__intro {
  display: grid;
  gap: 1.25rem;
  align-items: end;
}

.landing-integrations__intro h2 {
  max-width: 48rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.landing-integrations__intro > p {
  max-width: 32rem;
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
}

.landing-crm-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 2.3rem;
}

.landing-crm-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem 1rem;
  align-items: center;
  border: 1px solid #dbe3ef;
  border-radius: 1.1rem;
  padding: 1rem;
  background: #f8fafc;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.05);
}

.landing-crm-mark {
  display: inline-flex;
  width: 3.3rem;
  height: 3.3rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  color: white;
  font-size: 0.9rem;
  font-weight: 950;
  letter-spacing: -0.03em;
}

.landing-crm-mark--amo {
  background: linear-gradient(135deg, #111827, #334155);
}

.landing-crm-mark--bitrix {
  background: linear-gradient(135deg, #0284c7, #2563eb);
}

.landing-crm-grid h3 {
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 900;
}

.landing-crm-grid p {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.83rem;
  line-height: 1.45;
}

.landing-crm-status {
  display: inline-flex;
  grid-column: 1 / -1;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 9999px;
  background: #dcfce7;
  padding-inline: 0.75rem;
  color: #166534;
  font-size: 0.7rem;
  font-weight: 800;
}

.landing-integrations__note {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 1rem;
  border-left: 4px solid #2563eb;
  padding: 0.8rem 1rem;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.86rem;
  line-height: 1.55;
}

.landing-integrations__note svg {
  flex: none;
}

.landing-call-flow-section {
  padding-block: 5rem;
  background:
    radial-gradient(circle at 10% 5%, rgb(37 99 235 / 0.11), transparent 22rem),
    #f8fafc;
}

.landing-call-flow {
  display: grid;
  gap: 0.85rem;
  margin-top: 2.7rem;
}

.landing-call-flow > article {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 1.25rem;
  padding: 1.25rem;
  background: white;
  box-shadow: 0 14px 35px rgb(15 23 42 / 0.06);
}

.landing-call-flow > article::before {
  position: absolute;
  inset: 0 0 auto;
  height: 0.28rem;
  background: #2563eb;
  content: "";
}

.landing-call-flow > article[data-call-flow="analysis"]::before {
  background: #f59e0b;
}

.landing-call-flow > article[data-call-flow="result"]::before {
  background: #10b981;
}

.landing-call-flow__icon {
  display: inline-flex;
  width: 3.2rem;
  height: 3.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
}

.landing-call-flow__icon--call {
  background: #dbeafe;
  color: #1d4ed8;
}

.landing-call-flow__icon--analysis {
  background: #fef3c7;
  color: #b45309;
}

.landing-call-flow__icon--result {
  background: #d1fae5;
  color: #047857;
}

.landing-call-flow__step {
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.landing-call-flow h3 {
  margin-top: 0.45rem;
  color: #0f172a;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.landing-call-flow article > h3 + p {
  min-height: 3.9rem;
  margin-top: 0.6rem;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.55;
}

.landing-call-flow__arrow {
  display: flex;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  justify-self: center;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  background: white;
  color: #2563eb;
  transform: rotate(90deg);
}

.landing-call-flow__mini {
  min-height: 6.2rem;
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 0.8rem;
  background: #f8fafc;
}

.landing-call-flow__mini--call {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding-top: 1.9rem;
}

.landing-call-flow__mini--call span {
  position: absolute;
  top: 0.65rem;
  left: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 800;
}

.landing-call-flow__mini--call > i {
  width: 0.28rem;
  border-radius: 9999px;
  background: #60a5fa;
}

.landing-call-flow__mini--call > i:nth-of-type(1),
.landing-call-flow__mini--call > i:nth-of-type(7) {
  height: 1rem;
}

.landing-call-flow__mini--call > i:nth-of-type(2),
.landing-call-flow__mini--call > i:nth-of-type(6) {
  height: 2rem;
}

.landing-call-flow__mini--call > i:nth-of-type(3),
.landing-call-flow__mini--call > i:nth-of-type(5) {
  height: 3rem;
}

.landing-call-flow__mini--call > i:nth-of-type(4) {
  height: 4rem;
  background: #2563eb;
}

.landing-call-flow__mini--checks,
.landing-call-flow__mini--result {
  display: grid;
  gap: 0.42rem;
}

.landing-call-flow__mini--checks span,
.landing-call-flow__mini--result span {
  display: flex;
  min-height: 1.35rem;
  align-items: center;
  gap: 0.4rem;
  color: #475569;
  font-size: 0.69rem;
  font-weight: 700;
}

.landing-call-flow__mini--checks span > i {
  width: 1.3rem;
  height: 0.3rem;
  border-radius: 9999px;
  background: #cbd5e1;
}

.landing-call-flow__mini--checks b {
  display: inline-flex;
  width: 1.35rem;
  height: 1.35rem;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  border-radius: 9999px;
  background: #dcfce7;
  color: #15803d;
}

.landing-call-flow__mini--checks b.is-attention {
  background: #fef3c7;
  color: #b45309;
}

.landing-call-flow__mini--result span > i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 9999px;
}

.landing-call-flow__mini--result i.is-success {
  background: #10b981;
}

.landing-call-flow__mini--result i.is-attention {
  background: #f59e0b;
}

.landing-call-flow__mini--result i.is-system {
  background: #2563eb;
}

.landing-call-flow__drilldown {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 1rem auto 0;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.87rem;
  line-height: 1.55;
}

.landing-call-flow__drilldown svg {
  flex: none;
}

.landing-call-report-section {
  border-block: 1px solid #dbeafe;
  padding-block: 5rem;
  background:
    radial-gradient(circle at 50% 0%, rgb(59 130 246 / 0.11), transparent 28rem),
    white;
}

.landing-call-report-points {
  display: grid;
  gap: 0.75rem;
  margin-top: 2rem;
}

.landing-call-report-points article {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  border: 1px solid #dbe3ef;
  border-radius: 1rem;
  padding: 1rem;
  background: #f8fafc;
}

.landing-call-report-points article > span {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: #dbeafe;
  color: #1d4ed8;
}

.landing-call-report-points article:nth-child(2) > span {
  background: #dcfce7;
  color: #15803d;
}

.landing-call-report-points article:nth-child(3) > span {
  background: #fef3c7;
  color: #b45309;
}

.landing-call-report-points h3 {
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 850;
  line-height: 1.35;
}

.landing-call-report-points p {
  margin-top: 0.25rem;
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.5;
}

.landing-checklist-section {
  border-block: 1px solid #dbeafe;
  padding-block: 5rem;
  background:
    radial-gradient(circle at 85% 15%, rgb(96 165 250 / 0.22), transparent 24rem),
    #eff6ff;
}

.landing-checklist-layout {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.landing-checklist-copy > p:nth-of-type(2) {
  max-width: 36rem;
  margin-top: 1rem;
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
}

.landing-checklist-copy ul {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.landing-checklist-examples {
  margin-top: 1.5rem;
  border: 1px solid #bfdbfe;
  border-radius: 1rem;
  padding: 0.9rem;
  background: rgb(255 255 255 / 0.72);
}

.landing-checklist-examples > p {
  color: #1e3a8a;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.landing-checklist-examples ul {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.landing-checklist-examples li {
  display: flex;
  min-height: 2.35rem;
  align-items: center;
  gap: 0.45rem;
  border-radius: 0.65rem;
  padding: 0.45rem 0.6rem;
  background: white;
  color: #334155;
  font-size: 0.72rem;
  font-weight: 750;
}

.landing-checklist-examples li svg {
  flex: none;
  color: #16a34a;
}

.landing-checklist-copy__result {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  background: #1d4ed8;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
}

.landing-checklist-copy__result svg {
  flex: none;
}

.landing-checklist-copy li {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.55;
}

.landing-checklist-copy li svg {
  flex: none;
  margin-top: 0.1rem;
  color: #16a34a;
}

.landing-analytics-section {
  position: relative;
  overflow: hidden;
  padding-block: 5.5rem;
  background:
    radial-gradient(circle at 86% 8%, rgb(37 99 235 / 0.3), transparent 28rem),
    #0f1f3d;
}

.landing-analytics-section::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(148 163 184 / 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgb(148 163 184 / 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  pointer-events: none;
}

.landing-analytics-section > .landing-showcase-shell {
  position: relative;
}

.landing-report-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.landing-report-heading {
  margin-top: 3rem;
  color: white;
}

.landing-report-heading h3 {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.25;
}

.landing-report-heading p {
  max-width: 52rem;
  margin-top: 0.75rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.landing-report-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  border: 1px solid #dbe3ef;
  border-radius: 0.85rem;
  padding: 1rem;
  background: white;
  box-shadow: 0 6px 18px rgb(15 23 42 / 0.04);
}

.landing-report-grid article > span {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: #dbeafe;
  color: #1d4ed8;
}

.landing-report-grid article:nth-child(3) > span {
  background: #fef3c7;
  color: #b45309;
}

.landing-report-grid article:nth-child(4) > span,
.landing-report-grid article:nth-child(5) > span {
  background: #dcfce7;
  color: #15803d;
}

.landing-report-grid h3 {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.3;
}

.landing-report-grid p {
  margin-top: 0.4rem;
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.5;
}

.landing-report-grid article > small {
  grid-column: 1 / -1;
  border-radius: 0.45rem;
  padding: 0.3rem 0.45rem;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.62rem;
  font-weight: 750;
}

.landing-analytics-features {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.2rem;
}

.landing-analytics-features article {
  position: relative;
  overflow: hidden;
  border: 1px solid rgb(148 163 184 / 0.35);
  border-radius: 1.15rem;
  padding: 1.25rem;
  background: rgb(255 255 255 / 0.07);
  color: white;
}

.landing-analytics-features__icon {
  display: inline-flex;
  width: 2.8rem;
  height: 2.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: rgb(59 130 246 / 0.22);
  color: #93c5fd;
}

.landing-analytics-features h3 {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.landing-analytics-features p {
  margin-top: 0.75rem;
  color: #cbd5e1;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.landing-analytics-drilldown {
  display: grid;
  gap: 0.8rem;
  align-items: center;
  margin-top: 1.2rem;
  border: 1px solid rgb(147 197 253 / 0.42);
  border-radius: 1.15rem;
  padding: 1rem;
  background: rgb(37 99 235 / 0.16);
  color: white;
}

.landing-analytics-drilldown > div {
  display: inline-flex;
  width: 2.8rem;
  height: 2.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: #2563eb;
}

.landing-analytics-drilldown p {
  color: #dbeafe;
  font-size: 0.82rem;
  line-height: 1.55;
}

.landing-analytics-drilldown p strong {
  display: block;
  color: white;
}

.landing-analytics-drilldown a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 0.75rem;
  background: white;
  padding: 0.65rem 0.85rem;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 850;
}

.landing-scheduled-section {
  padding-block: 5rem;
  background: #f8fafc;
}

.landing-scheduled-layout {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.landing-scheduled-copy > p:nth-of-type(2) {
  max-width: 35rem;
  margin-top: 1rem;
  color: #475569;
  font-size: 1rem;
  line-height: 1.65;
}

.landing-scheduled-examples {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.landing-scheduled-examples p {
  border-left: 3px solid #2563eb;
  border-radius: 0 0.7rem 0.7rem 0;
  padding: 0.75rem 0.8rem;
  background: white;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 8px 20px rgb(15 23 42 / 0.04);
}

.landing-scheduled-examples span {
  display: block;
  margin-bottom: 0.2rem;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing-scheduled-preview {
  display: grid;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 1.35rem;
  padding: 1rem;
  background: white;
  box-shadow: 0 22px 55px rgb(15 23 42 / 0.09);
}

.landing-scheduled-preview__schedule,
.landing-scheduled-preview__delivery {
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  padding: 0.9rem;
  background: #f8fafc;
}

.landing-scheduled-preview__heading {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.landing-scheduled-preview__heading > span {
  display: inline-flex;
  width: 2.2rem;
  height: 2.2rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: #dbeafe;
  color: #1d4ed8;
}

.landing-scheduled-preview__delivery .landing-scheduled-preview__heading > span {
  background: #dcfce7;
  color: #15803d;
}

.landing-scheduled-preview__heading strong,
.landing-scheduled-preview__heading small {
  display: block;
}

.landing-scheduled-preview__heading strong {
  color: #0f172a;
  font-size: 0.78rem;
  font-weight: 850;
}

.landing-scheduled-preview__heading small {
  margin-top: 0.1rem;
  color: #64748b;
  font-size: 0.64rem;
}

.landing-schedule-options,
.landing-delivery-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.landing-schedule-options span,
.landing-delivery-channels span {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid #dbe3ef;
  border-radius: 9999px;
  padding-inline: 0.65rem;
  background: white;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 750;
}

.landing-schedule-options span.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.landing-delivery-channels span {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.landing-scheduled-preview__arrow {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  justify-self: center;
  border-radius: 9999px;
  background: #dbeafe;
  color: #2563eb;
  transform: rotate(90deg);
}

.landing-assistant-section {
  border-block: 1px solid #dbeafe;
  padding-block: 5rem;
  background:
    radial-gradient(circle at 50% 0%, rgb(96 165 250 / 0.18), transparent 30rem),
    white;
}

.landing-assistant-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 2.5rem;
}

.landing-assistant-grid article {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 1.2rem;
  padding: 1.15rem;
  background: #f8fafc;
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.055);
}

.landing-assistant-grid article:nth-child(2) {
  background: #eff6ff;
}

.landing-assistant-grid article:nth-child(3) {
  background: #f0fdf4;
}

.landing-assistant-card__number {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.landing-assistant-card__icon {
  display: inline-flex;
  width: 2.9rem;
  height: 2.9rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: #dbeafe;
  color: #1d4ed8;
}

.landing-assistant-grid article:nth-child(3) .landing-assistant-card__icon {
  background: #dcfce7;
  color: #15803d;
}

.landing-assistant-grid h3 {
  margin-top: 1rem;
  color: #0f172a;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.landing-assistant-question {
  margin-top: 0.9rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.85rem 0.85rem 0.2rem 0.85rem;
  padding: 0.75rem;
  background: white;
  color: #1e3a8a;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.45;
}

.landing-assistant-grid article > p {
  margin-top: 0.85rem;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.55;
}

.landing-assistant-sources,
.landing-assistant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.9rem;
}

.landing-assistant-sources span,
.landing-assistant-actions span {
  border-radius: 9999px;
  padding: 0.35rem 0.55rem;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.62rem;
  font-weight: 750;
}

.landing-assistant-actions span {
  background: white;
  color: #166534;
}

.landing-assistant-result {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin-top: 0.9rem;
  border-radius: 0.7rem;
  padding: 0.65rem;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.67rem;
  font-weight: 750;
}

.landing-assistant-proof {
  margin-top: 2rem;
  border: 1px solid #bfdbfe;
  border-radius: 1.5rem;
  padding: clamp(1rem, 2.5vw, 1.8rem);
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 38%, white 100%);
  box-shadow: 0 20px 55px rgb(30 64 175 / 0.09);
}

.landing-assistant-proof__heading {
  max-width: 48rem;
  margin-inline: auto;
  text-align: center;
}

.landing-assistant-proof__heading h3 {
  margin-top: 0.55rem;
  color: #0f172a;
  font-size: clamp(1.65rem, 3.4vw, 2.65rem);
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.landing-assistant-proof__heading > p:last-child {
  margin-top: 0.8rem;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.65;
}

.landing-assistant-proof__steps {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.4rem;
}

.landing-assistant-proof__steps article {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  border: 1px solid #dbe3ef;
  border-radius: 0.9rem;
  padding: 0.85rem;
  background: rgb(255 255 255 / 0.9);
}

.landing-assistant-proof__steps article > span {
  display: inline-flex;
  width: 1.8rem;
  height: 1.8rem;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #2563eb;
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
}

.landing-assistant-proof__steps strong,
.landing-assistant-proof__steps small {
  display: block;
}

.landing-assistant-proof__steps strong {
  color: #0f172a;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.4;
}

.landing-assistant-proof__steps small {
  margin-top: 0.18rem;
  color: #64748b;
  font-size: 0.67rem;
  line-height: 1.45;
}

.landing-assistant-guard {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  margin: 1rem auto 0;
  border: 1px solid #bbf7d0;
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}

.landing-assistant-guard svg {
  flex: none;
}

.landing-team-section {
  position: relative;
  overflow: hidden;
  padding-block: 5rem;
  background:
    radial-gradient(circle at 50% 0%, rgb(37 99 235 / 0.3), transparent 28rem),
    #0f1f3d;
}

.landing-team-grid {
  display: grid;
  gap: 0.8rem;
  margin-top: 2.5rem;
}

.landing-team-grid article {
  border: 1px solid rgb(148 163 184 / 0.3);
  border-radius: 1.1rem;
  padding: 1.15rem;
  background: rgb(255 255 255 / 0.065);
  color: white;
}

.landing-team-grid article > span {
  display: inline-flex;
  width: 2.8rem;
  height: 2.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.8rem;
  background: rgb(59 130 246 / 0.22);
  color: #93c5fd;
}

.landing-team-grid h3 {
  margin-top: 0.9rem;
  font-size: 1.15rem;
  font-weight: 900;
}

.landing-team-grid p {
  margin-top: 0.55rem;
  color: #cbd5e1;
  font-size: 0.8rem;
  line-height: 1.55;
}

.landing-team-cta {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: fit-content;
  margin: 1.5rem auto 0;
  border-radius: 0.85rem;
  background: white;
  padding: 0.75rem 1rem;
  color: #1d4ed8;
  font-size: 0.82rem;
  font-weight: 850;
  box-shadow: 0 12px 28px rgb(0 0 0 / 0.12);
}

.landing-team-cta:hover,
.landing-analytics-drilldown a:hover {
  background: #eff6ff;
}

.landing-team-cta:focus-visible,
.landing-analytics-drilldown a:focus-visible {
  outline: 3px solid #93c5fd;
  outline-offset: 3px;
}

@media (min-width: 640px) {
  .landing-crm-grid,
  .landing-report-grid,
  .landing-analytics-features,
  .landing-team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-report-grid article:last-child {
    grid-column: 1 / -1;
  }

  .landing-analytics-drilldown {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .landing-live-shot__bar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .landing-live-shot__bar small {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .landing-live-shot figcaption {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }
}

@media (min-width: 1100px) {
  .landing-analytics-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 800px) {
  .landing-integrations__intro {
    grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
  }

  .landing-crm-grid article {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .landing-crm-status {
    grid-column: auto;
  }

  .landing-call-flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: stretch;
  }

  .landing-call-flow__arrow {
    align-self: center;
    transform: none;
  }

  .landing-call-flow__drilldown {
    width: fit-content;
  }

  .landing-call-report-points,
  .landing-assistant-proof__steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .landing-report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-report-grid article:last-child {
    grid-column: 1 / -1;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .landing-report-grid article > small {
    grid-column: auto;
  }

  .landing-scheduled-preview {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .landing-scheduled-preview__arrow {
    transform: none;
  }

  .landing-assistant-grid,
  .landing-team-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .landing-checklist-layout,
  .landing-scheduled-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(28rem, 1.1fr);
  }
}

@media (min-width: 1024px) {
  .landing-integrations,
  .landing-call-flow-section,
  .landing-call-report-section,
  .landing-checklist-section,
  .landing-analytics-section,
  .landing-scheduled-section,
  .landing-assistant-section,
  .landing-team-section {
    padding-block: 6.5rem;
  }

  .landing-crm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-call-flow > article {
    padding: 1.5rem;
  }
}

@media (max-width: 540px) {
  .landing-showcase-shell {
    width: min(100% - 1.5rem, 76rem);
  }

  .landing-showcase-heading h2,
  .landing-integrations h2,
  .landing-checklist-section h2,
  .landing-scheduled-section h2 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .landing-crm-grid article {
    align-items: start;
  }

  .landing-live-shot--hero,
  .landing-live-shot--checklist {
    transform: none;
  }

  .landing-analytics-drilldown a,
  .landing-team-cta {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-live-shot--hero,
  .landing-live-shot--checklist {
    transform: none;
  }
}

.checklist-correlation-kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sales-report-filters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.sales-report-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.sales-report-filter-wide {
  grid-column: span 1 / span 1;
}

.sales-report-control {
  width: 100%;
  min-width: 0;
  height: 2.25rem;
  border: 1px solid var(--color-gray-300);
  border-radius: var(--radius);
  background: var(--color-white);
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--color-gray-900);
}

.sales-report-control:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--color-blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.funnel-pulse-column {
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.funnel-pulse-column-active {
  border-color: var(--color-blue-500) !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.checklist-correlation-tree {
  width: 100%;
  min-width: 1080px;
}

.checklist-correlation-tree-grid {
  display: grid;
  grid-template-columns:
    minmax(16rem, 1fr)
    minmax(5.25rem, 5.75rem)
    minmax(5.25rem, 5.75rem)
    minmax(5.75rem, 6.25rem)
    minmax(5.75rem, 6.25rem)
    minmax(6rem, 6.5rem)
    minmax(8.25rem, 9rem)
    minmax(7.5rem, 8.25rem);
  align-items: stretch;
}

.checklist-correlation-tree-header-label {
  white-space: nowrap;
}

.checklist-correlation-tree-summary::-webkit-details-marker {
  display: none;
}

.checklist-correlation-tree-chevron {
  transition: transform 150ms ease;
}

.checklist-correlation-tree-details[open] > .checklist-correlation-tree-summary .checklist-correlation-tree-chevron {
  transform: rotate(90deg);
}

@media (min-width: 640px) {
  .sales-report-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-report-kpi-grid.sales-report-kpi-grid--preview {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .checklist-correlation-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .sales-report-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .checklist-correlation-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1600px) {
  .sales-report-kpi-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .checklist-correlation-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1279px) {
  .sales-report-filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sales-report-filter-wide {
    grid-column: span 3 / span 3;
  }
}

@media (max-width: 767px) {
  .sales-report-filters-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .sales-report-filter-wide {
    grid-column: 1 / -1;
  }

  .sales-report-filter-actions {
    justify-content: stretch;
  }

  .sales-report-filter-actions > * {
    flex: 1 1 0;
    justify-content: center;
  }
}

.lead-response-deals-table {
  min-width: 1000px;
}

.lead-response-manager-table {
  min-width: 1000px;
}

@media (min-width: 1600px) {
  .sales-report-kpi-grid.sales-report-kpi-grid--lead-response {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .sales-report-filters-grid.lead-response-filters-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 768px) and (max-width: 1279px) {
  .sales-report-filters-grid.lead-response-filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lead-response-filters-grid .sales-report-filter-wide {
    grid-column: span 2 / span 2;
  }
}

/* ===========================
   CALLS TABLE: Brief row on hover (TailwindCSS v4 не генерирует group-hover:table-row из ERB)
   =========================== */
tbody.group .brief-row {
  display: none;
}
tbody.group:hover .brief-row {
  display: table-row;
}

/* ===========================
   REPORTS: Help tooltip (TailwindCSS v4 не генерирует group-hover:block из ERB)
   =========================== */
.report-help {
  position: relative;
  display: inline-flex;
}

.report-help-tooltip {
  display: none;
  max-width: calc(100vw - 2rem);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-line;
}

.report-help:hover .report-help-tooltip,
.report-help:focus-within .report-help-tooltip {
  display: block;
}

@media (max-width: 800px) {
  .report-help-tooltip {
    max-width: 13rem;
  }
}

/* Keep modal actions inside compact Safari/iPad viewports. */
.viewport-modal-panel {
  max-height: calc(100vh - 2rem);
}

@supports (height: 100dvh) {
  .viewport-modal-panel {
    max-height: calc(100dvh - 2rem);
  }
}

/* ===========================
   DEALS/CALLS TABLE: Floating brief popover on hover (no layout shift)
   =========================== */
.brief-popover-wrap {
  position: relative;
}

.deal-brief-popover {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 4px;
  z-index: 40;
  width: calc((100vw - 16rem) * 0.7);
  max-width: 900px;
  pointer-events: none;
}


tr.group:hover .deal-brief-popover {
  display: block;
}

/* Для нижних строк — попап сверху */
.deal-brief-popover.popover-top {
  top: auto;
  bottom: 100%;
  margin-top: 0;
  margin-bottom: 4px;
}

/* ===========================
   ФИНАЛЬНЫЕ СБРОСЫ
   =========================== */

/* Убираем все backdrop-blur и сложные эффекты в основном приложении */
/* ВАЖНО: Маркетинговые страницы используют backdrop-blur для стеклянных эффектов */
.app-layout *[class*="backdrop"],
.app-layout *[class*="blur"] {
  backdrop-filter: none !important;
  filter: none !important;
}

/* Простые тени только где нужно */
.shadow-reset {
  box-shadow: var(--shadow-sm) !important;
}

/* Убираем все transform эффекты в основном приложении кроме простых hover и спиннеров */
/* ВАЖНО: Маркетинговые страницы могут использовать transform для декоративных элементов */
.app-layout *:not(:hover):not(.animate-spin):not([class*="translate"]):not([class*="scale"]):not([class*="rotate"]) {
  transform: none !important;
}

/* ===========================
   СТИЛИ ДЛЯ ТРАНСКРИПЦИЙ
   =========================== */

/* Контейнер с прокруткой для транскрипций */
.transcription-container {
  scrollbar-width: thin;
  scrollbar-color: var(--color-gray-300) var(--color-gray-50);
}

/* Стили скроллбара для Webkit браузеров */
.transcription-container::-webkit-scrollbar {
  width: 8px;
}

.transcription-container::-webkit-scrollbar-track {
  background: var(--color-gray-50);
  border-radius: var(--radius);
}

.transcription-container::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: var(--radius);
}

.transcription-container::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
}

/* Стили для предложений в транскрипции */
.sentence-block {
  line-height: 1.6;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.sentence-block:not(:last-child) {
  padding-bottom: 0.5rem;
}

/* Улучшаем читаемость длинных предложений */
.sentence-block:nth-child(even) {
  padding-left: 0.75rem;
  border-left: 2px solid var(--color-gray-200);
  background: var(--color-gray-50);
  border-radius: var(--radius);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Стили для preview предложений в краткой версии */
.sentence-preview {
  line-height: 1.5;
  margin-bottom: 0.5rem;
  padding: 0.25rem 0;
}

.sentence-preview:nth-child(odd) {
  padding-left: 0.5rem;
  border-left: 1px solid var(--color-gray-300);
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
  .transcription-container {
    max-height: 300px !important;
  }

  .sentence-block:nth-child(even) {
    padding-left: 0.5rem;
  }
}

/* ===========================
   LLM CHAT FULLSCREEN MODE
   =========================== */

/* Fullscreen режим для чата */
.fullscreen-chat {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: var(--chat-fullscreen-left, 0px) !important;
  bottom: 0 !important;
  transform: translateX(0) !important;
  z-index: 50 !important;
  width: auto !important;
  max-width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

/* Header на всю ширину */
.fullscreen-chat > div:first-child {
  width: 100% !important;
  max-width: none !important;
}

/* Messages container и Footer - центрируем с max-width для читаемости */
.fullscreen-chat > div:not(:first-child) {
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 56rem !important; /* max-w-4xl для читаемости */
  width: 100% !important;
}

/* Backdrop для fullscreen режима */
#chat-fullscreen-backdrop {
  transition: opacity 0.3s ease-in-out;
}

#chat-fullscreen-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ===========================
   FIX: mx-auto FALLBACK
   =========================== */

/* Явный fallback для horizontal margins (TailwindCSS v4 использует margin-inline) */
.mx-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ===========================
   FLASH NOTIFICATIONS ANIMATIONS
   =========================== */

/* Анимация появления уведомлений (плавное появление сверху) */
@keyframes slide-down {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slide-down 0.3s ease-out;
}

/* Выбор даты и времени. Канон: docs/ui/DATE_TIME_PICKERS.md */
.time-composite { position: relative; min-width: 0; width: 100%; }
.time-composite__control {
  display: flex; align-items: center; height: 38px; overflow: hidden;
  border: 1px solid #d1d5db; border-radius: 8px; background: #fff;
}
.time-composite__control:focus-within { border-color: #3b82f6; box-shadow: 0 0 0 2px #dbeafe; }
.time-composite__control:has([aria-invalid="true"]) { border-color: #dc2626; }
.time-composite__input {
  flex: 1; min-width: 0; width: 100%; border: 0; background: transparent;
  padding: 8px 12px; font-size: 14px; line-height: 20px; color: #111827; font-variant-numeric: tabular-nums;
}
.time-composite__input:focus { outline: none; box-shadow: none; }
.time-composite__toggle {
  display: grid; place-items: center; flex-shrink: 0; width: 38px; height: 36px;
  border: 0; background: transparent; color: #6b7280; cursor: pointer;
}
.time-composite__toggle:hover, .time-composite__toggle[aria-expanded="true"] { color: #2563eb; background: #eff6ff; }
.time-composite__panel {
  position: fixed; z-index: 100; display: grid;
  grid-template-columns: 112px minmax(0, 1fr); width: 370px; max-width: calc(100vw - 24px);
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  box-shadow: 0 12px 32px #1118271f, 0 2px 6px #1118270a;
  overflow: hidden; color: #374151;
}
.time-composite__panel[hidden], .time-composite__error[hidden] { display: none; }
.picker-presets { display: flex; flex-direction: column; gap: 2px; padding: 12px 8px; background: #f9fafb; border-right: 1px solid #e5e7eb; }
.picker-presets__heading { display: block; padding: 0 8px 8px; font-size: 10px; font-weight: 500; color: #6b7280; white-space: nowrap; }
.picker-presets__button {
  display: block; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px;
  text-align: left; background: transparent; color: #374151; font-size: 13px; line-height: 18px;
  cursor: pointer; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.picker-presets__button:hover { background: #e5e7eb; }
.picker-presets__button[aria-pressed="true"] { color: #1d4ed8; background: #dbeafe; font-weight: 600; }
.time-composite__editor { display: flex; flex-direction: column; gap: 14px; padding: 16px 20px; }
.time-composite__exact { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #6b7280; }
.time-composite__exact input {
  width: 100%; padding: 8px; border: 1px solid #d1d5db; border-radius: 8px;
  text-align: center; font-size: 32px; font-weight: 500; line-height: 38px;
  color: #111827; background: #fff; font-variant-numeric: tabular-nums;
}
.time-composite__exact input:focus { border-color: #3b82f6; outline: 2px solid #dbeafe; }
.time-composite__shifts { display: flex; gap: 8px; margin-top: -6px; }
.time-composite__shifts button {
  flex: 1; padding: 5px 0; border: 1px solid #e5e7eb; border-radius: 6px;
  font-size: 12px; color: #4b5563; background: #fff; cursor: pointer;
}
.time-composite__shifts button:hover { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.time-composite__slider { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.time-composite__slider > span { display: flex; justify-content: space-between; }
.time-composite__slider output { font-weight: 600; font-variant-numeric: tabular-nums; }
.time-composite__slider input {
  appearance: none; width: 100%; height: 24px; margin: 0; padding: 0; border: 0; cursor: pointer;
  background: transparent; accent-color: #2563eb;
}
.time-composite__slider input::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px;
  background: linear-gradient(to right, #3b82f6 var(--range-fill, 0%), #e5e7eb var(--range-fill, 0%));
}
.time-composite__slider input::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 2px solid #fff;
  border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 1px #2563eb;
}
.time-composite__slider input::-moz-range-track { height: 4px; border-radius: 4px; background: #e5e7eb; }
.time-composite__slider input::-moz-range-progress { height: 4px; background: #3b82f6; }
.time-composite__slider input::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.time-composite__scale { color: #9ca3af; font-size: 10px; font-variant-numeric: tabular-nums; }
.time-composite__done { align-self: flex-end; padding: 7px 18px; border-radius: 6px; border: 0; color: #fff; background: #2563eb; font-size: 12px; font-weight: 500; cursor: pointer; }
.time-composite__done:hover { background: #1d4ed8; }
.time-composite button:focus-visible, .picker-presets__button:focus-visible, .time-composite__slider input:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.time-composite__control:has(input:disabled) { background: #f9fafb; }
.time-composite input:disabled, .time-composite button:disabled { color: #9ca3af; cursor: not-allowed; }
.time-composite__error { margin: 4px 0 0; font-size: 12px; color: #b91c1c; }

/* Flatpickr продолжает владеть календарём и форматом даты. */
.flatpickr-calendar.single-date-panel { width: 436px; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 12px 32px #1118271f; padding: 0; overflow: hidden; }
.flatpickr-calendar.single-date-panel.open { display: grid; grid-template-columns: 128px 307px; }
.single-date-panel > .picker-presets { grid-column: 1; grid-row: 1 / span 2; }
.single-date-panel > .flatpickr-months, .single-date-panel > .flatpickr-innerContainer { grid-column: 2; }
.single-date-panel > .flatpickr-months { padding-top: 8px; position: relative; }
.single-date-panel .flatpickr-current-month { font-size: 14px; }
.single-date-panel .flatpickr-months .flatpickr-prev-month, .single-date-panel .flatpickr-months .flatpickr-next-month { top: 8px; }
.single-date-panel .flatpickr-innerContainer { padding-bottom: 8px; }
.single-date-panel .flatpickr-day.selected { background: #2563eb; border-color: #2563eb; }
.date-range-panel { width: 458px; max-width: calc(100vw - 24px); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 32px #1118271f; }
.date-range-panel__body { display: grid; grid-template-columns: 128px minmax(0, 1fr); }
.date-range-panel__calendar { min-width: 0; padding: 10px; }
.date-range-panel .flatpickr-calendar { box-shadow: none; }

@media (max-width: 480px) {
  .time-composite__panel { grid-template-columns: 100px minmax(0, 1fr); }
  .time-composite__editor { padding: 14px; }
  .time-composite__panel .picker-presets__heading { font-size: 9px; padding-inline: 3px; }
  .flatpickr-calendar.single-date-panel.open { width: 309px; max-width: calc(100vw - 24px); grid-template-columns: minmax(0, 1fr); }
  .single-date-panel > .picker-presets { grid-column: 1; grid-row: 1; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid #e5e7eb; padding: 8px; }
  .single-date-panel .picker-presets__heading { display: none; }
  .single-date-panel .picker-presets__button { width: auto; padding: 5px 7px; font-size: 12px; }
  .single-date-panel > .flatpickr-months, .single-date-panel > .flatpickr-innerContainer { grid-column: 1; }
  .date-range-panel { width: 329px; }
  .date-range-panel__body { grid-template-columns: minmax(0, 1fr); }
  .date-range-panel .picker-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid #e5e7eb; padding: 6px; }
  .date-range-panel .picker-presets__button { width: auto; padding: 5px 7px; font-size: 11px; }
}

.single-date-panel .flatpickr-rContainer, .date-range-panel .flatpickr-rContainer,
.single-date-panel .flatpickr-days, .date-range-panel .flatpickr-days,
.single-date-panel .dayContainer, .date-range-panel .dayContainer { width: 100%; min-width: 0; max-width: 100%; }

/* Каждое время отдельной строкой; место удаления не растягивает первое поле. */
.scheduled-times-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 28rem; }
.scheduled-times-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: start; gap: 8px; }
.scheduled-times-row > button { height: 38px; }
.scheduled-times-list > .scheduled-times-first { margin-top: 0; padding-right: 96px; }

/* ===========================
   PRODUCT APP THEME
   Документация: /docs/ui/ROPIKA_PRODUCT_UI_STANDARD.md

   Shared presentation primitives for all application surfaces. Layout geometry
   remains explicit: workspace, form, reading, public and standalone pages.
   =========================== */
.app-shell,
.ropika-theme {
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --workspace-width: 1680px;
  --form-width: 960px;
  --reading-width: 896px;
  --public-width: 1160px;
  --public-reading-width: 760px;
  --brand-navy: #0f2d5b;
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: #eff6ff;
  --color-sidebar: #102340;
  --color-page: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-muted: #f8fafc;
  --color-border: #e2e8f0;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-success: #059669;
  --color-warning: #b45309;
  --color-danger: #dc2626;
  --radius-card: 14px;
  --radius-control: 8px;
  --radius-badge: 6px;
  --sidebar-width: 240px;
  --page-padding: 32px;
  --shadow-card: 0 1px 3px rgb(15 23 42 / 4%);

}

.ropika-theme {
  font-family: var(--font-ui);
  color: var(--color-text);
}

.app-shell {
  background: var(--color-page);
}

.app-shell .app-content,
.app-shell .page-content {
  background: var(--color-page);
}

.app-shell .app-content {
  min-width: 0;
}

/* One workspace contract; form/reading content has an explicit narrower role. */
:is(.app-shell, .ropika-theme) .ui-page {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: var(--workspace-width);
  margin-inline: auto;
  padding: var(--page-padding);
  background: var(--color-page);
}

/* Sidebar presentation. Stimulus still owns collapsed/expanded state. */
.ropika-theme .ui-page-title {
  color: var(--color-text);
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
  letter-spacing: -0.02em;
}

.ropika-theme .ui-page--detail .ui-page-title {
  font-size: 28px;
  line-height: 36px;
}

.ropika-theme .ui-page-subtitle {
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 20px;
}

.ropika-theme .ui-page-header { margin-bottom: 24px; }
.ropika-theme .ui-section-title { font-size: 20px; line-height: 28px; font-weight: 600; color: var(--color-text); }
.ropika-theme .ui-settings-content { max-width: var(--form-width); }
.ropika-theme .ui-form-content { width: 100%; max-width: var(--form-width); margin-inline: auto; }
.ropika-theme .ui-reading-content { width: 100%; max-width: var(--reading-width); margin-inline: auto; }
.ropika-theme .ui-page--form > :not(.ui-page-header, .fixed, script, style) { max-width: var(--form-width); margin-inline: auto; }
.ropika-theme .ui-page--chat { min-height: 32rem; }
.ropika-theme .ui-page--chat .ui-page-title { font-size: 20px; line-height: 28px; }
.ropika-theme .ui-check { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--color-primary); }
.ropika-theme .ui-check:disabled { cursor: not-allowed; opacity: 0.55; }
.ropika-theme :is(.ui-control, .ui-btn, .ui-tab, .ui-check, .ui-icon-button):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.ropika-theme .ui-control[aria-invalid="true"] { border-color: var(--color-danger); }
.ropika-theme .ui-control[aria-invalid="true"]:focus-visible { outline-color: var(--color-danger); }
.ropika-theme .ui-btn--danger { background: var(--color-danger); color: #fff; }
.ropika-theme .ui-btn--danger:hover { background: #b91c1c; }
.ropika-theme :is(.ui-btn--large, .public-button) { min-height: 52px; padding: 12px 24px; font-size: 16px; }
.ropika-theme .ui-btn[aria-disabled="true"] { cursor: not-allowed; opacity: 0.55; }
.ropika-theme .ui-icon-button {
  display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center;
  border-radius: var(--radius-control); color: var(--color-text-secondary);
}
.ropika-theme .ui-icon-button:hover { background: var(--color-primary-soft); color: var(--color-primary); }
.ropika-theme .brand-wordmark { display: block; flex-shrink: 0; }

/* The auth pages use the approved mark and wordmark as one centered lockup. */
.auth-brand { margin-bottom: 28px; text-align: center; }
.auth-brand__lockup { display: flex; align-items: center; justify-content: center; gap: 14px; }
.auth-brand__slogan { margin: 10px 0 0; color: #eff6ff; font-size: 16px; font-weight: 500; line-height: 1.4; }
.auth-brand__subtitle { margin: 5px 0 0; color: #bfdbfe; font-size: 13px; line-height: 1.4; }

.app-shell .app-sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  background: var(--color-sidebar) !important;
  border-right: 1px solid rgb(255 255 255 / 8%);
}

.app-shell .app-sidebar.w-16 {
  width: 64px;
  flex-basis: 64px;
}

.app-shell .app-sidebar__content {
  overflow-x: hidden;
  padding: 16px !important;
}

.app-shell .app-sidebar__brand {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 24px;
}

.app-shell .app-sidebar__brand > [data-sidebar-target="subtitle"] {
  min-width: 0;
  flex: 1 1 auto;
}

.app-shell .app-sidebar__brand h1 {
  color: #f8fafc;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.app-shell .app-sidebar__brand p {
  overflow: visible;
  color: #a9b8d0;
  font-size: 12px;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.app-shell .app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-shell .app-sidebar__nav.space-y-2 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0;
}

.app-shell .app-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-shell .app-sidebar__nav.space-y-2 > :not([hidden]) ~ :not([hidden]) {
  margin-top: 0;
}

.app-shell .app-sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 16px;
  border-color: rgb(255 255 255 / 12%) !important;
}

.app-shell .app-sidebar .sidebar-nav-item {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.app-shell .app-sidebar .sidebar-nav-item svg {
  width: 20px;
  height: 20px;
  color: #aebdd4;
  stroke-width: 2.25;
}

.app-shell .app-sidebar .sidebar-nav-item--idle:hover,
.app-shell .app-sidebar .sidebar-nav-item--idle:focus-visible {
  background: rgb(255 255 255 / 8%);
  color: #ffffff;
}

.app-shell .app-sidebar .sidebar-nav-item--idle:hover svg,
.app-shell .app-sidebar .sidebar-nav-item--idle:focus-visible svg,
.app-shell .app-sidebar .sidebar-nav-item--current svg {
  color: currentColor;
}

.app-shell .app-sidebar .sidebar-nav-item--current {
  background: var(--color-primary) !important;
  color: #ffffff !important;
  box-shadow: 0 1px 2px rgb(15 23 42 / 16%);
}

.app-shell .app-sidebar .sidebar-nav-item--highlight {
  background: #b45309 !important;
  color: #ffffff !important;
}

.app-shell .app-sidebar__account {
  border-color: rgb(255 255 255 / 12%) !important;
  padding: 12px 16px;
}

.app-shell .app-sidebar__account > [data-sidebar-target="label"] {
  color: #a9b8d0;
}

.app-shell .app-sidebar__logout {
  min-height: 36px;
  border-radius: var(--radius-control);
  color: #cbd5e1;
}

.app-shell .app-sidebar__logout:hover,
.app-shell .app-sidebar__logout:focus-visible,
.app-shell .app-sidebar__toggle button:hover,
.app-shell .app-sidebar__toggle button:focus-visible {
  background: rgb(255 255 255 / 8%);
  color: #ffffff;
}

.app-shell .app-sidebar__toggle {
  border-color: rgb(255 255 255 / 12%) !important;
  padding: 8px;
}

.app-shell .app-sidebar.w-16 .app-sidebar__content {
  padding: 16px 8px !important;
}

.app-shell .app-sidebar.w-16 .app-sidebar__brand {
  justify-content: center;
}

/* Shared surfaces and controls. Pages add these classes to existing ERB
   structure; no data or interaction is owned by these presentation rules. */
:is(.app-shell, .ropika-theme) .ui-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

:is(.app-shell, .ropika-theme) .ui-surface-muted {
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

:is(.app-shell, .ropika-theme) .ui-control {
  min-height: 40px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

:is(.app-shell, .ropika-theme) .ui-control::placeholder {
  color: var(--color-text-muted);
}

:is(.app-shell, .ropika-theme) .ui-control:hover {
  border-color: #cbd5e1;
}

:is(.app-shell, .ropika-theme) .ui-control:focus,
:is(.app-shell, .ropika-theme) .ui-control:focus-visible {
  border-color: var(--color-primary);
  outline: 0;
  box-shadow: 0 0 0 3px rgb(37 99 235 / 16%);
}

:is(.app-shell, .ropika-theme) .ui-control:disabled {
  cursor: not-allowed;
  background: #f1f5f9;
  color: var(--color-text-muted);
}

.app-shell .ts-wrapper.disabled.locked .ts-control {
  cursor: not-allowed;
  border-color: var(--color-border);
  background: #f1f5f9;
  color: var(--color-text-muted);
}

:is(.app-shell, .ropika-theme) :is(.ui-btn, .public-button):not(.hidden):not([hidden]) {
  display: inline-flex;
}

:is(.app-shell, .ropika-theme) :is(.ui-btn, .public-button) {
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

:is(.app-shell, .ropika-theme) .ui-btn--compact {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

.ropika-theme .ui-pagination-number { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
.ropika-theme .ui-pagination-number--compact { min-width: 36px; min-height: 36px; }
.ropika-theme .ui-pagination-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ropika-theme .ui-pagination-controls { margin-left: auto; }
@media (max-width: 640px) {
  .ropika-theme .ui-pagination-controls .ui-pagination-number--outer { display: none !important; }
}
@media (max-width: 340px) {
  .ropika-theme .ui-pagination-controls .ui-pagination-number:not([aria-current="page"]) { display: none !important; }
}

:is(.app-shell, .ropika-theme) .ui-btn--icon {
  width: 40px;
  padding-inline: 0;
}

:is(.app-shell, .ropika-theme) :is(.ui-btn--primary, .public-button) {
  background: var(--color-primary);
  color: #ffffff;
}

:is(.app-shell, .ropika-theme) :is(.ui-btn--primary, .public-button):hover,
:is(.app-shell, .ropika-theme) :is(.ui-btn--primary, .public-button):focus-visible {
  background: var(--color-primary-hover);
}

:is(.app-shell, .ropika-theme) .ui-btn--secondary {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-secondary);
}

:is(.app-shell, .ropika-theme) .ui-btn--secondary:hover,
:is(.app-shell, .ropika-theme) .ui-btn--secondary:focus-visible {
  border-color: #bfdbfe;
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

:is(.app-shell, .ropika-theme) .ui-btn--secondary[aria-expanded="true"] {
  border-color: #93c5fd;
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

:is(.app-shell, .ropika-theme) .ui-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--color-text-secondary);
}

:is(.app-shell, .ropika-theme) .ui-btn--ghost:hover,
:is(.app-shell, .ropika-theme) .ui-btn--ghost:focus-visible {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

:is(.app-shell, .ropika-theme) .ui-btn--icon {
  background: transparent;
  color: var(--color-text-secondary);
}

:is(.app-shell, .ropika-theme) .ui-btn--icon:hover,
:is(.app-shell, .ropika-theme) .ui-btn--icon:focus-visible {
  background: var(--color-surface-muted);
  color: var(--color-text);
}

:is(.app-shell, .ropika-theme) .ui-btn:disabled {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.55;
}

:is(.app-shell, .ropika-theme) .ui-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-badge);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

:is(.app-shell, .ropika-theme) .ui-badge--info {
  border-color: #bfdbfe;
  background: var(--color-primary-soft);
  color: #1d4ed8;
}

:is(.app-shell, .ropika-theme) .ui-badge--success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

:is(.app-shell, .ropika-theme) .ui-badge--warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
}

:is(.app-shell, .ropika-theme) .ui-badge--danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

:is(.app-shell, .ropika-theme) .ui-badge--neutral {
  border-color: var(--color-border);
  background: var(--color-surface-muted);
  color: var(--color-text-secondary);
}

:is(.app-shell, .ropika-theme) .ui-badge--crm {
  display: inline-block;
  vertical-align: middle;
}

:is(.app-shell, .ropika-theme) :is(.ui-badge--crm, .ui-crm-surface) {
  border-color: color-mix(in srgb, var(--crm-status-color) 75%, #ffffff);
  background: color-mix(in srgb, var(--crm-status-color) 50%, #ffffff);
  color: color-mix(in srgb, var(--crm-status-color) 25%, var(--color-text));
}

:is(.app-shell, .ropika-theme) .ui-filter-bar {
  display: flex;
  min-height: 48px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-control);
  background: var(--color-primary-soft);
  padding: 8px 12px;
  color: #1d4ed8;
  font-size: 13px;
}

:is(.app-shell, .ropika-theme) .ui-filter-chip {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 10px;
  color: #1d4ed8;
  font-size: 13px;
}

:is(.app-shell, .ropika-theme) .ui-filter-chip button {
  color: #2563eb;
}

:is(.app-shell, .ropika-theme) .ui-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface-muted);
  padding: 3px;
}

:is(.app-shell, .ropika-theme) .ui-tab {
  min-height: 34px;
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--color-text-secondary);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

:is(.app-shell, .ropika-theme) .ui-tab:hover,
:is(.app-shell, .ropika-theme) .ui-tab:focus-visible {
  background: var(--color-surface);
  color: var(--color-text);
}

:is(.app-shell, .ropika-theme) .ui-tab.is-active,
:is(.app-shell, .ropika-theme) .ui-tab[aria-selected="true"],
:is(.app-shell, .ropika-theme) .ui-tab[aria-pressed="true"] {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 12%);
}

:is(.app-shell, .ropika-theme) .ui-tabs--underline {
  gap: 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

:is(.app-shell, .ropika-theme) .ui-tabs--underline .ui-tab {
  min-height: 36px;
  border-radius: 0;
  border-bottom-width: 2px;
  background: transparent;
  padding: 7px 12px;
}

:is(.app-shell, .ropika-theme) .ui-tabs--underline .ui-tab:hover,
:is(.app-shell, .ropika-theme) .ui-tabs--underline .ui-tab:focus-visible {
  background: transparent;
  color: var(--color-primary-hover);
}

:is(.app-shell, .ropika-theme) .ui-tabs--underline .ui-tab.is-active,
:is(.app-shell, .ropika-theme) .ui-tabs--underline .ui-tab[aria-selected="true"],
:is(.app-shell, .ropika-theme) .ui-tabs--underline .ui-tab[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: transparent;
  color: var(--color-primary-hover);
  box-shadow: none;
}

:is(.app-shell, .ropika-theme) .ui-tab:disabled,
:is(.app-shell, .ropika-theme) .ui-tab:disabled:hover {
  cursor: not-allowed;
  background: transparent;
  color: var(--color-text-muted);
  opacity: 0.55;
}

:is(.app-shell, .ropika-theme) .ui-kpi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

:is(.app-shell, .ropika-theme) .ui-kpi-card {
  display: flex;
  min-width: 0;
  min-height: 88px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  padding: 16px;
}

:is(.app-shell, .ropika-theme) .ui-kpi-card__icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

:is(.app-shell, .ropika-theme) .ui-kpi-card__icon--info {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

:is(.app-shell, .ropika-theme) .ui-kpi-card__icon--success {
  background: #ecfdf5;
  color: var(--color-success);
}

:is(.app-shell, .ropika-theme) .ui-kpi-card__icon--warning {
  background: #fffbeb;
  color: var(--color-warning);
}

:is(.app-shell, .ropika-theme) .ui-kpi-card__icon--danger {
  background: #fef2f2;
  color: var(--color-danger);
}

:is(.app-shell, .ropika-theme) .ui-kpi-card__value {
  color: var(--color-text);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 24px;
}

:is(.app-shell, .ropika-theme) .ui-kpi-card__label {
  margin-top: 2px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 16px;
}

:is(.app-shell, .ropika-theme) .ui-transcript-segment {
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  border-radius: var(--radius-control);
  background: var(--color-surface);
  padding: 12px 14px;
}

:is(.app-shell, .ropika-theme) .ui-transcript-segment--manager {
  border-left-color: #93c5fd;
  background: #eff6ff;
}

:is(.app-shell, .ropika-theme) .ui-transcript-segment--client {
  border-left-color: #fbbf24;
  background: #fffbeb;
}

/* Approved communication palette. Geometry remains owned by the dashboard helpers. */
.ui-chart-category {
  background-color: var(--chart-category-color);
  color: var(--color-text);
}

a.ui-chart-category:is(:hover, :focus-visible) {
  box-shadow: inset 0 0 0 2px rgb(15 45 91 / 30%);
}

.ui-chart-swatch {
  display: inline-block;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background-color: var(--chart-category-color);
}

:is(.app-shell, .ropika-theme) .ui-table-shell {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

:is(.app-shell, .ropika-theme) .ui-table-shell > .overflow-x-auto {
  max-width: 100%;
}

:is(.app-shell, .ropika-theme) .ui-data-table {
  font-variant-numeric: tabular-nums;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--color-text);
  font-size: 13px;
}

:is(.app-shell, .ropika-theme) .ui-data-table thead {
  background: var(--color-surface-muted);
}

:is(.app-shell, .ropika-theme) .ui-data-table th,
:is(.app-shell, .ropika-theme) .ui-data-table__head-cell {
  border-bottom: 1px solid var(--color-border);
  padding: 10px 12px;
  color: var(--color-text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  white-space: nowrap;
}

:is(.app-shell, .ropika-theme) .ui-data-table th.text-right,
:is(.app-shell, .ropika-theme) .ui-data-table__head-cell.text-right {
  text-align: right;
}

:is(.app-shell, .ropika-theme) .ui-data-table th.text-center,
:is(.app-shell, .ropika-theme) .ui-data-table__head-cell.text-center {
  text-align: center;
}

/* Отчёт реакции сохраняет читаемые заголовки в рабочей области 1366px. */
:is(.app-shell, .ropika-theme) :is(.lead-response-manager-table, .lead-response-deals-table) th {
  white-space: normal;
}

:is(.app-shell, .ropika-theme) .ui-data-table td,
:is(.app-shell, .ropika-theme) .ui-data-table__cell {
  font-size: 13px;
  line-height: 20px;
  border-bottom: 1px solid #eef2f7;
  padding: 8px 12px;
  vertical-align: middle;
}

:is(.app-shell, .ropika-theme) .ui-data-table tbody tr,
:is(.app-shell, .ropika-theme) .ui-data-table__row {
  transition: background-color 120ms ease;
}

:is(.app-shell, .ropika-theme) .ui-data-table tbody tr:hover,
:is(.app-shell, .ropika-theme) .ui-data-table__row:hover {
  background: #f8fbff;
}

:is(.app-shell, .ropika-theme) .ui-data-table tbody tr[data-selected="true"],
:is(.app-shell, .ropika-theme) .ui-data-table tbody tr[aria-selected="true"],
:is(.app-shell, .ropika-theme) .ui-data-table tbody tr.bg-blue-50,
:is(.app-shell, .ropika-theme) .ui-data-table__row--selected {
  background: var(--color-primary-soft);
}

:is(.app-shell, .ropika-theme) .ui-data-table .tabular-nums,
:is(.app-shell, .ropika-theme) .ui-data-table [data-numeric="true"] {
  font-variant-numeric: tabular-nums;
}

.app-shell .deals-data-table {
  min-width: 1040px;
}

:is(.app-shell, .ropika-theme) select.criterion-type-select {
  padding-inline: 4px 20px;
  font-size: 13px;
}

:is(.app-shell, .ropika-theme) .ui-choice {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  cursor: pointer;
}

:is(.app-shell, .ropika-theme) .ui-choice:hover {
  border-color: var(--color-primary);
}

:is(.app-shell, .ropika-theme) .ui-choice:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}

.app-shell .calls-dashboard-table {
  min-width: 1080px;
}

.calls-dashboard-table .dashboard-col-manager { width: 168px; }
.calls-dashboard-table .dashboard-col-directions { width: 80px; }
.calls-dashboard-table .dashboard-col-count { width: 60px; }
.calls-dashboard-table .dashboard-col-conversations { width: 100px; }
.calls-dashboard-table .dashboard-col-time { width: 70px; }
.calls-dashboard-table .dashboard-col-contacts { width: 80px; }

.app-shell .calls-dashboard-table th,
.app-shell .calls-dashboard-table td {
  padding-left: 8px;
  padding-right: 8px;
}

.calls-dashboard-table .ui-chart-segment--compact { padding-inline: 4px; }
.calls-dashboard-table .ui-chart-segment--total { padding-inline: 6px; }

.calls-dashboard-table .dashboard-chart-segment {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(15, 23, 42, .38);
}

.calls-dashboard-table .dashboard-chart-segment[data-call-type="undefined"] {
  color: #0f172a;
  text-shadow: none;
}

.app-shell .calls-dashboard-table td.calls-dashboard-expansion {
  padding: 0;
  border-bottom: 0;
}

.calls-dashboard-table .dashboard-manager {
  width: 100%;
}

.calls-dashboard-table .dashboard-manager > [data-dashboard-toggle-target="arrow"] {
  flex-shrink: 0;
}

.calls-dashboard-table .dashboard-direction--inbound {
  color: #0f766e;
}

.calls-dashboard-table .dashboard-direction--outbound {
  color: #2563eb;
}

.calls-dashboard-table .dashboard-conversation-count {
  color: #15803d;
}

.app-shell .deals-data-table .deals-days-in-status-header,
.app-shell .deals-data-table .deals-days-in-status-cell {
  min-width: 128px;
}

.app-shell .deals-data-table .deals-last-call-header,
.app-shell .deals-data-table .deals-last-call-cell {
  min-width: 92px;
}


.app-shell :where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (min-width: 640px) {
  :is(.app-shell, .ropika-theme) .ui-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  :is(.app-shell, .ropika-theme) .ui-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  :is(.app-shell, .ropika-theme) .ui-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(max-content, 1.4fr) minmax(0, 1fr);
  }
}

@media (max-width: 1279px) {
  .app-shell { --page-padding: 24px; }
}

@media (max-width: 767px) {
  .app-shell { --page-padding: 16px; }

  :is(.app-shell, .ropika-theme) .ui-tabs {
    max-width: 100%;
    overflow-x: auto;
  }
}

/* Communication emphasis: approved variant A. */
.app-shell .communication-result-quiet {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--color-text-muted);
  font-weight: 400;
}
.app-shell .communication-sales-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid #c2e8cc;
  border-radius: var(--radius-badge);
  background: #edf8ef;
  color: #17643d;
  font-weight: 600;
}

.app-shell .communication-result-quiet--danger {
  color: #b91c1c;
}

/* Каждое время отдельной строкой; место удаления не растягивает первое поле. */
.scheduled-times-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 28rem; }
.scheduled-times-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px; align-items: start; gap: 8px; }
.scheduled-times-row > button { height: 38px; }
.scheduled-times-list > .scheduled-times-first { margin-top: 0; padding-right: 96px; }

/* ===========================
   CHECKLIST CONTEXT SETTINGS (docs/ui/CHECKLIST_CONTEXT_SOURCES.md)
   =========================== */

/* Свёрнутый по умолчанию блок «Дополнительные настройки»: две смысловые
   секции, строки без карточек на каждый чекбокс. Узкий экран переносит строку,
   а не создаёт горизонтальную прокрутку. */
.checklist-context-advanced > summary {
  list-style: none;
}

/* Сводка переносится целиком: заголовок не сжимается в узкую колонку и не
   упирается в минимальную ширину длинного слова. */
.checklist-context-advanced-summary {
  flex-wrap: wrap;
}

.checklist-context-advanced > summary::-webkit-details-marker {
  display: none;
}

.checklist-context-chevron {
  transition: transform 0.15s ease;
}

.checklist-context-advanced[open] > summary .checklist-context-chevron {
  transform: rotate(180deg);
}

.checklist-context-call-types-details[open] > summary .checklist-context-chevron {
  transform: rotate(180deg);
}

.checklist-context-advanced-badge {
  max-width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  background: #f9fafb;
  color: #374151;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  padding: 2px 8px;
  text-align: right;
}

.checklist-context-advanced-title {
  overflow-wrap: anywhere;
}

/* Узкий экран (<=640px): сводка встаёт отдельной строкой под заголовком, а
   заголовок занимает всю ширину шапки. */
@media (max-width: 640px) {
  .checklist-context-advanced-summary {
    flex-direction: column;
    margin-inline: 0;
  }

  .checklist-context-advanced-heading {
    width: 100%;
  }

  .checklist-context-advanced-badge {
    align-self: flex-start;
    text-align: left;
  }
}

.checklist-context-section {
  min-width: 0;
}

/* Быстрые пресеты «Что анализировать»: «Все» / «Только коммуникации» /
   «Настроить вручную». Полный список источников показывается только в ручном
   режиме. */
.checklist-context-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checklist-context-preset {
  border: 1px solid #d1d5db;
  border-radius: 9999px;
  background: #ffffff;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  padding: 4px 12px;
  cursor: pointer;
}

.checklist-context-preset:hover {
  background: #f9fafb;
}

.checklist-context-preset[aria-pressed="true"] {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

/* Подсказка кнопки-пресета: не выходит за пределы узкого экрана. */
.checklist-context-preset-tooltip {
  max-width: min(18rem, calc(100vw - 2rem));
}

/* Секция «Что анализировать»: один адаптивный чекбокс-груп, без карточек.
   Desktop — 4 колонки, уже — 2, мобильный — 1. Явное правило перекрывает
   display: grid, когда пресет скрывает список (class="hidden"). */
.checklist-context-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px 16px;
}

.checklist-context-source-grid.hidden {
  display: none;
}

@media (min-width: 640px) {
  .checklist-context-source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .checklist-context-source-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.checklist-context-source-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.checklist-context-option {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 4px 12px;
  min-width: 0;
  padding: 8px 0;
  border-top: 1px solid #f3f4f6;
}

.checklist-context-option:first-child {
  border-top: 0;
}

.checklist-context-option-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checklist-context-option-control {
  min-width: 0;
}

.checklist-context-option-status {
  margin-left: auto;
  flex-shrink: 0;
}

.checklist-context-call-types {
  min-width: 0;
  margin-bottom: 6px;
}

.checklist-context-call-types-details > summary {
  list-style: none;
}

.checklist-context-call-types-details > summary::-webkit-details-marker {
  display: none;
}
