:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #1a1a2e;
  --muted: #6b7280;
  --line: rgba(0, 0, 0, 0.08);
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --accent: #2563eb;
  --accent-deep: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --teal: #2f7567;
  --teal-soft: rgba(47, 117, 103, 0.14);
  --ok: #235c3e;
  --warn: #815912;
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', "Segoe UI Variable Text", sans-serif;
  color: var(--ink);
  background: #ffffff;
  overflow-x: hidden;
}

body::before {
  display: none;
}

.ambient {
  display: none;
}

.ambient-one {
  display: none;
}

.ambient-two {
  display: none;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 64px;
  overflow: visible;
}

.panel,
.feature-card,
.timeline-step,
.value-card,
.pricing-card,
.faq-item,
.market-strip {
  backdrop-filter: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav actions";
  align-items: center;
  gap: 16px;
  padding: 14px max(32px, calc((100vw - 1220px) / 2));
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: #fff;
  transition: background 0.35s ease, backdrop-filter 0.35s ease, border-radius 0.35s ease, box-shadow 0.35s ease;
}

.site-header.is-scrolled {
  left: max(16px, calc((100vw - 1220px) / 2));
  right: max(16px, calc((100vw - 1220px) / 2));
  top: 12px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-radius: 10px;
  color: #111;
}

.site-header.is-scrolled .main-nav a {
  color: rgba(0, 0, 0, 0.65);
}

.site-header.is-scrolled .main-nav a:hover {
  color: #111;
}

.site-header.is-scrolled .ghost-btn {
  color: #111;
}

.site-header.is-scrolled .primary-btn.inline-btn {
  border-color: rgba(0, 0, 0, 0.4);
  color: #111;
}

.site-header.is-scrolled .primary-btn.inline-btn:hover {
  border-color: #111;
  background: rgba(0, 0, 0, 0.05);
}

.site-header.is-scrolled .brand-logo {
  filter: none;
  height: 32px;
}

.site-header.is-scrolled .mobile-menu-toggle span {
  background: #111;
}

.mobile-menu-toggle {
  display: none;
  grid-area: toggle;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  justify-self: end;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 200ms ease, opacity 200ms ease;
}

.site-header.is-menu-open .mobile-menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.is-menu-open .mobile-menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.is-menu-open .mobile-menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
}

.site-header .main-nav a {
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border-radius: 0;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-header .main-nav a:hover {
  color: #fff;
  background: none;
}

.site-header .ghost-btn {
  color: #fff;
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.site-header .primary-btn.inline-btn {
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: none;
}

.site-header .primary-btn.inline-btn:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.brand-lockup {
  grid-area: brand;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 38px;
  border-radius: 0;
  object-fit: contain;
  object-position: left center;
  box-shadow: none;
}

.brand-tag {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main-nav {
  grid-area: nav;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.main-nav a,
.text-link,
.ghost-btn {
  color: inherit;
  text-decoration: none;
}

.main-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  padding: 10px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  white-space: nowrap;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.main-nav a:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
}

.header-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 12px;
  white-space: nowrap;
}

.header-workspace {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(18, 24, 31, 0.1);
  background: rgba(255, 255, 255, 0.58);
  font-weight: 700;
}

.live-status,
.ghost-btn,
.signal-card,
.stage-pill,
.market-grid span,
.status-pill,
.answer-item,
.note-item,
.faq-item {
  border: 1px solid var(--line);
}

.live-status {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.9rem;
  text-align: center;
}

.ghost-btn,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
  cursor: pointer;
}

.compact-btn {
  min-height: 40px;
  padding: 10px 14px;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.56);
}

.primary-btn {
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.secondary-btn {
  border: none;
  background: #f5f7fa;
  color: var(--ink);
}

.primary-btn:hover,
.secondary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-1px);
}

.inline-btn {
  white-space: nowrap;
}

main {
  display: grid;
  gap: 28px;
  margin-top: 0;
}

/* --- Main hero ---
   Full-bleed even though the parent .page-shell is constrained to 1220px.
   Using symmetric negative margins (instead of the older `left: 50%;
   margin-left: -50vw` trick) avoids a 1–N px asymmetric gap on the left
   that some browsers showed at certain viewport widths. */
.hero-main {
  position: relative;
  width: auto;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  margin-top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 140px;
  background: url('/hero-bg.png') 65% calc(100% + 270px) / 164% auto no-repeat #181c20;
  overflow: hidden;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.hero-main__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 10, 12, 0.83) 0%,
    rgba(10, 10, 12, 0.68) 38%,
    rgba(10, 10, 12, 0.22) 68%,
    transparent 100%
  );
  pointer-events: none;
}

.hero-main__content {
  z-index: 1;
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 40px;
  /* подняли блок на 10px выше (было -16px) */
  margin-top: -26px;
  max-width: 620px;
  margin-right: auto;
  margin-left: max(24px, calc((100vw - 1220px) / 2));
}

.hero-main__title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: normal;
  /* уменьшено на 10% (было clamp(3.08rem, 6.16vw, 5.53rem)) */
  font-size: clamp(2.77rem, 5.54vw, 4.98rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0;
  max-width: 12ch;
}

.hero-main__subtitle {
  margin: 28px 0 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  max-width: 48ch;
}

.hero-main__actions {
  margin-top: 36px;
}

.hero-main__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 16px 36px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #e040fb, #ff4081);
  color: #fff;
  font: inherit;
  font-size: 1.08rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 12px 36px rgba(224, 64, 251, 0.35);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.hero-main__cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 44px rgba(224, 64, 251, 0.45);
}

.hero-main__badges {
  position: absolute;
  left: max(24px, calc((100vw - 1220px) / 2));
  bottom: 80px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  z-index: 2;
  margin: 0;
}

.hero-main__badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.88rem;
  font-weight: 500;
}

.hero-main__badge svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.hero-main__rating {
  font-weight: 800;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.8);
}

/* --- Hero phone (один телефон справа в hero, заменяет старую chat-анимацию) --- */
.hero-main__phone {
  position: absolute;
  top: 50%;
  right: max(40px, calc((100vw - 1220px) / 2 + 40px));
  transform: translateY(-50%) rotate(4deg);
  width: min(290px, 24vw);
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 40px 60px rgba(0, 0, 0, 0.45));
}

.phone-mock--hero {
  width: 100%;
}

@media (max-width: 1100px) {
  .hero-main__phone {
    width: min(240px, 28vw);
    right: 24px;
  }
}

@media (max-width: 900px) {
  .hero-main__phone {
    display: none;
  }
}

/* --- Chats preview (iPhone-моки переписок, заходят глубоко в hero) --- */
.chats-preview {
  position: relative;
  z-index: 3;
  /* композиция спущена ниже — её верх на уровне заголовка hero, низ ниже CTA */
  margin-top: -650px;
  /* компенсируем подъём, чтобы следующая секция не «провалилась» в hero */
  margin-bottom: 270px;
  padding: 0;
  /* мягкий ambient-фон под композицией */
  background:
    radial-gradient(ellipse 60% 40% at 50% 80%, rgba(224, 64, 251, 0.04), transparent 70%);
}

.chats-preview__inner {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 0 24px;
  /* небольшой сдвиг вправо относительно центра */
  transform: translateX(50px);
}

/* --- iPhone frame --- */
.phone-mock {
  position: relative;
  display: block;
  width: 220px;
  flex-shrink: 0;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
  perspective: 1200px;
}

/* Композиция: WhatsApp слева на переднем плане, Telegram сзади (меньше),
   Web-чат справа как floating-карточка без рамки телефона. */
.chats-preview__inner > .phone-mock:nth-child(1) {
  transform: scale(1) translateY(20px);
  z-index: 3;
  transform-origin: bottom center;
}
.chats-preview__inner > .phone-mock:nth-child(2) {
  transform: scale(0.82) translateY(-30px);
  margin-left: -60px;
  z-index: 1;
  transform-origin: bottom center;
}
.chats-preview__inner > .phone-mock:nth-child(1):hover {
  transform: scale(1.02) translateY(10px);
}
.chats-preview__inner > .phone-mock:nth-child(2):hover {
  transform: scale(0.84) translateY(-40px);
}

/* --- Веб-виджет (третий элемент в композиции) ---
   Кнопка слева внизу (на уровне нижнего края Telegram-мока);
   панель раскрывается вправо от кнопки через absolute. */
.web-widget {
  position: relative;
  flex-shrink: 0;
  /* подвинули ближе к WhatsApp — пузырь и панель наезжают на Telegram (-90px), затем ещё -20px влево */
  margin-left: -110px;
  z-index: 4;
  /* было translateY(-30px), сместили на 20px вниз */
  transform: translateY(-10px);
  display: flex;
  align-items: flex-end;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1);
}

.web-widget__panel {
  position: absolute;
  left: calc(100% + 14px);
  bottom: 0;
  width: 260px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 30px 60px -15px rgba(10, 10, 18, 0.22),
    0 12px 24px -10px rgba(10, 10, 18, 0.12);
  overflow: hidden;
  /* стартовое состояние: свернуто в пузырь (раскрытие из левого нижнего угла) */
  transform: scale(0.15) translate(-30px, 30px);
  transform-origin: bottom left;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 420ms cubic-bezier(.2,.85,.3,1.05),
    opacity 240ms ease-out;
}

.web-widget[data-state="open"] .web-widget__panel {
  /* открытое состояние уменьшено на 20% (визуально компактнее) */
  transform: scale(0.8) translate(0, 0);
  opacity: 1;
  pointer-events: auto;
}

.web-widget__bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e040fb, #ff4081);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px -8px rgba(224, 64, 251, 0.45),
              0 4px 12px rgba(255, 64, 129, 0.2);
  cursor: default;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1);
}
/* Логотип iSat чуть приподнят внутри пузыря — оптическая компенсация */
.web-widget__bubble svg {
  transform: translateY(-3px);
}

.web-widget[data-state="open"] .web-widget__bubble {
  transform: scale(0.9) rotate(8deg);
}

/* Пульсация пузыря в закрытом состоянии — намекает что виджет интерактивен */
.web-widget[data-state="closed"] .web-widget__bubble {
  animation: bubblePulse 2.4s ease-in-out infinite;
}
@keyframes bubblePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 12px 28px -8px rgba(224, 64, 251, 0.45), 0 4px 12px rgba(255, 64, 129, 0.2); }
  50% { transform: scale(1.06); box-shadow: 0 16px 36px -8px rgba(224, 64, 251, 0.55), 0 6px 16px rgba(255, 64, 129, 0.3); }
}

/* Внутри виджета chat-mock без верхнего отступа (нет status bar) */
.web-widget__panel .chat-mock {
  margin-top: 0;
  padding-top: 0;
}

/* Полупрозрачный body — фон виджета просвечивает */
.web-widget__panel .chat-mock__body--web {
  background: transparent;
}

.phone-mock__frame {
  position: relative;
  border-radius: 32px;
  padding: 6px;
  background: linear-gradient(160deg, #2a2c30 0%, #1a1c1f 50%, #0e1012 100%);
  box-shadow:
    /* Внутренний highlight (бликующая рамка) */
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    /* Глубокая мягкая тень */
    0 50px 100px -20px rgba(10, 10, 18, 0.45),
    0 30px 60px -30px rgba(10, 10, 18, 0.5),
    0 8px 24px rgba(10, 10, 18, 0.18);
  aspect-ratio: 9 / 19.5;
  overflow: hidden;
}

.phone-mock__notch {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 28%;
  max-width: 96px;
  min-width: 70px;
  height: 24px;
  background: #050608;
  border-radius: 999px;
  z-index: 10;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.phone-mock__screen {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.phone-mock__status {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px 10px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: #fff;
  pointer-events: none;
}

.phone-mock__time {
  letter-spacing: -0.01em;
}

.phone-mock__icons {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
}

.phone-mock__home {
  position: absolute;
  bottom: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 38%;
  max-width: 124px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  z-index: 5;
  pointer-events: none;
}

/* Web-вариант имеет светлый фон → home indicator темнее */
.phone-mock--web .phone-mock__home {
  background: rgba(0, 0, 0, 0.35);
}

/* --- Push-стек в стиле iOS (Kaspi оплаты заваливают экран и гаснут) ---
   Каждое уведомление имеет свой «слот» (--slot). Скрытое состояние —
   чуть выше слота с уменьшенным масштабом → при .is-visible пружинит вниз
   на свою полку с лёгким overshoot, как настоящий iOS-баннер. --- */
.phone-mock__push-stack {
  position: absolute;
  top: 52px;
  left: 8px;
  right: 8px;
  z-index: 20;
  pointer-events: none;
  height: calc(100% - 60px);
}
.phone-mock__push {
  --slot: 0px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: rgba(245, 245, 247, 0.92);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow:
    0 14px 30px -10px rgba(10, 10, 18, 0.22),
    0 4px 10px rgba(10, 10, 18, 0.08);
  /* Скрыто: чуть выше своего слота, уменьшенное и прозрачное */
  opacity: 0;
  transform: translate3d(0, calc(var(--slot) - 28px), 0) scale(0.86);
  transform-origin: 50% 0%;
  /* iOS-овский spring: opacity быстро, transform с лёгким overshoot */
  transition:
    opacity 260ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 560ms cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  will-change: transform, opacity;
}
.phone-mock__push.is-visible {
  opacity: 1;
  transform: translate3d(0, var(--slot), 0) scale(1);
}
/* Слоты — каждое уведомление садится на свою «полку».
   Высота карточки ~50px, шаг 56px → лёгкий зазор. */
.phone-mock__push[data-idx="0"] { --slot: 0px;   z-index: 6; }
.phone-mock__push[data-idx="1"] { --slot: 56px;  z-index: 5; }
.phone-mock__push[data-idx="2"] { --slot: 112px; z-index: 4; }
.phone-mock__push[data-idx="3"] { --slot: 168px; z-index: 3; }
.phone-mock__push[data-idx="4"] { --slot: 224px; z-index: 2; }
.phone-mock__push[data-idx="5"] { --slot: 280px; z-index: 1; }
.phone-mock__push-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: linear-gradient(135deg, #ff5b5b, #c40606);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.phone-mock__push-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.phone-mock__push-meta strong {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1d1d1f;
  line-height: 1.1;
}
.phone-mock__push-meta span {
  font-size: 0.66rem;
  line-height: 1.25;
  color: rgba(60, 60, 67, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-mock__push time {
  font-size: 0.6rem;
  color: rgba(60, 60, 67, 0.55);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 1px;
}

/* --- Чат-контент внутри телефона --- */
.chat-mock {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: -34px; /* status bar накладывается на header */
  padding-top: 34px;
}

.chat-mock__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 12px;
  color: #fff;
  position: relative;
}

.chat-mock__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.chat-mock__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  flex: 1;
  min-width: 0;
}

.chat-mock__meta strong {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-mock__meta span {
  font-size: 0.64rem;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-mock__channel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  flex-shrink: 0;
}

.chat-mock__body {
  flex: 1;
  padding: 14px 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 0.74rem;
  line-height: 1.35;
  overflow: hidden;
}

.chat-mock__msg {
  position: relative;
  max-width: 86%;
  padding: 7px 10px 16px;
  border-radius: 14px;
  word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  /* стартовое состояние для JS-анимации появления */
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  transition: opacity 320ms cubic-bezier(.2,.7,.3,1),
              transform 320ms cubic-bezier(.2,.7,.3,1);
}

.chat-mock__msg.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Typing-индикатор — три прыгающие точки */
.chat-mock__typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 4px;
  padding: 9px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  transition: opacity 200ms ease, transform 200ms ease;
}
.chat-mock__typing.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.chat-mock__typing--out {
  align-self: flex-end;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 4px;
}
.chat-mock__typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  animation: typingBounce 1.2s infinite ease-in-out;
}
.chat-mock__typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-mock__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-3px); opacity: 0.85; }
}

.chat-mock__msg time {
  position: absolute;
  right: 8px;
  bottom: 3px;
  font-size: 0.56rem;
  opacity: 0.5;
  font-weight: 500;
}

.chat-mock__msg--in {
  align-self: flex-start;
  background: #fff;
  color: #111;
  border-bottom-left-radius: 4px;
}

.chat-mock__msg--out {
  align-self: flex-end;
  color: #111;
  border-bottom-right-radius: 4px;
}

/* WhatsApp variant */
.chat-mock--wa .chat-mock__header {
  background: linear-gradient(180deg, #1faf54 0%, #128c7e 100%);
}
.chat-mock__body--wa {
  background:
    radial-gradient(circle at 20% 10%, rgba(37, 211, 102, 0.06), transparent 60%),
    #ece5dd;
}
.chat-mock--wa .chat-mock__msg--out {
  background: #dcf8c6;
}

/* Telegram variant */
.chat-mock--tg .chat-mock__header {
  background: linear-gradient(180deg, #38b6f1 0%, #229ed9 100%);
}
.chat-mock__body--tg {
  background: #eef5fb;
}
.chat-mock--tg .chat-mock__msg--out {
  background: #d4edff;
}

/* Web-chat variant — фирменный градиент AiSat */
.chat-mock--web .chat-mock__header {
  background: linear-gradient(135deg, #e040fb 0%, #ff4081 100%);
}
.chat-mock__body--web {
  background: linear-gradient(180deg, #fafbff 0%, #f3f5fb 100%);
}
.chat-mock--web .chat-mock__msg--in {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.chat-mock--web .chat-mock__msg--out {
  background: linear-gradient(135deg, #e040fb, #ff4081);
  color: #fff;
}
.chat-mock--web .chat-mock__msg--out time {
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
}

/* Tablet: композиция уменьшается ЦЕЛИКОМ, как единая группа.
   Внутренние пропорции/расположение мокапов остаются такими же, как на десктопе. */
@media (max-width: 1100px) {
  .chats-preview {
    /* спустили композицию ниже на этом разрешении — низ группы выходит за CTA */
    margin-top: -560px;
    margin-bottom: 220px;
    padding-bottom: 0;
  }
  .chats-preview__inner {
    transform: translateX(50px) scale(0.85);
    transform-origin: top center;
  }
}

/* Чуть уже — ещё сильнее уменьшаем группу, но без перекомпоновки */
@media (max-width: 900px) {
  .chats-preview {
    margin-top: -460px;
    margin-bottom: 180px;
  }
  .chats-preview__inner {
    transform: translateX(30px) scale(0.7);
    transform-origin: top center;
  }
}

/* Mobile: композиция СОХРАНЯЕТСЯ как на десктопе (3 мокапа + виджет), просто
   сильнее масштабируется и прижимается к нижней части hero. Никакой колонки.
   Выравнивание по левому краю экрана. */
@media (max-width: 600px) {
  .chats-preview {
    /* спустили ниже — композиция «вылезает» из hero */
    margin-top: -200px;
    /* компенсируем layout-overflow от scale, но оставляем зазор так,
       чтобы заголовок «Результаты для бизнеса» не залезал под композицию */
    margin-bottom: -180px;
    padding: 0;
  }
  .chats-preview__inner {
    /* Группа уменьшается целиком, fan-расположение мокапов сохраняется (увеличили на 10%) */
    transform: scale(0.55);
    transform-origin: top left;
    justify-content: flex-start;
    padding: 0 16px;
  }
}

/* Hero chat animation */
.hero-main__chat {
  position: absolute;
  bottom: 60px;
  right: max(32px, calc((100vw - 1220px) / 2 + 280px));
  width: min(306px, 27vw);
  height: 280px;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.chat-message {
  position: absolute;
  bottom: 0;
  opacity: 0;
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 16px;
  font-size: 0.7rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  animation-duration: 16s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  will-change: opacity, transform;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chat-message--in {
  left: 0;
}

.chat-message--out {
  right: 0;
}

.chat-message--in {
  background: rgba(255, 255, 255, 0.15);
  border-bottom-left-radius: 5px;
}

.chat-message--out {
  background: linear-gradient(135deg, #7b2cff 0%, #c724ff 100%);
  border-bottom-right-radius: 5px;
}

.chat-message__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
  font-size: 0.67rem;
}

.chat-message--m1 { animation-name: chatMsg1; }
.chat-message--m2 { animation-name: chatMsg2; }
.chat-message--m3 { animation-name: chatMsg3; }
.chat-message--m4 { animation-name: chatMsg4; }

/* msg1 slides up by height of msg2 (~95px), msg3 by height of msg4 (~60px) */
/* Fade out: both keep their offset, msg1 fades first, then msg2 */
@keyframes chatMsg1 {
  0%        { opacity: 0; transform: translateY(10px) scale(0.92); }
  3%        { opacity: 1; transform: translateY(0) scale(1); }
  8%        { opacity: 1; transform: translateY(0) scale(1); }
  12%       { opacity: 1; transform: translateY(-95px) scale(1); }
  28%       { opacity: 1; transform: translateY(-95px) scale(1); }
  34%       { opacity: 0; transform: translateY(-95px) scale(1); }
  100%      { opacity: 0; transform: translateY(-95px) scale(1); }
}
@keyframes chatMsg2 {
  0%, 13%   { opacity: 0; transform: translateY(10px) scale(0.92); }
  16%       { opacity: 1; transform: translateY(0) scale(1); }
  30%       { opacity: 1; transform: translateY(0) scale(1); }
  36%       { opacity: 0; transform: translateY(0) scale(1); }
  100%      { opacity: 0; transform: translateY(0) scale(1); }
}
@keyframes chatMsg3 {
  0%, 48%   { opacity: 0; transform: translateY(10px) scale(0.92); }
  51%       { opacity: 1; transform: translateY(0) scale(1); }
  56%       { opacity: 1; transform: translateY(0) scale(1); }
  60%       { opacity: 1; transform: translateY(-60px) scale(1); }
  76%       { opacity: 1; transform: translateY(-60px) scale(1); }
  82%       { opacity: 0; transform: translateY(-60px) scale(1); }
  100%      { opacity: 0; transform: translateY(-60px) scale(1); }
}
@keyframes chatMsg4 {
  0%, 61%   { opacity: 0; transform: translateY(10px) scale(0.92); }
  64%       { opacity: 1; transform: translateY(0) scale(1); }
  78%       { opacity: 1; transform: translateY(0) scale(1); }
  84%       { opacity: 0; transform: translateY(0) scale(1); }
  100%      { opacity: 0; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .chat-message {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Hide chat on medium screens where it would overlap hero text */
@media (max-width: 1024px) and (min-width: 761px) {
  .hero-main__chat {
    display: none;
  }
}

/* legacy hero classes kept for other sections */
.hero-copy {
  padding-right: 0;
}

.hero-visual {
  margin: 0;
  min-width: 0;
  align-self: center;
  justify-self: center;
  width: min(100%, 360px);
  border-radius: 26px;
  overflow: hidden;
  background: #f9fbfd;
  border: none;
  box-shadow: none;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
.panel-head h3,
.pricing-card .price-row strong {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: 0.95;
  max-width: 11ch;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  line-height: 1.15;
  max-width: none;
}

h3 {
  font-size: 1.38rem;
}

.hero-text,
.feature-card p,
.timeline-step p,
.value-card p,
.plan-copy,
.faq-item p,
.inline-note,
.answer-item div,
.note-item div,
.status-pill div,
.result-row span,
.panel li {
  color: var(--muted);
  line-height: 1.65;
}

.hero-text {
  max-width: 60ch;
  margin: 22px 0 0;
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.text-link {
  align-self: center;
  color: var(--accent);
  font-weight: 600;
}

.signal-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.signal-card {
  display: grid;
  gap: 4px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.signal-card strong {
  font-size: 1.2rem;
}

.hero-stage {
  display: flex;
}

.stage-window {
  width: 100%;
  padding: 22px;
  border-radius: 28px;
  background: #f5f7fa;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stage-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.stage-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
  font-weight: 600;
}

.stage-micro {
  color: var(--muted);
  font-size: 0.88rem;
}

.conversation-card {
  display: grid;
  gap: 12px;
}

.chat-line {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(18, 24, 31, 0.08);
}

.chat-line.user {
  margin-left: 46px;
  background: rgba(18, 24, 31, 0.06);
}

.chat-line.bot.accent {
  background: rgba(37, 99, 235, 0.06);
}

.chat-role {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.chat-line p {
  margin: 0;
  line-height: 1.55;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.hero-metrics div {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.hero-metrics span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-metrics strong {
  display: block;
  line-height: 1.35;
}

.market-strip,
.panel,
.pricing-card,
.feature-card,
.timeline-step,
.value-card,
.faq-item {
  border-radius: 20px;
}

.section {
  border-radius: 0;
}

.market-strip {
  padding: 22px 26px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.market-grid span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 54px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  font-weight: 600;
}

.section {
  position: relative;
  display: grid;
  gap: 42px;
  padding: 80px 0 40px;
  border: none;
  box-shadow: none;
  background: transparent;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  z-index: -1;
}

.alt-section::before {
  background: transparent;
}

.problems-section::before {
  background: #f0f4ff;
}

.pricing-section {
  gap: 16px;
}

.pricing-section::before {
  background: #f5f7fa;
}

.auth-section::before {
  background: #2563eb;
}

.section-intro {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  margin-bottom: 4px;
  text-align: center;
  max-width: 680px;
}

.section-intro.narrow h2 {
  max-width: none;
}

/* Все заголовки секций в стиле главного hero-заголовка: Montserrat 900, тугая
   межстрочка и letter-spacing, только чёрный цвет (на светлом фоне). */
.section-intro h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-style: normal;
  font-size: clamp(2.42rem, 4.84vw, 3.96rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-align: center;
  margin: 0 auto;
}

.heading-nowrap {
  white-space: nowrap;
}

.heading-2lines {
  /* unified via .section-intro h2 */
}

.feature-grid,
.timeline,
.value-grid,
.faq-grid {
  display: grid;
  gap: 18px;
}

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

.feature-card,
.timeline-step,
.value-card,
.faq-item,
.pricing-card,
.panel {
  padding: 24px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.feature-index {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.feature-metric {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.feature-card h3,
.timeline-step h3,
.value-card h3,
.faq-item h3,
.panel-head h3,
.pricing-card .plan-name {
  margin-bottom: 10px;
}

.alt-section .timeline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.timeline-step {
  position: relative;
  overflow: hidden;
}

.timeline-step::after {
  content: none;
}

.timeline-step span {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.split-section .value-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Billing toggle */

.billing-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 0;
  background: #f1f5f9;
  border-radius: 100px;
  padding: 4px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.billing-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.billing-btn.is-active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.billing-save {
  display: inline-block;
  background: #dcfce7;
  color: #16a34a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 4px;
  vertical-align: 1px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.value-card {
  background: #ffffff;
}

/* ── Audience tabs section ── */

.audience-section {
  gap: 16px;
}

.section-sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

.audience-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 4px;
}

.audience-tab {
  padding: 10px 20px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.audience-tab svg {
  vertical-align: -3px;
  flex-shrink: 0;
}

.audience-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.audience-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.audience-tab.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 0 0 100px 100px;
  animation: tabTimer 6s linear forwards;
}

.audience-tab.is-paused::after {
  animation-play-state: paused;
}

@keyframes tabTimer {
  from { width: 0; }
  to { width: 100%; }
}

.audience-panel {
  display: none;
  animation: fadePanel 0.35s ease;
}

.audience-panel.is-active {
  display: block;
}

@keyframes fadePanel {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.case-grid {
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: 0;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: 0;
}

.case-image {
  position: relative;
  height: 100%;
  min-height: 320px;
}

.case-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.case-badge {
  position: absolute;
  top: 32px;
  right: 32px;
  padding: 5px 14px;
  background: rgba(37, 99, 235, 0.9);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 100px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-content {
  padding: 32px;
  order: -1;
}

.case-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--ink);
}

.case-pain,
.case-solution {
  margin-bottom: 18px;
}

.case-label {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  background: #fef2f2;
  color: #dc2626;
}

.case-label-green {
  background: #f0fdf4;
  color: #16a34a;
}

.case-pain p,
.case-solution p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.case-metrics {
  display: flex;
  gap: 24px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.case-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.case-metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.case-metric-label {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
  max-width: 120px;
}

/* Niche table */

.niche-table-wrap {
  margin-top: 40px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.niche-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.niche-table thead {
  background: #f8fafc;
}

.niche-table th {
  text-align: left;
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.niche-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.niche-table tbody tr:last-child td {
  border-bottom: none;
}

.niche-table tbody tr:hover {
  background: var(--accent-soft);
}

.niche-roi {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.pricing-layout,
.workspace-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
}

.pricing-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
}

.pricing-card:nth-child(3) {
  background: #ffffff;
  border-color: #e5e7eb;
  border-top: 3px solid var(--accent);
  position: relative;
}

.pricing-card:nth-child(3) .plan-name::after {
  content: "Рекомендуем";
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 700;
}

.price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
  min-width: 0;
}

.price-row strong {
  font-size: 2rem;
  line-height: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  letter-spacing: -0.02em;
}

.price-row-enterprise strong {
  font-size: 1.4rem;
  line-height: 1;
  white-space: nowrap;
}

.price-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-copy {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0;
}

.plan-includes {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 14px;
  margin-bottom: -6px;
}

.plan-list {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.9rem;
}

.plan-list li[class],
.st-pricing-features li[class] {
  background: none;
}

.plan-list li[class]::marker { content: ""; }

.tag-msg  { color: #3b82f6; }
.tag-ch   { color: #10b981; }
.tag-kb   { color: #d97706; }
.tag-agents { color: #7c3aed; }
.tag-voice  { color: #ea580c; }
.tag-lang   { color: #db2777; }

.pricing-card .primary-btn,
.pricing-card .secondary-btn {
  margin-top: auto;
}

.launch-panel {
  background: #ffffff;
}

.panel-head {
  margin-bottom: 18px;
}

.stack {
  display: grid;
  gap: 14px;
}

.compact {
  margin-bottom: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
button {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(18, 24, 31, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: rgba(37, 99, 235, 0.34);
}

.full-btn {
  width: 100%;
}

.inline-note {
  margin: 16px 0 0;
}

.hidden-state[hidden] {
  display: none;
}

.success-panel {
  background: #f5f7fa;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(18, 24, 31, 0.12);
}

.result-row strong,
.result-row a {
  text-align: right;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent);
}

.steps-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding-left: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dashboard-card {
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.dashboard-card.wide {
  grid-column: 1 / -1;
}

.card-title {
  margin: 0 0 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #3f3f46;
}

/* ─── Dashboard ─── */
.dash-container { padding: 0 8px; }

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.dash-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #18181b;
}
.dash-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: #71717a;
}
.dash-period-selector {
  display: flex;
  background: #f4f4f5;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.dash-period-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  color: #71717a;
  cursor: pointer;
  transition: all 150ms;
  white-space: nowrap;
}
.dash-period-btn.active {
  background: #fff;
  color: #18181b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* KPI grid */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.dash-kpi-card {
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #e4e4e7;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
}
.dash-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.dash-kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-kpi-icon--messages { background: #eff6ff; color: #3b82f6; }
.dash-kpi-icon--dialogs  { background: #f0fdf4; color: #22c55e; }
.dash-kpi-icon--leads    { background: #fefce8; color: #eab308; }
.dash-kpi-icon--agents   { background: #faf5ff; color: #a855f7; }
.dash-kpi-icon--limit    { background: #fff7ed; color: #f97316; }

.dash-kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #18181b;
  line-height: 1.1;
  margin-bottom: 4px;
}
.dash-kpi-of {
  font-size: 1rem;
  font-weight: 500;
  color: #a1a1aa;
}
.dash-kpi-label {
  font-size: 0.82rem;
  color: #71717a;
  font-weight: 500;
}
.dash-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
}
.dash-kpi-trend--up {
  background: #f0fdf4;
  color: #16a34a;
}
.dash-kpi-trend--down {
  background: #fef2f2;
  color: #dc2626;
}
.dash-kpi-trend--neutral {
  background: #f4f4f5;
  color: #71717a;
}
.dash-kpi-progress {
  height: 6px;
  background: #f4f4f5;
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}
.dash-kpi-progress-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width 600ms ease;
}

/* Charts grid */
.dash-charts-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-chart-card { padding: 24px; }

/* Dashboard create agent CTA */
.dash-create-agent-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
}
.dash-cta-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dash-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #dbeafe;
  color: #3b82f6;
  flex-shrink: 0;
}
.dash-cta-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1e3a5f;
}
.dash-cta-desc {
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 2px;
}
.dash-cta-desc strong {
  color: #3b82f6;
  font-weight: 600;
}
.dash-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 9px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms, box-shadow 150ms;
}
.dash-cta-btn:hover {
  background: #2563eb;
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.25);
}
.dash-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dash-chart-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #18181b;
}
.dash-chart-hint {
  font-size: 0.78rem;
  color: #a1a1aa;
}
.dash-link-btn {
  border: none;
  background: none;
  color: #3b82f6;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}
.dash-link-btn:hover { text-decoration: underline; }

/* Filter row */
.dash-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.dash-filter-label {
  font-size: 0.78rem;
  color: #a1a1aa;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1;
}
.dash-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dash-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  background: #fff;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  color: #71717a;
  cursor: pointer;
  transition: all 150ms;
}
.dash-pill:hover { border-color: #a1a1aa; color: #3f3f46; }
.dash-pill.active {
  background: #18181b;
  border-color: #18181b;
  color: #fff;
}
.dash-pill.active .dash-pill-dot { box-shadow: 0 0 0 1px #fff; }
.dash-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Date picker row */
.dash-datepicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
  animation: dash-fade-in 200ms ease;
}
@keyframes dash-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.dash-datepicker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #71717a;
  font-weight: 500;
}
.dash-datepicker-input {
  padding: 6px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  color: #18181b;
  background: #fff;
  outline: none;
  transition: border-color 150ms;
}
.dash-datepicker-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}
.dash-datepicker-sep {
  color: #a1a1aa;
  font-size: 0.85rem;
}
.dash-datepicker-apply {
  padding: 6px 18px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}
.dash-datepicker-apply:hover { background: #1d4ed8; }

/* Agent legend */
.dash-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0;
  line-height: 1;
}
.dash-filter-row .dash-legend {
  margin-bottom: 0;
}
.dash-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  line-height: 1;
  color: #52525b;
  font-weight: 500;
  cursor: pointer;
  opacity: 1;
  transition: opacity 150ms;
}
.dash-legend-item.dimmed { opacity: 0.35; }
.dash-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Bar chart — stacked */
.dash-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 200px;
  padding-top: 8px;
}
.dash-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.dash-bar-stack {
  width: 100%;
  max-width: 48px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 6px 6px 2px 2px;
  overflow: hidden;
  transition: height 500ms ease;
  min-height: 4px;
  position: relative;
}
.dash-bar-seg {
  width: 100%;
  transition: height 400ms ease;
  min-height: 0;
  position: relative;
}
.dash-bar-seg:last-child { border-radius: 6px 6px 0 0; }
.dash-bar-col:hover .dash-bar-tooltip { opacity: 1; pointer-events: auto; }
.dash-bar-tooltip {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #18181b;
  color: #fff;
  font-size: 0.7rem;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms;
  z-index: 10;
  line-height: 1.5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.dash-bar-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #18181b;
}
.dash-bar-label {
  font-size: 0.72rem;
  color: #a1a1aa;
  white-space: nowrap;
}

/* Agent-channel breakdown */
.dash-agent-channels {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dash-ac-agent {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-ac-agent-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #18181b;
}
.dash-ac-agent-name svg { color: #3b82f6; flex-shrink: 0; }
.dash-ac-bars {
  display: flex;
  gap: 4px;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #f4f4f5;
}
.dash-ac-seg {
  height: 100%;
  border-radius: 4px;
  transition: width 400ms ease;
}
.dash-ac-labels {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.dash-ac-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #71717a;
}

/* Channel distribution */
.dash-channels-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.dash-channel-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-channel-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dash-channel-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #3f3f46;
}
.dash-channel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-channel-count {
  font-size: 0.82rem;
  color: #71717a;
  font-weight: 600;
}
.dash-channel-bar {
  height: 6px;
  background: #f4f4f5;
  border-radius: 3px;
  overflow: hidden;
}
.dash-channel-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 500ms ease;
}

/* Bottom grid: agents + conversations */
.dash-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* Agents mini table */
.dash-agents-table {
  display: flex;
  flex-direction: column;
}
.dash-agent-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f4f4f5;
  gap: 12px;
}
.dash-agent-row:last-child { border-bottom: none; }
.dash-agent-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3b82f6;
  flex-shrink: 0;
}
.dash-agent-info {
  flex: 1;
  min-width: 0;
}
.dash-agent-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #18181b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-agent-msgs {
  font-size: 0.75rem;
  color: #a1a1aa;
}
.dash-agent-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}
.dash-agent-status--on { background: #f0fdf4; color: #16a34a; }
.dash-agent-status--off { background: #f4f4f5; color: #71717a; }
.dash-agent-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Recent conversations */
.dash-recent-list {
  display: flex;
  flex-direction: column;
}
.dash-conv-row {
  display: flex;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid #f4f4f5;
  gap: 10px;
}
.dash-conv-row:last-child { border-bottom: none; }
.dash-conv-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.dash-conv-body {
  flex: 1;
  min-width: 0;
}
.dash-conv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.dash-conv-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #18181b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-conv-time {
  font-size: 0.72rem;
  color: #a1a1aa;
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-conv-text {
  font-size: 0.8rem;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-conv-channel {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  margin-top: 4px;
}
.dash-conv-channel--telegram    { background: #e0f2fe; color: #0284c7; }
.dash-conv-channel--whatsapp    { background: #f0fdf4; color: #16a34a; }
.dash-conv-channel--widget      { background: #faf5ff; color: #9333ea; }
.dash-conv-channel--web-widget  { background: #faf5ff; color: #9333ea; }
.dash-conv-channel--link-widget { background: #fefce8; color: #b45309; }
.dash-conv-channel--instagram   { background: #fef3c7; color: #d97706; }

/* Subscription row */
.dash-sub-card {
  padding: 24px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #bfdbfe;
}
.dash-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.dash-sub-info { flex: 1; }
.dash-sub-info .dash-chart-title {
  margin: 0;
}
.dash-sub-badge {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1.5px solid #f97316;
  color: #f97316;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  white-space: nowrap;
}
.dash-sub-stats {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.dash-sub-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-sub-stat-label {
  font-size: 0.72rem;
  color: #a1a1aa;
}
.dash-sub-stat-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: #18181b;
}
.dash-sub-action { margin-left: auto; }
.dash-sub-action .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
  white-space: nowrap;
}
.dash-sub-action .btn-primary:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}
.dash-sub-action .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Empty state */
.dash-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  color: #a1a1aa;
  font-size: 0.85rem;
  text-align: center;
  gap: 4px;
}

/* ─── Dashboard responsive ─── */
@media (max-width: 900px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-charts-grid { grid-template-columns: 1fr; }
  .dash-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .dash-kpi-grid { grid-template-columns: 1fr; }
  .dash-header { flex-direction: column; }
  .dash-sub-stats { gap: 16px; }
}

.status-list,
.answer-list,
.notes-list {
  display: grid;
  gap: 10px;
}

.status-pill,
.answer-item,
.note-item {
  padding: 12px 16px;
  border-radius: 8px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
}

.status-pill.ok {
  background: rgba(35, 92, 62, 0.12);
  color: var(--ok);
}

.status-pill.warn {
  background: rgba(129, 89, 18, 0.12);
  color: var(--warn);
}

.answer-item strong,
.note-item strong,
.status-pill strong {
  display: block;
  margin-bottom: 6px;
}

.prompt-box {
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: #18181b;
  color: #e4e4e7;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.faq-item {
  background: #ffffff;
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.faq-list .faq-item {
  width: 100%;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid #e4e4e7;
  box-shadow: none;
  padding: 0;
  background: transparent;
}

.faq-list .faq-item:first-child {
  border-top: 1px solid #e4e4e7;
}

.faq-list .faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  user-select: none;
}

.faq-list .faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 200ms ease;
}

.faq-list .faq-item[open] .faq-chevron {
  transform: rotate(180deg);
}

.faq-list .faq-item p {
  padding: 0 4px 20px;
  margin: 0;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.65;
}

code {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(18, 24, 31, 0.08);
  font-family: Consolas, "Courier New", monospace;
  overflow-wrap: anywhere;
}

.auth-section,
.app-shell {
  display: grid;
  gap: 0;
}

.auth-section {
  padding-top: 50px;
  padding-bottom: 50px;
}

.auth-section .section-intro h2 {
  color: #ffffff;
}

.auth-hub-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 36px;
  border-radius: 14px;
  background: #ffffff;
  color: #2563eb;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #ffffff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-hub-btn:hover {
  background: #f5f7ff;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.auth-section .section-intro p {
  color: rgba(255, 255, 255, 0.8);
}

.auth-section .auth-card {
  background: #ffffff;
  color: var(--ink);
}

.workspace-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.workspace-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.workspace-intro {
  max-width: 58ch;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.final-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px;
  background: #f5f7fa;
}

.auth-grid,
.app-layout,
.overview-grid,
.integration-grid {
  display: grid;
  gap: 18px;
}

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

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.app-topbar-actions,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 0.82rem;
  font-weight: 500;
}

/* --- Dashboard Layout (Botmake-style) --- */
.app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  z-index: 50;
  background: #f4f4f5;
  transition: grid-template-columns 200ms ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 64px 1fr;
}

.app-shell.sidebar-collapsed .app-sidebar {
  width: 64px;
  overflow: hidden;
}

.app-shell.sidebar-collapsed .sidebar-logo {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-logo-mini {
  display: block;
}

.app-shell.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 16px 8px 12px;
}

.app-shell.sidebar-collapsed .sidebar-nav {
  padding: 12px 6px;
}

.app-shell.sidebar-collapsed .sidebar-btn {
  justify-content: center;
  padding: 10px;
  gap: 0;
}

.app-shell.sidebar-collapsed .sidebar-btn span {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-btn svg {
  opacity: 0.8;
}

/* collapsed toggle rotation handled in .topbar-collapse-btn */

.app-layout {
  display: contents;
}

/* Top bar */
.app-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  background: #ffffff;
  border-bottom: 1px solid #e4e4e7;
  flex-shrink: 0;
  min-height: 56px;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  color: #18181b;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.topbar-meta {
  font-size: 0.82rem;
  color: #71717a;
}

.topbar-plan strong {
  color: var(--accent);
}

/* Stacked stat blocks (Balance / Plan) */
.topbar-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.2;
}
.topbar-stat-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: #a1a1aa;
  text-transform: none;
  letter-spacing: 0.01em;
}
.topbar-stat-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #18181b;
}
#topbar-balance {
  color: #22c55e;
}
.topbar-stat--link {
  color: inherit;
}
.topbar-stat--link:hover .topbar-stat-value {
  color: var(--accent);
}
.topbar-stat--link .topbar-stat-value {
  color: var(--accent);
  font-weight: 600;
}

/* Topbar referral CTA */
.topbar-refer-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  color: #2563eb;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.topbar-refer-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}
.topbar-refer-btn:active { transform: translateY(0); }
.topbar-refer-btn svg { flex-shrink: 0; }

/* Floating toast for referral copy confirmation */
.refer-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translate(-50%, -12px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.25);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.refer-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.refer-toast svg { color: #22c55e; flex-shrink: 0; }

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e4e4e7;
  border-radius: 50%;
  background: #ffffff;
  color: #71717a;
  cursor: pointer;
  transition: background 150ms;
  overflow: hidden;
  padding: 0;
}

.topbar-icon-btn:hover {
  background: #f4f4f5;
}

.topbar-user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-menu-wrap {
  position: relative;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
  padding: 6px;
  z-index: 200;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: none;
  border-radius: 7px;
  font-size: .875rem;
  color: #3f3f46;
  cursor: pointer;
  text-align: left;
}

.user-menu-item:hover {
  background: #f4f4f5;
}

.user-menu-logout {
  color: #ef4444;
}

.user-menu-close {
  display: none;
}

.user-menu-overlay {
  display: none;
}

/* Mobile slide-in user menu */
@media (max-width: 900px) {
  .user-menu-dropdown {
    position: fixed;
    top: 0;
    right: -280px;
    bottom: 0;
    width: 260px;
    min-width: auto;
    border-radius: 0;
    border: none;
    border-left: 1px solid #e4e4e7;
    box-shadow: -4px 0 24px rgba(0,0,0,.12);
    padding: 24px 16px;
    z-index: 310;
    transition: right 250ms ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .user-menu-dropdown:not([hidden]) {
    right: 0;
  }
  .user-menu-dropdown[hidden] {
    display: flex;
    right: -280px;
    pointer-events: none;
  }
  .user-menu-item {
    padding: 14px 16px;
    font-size: 1rem;
    gap: 14px;
    border-radius: 10px;
  }
  .user-menu-item svg {
    width: 20px;
    height: 20px;
  }
  .user-menu-divider {
    margin: 8px 0;
  }
  .user-menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    width: 36px;
    height: 36px;
    border: none;
    background: #f4f4f5;
    border-radius: 50%;
    cursor: pointer;
    color: #71717a;
    margin-bottom: 8px;
    flex-shrink: 0;
  }
  .user-menu-close:hover {
    background: #e4e4e7;
    color: #18181b;
  }
  .user-menu-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 300;
  }
  .user-menu-overlay.active {
    display: block;
  }
}

.user-menu-logout:hover {
  background: #fef2f2;
}

.user-menu-divider {
  height: 1px;
  background: #e4e4e7;
  margin: 4px 0;
}

/* Sidebar groups */
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.sidebar-group:last-child,
.sidebar-group-admin {
  margin-bottom: 0;
}
.sidebar-group-admin {
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}
.sidebar-group--bottom {
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

/* Sidebar create agent CTA */
.sidebar-create-agent {
  margin-top: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-create-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px dashed #3b82f6;
  border-radius: 10px;
  background: #eff6ff;
  color: #3b82f6;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
}
.sidebar-create-btn:hover {
  background: #dbeafe;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.sidebar-create-limit {
  font-size: 0.72rem;
  color: #a1a1aa;
  text-align: center;
  font-weight: 500;
}
/* Collapsed sidebar: hide text, show compact */
.app-shell.sidebar-collapsed .sidebar-create-agent {
  padding: 8px 8px;
}
.app-shell.sidebar-collapsed .sidebar-create-btn {
  justify-content: center;
  padding: 10px;
  gap: 0;
}
.app-shell.sidebar-collapsed .sidebar-create-text {
  display: none;
}
.app-shell.sidebar-collapsed .sidebar-create-limit {
  display: none;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #3f3f46;
  padding: 0;
  overflow-y: auto;
  border-right: 1px solid #e4e4e7;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  transition: width 200ms ease;
}

.sidebar-close {
  display: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px 6px;
}

.sidebar-logo {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.sidebar-logo-mini {
  display: none;
  height: 28px;
  width: auto;
}

/* Topbar collapse button */
.topbar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 150ms, color 150ms;
}
.topbar-collapse-btn:hover {
  background: #f4f4f5;
  color: #3f3f46;
}
.topbar-collapse-btn svg {
  transition: transform 200ms ease;
}
.app-shell.sidebar-collapsed .topbar-collapse-btn svg {
  transform: rotate(180deg);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 10px 12px;
  flex: 1;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #71717a;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 150ms, color 150ms;
  min-height: auto;
  box-shadow: none;
}

.sidebar-btn:hover {
  background: #f4f4f5;
  color: #18181b;
  transform: none;
}

.sidebar-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: none;
}

.sidebar-btn svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.sidebar-btn:hover svg {
  opacity: 0.85;
}

.sidebar-btn.active svg {
  opacity: 1;
}

.app-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f4f4f5;
  padding: 28px 32px;
  flex: 1;
  min-width: 0;
}

.app-panel, .dash-container {
  min-width: 0;
  max-width: 100%;
}

.app-panel {
  display: grid;
  gap: 20px;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.app-panel {
  display: grid;
  gap: 18px;
}

/* --- Dashboard overrides for Botmake-style --- */
.app-content .panel-head {
  margin-bottom: 8px;
}
.st-tabs + .panel-head {
  margin: 0;
  padding: 0;
}
.st-tabs + .panel-head .inline-note {
  margin: 2px 0 6px;
}

.app-content .panel-head .eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #71717a;
  margin-bottom: 4px;
}

.app-content .panel-head h3 {
  font-size: 1.1rem;
  font-weight: 400;
  color: #52525b;
  margin: 0;
}

.app-content input,
.app-content textarea,
.app-content select {
  border-radius: 8px;
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  font-size: 0.9rem;
  transition: border-color 150ms;
}

.app-content input:focus,
.app-content textarea:focus,
.app-content select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.app-content label span {
  font-size: 0.85rem;
  font-weight: 500;
  color: #3f3f46;
  margin-bottom: 6px;
}

.app-content .primary-btn,
.app-content .secondary-btn {
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: none;
}

.app-content .primary-btn:hover,
.app-content .secondary-btn:hover {
  transform: none;
  opacity: 0.9;
}

.app-content .secondary-btn {
  background: #ffffff;
  border: 1px solid #e4e4e7;
  color: #3f3f46;
}

.app-content .secondary-btn:hover {
  background: #f4f4f5;
}

.app-content .inline-note {
  font-size: 0.85rem;
  color: #a1a1aa;
}

/* Agents grid */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.agent-create-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 200px;
  padding: 32px 24px;
  border: 2px dashed #d4d4d8;
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 200ms, background 200ms;
  text-align: center;
}

.agent-create-card:hover {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.03);
}

.agent-create-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--accent);
}

.agent-create-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #18181b;
}

.agent-create-sub {
  font-size: 0.82rem;
  color: #a1a1aa;
}

/* Agent card (existing agents) */
.agent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 200ms, box-shadow 200ms, transform 200ms;
}

.agent-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(59,130,246,0.10);
  transform: translateY(-1px);
}

/* Subtle chevron hint in the top-right corner — appears on hover */
.agent-card-edit-hint {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms, transform 180ms, background 150ms, color 150ms;
  pointer-events: none;
}
.agent-card:hover .agent-card-edit-hint {
  opacity: 1;
  transform: translateX(0);
  background: #eff6ff;
  color: #2563eb;
}

/* "Настроить" button — primary action for going into agent settings */
.agent-card-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  transition: all 150ms;
  white-space: nowrap;
  margin-right: auto;
}
.agent-card-settings-btn:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.agent-card-settings-btn svg {
  flex-shrink: 0;
}

/* When name/desc are clicked, indicate they're part of the link */
.agent-card-name,
.agent-card-desc {
  cursor: pointer;
}
.agent-card:hover .agent-card-name {
  color: #1d4ed8;
}

.agent-card-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 600;
  color: #18181b;
}
.agent-card-bot-icon {
  flex-shrink: 0;
  color: #2563eb;
}
.agent-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.agent-card-actions .agent-switch {
  margin-left: auto;
}
.agent-card-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: #3b82f6;
  cursor: pointer;
  transition: all 150ms;
  white-space: nowrap;
}
.agent-card-test-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.agent-card-test-btn svg {
  flex-shrink: 0;
}

.agent-card-desc {
  font-size: 0.85rem;
  color: #71717a;
  line-height: 1.5;
}

.agent-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #a1a1aa;
}

.agent-card-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a1a1aa;
}

.agent-card-status.active::before {
  background: #22c55e;
}

/* ─── Toggle switch ─── */
.agent-switch {
  position: relative;
  display: block;
  width: 40px;
  height: 22px;
  min-width: 40px;
  min-height: 22px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
}
.agent-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.agent-switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #d4d4d8;
  transition: background 200ms;
}
.agent-switch-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 200ms;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.agent-switch input:checked + .agent-switch-slider {
  background: #22c55e;
}
.agent-switch input:checked + .agent-switch-slider::before {
  transform: translateX(18px);
}

.agent-switch.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.agent-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid #f0f0f3;
  border-radius: 10px;
  background: #fafafa;
  transition: border-color 150ms;
}
.agent-doc-row:hover {
  border-color: #d4d4d8;
}
.agent-doc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
  margin-right: 12px;
}
.agent-doc-title {
  font-size: 0.88rem;
  font-weight: 500;
  color: #18181b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-doc-type {
  font-size: 0.75rem;
  color: #a1a1aa;
}

/* Voice picker */
.voice-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 2px solid #f0f0f3;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.voice-option:hover {
  border-color: #d4d4d8;
}
.voice-option.selected {
  border-color: #3b82f6;
  background: #eff6ff;
}
.voice-option-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.voice-option-info strong {
  font-size: 0.88rem;
  color: #18181b;
}
.voice-option-info span {
  font-size: 0.8rem;
  color: #71717a;
}
.voice-preview-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
  flex-shrink: 0;
}
.voice-preview-btn:hover {
  background: #2563eb;
  transform: scale(1.1);
}
.voice-preview-btn:disabled {
  background: #93c5fd;
  cursor: wait;
}

/* Reminders */
.rem-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 2px solid #f0f0f3;
  border-radius: 10px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}
.rem-radio-card:hover {
  border-color: #d4d4d8;
}
.rem-radio-card:has(input:checked) {
  border-color: #3b82f6;
  background: #eff6ff;
}
.rem-radio-card input[type="radio"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
  flex-shrink: 0;
}
.rem-radio-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rem-radio-content strong {
  font-size: 0.88rem;
  color: #18181b;
}
.rem-radio-content span {
  font-size: 0.8rem;
  color: #71717a;
}
.rem-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.rem-check-row span,
.rem-check-row strong {
  font-size: 0.88rem;
  color: #3f3f46;
}

/* Reminder type list (auto-trigger scenarios) */
.rem-types-list {
  display: flex;
  flex-direction: column;
}
.rem-type-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #f4f4f5;
}
.rem-type-item:last-child { border-bottom: none; }

.rem-type-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rem-type-icon--blue   { background: #dbeafe; color: #2563eb; }
.rem-type-icon--green  { background: #dcfce7; color: #16a34a; }
.rem-type-icon--amber  { background: #fef3c7; color: #d97706; }
.rem-type-icon--purple { background: #ede9fe; color: #7c3aed; }
.rem-type-icon--cyan   { background: #cffafe; color: #0891b2; }
.rem-type-icon--rose   { background: #ffe4e6; color: #e11d48; }
.rem-type-icon--indigo { background: #e0e7ff; color: #4f46e5; }
.rem-type-icon--orange { background: #ffedd5; color: #ea580c; }
.rem-type-icon--teal   { background: #ccfbf1; color: #0d9488; }
.rem-type-icon--pink   { background: #fce7f3; color: #db2777; }

.rem-type-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rem-type-body strong {
  font-size: 0.92rem;
  font-weight: 600;
  color: #18181b;
  letter-spacing: -0.005em;
}
.rem-type-body span {
  font-size: 0.82rem;
  color: #71717a;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .rem-type-item {
    gap: 10px;
    padding: 12px 0;
  }
  .rem-type-icon { width: 32px; height: 32px; }
  .rem-type-body strong { font-size: 0.88rem; }
  .rem-type-body span { font-size: 0.78rem; }
}

.agent-card-expired {
  font-size: 0.75rem;
  color: #ef4444;
  font-weight: 500;
}

/* ─── Modal overlay ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(480px, calc(100% - 32px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 24px 16px;
}

.modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #18181b;
}

.modal-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #71717a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 150ms;
}

.modal-close:hover {
  color: #18181b;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px 16px;
}

.modal-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 200ms, box-shadow 200ms;
  text-align: left;
  width: 100%;
}

.modal-option:hover {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-option-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #eff6ff;
}

.modal-option-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-option-text strong {
  font-size: 0.95rem;
  color: #18181b;
}

.modal-option-text span {
  font-size: 0.8rem;
  color: #71717a;
}

.modal-option-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eff6ff;
  color: #3b82f6;
}

.modal-option-badge.badge-green {
  background: #ecfdf5;
  color: #059669;
}

/* Wizard mounted inside the create-agent modal */
.modal-card.modal-wizard-mode {
  width: min(820px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
.modal-card.modal-wizard-mode .modal-wizard {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.modal-wizard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafafa;
}
.modal-wizard-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 6px 12px 6px 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #3f3f46;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, color 150ms;
}
.modal-wizard-back:hover {
  background: #fff;
  border-color: #cbd5e1;
  color: #18181b;
}
.modal-wizard-host {
  overflow-y: auto;
  padding: 18px 22px 22px;
  min-height: 0;
}
/* Inside the modal, the wizard breadcrumb is redundant — hide it */
.modal-wizard-host .wizard-breadcrumb { display: none; }
/* Compact wizard cards in modal so steps fit nicely */
.modal-wizard-host .wizard { padding: 0; max-width: none; }
.modal-wizard-host .wizard-card { box-shadow: none; border: 1px solid #f1f5f9; }
.modal-wizard-host .wizard-nav { padding-bottom: 4px; }
@media (max-width: 640px) {
  .modal-card.modal-wizard-mode { width: calc(100% - 16px); max-height: calc(100vh - 24px); }
  .modal-wizard-host { padding: 14px; }
}

@media (max-width: 480px) {
  .modal-header { padding: 18px 18px 12px; }
  .modal-title { font-size: 1.05rem; }
  .modal-body { padding: 0 18px 14px; gap: 10px; }
  .modal-option {
    display: grid;
    grid-template-columns: 36px 1fr;
    grid-template-rows: auto auto;
    gap: 4px 10px;
    padding: 12px;
  }
  .modal-option-icon {
    grid-row: 1 / 3;
    width: 36px; height: 36px; border-radius: 8px;
    align-self: center;
  }
  .modal-option-icon svg { width: 20px; height: 20px; }
  .modal-option-badge {
    grid-column: 2; grid-row: 1;
    justify-self: start;
    font-size: 0.6rem; padding: 2px 6px;
  }
  .modal-option-text {
    grid-column: 2; grid-row: 2;
  }
  .modal-option-text strong { font-size: 0.9rem; }
  .modal-option-text span { font-size: 0.75rem; }
  .modal-footer { padding: 8px 18px 16px; }
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 24px 20px;
}

.modal-cancel {
  background: none;
  border: none;
  font-size: 0.9rem;
  color: #71717a;
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 8px;
  transition: background 150ms, color 150ms;
}

.modal-cancel:hover {
  background: #f4f4f5;
  color: #18181b;
}

/* ─── Agent settings page ─── */
.agent-settings {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 24px;
}

.agent-breadcrumb {
  display: none;
}

.agent-settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.agent-breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px 0 10px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #3f3f46;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}

.agent-breadcrumb-back svg {
  flex-shrink: 0;
}

.agent-breadcrumb-back:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.agent-settings-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #18181b;
}

.agent-settings-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #71717a;
}

/* Name row */
.agent-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
}

.agent-avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.agent-name-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-weight: 600;
  color: #18181b;
  background: transparent;
  padding: 8px 4px;
}

.agent-name-input::placeholder {
  color: #a1a1aa;
  font-weight: 400;
}

.agent-delete-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}

.agent-delete-btn:hover {
  background: #fef2f2;
  border-color: #f87171;
}

/* ─── Tabs ─── */
.agent-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e4e4e7;
  margin-bottom: 20px;
  overflow-x: auto;
  flex-wrap: wrap;
}

.agent-tab {
  position: relative;
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: #71717a;
  cursor: pointer;
  white-space: nowrap;
  transition: color 150ms;
}

.agent-tab:hover {
  color: #18181b;
}

.agent-tab.active {
  color: #3b82f6;
  font-weight: 600;
}

.agent-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
  border-radius: 2px 2px 0 0;
}

.agent-tab-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agent-tab-content[hidden] {
  display: none !important;
}

/* ─── Accordion ─── */
.accordion {
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.accordion-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: background 150ms;
}

.accordion-toggle:hover {
  background: #fafafa;
}

.accordion-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
}
.accordion-icon svg {
  display: block;
}

.accordion-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.accordion-label strong {
  font-size: 0.9rem;
  color: #18181b;
}

.accordion-label span {
  font-size: 0.78rem;
  color: #a1a1aa;
}

.accordion-arrow {
  flex-shrink: 0;
  color: #a1a1aa;
  transition: transform 200ms;
}

.accordion.open .accordion-arrow {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 16px 16px;
}

.accordion-body[hidden] {
  display: none !important;
}

.accordion-body textarea,
.accordion-body input,
.accordion-body select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #18181b;
  background: #fafafa;
  transition: border-color 150ms;
  resize: vertical;
}

.accordion-body textarea:focus,
.accordion-body input:focus,
.accordion-body select:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

.accordion-body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.accordion-body label:last-child {
  margin-bottom: 0;
}

.accordion-body label > span {
  font-size: 0.82rem;
  font-weight: 500;
  color: #52525b;
}

.accordion-placeholder {
  font-size: 0.85rem;
  color: #a1a1aa;
  margin: 0;
  padding: 4px 0;
}

/* ─── Agent editor: model & temperature ─── */
.agent-slider-group {
  margin: 16px 0;
}

.agent-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: #18181b;
}

.agent-slider-value {
  font-weight: 600;
  color: var(--accent);
  min-width: 36px;
  text-align: right;
}

.agent-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-slider-label {
  font-size: 0.78rem;
  color: #a1a1aa;
  white-space: nowrap;
}

.agent-range {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--accent) var(--range-pct, 50%), #e4e4e7 var(--range-pct, 50%));
  outline: none;
  cursor: pointer;
}

.agent-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.agent-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: #a1a1aa;
  margin-top: 4px;
  line-height: 1.4;
}

/* ─── Bottom action bar ─── */
.agent-action-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 0 0;
  margin-top: 8px;
}

.agent-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}

.agent-save-btn:hover {
  background: #2563eb;
}

.agent-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  color: #18181b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, border-color 150ms;
}

.agent-test-btn:hover {
  background: #f4f4f5;
  border-color: #d4d4d8;
}

/* ─── Testing Chat ─── */
.app-panel--no-pad {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  overflow: hidden;
}

.tc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #e4e4e7;
  background: #fff;
  flex-shrink: 0;
}

.tc-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-agent-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f97316, #fb923c);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tc-agent-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tc-agent-label {
  font-size: 0.75rem;
  color: #a1a1aa;
}

.tc-agent-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tc-agent-select {
  border: none;
  background: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #18181b;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.tc-agent-select:focus {
  outline: none;
}

.tc-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tc-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
}

.tc-status.connected {
  color: #059669;
  background: #ecfdf5;
}

/* Layout: chat + sidebar */
.tc-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.tc-chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #e4e4e7;
}

.tc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tc-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #71717a;
}

.tc-empty-state h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #18181b;
}

.tc-empty-state p {
  margin: 6px 0 0;
  font-size: 0.85rem;
}

/* Chat bubbles */
.tc-msg {
  display: flex;
  gap: 10px;
  max-width: 80%;
}

.tc-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.tc-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tc-msg--user .tc-msg-avatar {
  background: #eff6ff;
  color: #3b82f6;
}

.tc-msg--agent .tc-msg-avatar {
  background: #fff7ed;
  color: #f97316;
}

.tc-msg-bubble {
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.tc-msg--user .tc-msg-bubble {
  background: #3b82f6;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.tc-msg--agent .tc-msg-bubble {
  background: #f4f4f5;
  color: #18181b;
  border-bottom-left-radius: 4px;
}

/* Input area */
.tc-input-area {
  padding: 12px 20px 16px;
  border-top: 1px solid #e4e4e7;
  background: #fff;
  flex-shrink: 0;
}

.tc-input-wrap {
  display: flex;
  align-items: flex-end;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  padding: 4px 4px 4px 14px;
  transition: border-color 150ms;
}

.tc-input-wrap:focus-within {
  border-color: #3b82f6;
}

.tc-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-family: inherit;
  color: #18181b;
  resize: none;
  padding: 8px 0;
  max-height: 120px;
  line-height: 1.4;
}

.tc-input::placeholder {
  color: #a1a1aa;
}

.tc-input-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.tc-attach-btn,
.tc-send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: none;
  color: #a1a1aa;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}

.tc-attach-btn:hover {
  background: #f4f4f5;
  color: #71717a;
}

.tc-send-btn {
  color: #3b82f6;
}

.tc-send-btn:hover {
  background: #eff6ff;
}

.tc-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.75rem;
  color: #a1a1aa;
}

.tc-char-count {
  font-variant-numeric: tabular-nums;
}

/* Right sidebar */
.tc-sidebar {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tc-sidebar-section {
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
}

.tc-sidebar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tc-sidebar-status {
  font-size: 0.78rem;
  color: #71717a;
  flex: 1;
}

.tc-sidebar-btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
  color: #71717a;
  cursor: pointer;
  transition: background 150ms;
}

.tc-sidebar-btn-icon:hover {
  background: #f4f4f5;
}

.tc-sidebar-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
  color: #18181b;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
}

.tc-sidebar-save-btn:hover {
  background: #f4f4f5;
}

.tc-sidebar-link {
  border: none;
  background: none;
  font-size: 0.78rem;
  color: #3b82f6;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tc-sidebar-link--danger {
  color: #dc2626;
}

/* Collapsible panels */
.tc-sidebar-panel {
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  overflow: hidden;
}

.tc-sidebar-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #18181b;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tc-sidebar-panel-head::-webkit-details-marker {
  display: none;
}

.tc-sidebar-panel-head::after {
  content: '';
  width: 16px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 200ms;
  flex-shrink: 0;
}

.tc-sidebar-panel[open] > .tc-sidebar-panel-head::after {
  transform: rotate(180deg);
}

.tc-sidebar-panel-meta {
  font-size: 0.75rem;
  font-weight: 400;
  color: #a1a1aa;
  margin-left: auto;
  margin-right: 8px;
}

.tc-sidebar-panel-body {
  padding: 0 12px 10px;
}

.tc-param-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tc-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  background: #f4f4f5;
  font-size: 0.75rem;
  color: #52525b;
}

@media (max-width: 760px) {
  .tc-sidebar {
    display: none;
  }
  .tc-chat-area {
    border-right: none;
  }
}

/* ─── Knowledge Base ─── */
.kb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

/* Knowledge base onboarding/storage card */
.kb-onboard-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  padding: 18px 22px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 14px;
}
.kb-onboard-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  grid-column: 1;
}
.kb-onboard-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kb-onboard-text { flex: 1; min-width: 0; }
.kb-onboard-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: #18181b;
}
.kb-onboard-desc {
  margin: 0;
  font-size: 0.85rem;
  color: #52525b;
  line-height: 1.5;
}

.kb-storage-block {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(191, 219, 254, 0.6);
  border-radius: 10px;
}
.kb-storage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: #52525b;
}
.kb-storage-title {
  font-weight: 600;
  color: #18181b;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kb-plan-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1.5px solid #f97316;
  color: #f97316;
  background: #fff;
}
.kb-storage-counts {
  font-variant-numeric: tabular-nums;
}
.kb-storage-counts strong {
  color: #18181b;
  font-weight: 600;
}
.kb-storage-bar-wrap {
  height: 8px;
  background: rgba(191, 219, 254, 0.5);
  border-radius: 999px;
  overflow: hidden;
}
.kb-storage-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  border-radius: 999px;
  transition: width 400ms ease, background 200ms ease;
}
.kb-storage-bar.is-warn { background: linear-gradient(90deg, #f59e0b, #f97316); }
.kb-storage-bar.is-full { background: linear-gradient(90deg, #ef4444, #dc2626); }
.kb-storage-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.72rem;
  color: #71717a;
}
.kb-storage-meta span:first-child {
  font-weight: 500;
  color: #52525b;
}

.kb-onboard-types {
  grid-column: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.kb-type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 500;
  color: #52525b;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(191, 219, 254, 0.6);
  border-radius: 999px;
}
.kb-type-chip svg {
  flex-shrink: 0;
  color: #3b82f6;
}

@media (max-width: 760px) {
  .kb-onboard-card {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }
  .kb-onboard-main,
  .kb-storage-block,
  .kb-onboard-types { grid-column: 1; }
  .kb-onboard-types { justify-content: flex-start; }
  .kb-onboard-title { font-size: 0.95rem; }
  .kb-onboard-desc { font-size: 0.82rem; }
  .kb-storage-meta { font-size: 0.7rem; }
}

.kb-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #18181b;
}

.kb-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #71717a;
}

.kb-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.kb-search-wrap {
  position: relative;
}

.kb-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #a1a1aa;
  pointer-events: none;
}

.kb-search {
  padding: 9px 12px 9px 36px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #18181b;
  background: #fff;
  width: 260px;
  transition: border-color 150ms;
}

.kb-search:focus {
  outline: none;
  border-color: #3b82f6;
}

.kb-new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
  white-space: nowrap;
}

.kb-new-btn:hover {
  background: #2563eb;
}

.kb-file-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #3f3f46;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
  white-space: nowrap;
}
.kb-file-upload-btn:hover {
  border-color: #3b82f6;
  background: #f0f7ff;
}
.kb-file-upload-btn:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.kb-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kb-empty {
  padding: 40px 24px;
  text-align: center;
  color: #71717a;
  font-size: 0.9rem;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
}

.kb-space-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 200ms, box-shadow 200ms;
}

.kb-space-card:hover {
  border-color: #d4d4d8;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kb-space-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #18181b;
}

.kb-space-card-desc {
  font-size: 0.82rem;
  color: #71717a;
  margin-top: 2px;
}

.kb-space-card-meta {
  font-size: 0.78rem;
  color: #a1a1aa;
  white-space: nowrap;
}

/* KB edit page */
.kb-edit-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #a1a1aa;
  margin-bottom: 20px;
}

.kb-edit-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #71717a;
  cursor: pointer;
  transition: background 150ms;
}

.kb-edit-back:hover {
  background: #f4f4f5;
}

.kb-breadcrumb-link {
  color: #71717a;
  cursor: pointer;
}

.kb-breadcrumb-link:hover {
  color: #18181b;
}

.kb-breadcrumb-current {
  color: #18181b;
  font-weight: 500;
}

.kb-edit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.kb-edit-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: #18181b;
}

.kb-edit-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #71717a;
}

.kb-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 10px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
  white-space: nowrap;
}

.kb-save-btn:hover {
  background: #2563eb;
}

.kb-edit-card {
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.kb-edit-card-header {
  display: flex;
  gap: 12px;
  padding: 24px 24px 16px;
}

.kb-edit-card-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.kb-edit-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #18181b;
}

.kb-edit-card-sub {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #71717a;
  line-height: 1.5;
}

.kb-edit-card-body {
  padding: 0 24px 24px;
}

.kb-field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #18181b;
  margin-bottom: 16px;
}

.kb-field-input,
.kb-field-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #18181b;
  background: #fff;
  transition: border-color 150ms;
  resize: vertical;
}

.kb-field-input:focus,
.kb-field-textarea:focus {
  outline: none;
  border-color: #3b82f6;
}

.kb-sources-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #18181b;
  margin: 20px 0 12px;
}

.kb-sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.kb-source-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
}

.kb-source-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kb-source-info {
  display: flex;
  gap: 10px;
}

.kb-source-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.kb-source-info strong {
  display: block;
  font-size: 0.88rem;
  color: #18181b;
}

.kb-source-info span {
  display: block;
  font-size: 0.78rem;
  color: #71717a;
  margin-top: 2px;
}

.kb-source-configure {
  padding: 6px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
  color: #18181b;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 150ms;
  align-self: flex-start;
}

.kb-source-configure:hover {
  background: #f4f4f5;
}

.kb-edit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid #e4e4e7;
  font-size: 0.8rem;
  color: #a1a1aa;
}

@media (max-width: 600px) {
  .kb-header {
    flex-direction: column;
  }
  .kb-search {
    width: 100%;
  }
  .kb-sources-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Wizard ─── */
.wizard {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 0 40px;
}

.wizard-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #a1a1aa;
  margin-bottom: 24px;
}

.wizard-breadcrumb-current {
  color: #18181b;
  font-weight: 500;
}

.wizard-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wizard-step-label {
  font-size: 0.82rem;
  color: #71717a;
}

.wizard-step-percent {
  font-size: 0.82rem;
  color: #71717a;
}

.wizard-bar {
  height: 4px;
  background: #e4e4e7;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 28px;
}

.wizard-bar-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 2px;
  transition: width 300ms ease;
}

.wizard-step[hidden] {
  display: none !important;
}

.wizard-step:not([hidden]) {
  display: block !important;
}

.wizard-card {
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.wizard-card-header {
  display: flex;
  gap: 14px;
  padding: 24px 24px 16px;
}

.wizard-card-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.wizard-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #18181b;
}

.wizard-card-sub {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: #71717a;
  line-height: 1.5;
}

.wizard-card-body {
  padding: 0 24px 24px;
}

.wizard-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #18181b;
  margin-bottom: 16px;
}

.wizard-label:last-child {
  margin-bottom: 0;
}

.wizard-label-static {
  margin: 0;
  font-size: 0.88rem;
  color: #18181b;
}

.wizard-sub-static {
  margin: 2px 0 10px;
  font-size: 0.82rem;
  color: #a1a1aa;
}

.wizard-input,
.wizard-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: #18181b;
  background: #fafafa;
  transition: border-color 150ms;
  resize: vertical;
}

.wizard-input:focus,
.wizard-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

.wizard-textarea.wizard-mono {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  background: #f9fafb;
}

.wizard-hint {
  font-size: 0.8rem;
  color: #a1a1aa;
  margin: 8px 0 0;
  line-height: 1.5;
}

/* Tone / channel cards */
.wizard-tone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wizard-tone-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 200ms, box-shadow 200ms;
}

.wizard-tone-card:hover {
  border-color: #d4d4d8;
}

.wizard-tone-card.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #f0f7ff;
}

.wizard-tone-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.wizard-tone-card strong {
  font-size: 0.9rem;
  color: #18181b;
}

.wizard-tone-card span {
  font-size: 0.8rem;
  color: #71717a;
}

/* Wizard language selector */
.wizard-lang-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}
.wizard-lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: border-color 200ms, box-shadow 200ms;
}
.wizard-lang-card:hover {
  border-color: #d4d4d8;
}
.wizard-lang-card.selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: #f0f7ff;
}
.wizard-lang-flag {
  font-size: 1.5rem;
  line-height: 1;
}
.wizard-lang-card strong {
  font-size: 0.82rem;
  color: #18181b;
}

/* Wizard channel selector */
.wizard-channels-section {
  margin-top: 8px;
}

.wizard-channels-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wizard-channel-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: #3f3f46;
  transition: border-color 200ms, background 200ms;
}

.wizard-channel-chip:hover {
  border-color: #d4d4d8;
}

.wizard-channel-chip.selected {
  border-color: #3b82f6;
  background: #f0f7ff;
  color: #1d4ed8;
}

.wizard-channel-chip input[type="checkbox"] {
  accent-color: #3b82f6;
  width: 16px;
  height: 16px;
}

.wizard-tone-card[data-tone="custom"] {
  grid-column: 1 / -1;
}

/* Info block */
.wizard-info-block {
  padding: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
}

.wizard-info-block strong {
  font-size: 0.9rem;
  color: #18181b;
}

.wizard-info-block p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #71717a;
  line-height: 1.5;
}

/* Checkbox */
.wizard-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-top: 12px;
  border-radius: 10px;
  background: #ecfdf5;
  cursor: pointer;
  font-size: 0.88rem;
  color: #065f46;
  font-weight: 500;
}

.wizard-checkbox input[type="checkbox"] {
  accent-color: #10b981;
  width: 18px;
  height: 18px;
}

/* Sliders */
.wizard-slider-group {
  margin-bottom: 20px;
}

.wizard-slider-group:last-child {
  margin-bottom: 0;
}

.wizard-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wizard-range {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #3b82f6 var(--range-pct, 40%), #e4e4e7 var(--range-pct, 40%));
  outline: none;
}

.wizard-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #3b82f6;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.wizard-range-value {
  font-size: 0.88rem;
  font-weight: 600;
  color: #18181b;
  min-width: 36px;
  text-align: right;
}

/* Toggle switch */
.wizard-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.wizard-toggle {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  min-width: 44px;
  min-height: 24px;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.wizard-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.wizard-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: #d4d4d8;
  transition: background 200ms;
}

.wizard-toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 200ms;
}

.wizard-toggle input:checked + .wizard-toggle-slider {
  background: #3b82f6;
}

.wizard-toggle input:checked + .wizard-toggle-slider::after {
  transform: translateX(20px);
}

/* Summary blocks */
.wizard-summary-block {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f4f4f5;
}

.wizard-summary-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.wizard-summary-block h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #18181b;
}

.wizard-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  margin-top: 12px;
}

.wizard-summary-item {
  padding: 10px 0;
}

.wizard-summary-item.wiz-sum-wide {
  grid-column: 1 / -1;
}

.wizard-summary-item:last-child {
  padding-bottom: 0;
}

.wizard-summary-item .wiz-sum-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin-bottom: 2px;
}

.wizard-summary-item .wiz-sum-value {
  font-size: 0.88rem;
  color: #18181b;
  white-space: pre-wrap;
}

/* Navigation */
.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
}

.wizard-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wizard-back-btn {
  padding: 10px 20px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  color: #18181b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
}

.wizard-back-btn:hover {
  background: #f4f4f5;
}

.wizard-next-btn,
.wizard-create-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}

.wizard-next-btn:hover,
.wizard-create-btn:hover {
  background: #2563eb;
}

.wizard-improve-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  color: #18181b;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
}

.wizard-improve-btn:hover {
  background: #f4f4f5;
}

@media (max-width: 600px) {
  .wizard-tone-grid {
    grid-template-columns: 1fr;
  }
  .wizard-lang-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Agent editor (legacy) */
.agent-editor-header {
  display: none;
}

.agent-editor-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #18181b;
  margin: 0;
}

.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #ffffff;
  color: #3f3f46;
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-overlay {
  display: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stat-grid .dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.big-inline {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
}

.toggle-row input {
  width: 18px;
  height: 18px;
}

.document-list,
.test-generation-list {
  display: grid;
  gap: 12px;
}

.funnel-stage-grid {
  display: grid;
  gap: 16px;
}

.funnel-overview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.funnel-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.funnel-overview-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: #52525b;
  font-size: 0.85rem;
}

.funnel-stage-stack {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 6px 0 2px;
}

.funnel-stage-step {
  width: min(100%, var(--funnel-width));
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 16px 28px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #ffffff;
  clip-path: polygon(5% 0, 95% 0, 100% 100%, 0 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.funnel-stage-step strong {
  font-size: 1rem;
}

.funnel-stage-step span {
  color: var(--muted);
  font-size: 0.9rem;
}

.funnel-stage-step-index {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(18, 24, 31, 0.52);
}

.document-item,
.integration-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
}

/* ── Channels page (Botmake-style) ── */

.ch-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.ch-stat-card {
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #fff;
}

.ch-stat-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #18181b;
  margin-bottom: 2px;
}

.ch-stat-sub {
  font-size: 0.82rem;
  color: #71717a;
  margin-bottom: 14px;
}

.ch-stat-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}

.ch-stat-big {
  font-size: 1.7rem;
  font-weight: 800;
  color: #3b82f6;
}

.ch-stat-total {
  font-size: 0.92rem;
  color: #a1a1aa;
  font-weight: 500;
}

.ch-progress {
  height: 6px;
  border-radius: 3px;
  background: #f4f4f5;
  overflow: hidden;
  margin-bottom: 6px;
}

.ch-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: #3b82f6;
  transition: width 0.4s ease;
}

.ch-stat-hint {
  font-size: 0.82rem;
  color: #a1a1aa;
}

.ch-top-bars {
  margin-top: 8px;
}

.ch-top-bar-track {
  height: 18px;
  border-radius: 4px;
  background: #f4f4f5;
  overflow: hidden;
  display: flex;
  margin-bottom: 8px;
}

.ch-top-bar-fill {
  height: 100%;
  border-radius: 4px 0 0 4px;
  transition: width 0.4s ease;
}

.ch-top-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #52525b;
}

.ch-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ch-section-head {
  margin-bottom: 16px;
}

.ch-section-head h4 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #18181b;
}

.ch-section-head .inline-note {
  margin: 0;
}

.ch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.ch-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #e4e4e7;
  background: #fff;
  gap: 10px;
  transition: box-shadow 0.15s ease;
}

.ch-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.ch-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ch-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.ch-card-icon.whatsapp { background: #dcfce7; color: #16a34a; }
.ch-card-icon.telegram { background: #dbeafe; color: #2563eb; }
.ch-card-icon.webchat { background: #f3f4f6; color: #6b7280; }
.ch-card-icon.instagram { background: #fce7f3; color: #db2777; }
.ch-card-icon.wazzup { background: #fef3c7; color: #d97706; }
.ch-card-icon.facebook { background: #e0e7ff; color: #1877f2; }
.ch-card-icon.wechat   { background: #dcfce7; color: #07c160; }

/* Coming-soon channel cards: muted, non-interactive */
.ch-card.ch-card-soon {
  background: #fafafa;
  border-color: #ececef;
  opacity: 0.78;
  filter: grayscale(0.25);
  cursor: not-allowed;
}
.ch-card.ch-card-soon:hover {
  opacity: 0.92;
  filter: grayscale(0);
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.ch-card-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.ch-card-status.disconnected {
  background: #fef2f2;
  color: #dc2626;
}

.ch-card-status.connected {
  background: #f0fdf4;
  color: #16a34a;
}

.ch-card-status.soon {
  background: #f9fafb;
  color: #9ca3af;
}

.ch-card-status .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.ch-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #18181b;
  margin: 0;
}

.ch-card-desc {
  font-size: 0.84rem;
  color: #71717a;
  line-height: 1.45;
  margin: 0;
}

.ch-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #a1a1aa;
}

.ch-card-note {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.4;
}

.ch-card-note.warning {
  background: #fffbeb;
  color: #b45309;
}

.ch-card-note.info {
  background: #f0f9ff;
  color: #0369a1;
}

.ch-card-actions {
  margin-top: auto;
  padding-top: 4px;
}

.ch-connect-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  color: #3b82f6;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ch-connect-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.ch-connect-btn.primary {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}

.ch-connect-btn.primary:hover {
  background: #ea580c;
}

.ch-connect-btn.blue {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.ch-connect-btn.blue:hover {
  background: #2563eb;
}

.ch-connect-btn.green {
  background: #22c55e;
  border-color: #22c55e;
  color: #fff;
}

.ch-connect-btn.green:hover {
  background: #16a34a;
}

.ch-connect-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ch-card form.ch-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.ch-form label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.82rem;
  color: #52525b;
  font-weight: 500;
}

.ch-form input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  font-size: 0.88rem;
  min-width: 0;
  outline: none;
  transition: border-color 0.15s;
}

.ch-form input:focus {
  border-color: #3b82f6;
}

.ch-disconnect-btn {
  font-size: 0.82rem;
  color: #dc2626;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.ch-disconnect-btn:hover {
  color: #b91c1c;
}

.ch-info-footer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ch-info-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

.ch-info-footer strong {
  font-size: 0.9rem;
  color: #18181b;
}

.ch-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ch-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.ch-badge-green {
  background: #dcfce7;
  color: #15803d;
}

.ch-badge-orange {
  background: #ffedd5;
  color: #c2410c;
}

/* Legacy (keep for backward compat) */
.integration-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.integration-card {
  display: grid;
  min-width: 0;
}

.integration-card > div {
  min-width: 0;
}

.integration-card .inline-note {
  overflow-wrap: anywhere;
}

.integration-card .quick-actions,
.integration-card form {
  margin-top: 18px;
}

.integration-card form {
  max-width: 100%;
}

.integration-card input {
  min-width: 0;
}

.test-generation-card {
  display: grid;
  gap: 16px;
}

.test-generation-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.test-generation-head div {
  display: grid;
  gap: 4px;
}

.test-generation-head > * {
  min-width: 0;
}

.test-generation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.test-generation-head span,
.test-message span {
  color: var(--muted);
  font-size: 0.82rem;
}

.test-message-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.test-history-list {
  display: grid;
  gap: 10px;
}

.test-followup-form {
  display: grid;
  gap: 10px;
}

.test-message {
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
}

.test-message.outbound {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.test-message p {
  margin: 8px 0 0;
  line-height: 1.55;
}

/* ─── Admin Panel: compact, data-dense ─── */

.adm-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.adm-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  font-family: inherit;
}

.adm-tab:hover {
  color: var(--ink);
}

.adm-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.adm-tab svg {
  opacity: 0.6;
}

.adm-tab.is-active svg {
  opacity: 1;
}

.adm-tab-panel {
  display: block;
}

.adm-tab-panel[hidden] {
  display: none;
}

/* Charts grid */
.adm-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.adm-chart-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px 12px;
}

.adm-chart-card h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 600;
}

.adm-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
}

.adm-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.adm-chart-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height .3s;
}

.adm-chart-bar-label {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

.adm-chart-bar-value {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
}

/* Pie / donut style breakdown */
.adm-breakdown {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.adm-breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.adm-breakdown-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.adm-breakdown-label {
  flex: 1;
  color: var(--ink);
}

.adm-breakdown-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.adm-breakdown-pct {
  font-size: 11px;
  color: var(--muted);
  min-width: 36px;
  text-align: right;
}

.adm-chart-card--wide {
  grid-column: 1 / -1;
}

.adm-global-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.adm-gs {
  flex: 1 1 120px;
  min-width: 100px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.adm-gs-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.adm-gs-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.adm-trend {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.adm-trend--up {
  color: #16a34a;
}
.adm-trend--down {
  color: #ef4444;
}

.adm-gs-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 2px;
}

.adm-gs-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.adm-gs-sub span {
  color: var(--ink);
  font-weight: 500;
}

/* Period pills — standalone pills, active gets white pill with border */
.adm-period-bar {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 14px;
}

.adm-period-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.adm-period-btn:hover {
  color: #475569;
  background: #f8fafc;
}

.adm-period-btn.is-active {
  background: #fff;
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.adm-search-bar {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}

.adm-search-input {
  width: 100%;
  padding: 7px 10px 7px 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7' stroke='%239ca3af' stroke-width='2'/%3E%3Cpath d='M20 20l-4-4' stroke='%239ca3af' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") 10px center no-repeat;
  transition: border-color .15s;
}
.adm-search-input:focus {
  border-color: var(--accent);
}

.adm-user-count {
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  padding: 4px 2px 6px;
  font-variant-numeric: tabular-nums;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 2px;
}
.adm-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 5px 8px;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
  user-select: none;
}
.adm-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  vertical-align: middle;
}
.adm-table tbody tr {
  cursor: pointer;
  transition: background .1s;
}
.adm-table tbody tr:hover {
  background: #f9fafb;
}
.adm-table tbody tr.adm-row-active {
  background: rgba(37, 99, 235, 0.06);
}
.adm-table tbody tr.adm-row-active td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

/* Status dot badges */
.adm-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}
.adm-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.adm-status--active::before { background: #22c55e; }
.adm-status--paused::before { background: #eab308; }
.adm-status--expired::before { background: #ef4444; }

.adm-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
}
.adm-role-badge--admin {
  background: #dbeafe;
  color: #1d4ed8;
}
.adm-role-badge--owner {
  background: #f3f4f6;
  color: #6b7280;
}

/* User card wrapper — single white container for detail + form */
.adm-user-card-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

/* Detail panel (top of card) */
.adm-detail {
  min-width: 0;
  padding: 16px 16px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.adm-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 4px;
  border-bottom: none;
  margin-bottom: 0;
}
.adm-detail-right {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.adm-detail-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-detail-badges {
  display: flex;
  align-items: center;
  gap: 8px;
}
.adm-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: 1px;
}
.adm-detail-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.adm-detail-email {
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.adm-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 0;
  margin-top: 8px;
}
.adm-stat {
  display: flex;
  flex-direction: column;
  padding: 2px 0;
  min-width: 60px;
}
.adm-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #b0b5bd;
  font-weight: 400;
  line-height: 1.2;
}
.adm-stat-value {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.adm-stat-value--mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
}

/* Form tabs */
.adm-form-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 12px;
}
.adm-form-tab {
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.adm-form-tab:hover {
  color: var(--ink);
}
.adm-form-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.adm-form-panel {
  padding: 0 4px 8px;
}

/* Compact form grid */
.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
}
.adm-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.adm-field-full {
  grid-column: 1 / -1;
}
.adm-section-body > .adm-field-full {
  margin-top: 8px;
}
.adm-form-panel > .adm-field-full {
  margin-top: 10px;
}
.adm-form-panel > .adm-form-grid + .adm-field-full,
.adm-form-panel > .adm-field-full + .adm-field-full {
  margin-top: 12px;
}
.adm-form .adm-label,
.adm-label {
  font-size: 9px;
  font-weight: 400;
  color: #b0b5bd;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0;
}
.adm-form-grid input,
.adm-form-grid select,
.adm-field-full input,
.adm-field-full textarea {
  padding: 5px 7px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.adm-form-grid input:focus,
.adm-form-grid select:focus,
.adm-field-full input:focus,
.adm-field-full textarea:focus {
  border-color: var(--accent);
}
.adm-field-full textarea {
  resize: vertical;
  min-height: 48px;
}

.adm-toggle-row {
  padding: 0;
  font-size: 13px;
}
.adm-toggle-cell {
  justify-content: flex-end;
}
.adm-toggle-cell .adm-toggle-row {
  padding: 4px 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

.adm-actions {
  display: flex;
  gap: 8px;
  padding: 12px 0 4px;
  justify-content: flex-end;
}
.adm-btn-sm {
  padding: 6px 18px !important;
  font-size: 13px !important;
  border-radius: 6px !important;
}

/* Storage info */
.adm-storage-info {
  padding: 8px 0 12px;
  border-bottom: 1px solid #f0f0f2;
  margin-bottom: 8px;
}
.adm-storage-stats {
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}
.adm-storage-bar-wrap {
  height: 6px;
  background: #f0f0f2;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.adm-storage-bar {
  height: 100%;
  border-radius: 3px;
  transition: width .3s;
}
.adm-storage-label {
  font-size: 11px;
  color: var(--muted);
}

/* Compact lists for integrations/documents */
.adm-compact-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}
.adm-compact-list .adm-li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px solid #f3f4f6;
}
.adm-compact-list .adm-li:last-child {
  border-bottom: none;
}
.adm-compact-list .adm-li-name {
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adm-compact-list .adm-li-meta {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
  white-space: nowrap;
}
.adm-compact-list .adm-li-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.adm-li-dot--connected { background: #22c55e; }
.adm-li-dot--not_connected { background: #d1d5db; }

.adm-placeholder {
  color: var(--muted);
  font-size: 13px;
  padding: 16px 0;
}

.adm-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 16px 16px;
}

/* ─── Admin Panel: Mobile responsive ─── */
@media (max-width: 760px) {
  /* Constrain content width on mobile */
  .app-content {
    padding: 16px 12px;
    min-width: 0;
    overflow-x: hidden;
  }
  .adm-tab-panel,
  .adm-user-card-wrap {
    min-width: 0;
    max-width: 100%;
  }

  /* Tabs: smaller and scrollable */
  .adm-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 14px;
  }
  .adm-tabs::-webkit-scrollbar { display: none; }
  .adm-tab {
    padding: 8px 12px;
    font-size: 12px;
    flex-shrink: 0;
  }

  /* Period bar: wrap and shrink */
  .adm-period-bar {
    flex-wrap: wrap;
    margin-bottom: 12px;
  }
  .adm-period-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
    flex: 0 0 auto;
  }

  /* Global stats: 2 columns on mobile */
  .adm-global-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 14px;
  }
  .adm-gs {
    flex: none;
    min-width: 0;
    padding: 8px 10px;
  }
  .adm-gs-value {
    font-size: 18px;
  }
  .adm-gs-head {
    flex-wrap: wrap;
    gap: 4px;
  }
  .adm-trend {
    font-size: 10px;
  }
  .adm-gs-label {
    font-size: 9px;
  }
  .adm-gs-sub {
    font-size: 10px;
  }

  /* Charts: stack vertically */
  .adm-charts {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .adm-chart-card {
    padding: 10px;
  }

  /* Search bar */
  .adm-search-bar {
    padding: 12px;
  }

  /* Table: horizontal scroll */
  .adm-search-bar {
    overflow: hidden;
  }
  .adm-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
  }
  .adm-table {
    font-size: 12px;
    min-width: 520px;
  }
  .adm-table th,
  .adm-table td {
    padding: 5px 6px;
    max-width: 160px;
  }

  /* User detail card */
  .adm-detail {
    padding: 14px 12px 10px;
  }
  .adm-detail-header {
    gap: 10px;
    padding: 6px 0 4px;
  }
  .adm-avatar {
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
  .adm-detail-header h4 {
    font-size: 14px;
  }
  .adm-detail-name-row {
    flex-wrap: wrap;
    gap: 6px 10px;
  }
  .adm-stats-row {
    gap: 4px 10px;
    margin-top: 6px;
    width: 100%;
  }
  .adm-stat {
    min-width: 0;
    flex: 0 1 auto;
  }
  .adm-stat-value {
    font-size: 13px;
  }

  /* Form tabs: scrollable */
  .adm-form-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .adm-form-tabs::-webkit-scrollbar { display: none; }
  .adm-form-tab {
    padding: 7px 12px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Form */
  .adm-form {
    padding: 6px 12px 14px;
  }
  .adm-form-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Action buttons */
  .adm-actions {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 0 4px;
  }
  .adm-btn-sm {
    flex: 1 1 auto;
    min-width: 130px;
  }

  /* Storage info */
  .adm-storage-stats {
    flex-wrap: wrap;
    gap: 6px 14px;
  }
}

@media (max-width: 480px) {
  /* Smallest screens: 1 column for stats too */
  .adm-global-stats {
    grid-template-columns: 1fr 1fr;
  }
  .adm-detail-name-row h4 {
    flex: 1 1 100%;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "actions"
      "nav";
    border-radius: 28px;
  }

  .main-nav,
  .header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .main-nav {
    border-top: none;
    padding-top: 0;
  }
}

@media (max-width: 1120px) {
  .hero-main,
  .pricing-layout,
  .pricing-grid,
  .workspace-layout,
  .feature-grid,
  .alt-section .timeline,
  .split-section .value-grid,
  .faq-grid,
  .market-grid,
  .signal-row,
  .dashboard-grid,
  .auth-grid,
  .app-layout,
  .adm-form-grid,
  .funnel-stage-grid,
  .overview-grid,
  .integration-grid,
  .ch-stats-row,
  .ch-grid,
  .stat-grid,
  .test-message-grid {
    grid-template-columns: 1fr;
  }

  .app-shell,
  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-shell.sidebar-collapsed .app-sidebar {
    width: 240px;
    position: fixed;
    left: -260px;
  }

  .app-sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 240px;
    z-index: 900;
    transition: left 250ms ease;
  }

  .app-sidebar.open,
  .app-shell.sidebar-collapsed .app-sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.12);
  }
  /* When sidebar is open on mobile, show full version even if collapsed */
  .app-sidebar.open .sidebar-logo { display: block; }
  .app-sidebar.open .sidebar-logo-mini { display: none; }
  .app-sidebar.open .sidebar-btn { justify-content: flex-start; padding: 10px 12px; gap: 10px; }
  .app-sidebar.open .sidebar-btn span { display: inline; }
  .app-sidebar.open .sidebar-nav { padding: 12px; }
  .app-sidebar.open .sidebar-brand { justify-content: flex-start; padding: 20px 16px 16px; }
  .app-sidebar.open .sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,.15);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    margin-left: auto;
    flex-shrink: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 899;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .app-content {
    padding: 20px 16px;
  }

  /* sidebar collapse toggle moved to topbar */

  .topbar-meta {
    display: none;
  }

  .agents-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    position: relative;
    width: 100%;
    max-width: 100vw;
    padding: 0 16px 64px;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  main > * {
    min-width: 0;
    max-width: 100%;
  }

  #public-shell {
    overflow: visible;
  }

  .page-shell {
    overflow-x: hidden;
  }

  .hero-main {
    left: auto !important;
    width: auto !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }

  .auth-section {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
  }

  /* Audience section mobile */
  .audience-tabs {
    gap: 6px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .audience-tabs::-webkit-scrollbar {
    display: none;
  }

  .audience-tab {
    font-size: 0.8rem;
    padding: 8px 14px;
    flex-shrink: 0;
  }

  .case-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .case-image {
    min-height: 200px;
    max-height: 220px;
  }

  .case-content {
    padding: 20px 18px;
    order: 0;
  }

  .case-content h3 {
    font-size: 1.15rem;
  }

  .case-metrics {
    flex-direction: column;
    gap: 14px;
  }

  .case-metric {
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }

  .case-metric-value {
    font-size: 1.25rem;
    min-width: 70px;
  }

  .case-metric-label {
    max-width: none;
  }

  .niche-table-wrap {
    margin-left: -16px;
    margin-right: -16px;
    padding: 0 16px;
  }

  .niche-table {
    font-size: 0.78rem;
    min-width: 560px;
  }

  .niche-table th,
  .niche-table td {
    padding: 10px 12px;
  }

  .feature-card,
  .timeline-step,
  .value-card,
  .pricing-card,
  .panel,
  .faq-item,
  .market-strip {
    border-radius: 16px;
  }

  .section-intro {
    text-align: center;
    padding: 0 8px;
    max-width: 100%;
  }

  .section-intro h2 {
    /* В мобильной версии тот же стиль Montserrat 900, чуть меньше размером */
    font-size: clamp(1.87rem, 8.14vw, 2.64rem);
    text-align: center;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .section-intro p {
    text-align: center;
  }

  .heading-nowrap {
    white-space: normal;
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 18px 24px;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand . toggle";
    gap: 0;
    background: transparent;
  }

  .site-header.is-scrolled {
    left: 0;
    right: 0;
    top: 0;
    border-radius: 0;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  .site-header.is-scrolled .brand-logo {
    filter: none;
    height: 29px;
  }

  .site-header.is-scrolled .mobile-menu-toggle span {
    background: #111;
  }


  .site-header.is-menu-open {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }

  .site-header.is-menu-open .mobile-menu-toggle span {
    background: #111;
  }

  .brand-logo {
    height: 29px;
  }


  .main-nav {
    display: none;
  }

  .header-actions {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-column: 1 / -1;
    padding: 16px 4px 24px;
    animation: slideDown 240ms ease;
  }

  .mobile-menu[hidden] {
    display: none;
  }

  .mobile-menu a {
    color: #111;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 14px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-transform: none;
    letter-spacing: normal;
  }

  .mobile-menu__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    padding: 0 !important;
    border-bottom: none !important;
  }

  .mobile-menu__actions a {
    text-align: center;
    padding: 14px 20px !important;
    font-size: 1rem;
  }

  .site-header .mobile-menu__actions .ghost-btn {
    background: transparent;
    border: 2px solid #2563eb;
    color: #2563eb;
    border-radius: 999px;
    box-shadow: none;
  }

  .site-header .mobile-menu__actions .ghost-btn:hover {
    background: rgba(37, 99, 235, 0.06);
  }

  .site-header .mobile-menu__actions .primary-btn.inline-btn {
    background: #2563eb;
    color: #fff;
    border: 2px solid #2563eb;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  }

  .site-header .mobile-menu__actions .primary-btn.inline-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .funnel-overview-bar {
    align-items: flex-start;
  }

  .funnel-stage-step {
    width: 100%;
    padding: 14px 18px;
    clip-path: polygon(3% 0, 97% 0, 100% 100%, 0 100%);
  }

  .workspace-hero,
  .final-cta,
  .conversation-meta,
  .document-item,
  .integration-card {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Mobile topbar — stay horizontal, compact */
  .app-topbar {
    padding: 8px 12px;
    gap: 8px;
    min-height: 48px;
    flex-wrap: wrap;
  }
  .topbar-title {
    font-size: 0.9rem;
  }
  .topbar-right {
    gap: 10px;
  }
  .topbar-stat-label {
    font-size: 0.62rem;
  }
  .topbar-stat-value {
    font-size: 0.78rem;
  }
  .topbar-refer-btn {
    height: 30px;
    padding: 0 8px;
  }
  .topbar-refer-btn span { display: none; }

  /* Prevent content overflow on mobile */
  .app-content {
    padding: 16px 12px;
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
  }
  .app-main {
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .app-panel,
  .dash-container {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .dash-container {
    padding: 0;
  }
  .dash-header {
    gap: 10px;
    margin-bottom: 16px;
  }
  .dash-title {
    font-size: 1.25rem;
  }
  .dash-period-selector {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dash-period-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  .dash-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .dash-card,
  .dash-sub-card {
    overflow: hidden;
    min-width: 0;
  }
  /* Bar chart: horizontal scroll on mobile */
  .dash-chart-card {
    padding: 16px 12px;
    overflow: hidden;
  }
  .dash-bar-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    gap: 4px;
    padding-bottom: 4px;
  }
  .dash-bar-col {
    min-width: 28px;
    flex: 0 0 28px;
  }
  .dash-bar-stack {
    max-width: 24px;
  }
  /* Bottom grid: ensure no overflow */
  .dash-bottom-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dashboard-card {
    min-width: 0;
    overflow: hidden;
  }
  .dash-sub-row {
    gap: 8px;
  }
  .dash-sub-badge {
    font-size: 0.65rem;
    padding: 3px 10px;
  }
  .dash-sub-stats {
    gap: 16px;
  }
  .dash-sub-upgrade-btn {
    font-size: 0.8rem;
    padding: 8px 16px;
    white-space: nowrap;
  }

  main {
    gap: 0;
  }

  .hero-main {
    width: auto;
    left: auto;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    min-height: 100vh;
    min-height: 100svh;
    padding-top: 0;
    padding-bottom: 0;
    background-size: cover;
    background-position: 65% bottom;
    background-repeat: no-repeat;
    background-color: #181c20;
  }

  .hero-main__content {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 100px 24px 28px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
  }

  .hero-main__actions {
    margin-top: 24px;
  }

  .hero-main__badges {
    position: static;
    left: auto;
    bottom: auto;
    margin-top: 20px;
    padding-top: 0;
  }

  .hero-main__chat {
    position: relative;
    transform: none;
    width: 80%;
    max-width: 80%;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    margin: 18px auto 0;
    align-self: center;
    padding: 0;
    gap: 7px;
    height: 180px;
  }

  .chat-message {
    font-size: 0.65rem;
    padding: 8px 10px;
    max-width: 88%;
    border-radius: 16px;
    gap: 6px;
  }

  .chat-message--in {
    border-bottom-left-radius: 4px;
  }

  .chat-message--out {
    border-bottom-right-radius: 4px;
  }

  .chat-message__cta {
    font-size: 0.6rem;
    padding: 5px 10px;
    border-radius: 10px;
  }

  .hero-main__content {
    justify-content: flex-start;
  }

  .hero-main__badges {
    position: static;
    left: auto;
    bottom: auto;
    margin-top: 20px;
  }

  .hero-main__subtitle {
    max-width: 100%;
    overflow-wrap: break-word;
    margin-top: 16px;
  }

  .hero-main__title {
    max-width: 100%;
  }

  .hero-main__title {
    font-size: clamp(2.53rem, 11.5vw, 3.91rem);
  }

  .hero-main__subtitle {
    font-size: 1rem;
  }

  .hero-main__cta {
    font-size: 0.82rem;
    padding: 12px 24px;
    min-height: 44px;
  }

  .hero-main__badges {
    position: static;
    left: auto;
    bottom: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px 14px;
    margin-top: 18px;
    padding-top: 0;
    border-top: none;
  }

  .hero-main__badge {
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
  }

  .hero-main__badge svg {
    width: 13px;
    height: 13px;
    opacity: 0.7;
  }

  .hero-main__rating {
    font-size: 0.78rem;
    font-weight: 800;
    color: #fff;
  }

  .hero-main__overlay {
    background: linear-gradient(
      180deg,
      rgba(10, 10, 12, 0.78) 0%,
      rgba(10, 10, 12, 0.6) 50%,
      rgba(10, 10, 12, 0.3) 100%
    );
  }

  .section {
    padding: 50px 0 24px;
    gap: 24px;
  }

  .section-intro {
    text-align: left;
  }

  h1 {
    font-size: clamp(2.2rem, 10vw, 3.4rem);
  }

  h2 {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
  }

  .feature-card,
  .timeline-step,
  .value-card,
  .pricing-card,
  .faq-item,
  .panel {
    padding: 20px;
  }

  .price-row strong {
    font-size: 1.6rem;
  }

  .price-row-enterprise strong {
    font-size: 1.3rem;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .stage-topline,
  .result-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-line.user {
    margin-left: 18px;
  }

  .result-row strong,
  .result-row a {
    text-align: left;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-copy {
    max-width: 100%;
  }
}

/* ── Tablet header (761–980px) ──────────────────────────────────────────────
   Below the desktop breakpoint the full nav + actions don't fit on one row
   and produce a 3-stack layout (logo / actions / nav). Same hamburger
   pattern as mobile, but kept above 760px so iPad-portrait / small-laptop
   widths get the clean compact header instead of the broken stack.        */
@media (min-width: 761px) and (max-width: 980px) {
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand . toggle";
    gap: 0;
    padding: 16px 28px;
    background: transparent;
    border-radius: 0;
  }
  .site-header.is-scrolled {
    left: 0;
    right: 0;
    top: 0;
    border-radius: 0;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  .site-header.is-scrolled .brand-logo { filter: none; height: 30px; }
  .site-header.is-scrolled .mobile-menu-toggle span { background: #111; }
  .site-header.is-menu-open {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  .site-header.is-menu-open .mobile-menu-toggle span { background: #111; }

  .brand-logo { height: 30px; }
  .main-nav { display: none; }
  .header-actions { display: none; }
  .mobile-menu-toggle { display: flex; }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    grid-column: 1 / -1;
    padding: 16px 4px 24px;
    animation: slideDown 240ms ease;
  }
  .mobile-menu[hidden] { display: none; }
  .mobile-menu a {
    color: #111;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 14px 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    text-transform: none;
    letter-spacing: normal;
  }
  .mobile-menu__actions {
    display: flex;
    flex-direction: row;     /* on tablets we have room for side-by-side */
    gap: 12px;
    margin-top: 16px;
    padding: 0 !important;
    border-bottom: none !important;
  }
  .mobile-menu__actions a {
    flex: 1;
    text-align: center;
    padding: 14px 20px !important;
    font-size: 0.95rem;
  }
  .site-header .mobile-menu__actions .ghost-btn {
    background: transparent;
    border: 2px solid #2563eb;
    color: #2563eb;
    border-radius: 999px;
    box-shadow: none;
  }
  .site-header .mobile-menu__actions .ghost-btn:hover { background: rgba(37, 99, 235, 0.06); }
  .site-header .mobile-menu__actions .primary-btn.inline-btn {
    background: #2563eb;
    color: #fff;
    border: 2px solid #2563eb;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  }
  .site-header .mobile-menu__actions .primary-btn.inline-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
  }
}

/* --- Footer --- */
.site-footer {
  margin-top: 60px;
  padding: 60px 0 30px;
  border-top: 1px solid #e5e7eb;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-logo {
  width: 208px;
  height: auto;
  object-fit: contain;
  margin-bottom: -8px;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 300px;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--ink);
}

.footer-col a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 150ms;
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-copy {
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ══════════════════════════════════════════════
   Settings page (Botmake-style tabs)
   ══════════════════════════════════════════════ */

.st-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e4e4e7;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.st-tab {
  position: relative;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #71717a;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.st-tab:hover {
  color: #18181b;
}

.st-tab.active {
  color: #3b82f6;
  font-weight: 600;
}

.st-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #3b82f6;
  border-radius: 2px 2px 0 0;
}

.st-pane {
  animation: stFadeIn 0.2s ease;
}

@keyframes stFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.st-card {
  padding: 24px 28px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #fff;
  margin-bottom: 16px;
}

.st-card-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #18181b;
}

.st-card-sub {
  margin: 0 0 18px;
  font-size: 0.85rem;
  color: #71717a;
}

.st-avatar-row {
  margin-bottom: 20px;
}

.st-profile-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 4px;
}
.st-profile-header .st-avatar {
  flex-shrink: 0;
  margin-top: 18px;
}
.st-profile-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
/* Align fields below avatar row with the text fields */
.st-profile-header ~ .st-form-row,
.st-profile-header ~ .st-field {
  margin-left: 120px;
}

.st-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #f4f4f5;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #e4e4e7;
  position: relative;
  overflow: hidden;
}
.st-avatar img,
.st-avatar svg.st-avatar-illustration {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.st-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.st-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.st-field > span:first-child {
  font-size: 0.85rem;
  font-weight: 500;
  color: #52525b;
}

.st-field input,
.st-field select,
.st-field textarea {
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  color: #18181b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.st-field input:focus,
.st-field select:focus,
.st-field textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.st-field input:disabled {
  background: #f9fafb;
  color: #a1a1aa;
}

.st-field-half {
  max-width: 360px;
}

.st-hint {
  font-size: 0.82rem;
  color: #a1a1aa;
  margin: 0;
}

.st-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.st-form-row--3col {
  grid-template-columns: 1fr 1fr 1fr;
}

.st-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.st-actions-spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.st-btn-primary {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.st-btn-primary:hover {
  background: #2563eb;
}

.st-btn-sm {
  padding: 8px 16px;
  font-size: 0.84rem;
}

.st-btn-full {
  width: 100%;
  margin-top: 10px;
}

.st-btn-ghost {
  padding: 10px 22px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  color: #52525b;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.st-btn-ghost:hover {
  background: #f4f4f5;
}

.st-btn-danger {
  padding: 8px 18px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.st-btn-danger:hover {
  background: #fef2f2;
}

.st-link {
  font-size: 0.88rem;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.st-link:hover {
  text-decoration: underline;
}

/* Tariff banner */
.st-tariff-banner {
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.st-tariff-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin-bottom: 6px;
  display: block;
}

.st-tariff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* Invite row */
.st-invite-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.st-invite-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.9rem;
  outline: none;
}

.st-invite-row input:focus {
  border-color: #3b82f6;
}

/* Team list */
.st-team-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.st-team-member {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f4f4f5;
}

.st-team-member:last-child {
  border-bottom: none;
}

.st-team-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  flex-shrink: 0;
}

.st-team-info {
  flex: 1;
  min-width: 0;
}

.st-team-info strong {
  font-size: 0.9rem;
  display: block;
}

.st-team-info span {
  font-size: 0.82rem;
  color: #a1a1aa;
}

.st-team-role {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #71717a;
}

.st-team-role button {
  background: none;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
}

/* Danger zone */
.st-danger-card {
  border-color: #fecaca;
  background: #fef2f2;
}

.st-danger-title {
  color: #dc2626;
}

.st-danger-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0 0;
}

/* Toggle items */
.st-toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f4f4f5;
}

.st-toggle-item:last-of-type {
  border-bottom: none;
}

.st-switch {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  min-width: 44px;
  min-height: 24px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
  padding: 0;
}

.st-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

.st-switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 24px;
  background: #d4d4d8;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.st-switch-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.st-switch input:checked + .st-switch-slider {
  background: #3b82f6;
}

.st-switch input:checked + .st-switch-slider::before {
  transform: translateX(20px);
}

/* Checkbox row */
.st-checkbox-row {
  padding: 14px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

.st-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #52525b;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Sessions */
.st-sessions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.st-session-item {
  padding: 12px 0;
  border-bottom: 1px solid #f4f4f5;
}

.st-session-skeleton {
  height: 18px;
  background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* API Keys Table */
.st-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 480px;
}

.st-table th {
  text-align: left;
  font-weight: 600;
  color: #71717a;
  font-size: 0.82rem;
  padding: 10px 12px;
  border-bottom: 1px solid #e4e4e7;
}

.st-table td {
  padding: 12px;
  border-bottom: 1px solid #f4f4f5;
  color: #3f3f46;
}

.st-table-empty {
  text-align: center;
  color: #a1a1aa;
  padding: 28px 12px !important;
}

/* Plan page */
.st-plan-top {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.st-plan-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #fff;
}

.st-plan-card-icon {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.st-plan-card-label {
  font-size: 0.82rem;
  color: #71717a;
  margin-bottom: 4px;
}

.st-plan-card-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #18181b;
  margin-bottom: 4px;
}

.st-plan-name {
  color: #3b82f6;
}

.st-plan-card-meta {
  font-size: 0.82rem;
  color: #71717a;
  margin-bottom: 8px;
}

.st-plan-days {
  display: inline-block;
  padding: 1px 8px;
  background: #dbeafe;
  color: #2563eb;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

.st-plan-progress {
  height: 5px;
  border-radius: 3px;
  background: #f4f4f5;
  overflow: hidden;
  margin-bottom: 4px;
}

.st-plan-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: #3b82f6;
}

.st-plan-alert {
  font-size: 0.82rem;
  color: #d97706;
  margin-bottom: 4px;
}

.st-plan-sub-tabs {
  display: flex;
  border-bottom: 1px solid #e4e4e7;
  margin-bottom: 20px;
}

.st-plan-sub {
  padding: 10px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #71717a;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.st-plan-sub.active {
  color: #18181b;
  border-bottom-color: #3b82f6;
}

/* Pricing grid */
.st-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.st-pricing-card {
  padding: 24px;
  border-radius: 12px;
  border: 1px solid #e4e4e7;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.st-pricing-card .st-btn-full {
  margin-top: auto;
}

.st-pricing-card h5 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
}

.st-pricing-current {
  border-color: #bfdbfe;
  background: #f8fafc;
}

.st-pricing-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: #18181b;
  margin: 12px 0 4px;
}

.st-pricing-features {
  list-style: none;
  padding: 0;
  margin: 14px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
  color: #52525b;
}

.st-pricing-features li {
  line-height: 1.45;
}

.st-pricing-models {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e4e4e7;
}

.st-pricing-models-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #a1a1aa;
  margin-bottom: 8px;
  display: block;
}

.st-pricing-model-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #52525b;
  padding: 3px 0;
}

/* Responsive */
@media (max-width: 900px) {
  .st-plan-top,
  .st-pricing-grid {
    grid-template-columns: 1fr;
  }

  .st-form-row {
    grid-template-columns: 1fr;
  }

  .st-tabs {
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
    border-bottom: none;
    padding: 4px 0 8px;
  }
  .st-tab {
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f4f4f5;
    color: #52525b;
    border-bottom: none;
  }
  .st-tab:hover {
    background: #e4e4e7;
  }
  .st-tab.active {
    background: #3b82f6;
    color: #fff;
  }
  .st-tab.active::after {
    display: none;
  }

  /* Plan sub-tabs: pill style on mobile */
  .st-plan-sub-tabs {
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: none;
    margin-bottom: 14px;
  }
  .st-plan-sub {
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 20px;
    background: #f4f4f5;
    color: #52525b;
    border-bottom: none;
  }
  .st-plan-sub:hover {
    background: #e4e4e7;
  }
  .st-plan-sub.active {
    background: #3b82f6;
    color: #fff;
    border-bottom-color: transparent;
  }

  .st-pane {
    max-width: 100%;
    overflow-x: hidden;
  }
  .st-card-sub {
    word-break: break-word;
  }

  .st-card {
    padding: 18px 16px;
    border-radius: 10px;
  }

  /* Profile: avatar above, fields full-width */
  .st-profile-header {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .st-profile-header .st-avatar {
    margin-top: 0;
  }
  .st-profile-fields {
    width: 100%;
  }
  .st-profile-header ~ .st-form-row,
  .st-profile-header ~ .st-field {
    margin-left: 0;
  }

  .st-danger-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .st-tariff-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Chat / Dialogs two-panel layout ── */
.chat-layout {
  display: flex;
  height: calc(100vh - 200px);
  min-height: 480px;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

/* ── Dialogs top toolbar (filters + qualification settings) ── */
.dlg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  padding: 14px 18px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  align-items: center;
}
.dlg-filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dlg-filter-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}
.dlg-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.dlg-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  height: 30px;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  background: #ffffff;
  color: #52525b;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dlg-pill:hover {
  border-color: #cbd5e1;
  color: #18181b;
}
.dlg-pill.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
  font-weight: 600;
}
.dlg-pill svg { flex-shrink: 0; }

/* Count badge inside each pill */
.dlg-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  margin-left: 2px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.dlg-pill.active .dlg-pill-count {
  background: #dbeafe;
  color: #1d4ed8;
}
.dlg-pill-count--zero {
  background: transparent;
  color: #cbd5e1;
  font-weight: 600;
}
.dlg-pill.active .dlg-pill-count--zero {
  background: transparent;
  color: #93c5fd;
}

.dlg-qual-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dlg-qual-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}

/* ── Lead-stage colour tokens ── */
.dlg-stage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dlg-stage-dot.stage-new      { background: #94a3b8; }
.dlg-stage-dot.stage-cold     { background: #3b82f6; }
.dlg-stage-dot.stage-warm     { background: #f59e0b; }
.dlg-stage-dot.stage-hot      { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.dlg-stage-dot.stage-customer { background: #10b981; }

.chat-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.chat-stage-badge.stage-new      { background: #f1f5f9; color: #64748b; }
.chat-stage-badge.stage-cold     { background: #dbeafe; color: #1d4ed8; }
.chat-stage-badge.stage-warm     { background: #fef3c7; color: #b45309; }
.chat-stage-badge.stage-hot      { background: #fee2e2; color: #b91c1c; }
.chat-stage-badge.stage-customer { background: #d1fae5; color: #047857; }

/* ── Auto-qualification modal ── */
.dlg-qual-modal {
  max-width: 640px;
  width: calc(100vw - 32px);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}
.dlg-qual-master {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  margin-bottom: 18px;
}
.dlg-qual-stages,
.dlg-qual-settings {
  margin-bottom: 18px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
  padding-top: 16px;
}
.dlg-qual-stage-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed #f1f5f9;
}
.dlg-qual-stage-row:last-child { border-bottom: none; }
.dlg-qual-stage-row > .dlg-stage-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
}
.dlg-qual-stage-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dlg-qual-stage-body strong {
  font-size: 0.92rem;
  color: #18181b;
}
.dlg-qual-input {
  margin-top: 6px;
  width: 100%;
  font-size: 0.85rem;
}

.dlg-qual-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
}

/* ── Dialogs onboarding (no agents / channels / convs) ── */
.dlg-onboarding {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 880px;
  margin: 0 auto;
}
.dlg-onb-hero {
  text-align: center;
  margin-bottom: 28px;
}
.dlg-onb-hero-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.25);
}
.dlg-onb-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.015em;
}
.dlg-onb-sub {
  margin: 0;
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.5;
}

.dlg-onb-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dlg-onb-step {
  display: grid;
  grid-template-columns: 36px 44px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  transition: all 0.18s ease;
  position: relative;
}
.dlg-onb-step.is-active {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border-color: #bfdbfe;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.08);
}
.dlg-onb-step.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.dlg-onb-step.is-locked {
  opacity: 0.55;
}

.dlg-onb-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.dlg-onb-step.is-active .dlg-onb-step-num {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.dlg-onb-step.is-done .dlg-onb-step-num {
  background: #10b981;
  color: #ffffff;
}
.dlg-onb-step.is-done .dlg-onb-step-num::before {
  content: "✓";
  font-size: 1.05rem;
  font-weight: 700;
}
.dlg-onb-step.is-done .dlg-onb-step-num { font-size: 0; }

.dlg-onb-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  color: #2563eb;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dlg-onb-step.is-done .dlg-onb-step-icon { color: #16a34a; border-color: #bbf7d0; }

.dlg-onb-step-body { min-width: 0; }
.dlg-onb-step-body strong {
  display: block;
  font-size: 0.98rem;
  color: #0f172a;
  margin-bottom: 3px;
  letter-spacing: -0.005em;
}
.dlg-onb-step-body p {
  margin: 0;
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.45;
}

.dlg-onb-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.dlg-onb-cta:hover { background: #1d4ed8; }
.dlg-onb-cta:active { transform: scale(0.98); }
.dlg-onb-cta--ghost {
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.dlg-onb-cta--ghost:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.dlg-onb-step.is-locked .dlg-onb-cta { display: none; }
.dlg-onb-step.is-done .dlg-onb-cta { display: none; }

.dlg-onb-status {
  display: none;
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}
.dlg-onb-step.is-done .dlg-onb-status {
  display: block;
  color: #16a34a;
}
.dlg-onb-step.is-done .dlg-onb-status::before { content: "Готово"; }
.dlg-onb-step.is-done .dlg-onb-status { font-size: 0; }
.dlg-onb-step.is-done .dlg-onb-status::before { font-size: 0.7rem; }

.dlg-onb-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}
.dlg-onb-footer-icon {
  flex-shrink: 0;
  color: #94a3b8;
}

@media (max-width: 760px) {
  .dlg-onboarding { padding: 22px 16px; }
  .dlg-onb-title { font-size: 1.15rem; }
  .dlg-onb-step {
    grid-template-columns: 32px 1fr;
    gap: 12px;
    padding: 14px 16px;
  }
  .dlg-onb-step-icon { display: none; }
  .dlg-onb-step-body { grid-column: 2; }
  .dlg-onb-cta {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }
  .dlg-onb-status { position: static; margin-left: auto; }
}

@media (max-width: 760px) {
  .dlg-toolbar {
    padding: 12px;
    gap: 10px;
  }
  .dlg-filter-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  .dlg-qual-btn {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

.chat-sidebar {
  flex: 0 0 340px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e4e4e7;
  background: #fafafa;
}

.chat-sidebar-head {
  padding: 16px;
  border-bottom: 1px solid #e4e4e7;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-search {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.chat-search:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.chat-filters { display: flex; gap: 6px; }
.chat-filter-btn {
  padding: 5px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
  font-family: inherit;
  color: #52525b;
  cursor: pointer;
}
.chat-filter-btn.active { background: #f0f4ff; border-color: #2563eb; color: #2563eb; font-weight: 500; }

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: #a1a1aa;
  font-size: 0.9rem;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f4f4f5;
  transition: background 0.1s;
}
.chat-item:hover { background: #f4f4f5; }
.chat-item.active { background: #eff6ff; border-right: 3px solid #2563eb; }

.chat-item-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e4e4e7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  color: #52525b;
}

.chat-item-body { flex: 1; min-width: 0; }
.chat-item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.chat-item-name { font-weight: 500; font-size: 0.9rem; color: #18181b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-time { font-size: 0.75rem; color: #a1a1aa; flex-shrink: 0; }
.chat-item-preview { font-size: 0.825rem; color: #71717a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Right panel */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
}

.chat-main-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  color: #a1a1aa;
}
.chat-main-empty h4 { color: #52525b; font-size: 1rem; font-weight: 600; }
.chat-main-empty p { font-size: 0.9rem; }

.chat-detail { display: flex; flex-direction: column; height: 100%; }
.chat-detail-head {
  padding: 14px 20px;
  border-bottom: 1px solid #e4e4e7;
  font-weight: 600;
  font-size: 0.95rem;
  color: #18181b;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg.in {
  align-self: flex-start;
  background: #f4f4f5;
  color: #18181b;
  border-bottom-left-radius: 4px;
}
.chat-msg.out {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-time {
  font-size: 0.7rem;
  margin-top: 4px;
  opacity: 0.6;
}

.chat-input-area {
  padding: 12px 20px;
  border-top: 1px solid #e4e4e7;
}
.chat-reply-form {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-reply-form textarea {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 40px;
  max-height: 120px;
}
.chat-reply-form textarea:focus { border-color: #2563eb; }
.chat-send-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-send-btn:hover { background: #1d4ed8; }

@media (max-width: 768px) {
  .chat-layout { flex-direction: column; height: auto; min-height: 60vh; }
  .chat-sidebar { flex: none; max-height: 300px; border-right: none; border-bottom: 1px solid #e4e4e7; }
}

/* QR loading spinner — shown while Green API instance boots (1-2 min) */
.qr-spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  border: 4px solid #e4e4e7;
  border-top-color: #16a34a;
  border-radius: 50%;
  animation: qrSpin 0.9s linear infinite;
}
@keyframes qrSpin {
  to { transform: rotate(360deg); }
}


/* ─── Bio Link (linktr.ee clone) admin panel ─── */
.bio-edit-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1100px) {
  .bio-edit-grid { grid-template-columns: 1fr; }
  .bio-preview-col { order: 1; }
}
@media (max-width: 480px) {
  .bio-edit-grid { gap: 14px; }
  .bio-card { padding: 16px; }
  .bio-card-title { font-size: 0.9rem; margin-bottom: 10px; }
  .bio-username-row { flex-wrap: nowrap; }
  .bio-username-prefix { font-size: 0.82rem; padding: 8px 10px; }
  .bio-username-row .bio-input { padding: 8px 10px; font-size: 0.88rem; }
  .bio-username-suffix { padding: 8px 10px; font-size: 0.78rem; gap: 0; }
  .bio-username-suffix #bio-copy-url-label,
  .bio-username-suffix span { display: none; }
  .bio-image-row { flex-direction: column; }
  .bio-color-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .bio-phone-frame { width: 260px; height: 480px; border-radius: 28px; padding: 10px; }
  .bio-phone-iframe { border-radius: 18px; }
  .bio-actions-row { flex-direction: column; }
  .bio-actions-row .bio-btn-primary,
  .bio-actions-row .bio-btn-secondary { width: 100%; text-align: center; justify-content: center; }
}

.bio-edit-col { display: flex; flex-direction: column; gap: 16px; }

.bio-card {
  padding: 20px 24px;
}
.bio-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 14px;
  color: #18181b;
}

.bio-username-row {
  display: flex;
  align-items: stretch;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.bio-username-prefix {
  padding: 10px 12px;
  background: #f4f4f5;
  color: #71717a;
  font-size: 0.9rem;
  white-space: nowrap;
  border-right: 1px solid #e4e4e7;
  display: flex;
  align-items: center;
}
.bio-username-row .bio-input {
  border: none;
  border-radius: 0;
  flex: 1;
  padding: 10px 12px;
}
.bio-username-suffix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f4f4f5;
  color: #71717a;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  border: none;
  border-left: 1px solid #e4e4e7;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.bio-username-suffix:hover {
  background: #e4e4e7;
  color: #18181b;
}
.bio-username-status {
  margin-top: 8px;
  font-size: 0.83rem;
  font-weight: 500;
  min-height: 18px;
}
.bio-username-status.ok { color: #16a34a; }
.bio-username-status.err { color: #dc2626; }
.bio-username-status.checking { color: #71717a; }

.bio-form-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.bio-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #3f3f46;
}
.bio-label-text { font-size: 0.88rem; font-weight: 500; color: #3f3f46; display: block; margin-bottom: 8px; }

.bio-input {
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  color: #18181b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease;
}
.bio-input:focus { border-color: #3b82f6; }
textarea.bio-input { resize: vertical; min-height: 110px; }

.bio-image-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.bio-image-block { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.bio-image-block:last-child { flex: 1; min-width: 0; }
.bio-image-preview {
  width: 160px;
  height: 160px;
  background: #f4f4f5;
  background-size: cover;
  background-position: center;
  border-radius: 10px;
  border: 1px dashed #d4d4d8;
}
.bio-image-preview--bg { width: 100%; height: 160px; }
.bio-image-actions { display: flex; gap: 8px; align-items: center; }

/* Profile row: avatar on the left, name + bio on the right */
.bio-profile-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 6px;
}
.bio-image-block--avatar {
  flex-shrink: 0;
}
.bio-image-block--avatar .bio-image-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border-style: solid;
  border-width: 3px;
  border-color: #ffffff;
  box-shadow: 0 0 0 1px #e4e4e7;
}
.bio-profile-colors-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.bio-profile-fields {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.bio-image-block--bg-full .bio-image-preview--bg {
  width: 100%;
  height: 140px;
}
.bio-bg-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
@media (max-width: 720px) {
  .bio-profile-row { flex-direction: column; align-items: stretch; }
  .bio-image-block--avatar { align-self: flex-start; }
}

.bio-color-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.bio-color-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #3f3f46;
}
.bio-color-label input[type="color"] {
  width: 42px;
  height: 32px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: #fff;
}
/* Profile card: inline color picker (text color, bg color tucked under bg image) */
.bio-color-label-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #3f3f46;
  margin-top: 12px;
}

/* Background controls group (color + opacity) — inline with Upload/Remove buttons */
.bio-image-actions--bg {
  flex-wrap: wrap;
  width: 100%;
}
.bio-bg-inline-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bio-inline-field--compact {
  padding: 0;
  gap: 6px;
}

/* Compact inline field — small label + control on one row, no fill background */
.bio-inline-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: #475569;
}
.bio-inline-field input[type="color"] {
  width: 36px;
  height: 26px;
  border: 1px solid #e4e4e7;
  border-radius: 5px;
  cursor: pointer;
  padding: 2px;
  background: #fff;
  flex-shrink: 0;
}

/* Avatar border colour: combined swatch + on/off toggle. When the field is
   in the "no outline" state, the colour input is visually replaced by a
   crossed-out circle and the toggle flips from "×" to "+" so the user can
   restore the previously picked colour. */
.bio-color-with-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bio-color-swatch-wrap {
  position: relative;
  display: inline-flex;
  width: 36px;
  height: 26px;
  flex-shrink: 0;
}
.bio-color-swatch-wrap input[type="color"] {
  width: 100%;
  height: 100%;
}
.bio-color-disabled-mark {
  position: absolute;
  inset: 0;
  display: none;
  border: 1px solid #d4d4d8;
  border-radius: 5px;
  background: #fff;
  pointer-events: none;
}
.bio-color-disabled-mark::before,
.bio-color-disabled-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border: 1.5px solid #b0b5bd;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.bio-color-disabled-mark::after {
  width: 26px;
  height: 0;
  border: 0;
  border-top: 1.5px solid #ef4444;
  border-radius: 0;
  transform: translate(-50%, -50%) rotate(-45deg);
}
.bio-color-toggle {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e4e4e7;
  border-radius: 50%;
  background: #fff;
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  font-weight: 500;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bio-color-toggle:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.bio-avatar-border-field.is-disabled .bio-color-swatch-wrap input[type="color"] {
  pointer-events: none;
  opacity: 0;
}
.bio-avatar-border-field.is-disabled .bio-color-disabled-mark {
  display: block;
}
.bio-avatar-border-field.is-disabled .bio-color-toggle {
  color: #16a34a;
  border-color: #bbf7d0;
}
.bio-avatar-border-field.is-disabled .bio-color-toggle:hover {
  background: #f0fdf4;
}
.app-content select.bio-inline-select,
.bio-inline-select {
  box-sizing: border-box;
  display: inline-block;
  vertical-align: middle;
  height: 30px;
  width: 80px;
  flex-shrink: 0;
  padding: 0 22px 0 10px;
  margin: 0;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background-color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 28px;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 9px 9px;
}
.bio-inline-field--standalone {
  margin-left: auto;
  margin-top: 6px;
  width: auto;
  justify-content: flex-end;
  gap: 8px;
  padding: 0;
}

/* Empty-state CTA inside the Links card — shown when no links exist yet.
   Same primary button as elsewhere; just promoted to the main action. */
.bio-empty-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Buttons design section at bottom of Links & Tabs card */
.bio-buttons-style-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bio-buttons-style-section .bio-color-grid {
  margin-bottom: 0;
}
.bio-buttons-style-section .bio-button-style-row {
  border-top: none;
  padding-top: 0;
}

/* Background opacity slider — full-width row inside the color grid */
.bio-color-label-wide {
  grid-column: 1 / -1;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.bio-opacity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.bio-opacity-value {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  font-weight: 600;
  color: #2563eb;
  min-width: 38px;
  text-align: right;
}
.bio-opacity-range {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 22px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}
.bio-opacity-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e0e7ff 0%, #2563eb 100%);
}
.bio-opacity-range::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #e0e7ff 0%, #2563eb 100%);
}
.bio-opacity-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
  margin-top: -6px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}
.bio-opacity-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}
.bio-opacity-hint {
  font-size: 0.74rem;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.35;
  padding: 0 2px;
}

.bio-button-style-row { padding-top: 8px; border-top: 1px solid #f4f4f5; }
.bio-button-style-options { display: flex; gap: 8px; flex-wrap: wrap; }
.bio-style-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #f4f4f5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}
.bio-style-opt input[type="radio"] { margin: 0; }
.bio-style-opt input[type="radio"]:checked + span { color: #3b82f6; font-weight: 600; }

.bio-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  color: #18181b;
}
.bio-toggle input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #3b82f6; }

.bio-links-list,
.bio-items-list { display: flex; flex-direction: column; gap: 10px; }
/* Stacked rows inside each link card:
   row 1 — group selector + link type
   row 2 — подпись + ссылка
   row 3 — подзаголовок (опционально)
   The × delete button is absolutely positioned in the top-right corner.
   Left padding leaves room for the absolute drag handle. */
.bio-link-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 38px 10px 30px;
  background: #f9fafb;
  border-radius: 10px;
  border: 1px solid #e4e4e7;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.bio-link-item.is-dragging {
  opacity: 0.45;
  border-style: dashed;
}
/* Drop indicator: a thin coloured edge tells the user where the dragged
   row will land. We use box-shadow rather than borders so the layout
   doesn't shift while hovering. */
.bio-link-item.drop-before {
  box-shadow: 0 -3px 0 0 #3b82f6;
}
.bio-link-item.drop-after {
  box-shadow: 0 3px 0 0 #3b82f6;
}
.bio-drag-handle {
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  color: #94a3b8;
  font-size: 0.95rem;
  letter-spacing: -2px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 6px;
}
.bio-drag-handle:hover { color: #475569; background: rgba(148, 163, 184, 0.12); }
.bio-drag-handle:active { cursor: grabbing; }
.bio-link-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.bio-link-row > select,
.bio-link-row > input {
  flex: 1;
  min-width: 0;
}
/* Labelled field column: small grey label sits flush above the control */
.bio-link-field {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* Small, light slate field label — sits flush above the control with no
   bottom gap. Slightly lighter than .bio-stat-label so it recedes more. */
.bio-link-field-label {
  font-size: 0.68rem;
  font-weight: 400;
  color: #94a3b8;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.2;
  padding-left: 2px;
  margin: 0;
}
.bio-link-field > select,
.bio-link-field > input {
  width: 100%;
}
.bio-link-item select, .bio-link-item input {
  padding: 8px 10px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  font-size: 0.88rem;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.bio-link-item select:focus, .bio-link-item input:focus { border-color: #3b82f6; }
/* Subtitle row — slightly muted to signal "secondary description" */
.bio-link-row--sub input {
  font-size: 0.82rem;
  color: #475569;
  background: #fff;
}
.bio-link-row--sub input::placeholder {
  color: #94a3b8;
  font-style: italic;
}
.bio-link-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.bio-link-remove:hover { background: #fecaca; }
@media (max-width: 720px) {
  .bio-link-row { flex-direction: column; align-items: stretch; }
}

.bio-actions-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}
.bio-btn-primary {
  padding: 11px 22px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}
.bio-btn-primary:hover { background: #2563eb; }
.bio-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.bio-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  background: #fff;
  color: #18181b;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s ease;
}
.bio-btn-secondary:hover { background: #f4f4f5; }
.bio-btn-text {
  padding: 0;
  background: none;
  border: none;
  color: #71717a;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}
.bio-btn-text:hover { color: #dc2626; }

.bio-feedback { margin-top: 10px; font-size: 0.88rem; min-height: 20px; }
.bio-feedback.ok { color: #16a34a; }
.bio-feedback.err { color: #dc2626; }

.bio-phone-frame {
  position: sticky;
  top: 20px;
  width: 320px;
  margin: 0 auto;
  height: 600px;
  background: #18181b;
  border-radius: 32px;
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  overflow: hidden;
}
.bio-phone-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 22px;
  background: #fff;
}

/* ═══════════════════════════════════════════
   Settings → Referrals tab
   ═══════════════════════════════════════════ */

.st-ref-hero {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #bfdbfe;
  margin-bottom: 18px;
}
.st-ref-hero-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}
.st-ref-hero-text { min-width: 0; }
.st-ref-hero-title {
  margin: 0 0 6px 0;
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.st-ref-hero-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: #475569;
}

.st-ref-bonuses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.st-ref-bonus-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.st-ref-bonus-card:hover {
  border-color: #bfdbfe;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}
.st-ref-bonus-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.st-ref-bonus-icon--user { background: #dbeafe; color: #2563eb; }
.st-ref-bonus-icon--gift { background: #ede9fe; color: #7c3aed; }
.st-ref-bonus-icon--star { background: #fef3c7; color: #d97706; }
.st-ref-bonus-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.st-ref-bonus-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 600;
}
.st-ref-bonus-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.st-ref-bonus-sub {
  font-size: 12.5px;
  line-height: 1.45;
  color: #64748b;
}

/* Link row */
.st-ref-link-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  align-items: stretch;
}
.st-ref-link-input {
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 14px;
  color: #0f172a;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: -0.01em;
}
.st-ref-link-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.st-ref-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.st-ref-copy-btn:hover { background: #1d4ed8; }
.st-ref-copy-btn:active { transform: scale(0.97); }
.st-ref-copy-btn.copied { background: #10b981; }

/* Code + share row */
.st-ref-code-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}
.st-ref-code-block {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 42px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
}
.st-ref-code-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 600;
}
.st-ref-code-value {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: 0.02em;
}
.st-ref-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.st-ref-share-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.st-ref-share-btn[id="ref-share-tg"]:hover { color: #2563eb; }
.st-ref-share-btn[id="ref-share-wa"]:hover { color: #16a34a; border-color: #86efac; background: #f0fdf4; }

/* Stats grid */
.st-ref-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.st-ref-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.st-ref-stat--accent {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border-color: #bfdbfe;
}
.st-ref-stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.st-ref-stat--accent .st-ref-stat-value { color: #2563eb; }
.st-ref-stat-label {
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

/* Recent referrals list */
.st-ref-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.st-ref-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: background 0.15s ease;
}
.st-ref-row:hover { background: #f1f5f9; }
.st-ref-row-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.st-ref-row--pending .st-ref-row-avatar {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}
.st-ref-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-ref-row-name {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-ref-row-meta {
  font-size: 12.5px;
  color: #64748b;
}
.st-ref-row-bonus {
  flex-shrink: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: #16a34a;
  white-space: nowrap;
}
.st-ref-row-bonus--pending {
  color: #94a3b8;
  font-weight: 500;
  font-size: 12.5px;
}

/* Mobile */
@media (max-width: 760px) {
  .st-ref-hero {
    flex-direction: column;
    gap: 12px;
    padding: 18px;
  }
  .st-ref-hero-icon { width: 40px; height: 40px; }
  .st-ref-bonuses {
    grid-template-columns: 1fr;
  }
  .st-ref-link-row { flex-direction: column; }
  .st-ref-copy-btn { width: 100%; justify-content: center; }
  .st-ref-code-row { flex-direction: column; }
  .st-ref-share-btn { width: 100%; justify-content: center; }
  .st-ref-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-ref-row { padding: 10px 12px; }
  .st-ref-row-avatar { width: 32px; height: 32px; font-size: 11.5px; }
}

/* ─── Integrations grid (coming-soon cards) ─── */
.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 4px;
}

.integration-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  transition: border-color 200ms, box-shadow 200ms;
}

.integration-card.is-soon {
  background: #fafafa;
  border-color: #ececef;
  opacity: 0.78;
  filter: grayscale(0.25);
  cursor: not-allowed;
}

.integration-card.is-soon:hover {
  opacity: 0.92;
  filter: grayscale(0);
  border-color: #d4d4d8;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

.integration-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.integration-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  color: #fff;
  background: #71717a;
  flex-shrink: 0;
}
.integration-logo svg { display: block; }

/* Brand-coloured logos (purely decorative, abstract initials) */
.integration-logo-amocrm  { background: #2da6df; }
.integration-logo-bitrix  { background: #1d92cf; }
.integration-logo-dingtalk {
  background: #1677ff;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-size: 1.15rem;
}
.integration-logo-onec    { background: #f0c52f; color: #3f2a01; }
.integration-logo-kaspi   { background: #f04438; }
.integration-logo-hubspot { background: #ff7a59; }
.integration-logo-gsheets { background: #34a853; color: #ffffff; }

.integration-soon-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6b7280;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 10px;
}

.integration-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.integration-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: #18181b;
}

.integration-desc {
  margin: 0;
  font-size: 0.83rem;
  line-height: 1.45;
  color: #71717a;
}

.integration-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.integration-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 3px 8px;
}

.integration-notify-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 6px 10px;
  cursor: not-allowed;
  pointer-events: none;
}

/* Suggest-an-integration banner */
.integrations-suggest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 14px;
}
.integrations-suggest-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.integrations-suggest-text strong {
  font-size: 0.92rem;
  color: #18181b;
}
.integrations-suggest-text span {
  font-size: 0.82rem;
  color: #4b5563;
}
.integrations-suggest-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
}
.integrations-suggest-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .integrations-suggest {
    flex-direction: column;
    align-items: flex-start;
  }
  .integrations-suggest-btn { width: 100%; justify-content: center; }
}

/* Suggest-integration modal */
.modal-card.int-suggest-card {
  width: min(540px, calc(100% - 32px));
}
.int-suggest-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.int-suggest-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.83rem;
  color: #3f3f46;
  font-weight: 600;
}
.int-suggest-field input,
.int-suggest-field textarea {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 400;
  color: #18181b;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  background: #fff;
  transition: border-color 150ms, box-shadow 150ms;
  resize: vertical;
}
.int-suggest-field input:focus,
.int-suggest-field textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.int-suggest-req {
  color: #ef4444;
  font-weight: 700;
  margin-left: 2px;
}
.int-suggest-channels {
  margin-top: 4px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.int-suggest-channels-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.int-suggest-channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 0.85rem;
  color: #334155;
}
.int-suggest-channel-row strong {
  color: #1d4ed8;
  font-weight: 600;
}
.int-suggest-channel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #e0f2fe;
  color: #0369a1;
  flex-shrink: 0;
}
.int-suggest-feedback {
  margin: 0;
  font-size: 0.82rem;
  min-height: 18px;
}
.int-suggest-feedback.is-error { color: #ef4444; }
.int-suggest-feedback.is-success { color: #059669; }
.int-suggest-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 24px 20px;
}
.int-suggest-footer .integrations-suggest-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========================================================================
   Bio Link admin — extras (themes, QR, welcome preview, analytics, share, langs)
   ======================================================================== */

.bio-card-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.bio-card-head .bio-card-title { margin-bottom: 0; }
.bio-card-hint {
  font-size: 0.8rem;
  color: #71717a;
  line-height: 1.4;
}

/* ---- Themes ---- */
.bio-themes-card .bio-themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.bio-theme-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  font-family: inherit;
}
.bio-theme-card:hover {
  border-color: #2563eb;
  box-shadow: 0 4px 14px -6px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}
.bio-theme-card.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}
.bio-theme-preview {
  position: relative;
  height: 96px;
  border-radius: 8px;
  padding: 12px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  overflow: hidden;
}
.bio-theme-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  margin-bottom: 4px;
}
.bio-theme-bar {
  height: 4px;
  border-radius: 2px;
  width: 60%;
}
.bio-theme-bar-2 { width: 80%; }
.bio-theme-btn {
  width: 80%;
  height: 12px;
  margin-top: 4px;
}
.bio-theme-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 0 4px 4px;
}
.bio-theme-icon {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: #eff6ff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bio-theme-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bio-theme-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #18181b;
}
.bio-theme-tag {
  font-size: 0.72rem;
  color: #71717a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Welcome preview ---- */
.bio-welcome-preview {
  margin-top: 16px;
  padding: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
}
.bio-welcome-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 8px;
}
.bio-welcome-title { font-weight: 500; }
.bio-welcome-bubble {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px 12px 12px 2px;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #18181b;
  line-height: 1.45;
  max-width: 90%;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bio-welcome-bubble.is-fallback { color: #64748b; font-style: italic; }
.bio-welcome-hint {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
}
.bio-welcome-hint b { color: #475569; font-weight: 600; }

/* ---- Mini-analytics ---- */
.bio-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}
.bio-stat-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.bio-stat-label {
  font-size: 0.72rem;
  color: #64748b;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.3;
}
.bio-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.bio-stat-sub {
  font-size: 0.7rem;
  color: #94a3b8;
}
.bio-stats-foot {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bio-stats-foot .inline-note { margin: 0; }

.bio-stats-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.bio-stat-tile-lg .bio-stat-value { font-size: 1.7rem; }
.bio-funnel {
  margin-top: 18px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}
.bio-funnel-title {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #18181b;
}
.bio-funnel-row {
  display: grid;
  grid-template-columns: 160px 1fr 50px;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
}
.bio-funnel-label { color: #475569; }
.bio-funnel-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}
.bio-funnel-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  border-radius: 4px;
  transition: width 0.3s;
}
.bio-funnel-num {
  text-align: right;
  color: #0f172a;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 540px) {
  .bio-stats-modal-grid { grid-template-columns: 1fr; }
  .bio-funnel-row { grid-template-columns: 110px 1fr 44px; font-size: 0.75rem; }
}

/* ---- QR (compact inline, inside Address card) ---- */
.bio-qr-inline {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 12px;
  align-items: center;
}
.bio-qr-box {
  width: 64px;
  height: 64px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.bio-qr-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.bio-qr-empty {
  font-size: 0.7rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.04em;
}
.bio-qr-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bio-qr-status {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.25;
}
.bio-qr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.bio-qr-dl-wrap {
  position: relative;
  display: inline-block;
}
.bio-qr-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bio-qr-dl-caret {
  margin-left: 2px;
  opacity: 0.7;
}
.bio-qr-dl-btn[aria-expanded="true"] .bio-qr-dl-caret {
  transform: rotate(180deg);
}
.bio-qr-dl-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 30;
  min-width: 200px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bio-qr-dl-menu[hidden] { display: none; }
.bio-qr-dl-menu button {
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 6px;
  transition: background 0.12s;
}
.bio-qr-dl-menu button:hover {
  background: #f1f5f9;
}
.bio-qr-dl-menu button span {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
}

/* ---- Share ---- */
.bio-share-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 4px 10px;
  background: #f8fafc;
  border-radius: 999px;
}
.bio-share-label {
  font-size: 0.78rem;
  color: #64748b;
}
.bio-share-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.bio-share-btn:hover { transform: translateY(-1px); }
.bio-share-tg:hover { background: #229ED9; color: #fff; }
.bio-share-wa:hover { background: #25D366; color: #fff; }
.bio-share-copy:hover { background: #2563eb; color: #fff; }
.bio-share-copy.is-ok { background: #10b981; color: #fff; }

@media (max-width: 720px) {
  .bio-share-group { margin-left: 0; width: 100%; justify-content: center; }
}

/* ---- Languages ---- */
.bio-langs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.bio-lang-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bio-lang-card:hover { border-color: #93c5fd; }
.bio-lang-card.is-on {
  border-color: #2563eb;
  background: #eff6ff;
}
.bio-lang-card.is-default { cursor: default; opacity: 0.95; }
.bio-lang-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bio-lang-flag { font-size: 1.2rem; line-height: 1; }
.bio-lang-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #18181b;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
.bio-lang-badge {
  margin-left: auto;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #2563eb;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.bio-langs-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bio-langs-foot .bio-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bio-langs-foot .bio-btn-secondary.is-loading {
  opacity: 0.7;
  pointer-events: none;
}
.bio-langs-feedback {
  font-size: 0.8rem;
  color: #475569;
  flex: 1;
  min-width: 200px;
}
.bio-langs-feedback.is-ok { color: #059669; }
.bio-langs-feedback.is-err { color: #ef4444; }

/* ---- Modal-open lock for stats modal (reuse existing modal styles) ---- */
body.modal-open { overflow: hidden; }

/* Tighter spacing on small screens */
@media (max-width: 720px) {
  .bio-themes-card .bio-themes-grid { grid-template-columns: repeat(2, 1fr); }
  .bio-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bio-qr-actions { width: 100%; }
}

/* ========================================================================
   Bio Link — Mode tabs (Editor | Analytics) + sticky live-preview
   ======================================================================== */

.bio-mode-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}
.bio-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.bio-mode-tab:hover { color: var(--ink); }
.bio-mode-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.bio-mode-tab svg { opacity: 0.6; }
.bio-mode-tab.is-active svg { opacity: 1; }

.bio-mode-pane[hidden] { display: none; }
.bio-section[hidden] { display: none !important; }
.bio-section { display: flex; flex-direction: column; gap: 16px; }

/* "Hot" badge on the AI tab — small accent so the new section is discoverable */
.bio-mode-tab-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.35);
}
.bio-mode-tab.is-active .bio-mode-tab-badge {
  filter: brightness(1.05);
}
/* "Soon" variant — purple/indigo so it's visually distinct from the orange
   "Hot" badge. Used on the Generator tab while the feature is in beta. */
.bio-mode-tab-badge.bio-mode-tab-badge-soon {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  box-shadow: 0 1px 3px rgba(99, 102, 241, 0.35);
}

/* ===== Auto-generation section ===== */
.bio-autogen-section { gap: 18px; }
.bio-autogen-intro {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border: 1px solid rgba(99, 102, 241, 0.18);
}
.bio-autogen-intro-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 6px 16px -4px rgba(99, 102, 241, 0.5);
}
.bio-autogen-intro-text {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.bio-autogen-grid {
  display: grid;
  /* Auto-fit so we get 1/2/3 columns depending on width — 6 cards lay out
     as 3×2 on wide screens, 2×3 mid-size, single column on phones. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.bio-autogen-quota {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  font-size: 0.78rem;
  font-weight: 500;
}
.bio-autogen-quota svg { opacity: 0.75; }
.bio-autogen-quota strong { font-weight: 700; }
.bio-autogen-field textarea {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-family: inherit;
  background: #fff;
  resize: vertical;
  min-height: 70px;
  transition: border-color 0.15s;
}
.bio-autogen-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.bio-autogen-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bio-autogen-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(15, 23, 42, 0.18);
}
.bio-autogen-card-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
/* Default flex children won't shrink past their content's intrinsic
   width — that's what pushes mobile cards past the viewport. min-width:0
   on the text columns lets long lines wrap normally. */
.bio-autogen-intro > div:not(.bio-autogen-intro-icon),
.bio-autogen-card-head > div:not(.bio-autogen-card-icon) {
  min-width: 0;
  flex: 1 1 auto;
}
.bio-autogen-card-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.bio-autogen-card-icon--ig {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
}
.bio-autogen-card-icon--db,
.bio-autogen-card-icon--kb {
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
}
.bio-autogen-card-icon--x {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
}
.bio-autogen-card-icon--yt {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
}
.bio-autogen-card-icon--tg {
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
}
.bio-autogen-card-icon--custom {
  background: linear-gradient(135deg, #94a3b8 0%, #475569 100%);
}
.bio-autogen-card-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.bio-autogen-card-sub {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}
.bio-autogen-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}
.bio-autogen-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s;
}
.bio-autogen-input-wrap:focus-within { border-color: var(--accent); }
.bio-autogen-input-prefix {
  padding: 0 4px 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
}
.bio-autogen-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 10px 12px 10px 0;
  font-size: 0.95rem;
  background: transparent;
  font-family: inherit;
}
.bio-autogen-dropzone {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.02);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.bio-autogen-dropzone:hover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.04);
}
.bio-autogen-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
}
.bio-autogen-dropzone-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
}
.bio-autogen-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}
.bio-autogen-dropzone-text strong {
  color: var(--ink);
  font-weight: 600;
}
.bio-autogen-dropzone-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
}
.bio-autogen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.bio-autogen-disclaimer {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
}

/* Override the legacy `align-items: start` so the preview column stretches
   to match the editor column height — `position: sticky` needs scrolling
   room within its containing block to actually stick. */
.bio-mode-pane.bio-edit-grid {
  align-items: stretch;
}
.bio-mode-pane.bio-edit-grid .bio-preview-col {
  height: 100%;
}

/* ---- Sticky preview wrapper ---- */
.bio-preview-sticky {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Override the older sticky on .bio-phone-frame inside the new wrapper */
.bio-preview-sticky .bio-phone-frame {
  position: relative;
  top: auto;
  width: 300px;
  height: 580px;
  margin: 0;
}

.bio-preview-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bio-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #ecfdf5;
  color: #047857;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.bio-preview-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18);
  animation: bioDotPulse 1.6s ease-in-out infinite;
}
@keyframes bioDotPulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.06); }
}

/* ---- Live preview mockup (replaces iframe) ---- */
.bio-live-preview {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  overflow: hidden;
  background: var(--bio-bg, #f4f4f5);
  color: var(--bio-text, #18181b);
  display: flex;
  flex-direction: column;
}
.bio-live-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 1;
}
.bio-live-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 18px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Anchor everything to the top — adding a video should push later items
     down, not shrink/shift the avatar+name+tabs upward. */
  justify-content: flex-start;
  gap: 10px;
  scrollbar-width: thin;
}
/* Pin every direct child to its intrinsic height. Without this, flex would
   shrink children (tabs strip, bio text, etc.) once total content exceeds
   the phone frame, which is what made the upper section visibly compress
   when a video was added. */
.bio-live-scroll > * {
  flex-shrink: 0;
}
.bio-live-scroll::-webkit-scrollbar { width: 4px; }
.bio-live-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 2px; }
.bio-live-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  background-size: cover;
  background-position: center;
  border: 3px solid rgba(255,255,255,0.7);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.bio-live-name {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  margin-top: 4px;
  word-break: break-word;
}
.bio-live-bio {
  font-size: 0.78rem;
  text-align: center;
  opacity: 0.78;
  line-height: 1.4;
  max-width: 240px;
  word-break: break-word;
}
/* ---- Live preview: link tabs strip (above the link list) ---- */
/* A grid-based segmented switcher. Using `display: grid` with equal columns
   guarantees every tab gets the same share of the strip — long text just
   truncates with ellipsis instead of overflowing or scrolling sideways. */
.bio-live-tabs {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
  margin: 12px 0 6px;
  background: color-mix(in srgb, var(--bio-text, #1e293b) 10%, transparent);
  border-radius: 999px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.bio-live-tabs[hidden] { display: none; }
.bio-live-tab {
  /* Allow grid to shrink the cell content */
  min-width: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--bio-text, #1e293b);
  font-size: 0.74rem;
  font-weight: 500;
  border: none;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0.65;
  line-height: 1.2;
  transition: background 0.15s, opacity 0.15s, color 0.15s;
  /* Don't let an inner span push the cell wider than its grid track */
  overflow: hidden;
}
.bio-live-tab > span {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Slightly tighter type when 3 tabs share the strip */
.bio-live-tabs[data-tab-count="3"] .bio-live-tab {
  font-size: 0.68rem;
  padding: 5px 6px;
}
.bio-live-tab.is-active {
  background: var(--bio-btn, #3b82f6);
  color: var(--bio-btn-text, #fff);
  opacity: 1;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.bio-live-tab-emoji {
  font-size: 0.88rem;
  line-height: 1;
}

.bio-live-links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.bio-live-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bio-btn, #3b82f6);
  color: var(--bio-btn-text, #fff);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
  justify-content: center;
  border-radius: var(--bio-radius, 12px);
  transition: transform 0.1s;
}
.bio-live-link:hover { transform: translateY(-1px); }
.bio-live-link svg { width: 14px; height: 14px; flex-shrink: 0; }
/* Video tiles in the live preview — 16:9 frame matches the public page. */
.bio-live-videos {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.bio-live-video { display: flex; flex-direction: column; gap: 3px; }
.bio-live-video-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: rgba(0,0,0,0.2);
  border-radius: var(--bio-radius, 12px);
  overflow: hidden;
}
.bio-live-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.bio-live-video--placeholder .bio-live-video-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: rgba(255,255,255,0.7);
}
.bio-live-video-label {
  font-size: 0.7rem;
  text-align: center;
  opacity: 0.78;
}

/* Admin-side video editor card. Reuses .bio-link-item shell + adds a small
   16:9 preview frame at the bottom so the user immediately sees their video. */
.bio-videos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.bio-videos-list:empty { margin-top: 0; }
.bio-video-preview {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.bio-video-preview iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.bio-video-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.82rem;
  padding: 0 12px;
  text-align: center;
}

/* === Admin-side gallery editor (Instagram-style image collection) ===
   Thumbnail grid with a `+` tile for adding more (up to 5). Each thumbnail
   has a small × button on hover to remove the photo. */
.bio-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.bio-gallery-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.bio-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bio-gallery-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.bio-gallery-thumb:hover .bio-gallery-thumb-remove,
.bio-gallery-thumb-remove:focus {
  opacity: 1;
}
.bio-gallery-add-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 2px dashed rgba(15, 23, 42, 0.25);
  background: rgba(15, 23, 42, 0.02);
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}
/* Visually hide the file input without using the HTML5 `hidden` attribute,
   which prevents the label from opening the native file picker in some
   browsers. The input must still be focusable/clickable for the label
   association to work — so we don't use display:none either. */
.bio-gallery-add-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  /* Hide the native button text in browsers that still render it */
  font-size: 0;
  color: transparent;
}
.bio-gallery-add-tile:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
  color: #2563eb;
}
.bio-gallery-add-plus {
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.bio-gallery-add-hint {
  font-size: 11px;
  letter-spacing: 0.01em;
}
/* Loading state: shown while a freshly picked file is being compressed +
   uploaded. Disables pointer interaction, hides the file input, swaps the
   plus glyph for a CSS spinner, and changes the hint text via JS. */
.bio-gallery-add-tile.is-loading {
  cursor: progress;
  border-style: solid;
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.06);
  color: #2563eb;
  pointer-events: none;
}
.bio-gallery-add-tile.is-loading .bio-gallery-add-input { display: none; }
.bio-gallery-add-tile.is-loading .bio-gallery-add-plus {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2.5px solid rgba(59, 130, 246, 0.25);
  border-top-color: #2563eb;
  animation: bio-gallery-spin 0.8s linear infinite;
  font-size: 0;
}
@keyframes bio-gallery-spin {
  to { transform: rotate(360deg); }
}
.bio-gallery-count {
  margin-left: 6px;
  font-weight: 500;
  color: #94a3b8;
  font-size: 0.78rem;
}
.bio-gallery-hint {
  color: #94a3b8;
}

/* === Live preview + public gallery slider ===
   Horizontal scroll-snap with hidden scrollbar + dot indicator below.
   Same DOM is used in both #bio-live-preview and the public bio.js shell. */
.bio-live-gallery {
  width: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bio-live-gallery-track {
  display: flex;
  width: 100%;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* pan-x lets the browser scroll horizontally on touch but lets the page
     handle vertical pan, so a slight diagonal swipe doesn't get stuck.
     For mouse/pen we add JS-driven drag-scroll on top. */
  touch-action: pan-x;
  cursor: grab;
  /* No background/radius on the track itself — the peeking slide should look
     like it belongs to the page, not pop out of a colored frame. */
  background: transparent;
  scrollbar-width: none;
  /* Right padding leaves room so the last slide can still snap to the start
     while showing some empty space — matches Instagram's overscroll feel. */
  padding-right: 14%;
  scroll-padding-left: 0;
}
.bio-live-gallery-track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}
.bio-live-gallery-track.is-dragging .bio-live-gallery-slide img {
  pointer-events: none;
}
.bio-live-gallery-track::-webkit-scrollbar { display: none; }
.bio-live-gallery-slide {
  /* Each slide takes ~86% of the track width so the next slide peeks on the
     right — moves "through space" rather than swapping inside a fixed frame. */
  flex: 0 0 86%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  aspect-ratio: 1 / 1;
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.05);
}
.bio-live-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.bio-live-gallery-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 0;
}
.bio-live-gallery-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.28;
  transition: opacity 0.18s ease, transform 0.18s ease;
  cursor: pointer;
}
.bio-live-gallery-dot.is-active {
  opacity: 0.92;
  transform: scale(1.25);
}
.bio-live-gallery-label {
  font-size: 0.86rem;
  text-align: center;
  opacity: 0.78;
  padding: 0 4px;
}

/* Soft character limit: counter sits next to the field label (top-right) or
   inline as a sibling under the field. Stays light grey by default — only
   the colour changes when the user goes past the limit. */
.bio-char-counter {
  font-size: 0.7rem;
  color: #cbd5e1;
  font-weight: 400;
  text-align: right;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}
.bio-char-counter.is-over-limit {
  color: #dc2626;
  font-weight: 600;
}

/* Label with a counter chip pinned to the right */
.bio-label-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.bio-label-head-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: #3f3f46;
}
.bio-char-counter--top {
  margin-top: 0;
  flex-shrink: 0;
}
input.is-over-limit,
textarea.is-over-limit,
input.bio-input.is-over-limit,
textarea.bio-input.is-over-limit {
  border-color: #dc2626 !important;
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
input.is-over-limit:focus,
textarea.is-over-limit:focus {
  outline: none;
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}

/* "+ Добавить ссылку" / "Добавить видео" row at the bottom of the card */
.bio-add-actions,
.bio-empty-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.bio-add-video-btn,
.bio-empty-add-video {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bio-live-link--with-sub { padding: 8px 14px; }
.bio-live-link-text {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
}
.bio-live-link-label { font-size: 0.82rem; font-weight: 600; }
.bio-live-link-sub { font-size: 0.66rem; font-weight: 400; opacity: 0.78; margin-top: 1px; }
/* ---- Mini chat box (already-open state in live preview) ---- */
.bio-live-chatbox {
  position: relative;
  z-index: 1;
  margin: 0 10px 10px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08), 0 6px 18px rgba(15, 23, 42, 0.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  flex-shrink: 0;
}
.bio-live-chatbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}
.bio-live-chatbox-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bio-btn, #3b82f6);
  color: var(--bio-btn-text, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bio-live-chatbox-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bio-live-chatbox-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #18181b;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bio-live-chatbox-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.66rem;
  color: #64748b;
  line-height: 1.2;
}
.bio-live-chatbox-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.bio-live-chatbox-bubble {
  background: #f1f5f9;
  border-radius: 12px 12px 12px 2px;
  padding: 8px 10px;
  font-size: 0.74rem;
  color: #1e293b;
  line-height: 1.4;
  max-width: 90%;
  align-self: flex-start;
  word-break: break-word;
}
.bio-live-chatbox-input {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 4px 4px 4px 12px;
  margin-top: 2px;
}
.bio-live-chatbox-placeholder {
  flex: 1;
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 0;
}
.bio-live-chatbox-send {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--bio-btn, #3b82f6);
  color: var(--bio-btn-text, #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex-shrink: 0;
}
.bio-live-preview.no-chat .bio-live-chatbox { display: none; }

/* Inline chatbox preview — sits in normal flow at the END of the scroll
   content (after links + videos), not as a floating overlay. Reuses most
   of the chatbox sub-styles via shared bio-live-chatbox-* classes. */
.bio-live-inline-chat {
  width: 100%;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  margin-top: 6px;
}
.bio-live-inline-chat[hidden] { display: none; }
.bio-live-inline-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px;
}
.bio-live-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}
.bio-live-empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bio-live-empty p {
  margin: 0;
  font-size: 0.82rem;
  color: #475569;
  line-height: 1.45;
  max-width: 200px;
}

/* ---- Analytics pane (when stats tab is active) ---- */
.bio-stats-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 920px;
}
.bio-stats-pane .bio-stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.bio-stats-pane .bio-funnel {
  background: transparent;
  border: none;
  padding: 0;
  margin-top: 0;
}
.bio-toplinks-empty {
  padding: 14px 0;
  text-align: center;
}

/* ---- Link groups / tabs editor (in Links card) ---- */
.bio-tabs-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  margin-bottom: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}
.bio-tabs-enable {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.bio-tag-soft {
  margin-left: auto;
  padding: 2px 8px;
  background: #e0e7ff;
  color: #4338ca;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.bio-tabs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bio-tab-row {
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 6px;
  align-items: center;
}
.bio-tab-row .bio-tab-name {
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.86rem;
}
.bio-tab-row .bio-tab-name:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.bio-tab-row .bio-tab-remove {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bio-tab-row .bio-tab-remove:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.bio-tabs-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bio-tabs-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  transition: color 0.15s;
}
.bio-tabs-hint--warn {
  color: #dc2626;
  font-weight: 600;
}
.bio-tab-row .bio-tab-name.is-too-long {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}
.bio-tab-row .bio-tab-name.is-too-long:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18);
}
.bio-tabs-add {
  align-self: flex-start;
}
.bio-tabs-add[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.bio-links-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 0 0 14px;
}

/* Per-link group selector — injected into the head row by JS as a labelled
   field column to the right of "Тип ссылки". Inherits the .bio-link-field
   layout (label on top, control below) and matches the type select. */
.bio-link-item .bio-link-group-wrap select {
  padding: 8px 10px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
  font-size: 0.88rem;
  color: #1e293b;
  outline: none;
}
.bio-link-item .bio-link-group-wrap select:focus { border-color: #3b82f6; }

/* ---- Chat card: motivational pitch ---- */
.bio-chat-card .bio-card-head {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.bio-chat-card .bio-card-head .bio-card-title {
  margin: 0;
  text-align: left;
}
.bio-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.bio-badge-hot {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  border: 1px solid #fcd34d;
}
.bio-pitch {
  display: flex;
  gap: 12px;
  padding: 14px;
  margin: 0 0 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eff6ff 0%, #ede9fe 100%);
  border: 1px solid #dbeafe;
}
.bio-pitch-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.18);
}
.bio-pitch-body {
  flex: 1;
  min-width: 0;
}
.bio-pitch-body strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  margin-bottom: 4px;
}
.bio-pitch-body p {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.45;
}
.bio-pitch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bio-pitch-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.3;
}
.bio-pitch-list li b {
  color: #1e293b;
  font-weight: 700;
}
.bio-pitch-bullet {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.18);
}

/* ---- Chat display mode (admin radio cards) ---- */
.bio-chat-mode .bio-label-text {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}
.bio-chat-mode-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.bio-chat-mode-opt {
  display: block;
  cursor: pointer;
  position: relative;
}
.bio-chat-mode-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bio-chat-mode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.bio-chat-mode-opt:hover .bio-chat-mode-card {
  border-color: #cbd5f5;
  background: #f8fafc;
}
.bio-chat-mode-opt input[type="radio"]:checked + .bio-chat-mode-card {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb inset;
}
.bio-chat-mode-opt input[type="radio"]:focus-visible + .bio-chat-mode-card {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
.bio-chat-mode-illu {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 70px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  overflow: hidden;
}
.bio-chat-mode-illu .bcm-bar {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
}
.bio-chat-mode-illu .bcm-bar-1 { top: 12px; }
.bio-chat-mode-illu .bcm-bar-2 { top: 22px; right: 18px; }
.bio-chat-mode-illu .bcm-bubble {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 22px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
}
.bio-chat-mode-illu .bcm-fab {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.5);
}
.bio-chat-mode-illu .bcm-tooltip {
  position: absolute;
  right: 22px;
  bottom: 8px;
  background: #fff;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 0.5rem;
  color: #334155;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
}
/* Inline mode illustration: a wider chat block sitting at the bottom of the
   page mock — represents the chat embedded after all links/videos. */
.bio-chat-mode-illu .bcm-inline-block {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 28px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  background-image:
    linear-gradient(#cbd5e1, #cbd5e1),
    linear-gradient(#cbd5e1, #cbd5e1);
  background-size: 22px 3px, 14px 3px;
  background-repeat: no-repeat;
  background-position: 4px 6px, 4px 13px;
}
.bio-chat-mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.bio-chat-mode-text strong {
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
}
.bio-chat-mode-text span {
  font-size: 0.74rem;
  color: #64748b;
  line-height: 1.35;
}

/* ---- Live preview: FAB + teaser variants ---- */
.bio-live-fab {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bio-btn, #3b82f6);
  color: var(--bio-btn-text, #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  animation: bio-fab-pop 0.3s ease;
}
@keyframes bio-fab-pop {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.bio-live-teaser {
  position: absolute;
  right: 66px;
  bottom: 22px;
  z-index: 2;
  max-width: 170px;
  background: #fff;
  color: #1e293b;
  border-radius: 12px 12px 2px 12px;
  padding: 8px 28px 8px 12px;
  font-size: 0.74rem;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
  animation: bio-teaser-in 0.4s ease;
}
@keyframes bio-teaser-in {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.bio-live-teaser-close {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.bio-live-fab[hidden],
.bio-live-teaser[hidden],
.bio-live-chatbox[hidden] {
  display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
  .bio-preview-sticky { position: static; }
}

/* Tablet/phone: tabs become a horizontally-scrollable strip so a 4th/5th
   tab doesn't wrap onto a second line and break the underline indicator.
   We hide the scrollbar but keep wheel/touch swipe working. */
@media (max-width: 760px) {
  .bio-mode-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .bio-mode-tabs::-webkit-scrollbar { display: none; }
  .bio-mode-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  /* Cards must shrink to viewport width — without min-width:0 the grid
     items stay at their content's intrinsic width and push the parent
     past the viewport, causing horizontal page scroll. */
  .bio-edit-col,
  .bio-edit-col > .bio-section,
  .bio-edit-col .dashboard-card { min-width: 0; max-width: 100%; box-sizing: border-box; }
  .bio-autogen-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .bio-preview-sticky .bio-phone-frame { width: 260px; height: 500px; }
  .bio-mode-tab { padding: 8px 12px; font-size: 12px; }
  /* Tighter spacing on phones — give content room over chrome. */
  .bio-mode-tabs { margin-bottom: 14px; }
  .bio-autogen-section { gap: 14px; }
  .bio-autogen-intro { padding: 14px; gap: 10px; }
  .bio-autogen-intro-icon {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .bio-autogen-intro-icon svg { width: 22px; height: 22px; }
  .bio-autogen-intro-text { font-size: 0.86rem; }
  .bio-autogen-card { gap: 12px; }
  .bio-autogen-card-head { gap: 10px; }
  .bio-autogen-card-title { font-size: 0.95rem; }
  .bio-autogen-card-sub { font-size: 0.82rem; }
  .bio-autogen-quota { font-size: 0.74rem; padding: 4px 8px; }
  /* Themes grid down to 2 cols on phone — items stay clickable but the
     grid doesn't push the card past the viewport. */
  .bio-themes-card .bio-themes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

/* ============== Admin → Промокоды ============== */
.promo-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.promo-create-card,
.promo-list-card {
  padding: 18px 20px;
}
.promo-card-title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.promo-card-hint {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.4;
}

.promo-form {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(120px, 1fr) 80px minmax(120px, 1fr) 100px minmax(140px, 1fr);
  gap: 10px 12px;
  align-items: end;
}
.promo-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.app-content label span.promo-label,
.promo-label {
  font-size: 9px;
  font-weight: 400;
  color: #b0b5bd;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.2;
  margin-bottom: 0;
}
.promo-field-row {
  display: contents;
}
.promo-field-narrow { min-width: 0; }
.promo-field--full {
  grid-column: 1 / -1;
}
.promo-field--note {
  grid-column: 1 / -2;
}
.promo-create-btn {
  grid-column: -2 / -1;
}
.promo-feedback {
  grid-column: 1 / -1;
}
@media (max-width: 1100px) {
  .promo-form {
    grid-template-columns: repeat(2, 1fr);
  }
  .promo-field--note { grid-column: 1 / -1; }
  .promo-create-btn { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .promo-form { grid-template-columns: 1fr; }
}

.promo-input {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.88rem;
  color: #0f172a;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.promo-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
select.promo-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 10px;
}

.promo-code-row {
  display: flex;
  gap: 6px;
}
.promo-code-row .promo-code-text {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.promo-regen-btn {
  flex-shrink: 0;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.promo-create-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.promo-feedback {
  font-size: 0.78rem;
  min-height: 1em;
  color: #16a34a;
}
.promo-feedback--err { color: #dc2626; }

/* ---- List ---- */
.promo-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.promo-filter {
  display: inline-flex;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 2px;
}
.promo-filter-btn {
  border: none;
  background: transparent;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.promo-filter-btn:hover { color: #0f172a; }
.promo-filter-btn.is-active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.promo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.promo-empty {
  padding: 28px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  background: #f8fafc;
  border: 1px dashed #e2e8f0;
  border-radius: 10px;
}
.promo-empty--inline {
  padding: 12px;
  font-size: 0.78rem;
  margin-top: 8px;
}

.promo-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.promo-card:hover { border-color: #cbd5e1; }

.promo-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.promo-code-block {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.promo-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #eff6ff 0%, #ede9fe 100%);
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 6px;
}
.promo-icon-btn {
  border: none;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  color: #94a3b8;
  border-radius: 4px;
  display: inline-flex;
  transition: color 0.12s, background 0.12s;
}
.promo-icon-btn:hover { color: #2563eb; background: #f1f5f9; }
.promo-icon-btn.is-copied { color: #16a34a; }
.promo-icon-btn--danger { color: #cbd5e1; }
.promo-icon-btn--danger:hover { color: #dc2626; background: #fef2f2; }

.promo-status {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  margin-left: 4px;
}
.promo-status--active   { background: #dcfce7; color: #15803d; }
.promo-status--expired  { background: #fee2e2; color: #b91c1c; }
.promo-status--exhausted{ background: #fef3c7; color: #92400e; }

.promo-meta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 0;
  padding-left: 6px;
  margin-left: 6px;
  border-left: 1px solid #f1f5f9;
}
.promo-meta-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.promo-meta-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  line-height: 1.2;
}
.promo-meta-value {
  font-size: 0.82rem;
  color: #1e293b;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}
.promo-meta-value b { font-weight: 700; color: #0f172a; }

.promo-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.promo-note {
  margin-top: 10px;
  padding: 8px 10px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
}

.promo-link-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 10px;
  cursor: pointer;
  color: #2563eb;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  transition: background 0.12s, border-color 0.12s;
}
.promo-link-btn:hover { background: #eff6ff; }
.promo-link-btn--danger { color: #dc2626; }
.promo-link-btn--danger:hover { background: #fef2f2; }
.promo-toggle-icon {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s;
}
.promo-card.is-expanded .promo-toggle-icon { transform: rotate(-180deg); }

.promo-users {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.promo-card.is-expanded .promo-users { display: block; }

@media (max-width: 760px) {
  /* Reclaim a few pixels on phones — outer card padding cuts into the
     already-tight viewport width. */
  .promo-create-card,
  .promo-list-card { padding: 14px; min-width: 0; max-width: 100%; box-sizing: border-box; }
  .promo-list { min-width: 0; }
  /* Stack the card top into header / chips / actions on mobile so the
     code badge, meta and actions don't fight for one cramped row. */
  .promo-card { padding: 12px; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }
  .promo-card-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .promo-code-block { flex-wrap: wrap; min-width: 0; }
  .promo-code { font-size: 0.88rem; }
  /* Meta becomes a vertical list of label↔value rows — much more legible
     on a phone than wrap-flowed chips that cut off mid-value. */
  .promo-meta-inline {
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    width: 100%;
    flex-direction: column;
    gap: 6px;
  }
  .promo-meta-chip {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }
  .promo-meta-label { flex: 0 0 auto; }
  .promo-meta-value {
    white-space: normal;
    text-align: right;
    word-break: break-word;
    min-width: 0;
  }
  .promo-card-actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 8px;
  }
  /* Registered-users table doesn't fit 4 columns inside the cramped card on
     phones — wrap it in a horizontal scroller and tighten typography so the
     row stays readable while still being swipable. */
  .promo-users {
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .promo-users-table {
    min-width: 460px;
    font-size: 0.74rem;
  }
  .promo-users-table th,
  .promo-users-table td {
    padding: 6px 6px;
    white-space: nowrap;
  }
  .promo-users-table td:nth-child(2) {
    /* Email is the longest column — let it wrap so the table doesn't blow up
       past the swipe area for very long addresses. */
    white-space: normal;
    word-break: break-all;
    min-width: 140px;
  }
}

.promo-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.promo-users-table th {
  text-align: left;
  font-weight: 600;
  color: #64748b;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.promo-users-table td {
  padding: 8px 8px;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}
.promo-users-table tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────────────────────────────────────
   Post-registration onboarding wizard.
   Modal overlay shown once on first /app visit. 5 steps, with progress dots,
   tone-of-voice chip selector, and optional promo code at the end.
   ───────────────────────────────────────────────────────────────────────── */
.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: wizard-fade-in 0.2s ease-out;
}
.wizard-overlay[hidden] { display: none; }

@keyframes wizard-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wizard-modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: wizard-slide-up 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes wizard-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.wizard-skip-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  z-index: 2;
  transition: background 0.15s, color 0.15s;
}
.wizard-skip-x:hover { background: #f1f5f9; color: #1e293b; }

.wizard-header {
  padding: 28px 28px 16px;
  text-align: center;
}

.wizard-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}
.wizard-dot {
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background 0.2s, width 0.2s;
}
.wizard-dot.is-active { background: #3b82f6; }
.wizard-dot.is-done { background: #93c5fd; }

.wizard-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}
.wizard-sub {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
}

.wizard-body {
  padding: 4px 28px 20px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.wizard-step { display: none; animation: wizard-step-in 0.2s ease-out; }
.wizard-step.is-active { display: block; }
.wizard-step[hidden] { display: none !important; }

@keyframes wizard-step-in {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.wizard-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
}
.wizard-label:first-child { margin-top: 6px; }

.wizard-input,
.wizard-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wizard-textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
.wizard-input:focus,
.wizard-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.wizard-input-promo {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.wizard-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.45;
}
.wizard-hint.is-success { color: #10b981; }
.wizard-hint.is-error { color: #ef4444; }

.wizard-tone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.wizard-chip {
  padding: 8px 14px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.wizard-chip:hover { border-color: #cbd5e1; background: #f8fafc; }
.wizard-chip.is-selected {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  font-weight: 600;
}

.wizard-feedback {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: #ef4444;
  min-height: 1.2em;
}
.wizard-feedback.is-success { color: #10b981; }

.wizard-actions {
  padding: 14px 28px 22px;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.wizard-actions-main {
  display: flex;
  gap: 8px;
}

.wizard-btn-skip,
.wizard-btn-back,
.wizard-btn-next,
.wizard-btn-finish {
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1.5px solid transparent;
}
.wizard-btn-skip {
  background: transparent;
  color: #94a3b8;
  padding-left: 4px;
  padding-right: 4px;
}
.wizard-btn-skip:hover { color: #475569; }

.wizard-btn-back {
  background: transparent;
  color: #475569;
  border-color: #e2e8f0;
}
.wizard-btn-back:hover { background: #f1f5f9; }

.wizard-btn-next,
.wizard-btn-finish {
  background: #3b82f6;
  color: #ffffff;
}
.wizard-btn-next:hover,
.wizard-btn-finish:hover { background: #2563eb; }
.wizard-btn-next:disabled,
.wizard-btn-finish:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 480px) {
  .wizard-overlay { padding: 0; align-items: stretch; }
  .wizard-modal {
    max-height: 100vh;
    height: 100vh;
    max-width: 100%;
    border-radius: 0;
  }
  .wizard-header { padding: 22px 20px 14px; }
  .wizard-body { padding: 4px 20px 16px; }
  .wizard-actions { padding: 12px 20px 16px; }
  .wizard-title { font-size: 1.15rem; }
  .wizard-btn-skip { font-size: 0.8rem; }
}

/* =========================================================================
   Demo page: chat-analysis landing (/demo)
   ========================================================================= */

.demo-page { background: linear-gradient(180deg, #f6f7fb 0%, #ffffff 40%); }
.demo-page .ambient { display: none; }

.demo-hero,
.demo-upload,
.demo-lead,
.demo-report {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.demo-section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.demo-section-subtitle {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  margin: 0 0 28px;
  max-width: 62ch;
}

.demo-hero { padding-top: 88px; padding-bottom: 48px; text-align: left; }
.demo-hero__inner { display: flex; flex-direction: column; gap: 20px; }

.demo-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(224, 64, 251, 0.10);
  color: #a11cd6;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.demo-hero__title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.08;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.02em;
  white-space: nowrap;
  align-self: stretch;
  width: 100%;
}

@media (max-width: 640px) {
  .demo-hero__title {
    white-space: normal;
    font-size: clamp(1.9rem, 8vw, 2.6rem);
  }
}

.demo-hero__subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #334155;
  max-width: 56ch;
  margin: 0;
}

.demo-hero__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.demo-hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e040fb 0%, #ff4081 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(224, 64, 251, 0.32);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.demo-hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(224, 64, 251, 0.45);
}

.demo-hero__note { font-size: 0.82rem; color: var(--muted); }

.demo-hero__features {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 10px;
}
.demo-hero__features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #334155;
  font-size: 0.95rem;
}
.demo-hero__features svg { width: 20px; height: 20px; color: #16a34a; flex-shrink: 0; }

.demo-upload { padding-top: 16px; padding-bottom: 40px; }

.demo-upload__inner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}

.demo-upload__form { display: flex; flex-direction: column; gap: 20px; }

.demo-upload__dropzone {
  display: block;
  border: 2px dashed rgba(37, 99, 235, 0.25);
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.demo-upload__dropzone:hover,
.demo-upload__dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.demo-upload__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}
.demo-upload__placeholder svg { color: var(--accent); margin-bottom: 6px; }
.demo-upload__placeholder strong { color: var(--ink); font-size: 1.05rem; font-weight: 700; }

.demo-upload__file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-upload__file-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: left;
}
.demo-upload__file-icon { font-size: 1.3rem; line-height: 1; }
.demo-upload__file-name {
  flex: 1;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-upload__file-size { color: var(--muted); font-size: 0.82rem; }
.demo-upload__file-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 140ms ease, color 140ms ease;
}
.demo-upload__file-remove:hover { background: rgba(239, 68, 68, 0.1); color: #dc2626; }

.demo-upload__error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border-radius: 12px;
  font-size: 0.9rem;
}

.demo-upload__frame-toggle {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.demo-upload__frame-toggle legend {
  padding: 0 6px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.demo-upload__frame-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
}
.demo-upload__frame-option input { accent-color: var(--accent); width: 18px; height: 18px; }

.demo-upload__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e040fb 0%, #ff4081 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(224, 64, 251, 0.32);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.demo-upload__submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(224, 64, 251, 0.45);
}
.demo-upload__submit:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.demo-analyzing {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 24, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.demo-analyzing[hidden] { display: none; }

.demo-analyzing__card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: min(100%, 420px);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.demo-analyzing__spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid rgba(224, 64, 251, 0.18);
  border-top-color: #e040fb;
  animation: demo-spin 900ms linear infinite;
}
@keyframes demo-spin { to { transform: rotate(360deg); } }

.demo-analyzing__label {
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
  min-height: 1.4em;
  margin-bottom: 18px;
}
.demo-analyzing__bar {
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.demo-analyzing__bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e040fb 0%, #ff4081 100%);
  border-radius: 999px;
  transition: width 140ms linear;
}
.demo-analyzing__percent {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.demo-lead { padding-top: 16px; padding-bottom: 48px; }

.demo-lead__inner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.demo-lead__form { display: flex; flex-direction: column; gap: 18px; }
.demo-lead__field { display: flex; flex-direction: column; gap: 6px; }
.demo-lead__field > span { font-size: 0.85rem; color: var(--ink); font-weight: 600; }

.demo-lead__field input {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.demo-lead__field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.demo-lead__error {
  color: #b91c1c;
  font-size: 0.82rem;
  font-style: normal;
  min-height: 1em;
}

.demo-lead__consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
  cursor: pointer;
}
.demo-lead__consent input {
  margin-top: 3px;
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.demo-lead__consent a { color: var(--accent); text-decoration: none; }
.demo-lead__consent a:hover { text-decoration: underline; }

.demo-lead__submit {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e040fb 0%, #ff4081 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(224, 64, 251, 0.32);
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}
.demo-lead__submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(224, 64, 251, 0.45);
}
.demo-lead__submit:disabled { opacity: 0.7; cursor: wait; }

.demo-lead__submit-spinner {
  width: 18px;
  height: 18px;
  margin-left: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: demo-spin 800ms linear infinite;
  display: none;
}
.demo-lead__submit.is-loading .demo-lead__submit-spinner { display: inline-block; }

.demo-lead__server-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border-radius: 12px;
  font-size: 0.9rem;
}

.demo-report { padding-top: 16px; padding-bottom: 80px; }
.demo-report__inner { display: flex; flex-direction: column; gap: 28px; }

.demo-report__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-lg);
}
.demo-report__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.demo-scorecard {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(224, 64, 251, 0.08), rgba(255, 64, 129, 0.08));
  border: 1px solid rgba(224, 64, 251, 0.2);
}
.demo-scorecard__value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 1;
  background: linear-gradient(135deg, #e040fb, #ff4081);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.demo-scorecard__label { font-size: 0.78rem; color: var(--muted); line-height: 1.25; }

.demo-report__scores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-lg);
}

.demo-score__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.demo-score__label { font-weight: 600; color: var(--ink); font-size: 0.95rem; }
.demo-score__value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.demo-score__bar {
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.demo-score__bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e040fb, #ff4081);
  border-radius: 999px;
  transition: width 900ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.demo-score__note { margin: 8px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }

.demo-report__section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-lg);
}
.demo-report__section h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  margin: 0 0 16px;
}

.demo-errors {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.demo-errors__item {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  border-left: 4px solid #94a3b8;
}
.demo-errors__item--medium { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.06); }
.demo-errors__item--high { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.06); }
.demo-errors__item blockquote {
  margin: 0 0 8px;
  color: var(--ink);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.5;
}
.demo-errors__item p { margin: 0; color: #334155; font-size: 0.92rem; line-height: 1.55; }

.demo-lost-moment { margin: 0; color: #334155; font-size: 1rem; line-height: 1.65; }

.demo-rewrite { display: flex; flex-direction: column; gap: 10px; }
.demo-rewrite__bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.demo-rewrite__bubble--client {
  align-self: flex-start;
  background: #f1f5f9;
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.demo-rewrite__bubble--seller {
  align-self: flex-end;
  background: linear-gradient(135deg, #e040fb, #ff4081);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.demo-report__cta {
  text-align: center;
  padding: 36px 32px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2a1a3e 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.demo-report__cta h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 10px;
}
.demo-report__cta p {
  margin: 0 auto 22px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.98rem;
  line-height: 1.6;
  max-width: 52ch;
}
.demo-report__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e040fb 0%, #ff4081 100%);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 32px rgba(224, 64, 251, 0.38);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.demo-report__cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(224, 64, 251, 0.5);
}

@media (max-width: 720px) {
  .demo-hero { padding-top: 68px; padding-bottom: 32px; }
  .demo-upload__inner,
  .demo-report__header,
  .demo-report__scores,
  .demo-report__section,
  .demo-report__cta { padding: 22px 20px; }
  .demo-report__scores { grid-template-columns: 1fr; }
  .demo-report__header { flex-direction: column; align-items: flex-start; }
  .demo-scorecard { align-self: stretch; justify-content: flex-start; }
  .demo-upload__frame-toggle { flex-wrap: wrap; }
  .demo-rewrite__bubble { max-width: 92%; }
}

/* ============================================================
   Demo lead — modal popup
   Открывается после анализа переписки. Затемняет фон и держит фокус
   внутри карточки. Закрывается по крестику, бэкдропу или Esc.
   ============================================================ */
.demo-lead-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease-out;
}
.demo-lead-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}
.demo-lead-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 23, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}
.demo-lead-modal__panel {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  box-shadow:
    0 30px 80px -20px rgba(10, 10, 18, 0.45),
    0 12px 30px -12px rgba(10, 10, 18, 0.18);
  transform: translateY(16px) scale(0.96);
  transition: transform 280ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
.demo-lead-modal.is-open .demo-lead-modal__panel {
  transform: translateY(0) scale(1);
}
.demo-lead-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(15, 17, 23, 0.06);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease;
}
.demo-lead-modal__close:hover {
  background: rgba(15, 17, 23, 0.12);
}
.demo-lead-modal .demo-section-title {
  margin-top: 0;
  padding-right: 40px;
}

/* Двухколоночная разметка (email + phone, employees + revenue) */
.demo-lead__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 540px) {
  .demo-lead__row { grid-template-columns: 1fr; }
  .demo-lead-modal { padding: 12px; }
  .demo-lead-modal__panel { padding: 28px 22px 24px; }
  .demo-lead-modal .demo-section-title { font-size: 1.4rem; }
}

/* Стили для select — повторяют input, плюс нативная стрелка через bg */
.demo-lead__field select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 40px 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>")
    no-repeat right 14px center;
  cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.demo-lead__field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.demo-lead__hint {
  margin: -2px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ============================================================
   Benchmark indicators (above / on / below market)
   ============================================================ */

/* Бейдж в карточке общего скора */
.demo-scorecard__benchmark {
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  display: inline-block;
}
.demo-scorecard__benchmark.is-above { background: rgba(34, 197, 94, 0.12);  color: #15803d; }
.demo-scorecard__benchmark.is-on    { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.demo-scorecard__benchmark.is-below { background: rgba(239, 68, 68, 0.12);  color: #b91c1c; }

/* Развёрнутый текстовый бенчмарк */
.demo-benchmark {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: #fff;
}
.demo-benchmark.is-above { border-color: rgba(34, 197, 94, 0.3);  background: linear-gradient(180deg, rgba(34, 197, 94, 0.06), rgba(255, 255, 255, 1)); }
.demo-benchmark.is-on    { border-color: rgba(245, 158, 11, 0.3); background: linear-gradient(180deg, rgba(245, 158, 11, 0.06), rgba(255, 255, 255, 1)); }
.demo-benchmark.is-below { border-color: rgba(239, 68, 68, 0.3);  background: linear-gradient(180deg, rgba(239, 68, 68, 0.06), rgba(255, 255, 255, 1)); }
.demo-benchmark__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.demo-benchmark.is-above .demo-benchmark__icon { background: rgba(34, 197, 94, 0.15);  color: #15803d; }
.demo-benchmark.is-on .demo-benchmark__icon    { background: rgba(245, 158, 11, 0.15); color: #b45309; }
.demo-benchmark.is-below .demo-benchmark__icon { background: rgba(239, 68, 68, 0.15);  color: #b91c1c; transform: rotate(180deg); }
.demo-benchmark__body { flex: 1; }
.demo-benchmark__body strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.demo-benchmark__body p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

/* Маркер бенчмарка на полоске скора */
.demo-score__bar { position: relative; }
.demo-score__bar-marker {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  background: rgba(15, 17, 23, 0.5);
  border-radius: 2px;
  transform: translateX(-50%);
  pointer-events: none;
}
.demo-score__bar-marker::after {
  content: "";
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  background: rgba(15, 17, 23, 0.65);
  border-radius: 50%;
  transform: translateX(-50%);
}

/* Per-metric mini-badge */
.demo-score__benchmark {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.demo-score__benchmark.is-above { background: rgba(34, 197, 94, 0.12);  color: #15803d; }
.demo-score__benchmark.is-on    { background: rgba(245, 158, 11, 0.14); color: #b45309; }
.demo-score__benchmark.is-below { background: rgba(239, 68, 68, 0.12);  color: #b91c1c; }

/* ============================================================
   Methodology footer (sources / authors)
   ============================================================ */
.demo-method {
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-top: 8px;
}
.demo-method h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.demo-method p {
  margin: 0 0 10px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
}
.demo-method__list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.demo-method__list li {
  padding-left: 16px;
  position: relative;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.demo-method__list li::before {
  content: "·";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--accent);
  font-weight: 800;
}
.demo-method__list strong { color: var(--ink); font-weight: 700; }
.demo-method__note {
  font-size: 0.78rem;
  color: var(--muted);
  font-style: italic;
  margin: 8px 0 0;
}

