/* ═══════════════════════════════════════════════════════════════════════
   TEST страница покупателей — Premium-стиль (в духе главной)
   ═══════════════════════════════════════════════════════════════════════ */

/* Палитра «светло-синий + ванильный» — переопределяет --green из style.css
   только в рамках /test/buyers. На главной странице --green остаётся индиго. */
:root {
  --green:        #3B82F6;  /* sky-500 */
  --green-dark:   #1D4ED8;  /* blue-700 */
  --green-light:  #DBEAFE;  /* blue-100 */
  --green-mint:   #EFF6FF;  /* blue-50 */
  --green-glow:   rgba(59, 130, 246, 0.22);
  --bg:           #F0F9FF;  /* почти-белый с голубым отливом */
}
/* html получает фон — иначе при коротком body просвечивает белый */
html { background: #F0F9FF; }
/* Прозрачный голубоватый фон страницы /test/buyers */
body {
  background:
    radial-gradient(circle at 10% 8%, rgba(147, 197, 253, 0.14) 0, transparent 40%),
    radial-gradient(circle at 88% 12%, rgba(186, 230, 253, 0.10) 0, transparent 42%),
    radial-gradient(circle at 6% 78%, rgba(147, 197, 253, 0.12) 0, transparent 44%),
    linear-gradient(180deg, #F0F9FF 0%, #F8FAFC 50%, #EFF6FF 100%) !important;
  background-attachment: fixed;
  min-height: 100dvh;
}

.test-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #b45309;
  background: #EEF2FF;
  border: 1px solid #C7D2FE;
  border-radius: 12px;
  padding: 3px 10px;
}

/* ─── PAYWALL: auth-блок в навигации ─── */
.tb-auth {
  position: relative;
  display: inline-block;
}
/* Войти / Выйти — единый стиль как у nav-links: текст без фона и рамок */
.tb-login-btn,
.tb-logout-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  cursor: pointer;
  transition: color .12s;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tb-login-btn:hover,
.tb-logout-btn:hover { color: var(--text); background: transparent; }
.tb-user-menu {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
/* Универсальное правило: hidden всегда скрывает на этой странице */
.tb-user-menu[hidden],
.tb-login-dropdown[hidden],
.tb-login-btn[hidden] { display: none !important; }
.tb-login-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(0,0,0,0.18);
  padding: 16px;
  z-index: 100;
  animation: tb-drop .16s ease-out;
}
@keyframes tb-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Крестик закрытия дропдауна логина */
.tb-login-dd-close {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--muted);
  font-size: 14px; line-height: 1; cursor: pointer; border-radius: 6px;
}
.tb-login-dd-close:hover { background: #f3f4f6; color: var(--text); }
/* Чипсы возможностей демо в модалке */
.tb-demo-feats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tb-demo-feat {
  font-size: 11px; font-weight: 600; color: var(--green-dark);
  background: var(--green-mint); border-radius: 999px; padding: 5px 10px;
}
/* Переключатель вход/регистрация в модалке */
.tb-login-popup-switch { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }
.tb-login-popup-switch button {
  background: none; border: none; color: var(--green-dark); font-weight: 700;
  cursor: pointer; font-size: 12px; padding: 0; text-decoration: underline;
}
/* Апселл полного доступа в кабинете демо */
.tb-account-upsell {
  font-size: 11.5px; line-height: 1.45; color: var(--green-dark);
  background: var(--green-mint); border: 1px solid var(--green-light);
  border-radius: 10px; padding: 9px 11px; margin-bottom: 10px;
}
.tb-account-upsell strong { font-weight: 700; }
/* Баннер «подтвердите e-mail» (Double Opt-In) в кабинете */
.tb-account-confirm {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 11.5px; line-height: 1.4; color: #92400e;
  background: var(--amber-light, #FEF3C7); border: 1px solid #FCD9A8;
  border-radius: 10px; padding: 9px 11px; margin-bottom: 10px;
}
.tb-account-confirm[hidden] { display: none; }
.tb-account-confirm-txt { flex: 1; min-width: 140px; }
.tb-account-confirm-btn {
  font: inherit; font-size: 11px; font-weight: 700; white-space: nowrap;
  color: #92400e; background: #fff; border: 1px solid #FCD9A8;
  border-radius: 7px; padding: 5px 9px; cursor: pointer;
}
.tb-account-confirm-btn:hover { background: #FEF3C7; }
.tb-account-confirm-btn:disabled { opacity: .65; cursor: default; }
/* История обращений (личный кабинет, п. 3.7) */
.tb-account-activity {
  margin: 14px 0 12px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.tb-account-activity-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--muted); margin-bottom: 8px;
}
.tb-account-activity-title::before { content: "🕑"; font-size: 12px; }
.tb-account-activity-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.tb-account-activity-empty { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.tb-account-activity-item {
  border: 1px solid var(--border); border-radius: 9px; padding: 7px 9px; background: #fff;
}
.tb-account-activity-row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.tb-account-activity-kind { font-size: 12px; font-weight: 700; color: var(--text); }
.tb-account-activity-when { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.tb-account-activity-detail { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.tb-account-activity-status {
  display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700;
  color: #0F6E56; background: #E6F7F0; border-radius: 999px; padding: 2px 8px;
}
/* Лёгкий тост */
#tb-mini-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 14px);
  z-index: 3000; max-width: 360px; width: max-content;
  background: #111827; color: #fff; font-size: 13px; font-weight: 600; line-height: 1.4;
  padding: 12px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
#tb-mini-toast.show { opacity: 1; transform: translate(-50%, 0); }
.tb-login-form {
  display: flex; flex-direction: column;
  gap: 10px;
}
.tb-login-form[hidden] { display: none; }
.tb-login-title {
  font-size: 13.5px; font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.tb-login-form input {
  font: inherit; font-size: 13.5px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color .12s;
}
.tb-login-form input:focus { border-color: var(--green); }
.tb-login-submit {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .12s;
}
.tb-login-submit:hover { opacity: 0.9; }
.tb-login-error {
  font-size: 12px;
  color: #b91c1c;
  background: #FEE2E2;
  border: 1px solid #FECACA;
  padding: 6px 10px;
  border-radius: 6px;
}
.tb-login-error.is-ok {
  color: #0F6E56;
  background: #E6F7F0;
  border-color: #BBE9D7;
}
.tb-login-hint {
  font-size: 11px; color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}
.tb-login-hint code {
  font-family: ui-monospace, "SF Mono", monospace;
  background: #f3f4f6;
  padding: 1px 4px;
  border-radius: 3px;
}

/* ─── PAYWALL: баннер сверху списка результатов ─── */
.tb-paywall-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--green-mint);
  border: 1.5px solid var(--green-light);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
/* display:flex выше перебивает дефолт [hidden]{display:none} — добавляем явно */
.tb-paywall-banner[hidden] { display: none !important; }
.tb-paywall-icon {
  font-size: 26px;
  flex-shrink: 0;
}
.tb-paywall-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.tb-paywall-text strong {
  display: block;
  font-size: 14px;
  color: var(--green-dark);
  margin-bottom: 2px;
}
.tb-paywall-actions {
  display: flex; gap: 8px;
  flex-shrink: 0;
}
.tb-paywall-btn {
  font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 1.5px solid var(--green-light);
  background: #fff;
  color: var(--green-dark);
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.tb-paywall-btn:hover { background: #fff; border-color: var(--green); }
.tb-paywall-btn--primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 2px 8px var(--green-glow);
}
.tb-paywall-btn--primary:hover {
  background: var(--green-dark); border-color: var(--green-dark);
  box-shadow: 0 4px 14px var(--green-glow);
}
@media (max-width: 640px) {
  .tb-paywall-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .tb-paywall-actions { width: 100%; }
  .tb-paywall-btn { flex: 1; }
  /* На мобиле dropdown анкорится к вьюпорту (а не к .tb-auth),
     иначе с right:-10px и узким экраном поля логина уезжают за край */
  .tb-login-dropdown {
    position: fixed;
    top: 62px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
  }
}

/* Когда не залогинен — замок-стиль на цифрах */
body.tb-locked .tb-row-val,
body.tb-locked .dash-kpi-val {
  letter-spacing: 2px;
  color: #9ca3af;
}
.dash-contact--locked {
  background: #EEF2FF !important;
  color: #3730A3 !important;
  border-color: #C7D2FE !important;
  cursor: default;
}
/* «Купить доступ» — рядом с пилюлей «Контакты после оплаты» */
.dash-contact--cta {
  background: linear-gradient(135deg, #4F46E5, #3730A3) !important;
  color: #fff !important;
  border: 1.5px solid #3730A3 !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: transform .12s, box-shadow .12s;
}
.dash-contact--cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.5);
}

/* Locked-режим: блюрим содержимое чартов (но не заголовки) */
body.tb-locked .dash-chart-body {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
  position: relative;
}
body.tb-locked .dash-chart-card {
  position: relative;
}
/* Маленький замок в углу каждой чарт-карточки */
body.tb-locked .dash-chart-card::after {
  content: '🔒';
  position: absolute;
  top: 12px; right: 12px;
  font-size: 14px;
  opacity: 0.55;
  z-index: 2;
  pointer-events: none;
}
/* Инсайт — тоже подчёркиваем что данные урезаны */
body.tb-locked .dash-insight {
  background: linear-gradient(135deg, #EEF2FF 0%, #F1F5F9 100%);
  border-color: #C7D2FE;
}
body.tb-locked .dash-insight em {
  font-style: normal;
  color: #3730A3;
  font-weight: 600;
}

/* ─── Sticky-CTA внизу дашборда в locked-режиме ─── */
.dash-locked-cta {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin-top: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.97) 25%, #F8FAFC 100%);
  border-top: 1.5px solid #C7D2FE;
  padding: 20px 32px;
  box-shadow: 0 -8px 24px -8px rgba(79, 70, 229, 0.18);
}
.dash-locked-cta-inner {
  display: flex; align-items: center; gap: 16px;
  max-width: 900px; margin: 0 auto;
}
.dash-locked-cta-text {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #334155;
}
.dash-locked-cta-text strong { color: #3730A3; }
.dash-locked-cta-icon { font-size: 20px; flex-shrink: 0; }
.dash-locked-cta-buttons {
  display: flex; gap: 10px;
  flex-shrink: 0;
}
.dash-locked-btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid #C7D2FE;
  background: #fff;
  color: #3730A3;
  transition: all .15s;
  white-space: nowrap;
}
.dash-locked-btn:hover { background: #EEF2FF; }
.dash-locked-btn--primary {
  background: linear-gradient(135deg, #4F46E5, #3730A3);
  color: #fff;
  border-color: #3730A3;
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.45);
}
.dash-locked-btn--primary:hover {
  background: linear-gradient(135deg, #3730A3, #4F46E5);
  box-shadow: 0 6px 16px -2px rgba(79, 70, 229, 0.55);
}
@media (max-width: 640px) {
  .dash-locked-cta { padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .dash-locked-cta-inner { flex-direction: column; gap: 12px; align-items: stretch; }
  .dash-locked-cta-text { font-size: 12.5px; text-align: center; justify-content: center; }
  .dash-locked-cta-buttons { width: 100%; }
  .dash-locked-btn { flex: 1; }
}

/* ─── Sticky-инструменты внизу дашборда (после логина) ─── */
.dash-tools-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.97) 35%, var(--green-mint) 100%);
  border-top: 1px solid var(--green-light);
  padding: 14px 32px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 20px -10px rgba(79, 70, 229, 0.18);
  border-radius: 0 0 18px 18px;
}
.dash-tools-bar-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  max-width: 900px; margin: 0 auto;
}
.dash-tools-btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 10px 18px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid var(--green-light);
  background: #fff;
  color: var(--green-dark);
  transition: all .15s;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.dash-tools-btn:hover {
  background: var(--green-mint);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.25);
}
.dash-tools-btn--primary {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  border-color: var(--green-dark);
  box-shadow: 0 4px 12px -2px rgba(79, 70, 229, 0.4);
}
.dash-tools-btn--primary:hover {
  background: linear-gradient(135deg, var(--green-dark), #312E81);
  box-shadow: 0 6px 16px -2px rgba(79, 70, 229, 0.5);
  color: #fff;
}
@media (max-width: 640px) {
  .dash-tools-bar { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .dash-tools-bar-inner { gap: 8px; }
  .dash-tools-btn { flex: 1; justify-content: center; font-size: 13px; padding: 10px 12px; }
}

/* ─── PAYWALL: плашка вместо чартов в дашборде ─── */
.dash-paywall {
  margin: 0;
  padding: 40px 36px;
  background: linear-gradient(135deg, #EEF2FF 0%, #F1F5F9 50%, var(--green-mint) 100%);
  text-align: center;
  border-top: 1px solid #C7D2FE;
  border-bottom: 1px solid #C7D2FE;
}
.dash-paywall-icon {
  font-size: 56px;
  margin-bottom: 12px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.1));
}
.dash-paywall-title {
  font-size: 20px;
  font-weight: 700;
  color: #334155;
  margin: 0 0 16px;
  letter-spacing: -0.3px;
}
.dash-paywall-desc {
  font-size: 13.5px;
  color: #334155;
  margin-bottom: 12px;
}
.dash-paywall-features {
  display: inline-block;
  text-align: left;
  list-style: none;
  padding: 0 0 0 0;
  margin: 0 auto 24px;
  font-size: 13.5px;
  color: var(--text);
}
.dash-paywall-features li {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(146, 64, 14, 0.18);
}
.dash-paywall-features li:last-child { border-bottom: none; }
.dash-paywall-actions {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px;
}
.dash-paywall-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: all .15s;
}
.dash-paywall-btn:hover { background: #f9fafb; transform: translateY(-1px); }
.dash-paywall-btn--primary {
  background: linear-gradient(135deg, #4F46E5, #3730A3);
  color: #fff;
  border-color: #3730A3;
  box-shadow: 0 4px 14px -2px rgba(79, 70, 229, 0.45);
}
.dash-paywall-btn--primary:hover {
  background: linear-gradient(135deg, #3730A3, #4F46E5);
  box-shadow: 0 6px 18px -2px rgba(79, 70, 229, 0.55);
}
@media (max-width: 640px) {
  .dash-paywall { padding: 30px 18px; }
  .dash-paywall-icon { font-size: 44px; }
  .dash-paywall-title { font-size: 17px; }
  .dash-paywall-actions { flex-direction: column; }
  .dash-paywall-btn { width: 100%; }
}

/* ─── HERO — прозрачный (body даёт var(--bg)) + 2 декор blob'а ─── */
.tb-hero {
  position: relative;
  /* background: transparent — раньше было #fff, у границы hero и main
     был резкий переход на body var(--bg)=#F8FAFC. С transparent всё
     поле сверху и main ниже на одном bg, без видимой ступеньки. */
  background: transparent;
  /* overflow: visible — нижний blob (amber) естественно растекается
     в demo-секцию ниже, мягко связывая hero и main без резкой границы.
     z-index < tb-main, так что blob'ы не перекрывают контент main */
  overflow: visible;
  z-index: 0;
}
/* В hero сейчас только: tag → h1 → hero-sub → hero-metrics.
   Стандартный flow-margin. Унифицированный гэп правилу был нужен когда
   hero содержал ещё search-card / final-cta / intro — сейчас не нужен. */
.tb-hero::before {
  content: ''; position: absolute; top: -120px; left: -80px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.32), transparent 70%);
  pointer-events: none; z-index: 0;
}
.tb-hero::after {
  content: ''; position: absolute; bottom: -140px; right: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(253, 230, 138, 0.28), transparent 70%);
  pointer-events: none; z-index: 0;
}
.tb-hero > * { position: relative; z-index: 1; }
.tb-hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 32px 40px;
  text-align: center;
}
/* Hero-tag — тот же pill что и .tb-section-tag, для единообразия */
.tb-hero-tag {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--green);
  background: var(--green-light);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.tb-hero h1 {
  font-size: clamp(26px, 3.6vw, 36px);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.2;
  max-width: 760px;
  margin: 0 auto 14px;
  text-align: center;
  color: var(--text);
}
.tb-hero h1 em {
  font-style: normal;
  /* Градиент-текст как на главной (.hero h1 em / page-intro-country) */
  background: linear-gradient(90deg, var(--green) 0%, #818CF8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tb-hero-sub {
  font-size: 15px;
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto 24px;
  line-height: 1.55;
}
.tb-hero-metrics {
  display: inline-flex; align-items: center; gap: 22px;
  /* Равные отступы сверху и снизу — между hero-sub выше и intro-main ниже */
  margin: 24px 0;
  padding: 12px 24px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}
.tb-hm { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tb-hm-n {
  font-size: 18px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.tb-hm-l {
  font-size: 10.5px; color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tb-hm-sep {
  width: 1px; height: 28px;
  background: var(--border);
}

/* ─── INTRO-текст внутри hero (was a separate section, теперь жилец hero) ─── */
.tb-intro-main {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.2px;
  /* margin-top: 0 — отступ от метрик задан в .tb-hero-metrics { margin: 24px 0 } */
  margin: 0 auto 6px;
  max-width: 720px;
}
.tb-intro-sub {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 720px;
  margin: 0 auto;
}
/* Trust-strip — 3 пиллы под intro-текстом */
.tb-trust {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.tb-trust-item {
  display: inline-flex; align-items: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--green-dark);
  background: var(--green-mint);
  border: 1px solid var(--green-light);
  padding: 5px 12px;
  border-radius: 16px;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .tb-intro-main { font-size: 14px; }
  .tb-intro-sub { font-size: 12.5px; }
  .tb-trust { gap: 6px; margin-top: 12px; }
  .tb-trust-item { font-size: 11px; padding: 4px 9px; }
}

/* Empty-state в результатах скрыт пока пользователь не залогинен —
   до логина текст с тем же смыслом уже есть в intro-блоке наверху */
body.tb-locked .tb-empty { display: none; }

/* Auth-landing (нет locked, нет compact) — demo-секция последняя в main,
   поэтому её padding-bottom удваивается с main padding-bottom = большое
   пустое место перед футером. Обнуляем — main padding-bottom даст ровный
   отступ. Для locked/compact оставляем как было — там есть другие секции
   после demo */
body:not(.tb-locked):not(.tb-compact) #tb-sec-demo { padding-bottom: 0; }

/* ─── FINAL CTA — белая карточка с индиго-акцентом ─── */
/* Виден только до логина (как и howto) */
body:not(.tb-locked) .tb-final-cta { display: none; }
.tb-final-cta {
  max-width: 1000px;
  /* Увеличенный отступ сверху — final-cta теперь последний в hero,
     отделяет блок CTA от search-card выше */
  margin: 56px auto 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 32px 32px 26px;
  text-align: center;
  box-shadow: var(--shadow-md);
}
@media (max-width: 640px) {
  .tb-final-cta { margin-top: 36px; }
}
.tb-final-cta-title {
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--text);
}
.tb-final-cta-sub {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 22px;
}
.tb-final-cta-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
.tb-final-cta-btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 11px 22px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid var(--green-light);
  background: #fff;
  color: var(--green-dark);
  transition: background .15s, border-color .15s;
}
.tb-final-cta-btn:hover { background: var(--green-mint); }
.tb-final-cta-btn--primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 2px 8px var(--green-glow);
}
.tb-final-cta-btn--primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  box-shadow: 0 4px 14px var(--green-glow);
}
.tb-final-cta-hint {
  font-size: 12px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.5;
}
@media (max-width: 640px) {
  .tb-final-cta { padding: 24px 16px 20px; margin-top: 16px; border-radius: 14px; }
  .tb-final-cta-sub { font-size: 13px; margin-bottom: 18px; }
  .tb-final-cta-actions { flex-direction: column; gap: 8px; margin-bottom: 12px; }
  .tb-final-cta-btn { width: 100%; padding: 11px 16px; font-size: 13.5px; }
  .tb-final-cta-hint { font-size: 11.5px; }
}

/* ─── MAIN ─── */
.tb-main {
  /* width: 100% + max-width: 1000 — main всегда фиксированной ширины.
     Без width:100% в flex-column body (display:flex из style.css) main
     с margin:0 auto сжимается до ширины контента → между landing и
     compact ширина прыгала (919 ↔ 1000px). */
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 32px 30px;
  /* z-index: 1 + position:relative — чтобы контент main был ВЫШЕ
     hero-blob'ов (теперь они растекаются в main с overflow:visible) */
  position: relative;
  z-index: 1;
}

/* ─── СЕКЦИИ — единый каркас 1:1 с главной (.section-tag, h2 800, etc) ─── */
/* Внутри секции padding = 0, чтобы расстояние между секциями было задано
   только внешним margin (т.е. одинаковым). Иначе суммируются: padding одной +
   padding следующей. Pricing-секция с mint-фоном сохраняет свой внутренний
   padding (см. .tb-section--pricing). */
.tb-section { padding: 0; }
.tb-section + .tb-section { margin-top: 48px; }
.tb-section-head {
  text-align: center;
  margin-bottom: 36px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
/* Tag-пилл как .section-tag на главной: indigo bg + indigo text */
.tb-section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--green);
  background: var(--green-light);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.tb-section-h {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.2;
}
.tb-section-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 auto;
  max-width: 520px;
}
@media (max-width: 640px) {
  .tb-section + .tb-section { margin-top: 32px; }
  .tb-section-head { margin-bottom: 24px; }
  .tb-section-sub { font-size: 13.5px; }
}

/* ─── Приветствие для залогиненных юзеров ─── */
.tb-greeting { display: none; }
body:not(.tb-locked) #tb-sec-demo-head { display: none; }
/* Залогинен + не compact: hero скрыт, приветствие — первый элемент.
   Без этого блок прилипает к шапке (у .tb-main padding-top: 0). */
body:not(.tb-locked):not(.tb-compact) .tb-main { padding-top: 28px; }
/* Градиентный баннер-приветствие (демо и платные) */
body:not(.tb-locked) #tb-greeting {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.tb-greet-hero {
  position: relative;
  background: linear-gradient(120deg, #4F46E5, #3730A3);
  color: #fff;
  padding: 20px 24px;
}
.tb-greet-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.16); color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.tb-greet-close:hover { background: rgba(255,255,255,.30); }
.tb-greet-hero-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-right: 32px;
}
.tb-greet-title { font-size: 18px; font-weight: 800; letter-spacing: -0.2px; color: #fff; margin: 0; }
.tb-greet-email { font-size: 12px; color: #C7D2FE; margin-top: 3px; word-break: break-all; }
.tb-greet-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #BBF7D0; }
.tb-greet-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.tb-greet-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tb-greet-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; color: #fff;
}
.tb-greet-body { padding: 18px 24px; display: flex; flex-direction: column; gap: 11px; }
.tb-greet-lead { font-size: 13.5px; color: var(--muted); margin: 0; }
.tb-greet-lead strong { color: var(--text); font-weight: 700; }
.tb-greet-feat { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--muted); line-height: 1.5; }
.tb-greet-feat strong { color: var(--text); font-weight: 600; }
.tb-greet-feat-ic { flex-shrink: 0; }
.tb-greet-strip {
  display: flex; align-items: center; gap: 12px; position: relative;
  border-top: 1px dashed var(--border); background: #FFFBEB;
  padding: 13px 24px;
}
.tb-greet-strip[hidden] { display: none; }
.tb-greet-strip-txt { font-size: 12.5px; color: #92400E; flex: 1; line-height: 1.45; }
.tb-greet-strip-txt b { color: #7c2d12; }
.tb-greet-x {
  position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
  width: 26px; height: 26px; border: none; background: transparent; color: #B45309;
  font-size: 15px; border-radius: 50%; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.tb-greet-x:hover { background: rgba(180,83,9,.12); }
.tb-greet-tariff {
  font: inherit; font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 10px;
  border: none; background: var(--accent); color: #3a2400; cursor: pointer; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(245,158,11,.3);
}
.tb-greet-tariff:hover { filter: brightness(1.04); }
body.tb-compact #tb-greeting { display: none !important; }
/* Закрыт крестиком ранее — прячем сразу (без мелькания при перезагрузке) */
body.greet-closed #tb-greeting { display: none !important; }
@media (max-width: 640px) {
  .tb-greet-hero { padding: 16px 16px; }
  .tb-greet-body { padding: 14px 16px; }
  .tb-greet-strip { padding: 12px 16px; flex-wrap: wrap; }
  .tb-greet-title { font-size: 16px; }
}

/* ─── Для залогиненных скрываем hero + features + pricing — оставляем
       только приветствие и поиск ─── */
body:not(.tb-locked) .tb-hero,
body:not(.tb-locked) #tb-sec-what,
body:not(.tb-locked) #tb-sec-pricing { display: none; }

/* ─── ФИЧИ — карточки в стиле .why-card главной (shadow-based) ─── */
.tb-feat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.tb-feat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: 0 1px 2px rgba(15,23,42,0.05), 0 1px 3px rgba(15,23,42,0.06);
  transition: box-shadow .2s, border-color .2s;
}
.tb-feat:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(15,23,42,0.06), 0 2px 4px rgba(15,23,42,0.04);
}
/* Эмодзи-иконка в soft-индиго круге — даёт визуальную опору карточке */
.tb-feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  font-size: 26px;
  line-height: 1;
  background: var(--green-mint);
  border: 1px solid var(--green-light);
  border-radius: 50%;
}
.tb-feat-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.1px;
}
.tb-feat-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
@media (max-width: 720px) {
  .tb-feat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tb-feat { padding: 22px 16px 20px; }
  .tb-feat-icon { font-size: 26px; margin-bottom: 10px; }
  .tb-feat-title { font-size: 13.5px; margin-bottom: 6px; }
  .tb-feat-desc { font-size: 12px; }
}

/* ─── PRICING-секция (та же ширина что и остальные, мягкий wash) ─── */
/* Премиум-CTA: глубокий indigo-градиент со свечением — выделяется на светлом фоне */
.tb-section--pricing {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3B82F6 0%, #1E40AF 100%);
  border-radius: 20px;
  padding: 56px 32px;
  box-shadow: 0 18px 44px -14px rgba(37, 99, 235, 0.45);
  color: #fff;
}
/* Мягкое свечение в углу + тонкая световая рамка — добавляют глубины */
.tb-section--pricing::before {
  content: "";
  position: absolute;
  top: -45%; right: -8%;
  width: 460px; height: 460px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}
.tb-section--pricing > * { position: relative; z-index: 1; }
.tb-section--pricing .tb-section-h { color: #fff; }
.tb-section--pricing .tb-section-sub { color: rgba(255, 255, 255, 0.86); }
.tb-section--pricing .tb-section-tag {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
/* Trust-пиллы — полупрозрачное стекло поверх градиента */
.tb-section--pricing .tb-trust { margin-top: 0; }
.tb-section--pricing .tb-trust-item {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}
/* «от 4 900 ₽/мес · …» — короткая строка с ценой над CTA-кнопками */
.tb-pricing-from {
  text-align: center;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.86);
  margin-top: 28px;
  margin-bottom: 0;
}
.tb-pricing-from strong {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.2px;
}
.tb-cta-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}
.tb-cta-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s;
  white-space: nowrap;
}
.tb-cta-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: #fff; }
/* Главная кнопка — белая на indigo, максимальный контраст */
.tb-cta-btn--primary {
  background: #fff;
  color: var(--green-dark);
  border-color: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}
.tb-cta-btn--primary:hover {
  background: #fff;
  color: #312E81;
  border-color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.30);
}
@media (max-width: 640px) {
  .tb-section--pricing { padding: 36px 20px; border-radius: 18px; margin: 0; }
  .tb-cta-actions { flex-direction: column; gap: 8px; }
  .tb-cta-btn { width: 100%; padding: 12px 16px; }
}

/* «← Назад» — показывается в compact-режиме */
.tb-back-btn {
  display: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  padding: 18px 0;
  margin: 0;
  cursor: pointer;
  align-items: center;
  gap: 6px;
  transition: color .15s;
}
.tb-back-btn:hover { color: var(--text); }
body.tb-compact .tb-back-btn { display: inline-flex; }
/* В compact «← Назад» — первый элемент. Обнуляем верхний padding у main и
   секции, чтобы отступ задавал ТОЛЬКО симметричный padding кнопки (18/18) —
   одинаково над и под кнопкой на всех ширинах (у .tb-main padding-top меняется
   по брейкпоинтам: 0 на пк, 18 на мобиле — иначе сверху разъезжается). */
body.tb-compact .tb-main { padding-top: 0; }
/* В compact-режиме скрываем «landing»-блоки */
/* compact-режим: после первого поиска скрываем hero (с описанием),
   секцию «Что внутри отчёта» и секцию «Платный доступ». В демо-секции
   прячем header (tag+h2+sub) — остаются search-card + результаты */
body.tb-compact .tb-hero,
body.tb-compact #tb-sec-what,
body.tb-compact #tb-sec-pricing,
body.tb-compact #tb-sec-demo .tb-section-head { display: none !important; }
/* В compact «← Назад» — первый элемент секции; убираем верхний padding секции,
   чтобы отступ над кнопкой = отступу под ней (симметрично, через padding кнопки) */
body.tb-compact #tb-sec-demo { padding-top: 0; padding-bottom: 0; }
/* Для незалогиненных в compact блок «Полный доступ» оставляем — он завершает демо-список */
body.tb-compact.tb-locked:not(.tb-dashboard) #tb-sec-pricing { display: block !important; margin-top: 32px; }

/* Заголовок над инпутом — виден только в compact-режиме после логина */
.tb-compact-title { display: none; }
body.tb-compact:not(.tb-locked) .tb-compact-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.3;
  margin: 0 0 26px;
}
@media (max-width: 640px) {
  body.tb-compact:not(.tb-locked) .tb-compact-title { font-size: 14.5px; margin-bottom: 20px; }
}

/* Поисковая карточка — лёгкая индиго-мятная подложка, выделяется
   на белом фоне страницы как «активная зона ввода» */
.tb-search-card {
  background: var(--green-mint);
  border: 1.5px solid var(--green-light);
  border-radius: 18px;
  padding: 24px 24px 20px;
  margin-bottom: 20px;
  position: relative;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 18px rgba(79, 70, 229, 0.07);
}
/* пустой ::before — убираем декоративный шильдик «Поиск компаний» */
.tb-search-card::before { content: none; }
.tb-search-card .field input,
.tb-search-card .field select,
.tb-name-field input {
  background: #fff;
  border-color: var(--border);
}
.tb-search-card .field input:focus,
.tb-name-field input:focus {
  background: #fff;
  border-color: var(--green);
}
.tb-name-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}
.tb-direction-field { min-width: 0; }
@media (max-width: 720px) {
  .tb-name-row { grid-template-columns: 1fr; gap: 12px; }
}
.tb-name-field input {
  width: 100%;
  font-size: 14.5px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.tb-name-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.tb-name-field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  display: block;
}
.tb-search-grid {
  display: grid;
  /* tnved (1.2fr), country (1fr), button (auto). direction теперь в name-row */
  grid-template-columns: 1.2fr 1fr auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}
.tb-direction {
  display: inline-flex;
  background: #f3f4f6;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.tb-dir-btn {
  font: inherit; font-size: 13px;
  /* Одинаковая толщина шрифта во всех состояниях → ширина не прыгает */
  font-weight: 600;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}
.tb-dir-btn:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.6); }
.tb-dir-btn.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.tb-dir-btn[data-dir="import"].active { color: #1E40AF; }
.tb-dir-btn[data-dir="export"].active { color: #047857; }
@media (max-width: 1000px) {
  .tb-search-grid { grid-template-columns: 1fr; }
  .tb-direction { width: 100%; display: flex; }
  .tb-dir-btn { flex: 1; text-align: center; }
}
@media (max-width: 640px) {
  /* «🔍 Поиск компаний» pseudoelement-шильдик удалён — можно убрать
     запасной отступ сверху, делаем компактнее на мобиле */
  .tb-search-card { padding: 16px 14px 14px; border-radius: 14px; }
  .tb-name-row { margin-bottom: 10px; }
  .tb-search-grid { gap: 10px; margin-bottom: 10px; }
  /* Чипы: label на отдельной строке, чипы — flex-row с одинаковыми отступами */
  .tb-search-chips {
    row-gap: 8px;
    column-gap: 6px;
    padding-top: 12px;
  }
  .tb-search-chips .search-chip { font-size: 11.5px; padding: 5px 10px; border-radius: 16px; }
  .tb-chips-label {
    font-size: 10.5px;
    width: 100%;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    color: var(--muted);
  }
}
.tb-search-grid .field label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  display: block;
}
.tb-search-grid .field input {
  width: 100%;
  font-size: 14.5px;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.tb-search-grid .field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.btn-tb-search {
  padding: 11px 22px !important;
  font-size: 14.5px !important;
  white-space: nowrap;
  height: fit-content;
}

.tb-search-chips {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.tb-chips-label {
  font-size: 11.5px; color: var(--muted);
  font-weight: 500;
  margin-right: 4px;
}
/* После логина в «Часто ищут» оставляем ТОЛЬКО «Избранное»: прячем подпись и
   товарные/страновые чипсы. Если избранного нет — весь блок пуст (fav-chip
   имеет [hidden]), скрываем его, чтобы не висела пунктирная линия. */
body:not(.tb-locked) .tb-search-chips .tb-chips-label,
body:not(.tb-locked) .tb-search-chips .search-chip:not(.tb-fav-chip):not(.tb-recent-chip) { display: none; }
body:not(.tb-locked) .tb-search-chips:not(:has(.tb-fav-chip:not([hidden]))):not(:has(.tb-recent-chip:not([hidden]))) { display: none !important; }

/* ─── Метрик-бар результатов поиска (полноширинный над списком) ─── */
.tb-metrics-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.tb-metric-card {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.tb-metric-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green), #818CF8);
}
.tb-metric-card.green::before {
  background: linear-gradient(90deg, #10B981, #34D399);
}
.tb-metric-card-val {
  font-size: 22px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
  line-height: 1.1;
}
.tb-metric-card-lbl {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 6px;
}

/* ─── Empty-state ─── */
.tb-empty {
  text-align: center;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 28px 32px;
}
.tb-empty-icon { font-size: 32px; margin-bottom: 10px; opacity: 0.6; }
.tb-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.tb-empty-text { font-size: 13px; color: var(--muted); }

/* ─── Блок «Как это работает» (отдельная карточка, только до логина) ─── */
body:not(.tb-locked) .tb-howto { display: none; }
.tb-howto {
  display: none;   /* блок «Как это работает» скрыт */
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 12px 32px 24px;
  text-align: left;
  box-shadow: none;
  overflow: hidden;
}
/* Те же декоративные blob-фигуры что и у hero — даёт визуальную связь
   с верхом страницы. Прозрачность ниже чтобы не отвлекать от шагов. */
.tb-howto::before {
  content: ''; position: absolute; top: -100px; left: -100px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.09), transparent 70%);
  pointer-events: none; z-index: 0;
}
.tb-howto::after {
  content: ''; position: absolute; bottom: -120px; right: -80px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.07), transparent 70%);
  pointer-events: none; z-index: 0;
}
.tb-howto > * { position: relative; z-index: 1; }
.tb-howto-divider {
  width: 40px; height: 2px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 14px;
}
.tb-howto-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
  letter-spacing: -0.2px;
}
.tb-howto-steps {
  list-style: none;
  padding: 0;
  /* Один столбец на любых экранах — шаги идут друг под другом по центру */
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 520px;
  margin: 0 auto;
}
.tb-howto-steps li {
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.tb-howto-step-num {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  flex-shrink: 0;
  background: var(--green-mint);
  color: var(--green-dark);
  border-radius: 50%;
  font-size: 14.5px;
  font-weight: 700;
  /* Soft halo вокруг кружка — добавляет жизни без смены цвета/гео */
  box-shadow:
    0 0 0 4px rgba(79, 70, 229, 0.08),
    0 4px 12px rgba(79, 70, 229, 0.10);
  transition: transform .2s, box-shadow .2s;
}
.tb-howto-steps li:hover .tb-howto-step-num {
  transform: scale(1.08);
  box-shadow:
    0 0 0 6px rgba(79, 70, 229, 0.12),
    0 6px 18px rgba(79, 70, 229, 0.18);
}
.tb-howto-step-body {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  padding-top: 0;
}
/* strong на своей строке — следующее предложение с новой строки */
.tb-howto-step-body strong {
  display: block;
  color: var(--text);
  font-weight: 700;
  margin-bottom: 2px;
}
.tb-howto-step-body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  background: #f3f4f6;
  color: var(--text);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}
.tb-howto-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}
.tb-howto-btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 11px 22px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid var(--green-light);
  background: #fff;
  color: var(--green-dark);
  transition: background .15s, border-color .15s;
}
.tb-howto-btn:hover { background: var(--green-mint); }
.tb-howto-btn--primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}
.tb-howto-btn--primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}
.tb-howto-hint {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}
@media (max-width: 640px) {
  .tb-howto { padding: 20px 16px 18px; margin-top: 14px; border-radius: 14px; }
  .tb-howto-title { font-size: 15.5px; margin-bottom: 14px; }
  .tb-howto-steps { gap: 12px; margin-bottom: 18px; }
  .tb-howto-steps li { gap: 11px; }
  .tb-howto-step-num { width: 24px; height: 24px; font-size: 11.5px; }
  .tb-howto-step-body { font-size: 12.5px; padding-top: 1px; }
  .tb-howto-actions { flex-direction: column; gap: 8px; margin-bottom: 10px; }
  .tb-howto-btn { width: 100%; font-size: 13px; padding: 10px 16px; }
  .tb-howto-hint { font-size: 11px; }
}

/* ─── Список компаний — премиум-карточки ─── */
.tb-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(86px, 110px)) 24px;
  gap: 20px;
  align-items: center;
  padding: 16px 22px 16px 48px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  /* Скругляем pseudo-полосу слева (::before) по углам row */
  overflow: hidden;
}
.tb-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; border-radius: 12px 0 0 12px;
  background: transparent;
  transition: background .15s;
}
.tb-row:hover {
  border-color: var(--green-light);
  box-shadow: 0 6px 20px -6px rgba(79, 70, 229, 0.2);
  transform: translateY(-1px);
}
.tb-row:hover::before {
  background: linear-gradient(180deg, var(--green), #818CF8);
}
.tb-row-num {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--green-dark);
  background: var(--green-mint); line-height: 1;
}
.tb-row-main { min-width: 0; }
.tb-row-nameline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tb-row-nameline .tb-row-name { flex: 0 1 auto; min-width: 0; }
.tb-row-nameline .tb-fav { width: 28px; height: 28px; font-size: 17px; }
.tb-row-name {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-row-sub {
  font-size: 12px; color: var(--muted);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-row-codes {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 6px;
  max-width: 100%;
}
.tb-code-badge {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--green-mint);
  color: var(--green-dark);
  border: 1px solid var(--green-light);
}
.tb-code-badge-more {
  font-size: 10.5px;
  color: var(--muted);
  padding: 2px 4px;
}
.tb-row-stat { text-align: right; }
.tb-row-val {
  display: block;
  font-size: 14px; font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.tb-row-lbl {
  display: block;
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-top: 3px;
}
.tb-row-arrow {
  font-size: 18px; color: var(--muted);
  transition: all .15s;
}
.tb-row:hover .tb-row-arrow { color: var(--green); transform: translateX(4px); }

@media (max-width: 900px) {
  .tb-row { grid-template-columns: 1fr auto auto; gap: 12px; padding: 12px 16px 12px 40px; }
  .tb-row-stat:nth-of-type(3),
  .tb-row-stat:nth-of-type(4) { display: none; }
  .tb-row-arrow { display: none; }
  .btn-tb-search { width: 100%; }
  .tb-metrics-bar { grid-template-columns: repeat(2, 1fr); }
  .tb-hero-metrics { gap: 14px; padding: 12px 18px; flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 640px) {
  .tb-hero-inner { padding: 22px 16px 20px; }
  .tb-hero h1 { font-size: 22px; line-height: 1.22; margin-bottom: 10px; }
  .tb-hero-sub { font-size: 13px; margin-bottom: 18px; }
  .tb-hero-tag {
    font-size: 10.5px;
    padding: 4px 12px;
    margin-bottom: 12px;
    letter-spacing: 0.2px;
  }
  .tb-hero-metrics {
    gap: 6px;
    margin: 18px 0;
    padding: 10px 14px;
    border-radius: 12px;
  }
  .tb-hm { gap: 1px; }
  .tb-hm-n { font-size: 15px; }
  .tb-hm-l { font-size: 9px; letter-spacing: 0.3px; }
  .tb-hm-sep { height: 20px; }
  /* Главные отступы main — одинаковые 14px по краям, 18px сверху, 32px снизу */
  .tb-main { padding: 18px 14px 32px; }
  .tb-metrics-bar { grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
  .tb-metric-card { padding: 10px 12px; }
  .tb-metric-card-val { font-size: 17px; }
  .tb-metric-card-lbl { font-size: 9.5px; }
  /* Карточка компании — 1 stat для компактности (оборот ВЭД) */
  .tb-row {
    padding: 12px 14px 12px 38px;
    gap: 8px;
    grid-template-columns: 1fr auto;
    border-radius: 10px;
  }
  .tb-row-num { left: 10px; width: 20px; height: 20px; font-size: 11px; }
  .tb-row-stat:nth-of-type(2),
  .tb-row-stat:nth-of-type(3),
  .tb-row-stat:nth-of-type(4) { display: none; }
  .tb-row-stat { text-align: right; }
  .tb-row-val { font-size: 13px; }
  .tb-row-lbl { font-size: 9px; margin-top: 2px; }
  .tb-row-codes { margin-top: 5px; }
  .tb-empty { padding: 28px 18px; border-radius: 12px; }
  .tb-empty-icon { font-size: 26px; margin-bottom: 8px; }
  .tb-empty-title { font-size: 13.5px; line-height: 1.4; }
  .tb-empty-text { font-size: 12px; margin-top: 4px; }
}

/* Для scrollIntoView к результатам — учитываем sticky navbar высотой ~70px,
   чтобы первые карточки не оказались под ним */
#t-results { scroll-margin-top: 80px; }

/* Лёгкий dim во время поиска — не очищаем DOM, layout стабильный */
#t-results.tb-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity .15s;
}

/* ─── Пагинация — по центру, без фона ─── */
.tb-pagination {
  display: flex; flex-direction: column; align-items: center;
  margin-top: 22px;
  padding: 0;
  gap: 8px;
  background: transparent;
  border: none;
}
.tb-pagination-info {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.tb-pagination-info strong { color: var(--text); }
.tb-pagination-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.tb-page-btn {
  font: inherit; font-size: 13px; font-weight: 500;
  min-width: 34px; height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s;
}
.tb-page-btn:hover:not(:disabled):not(.tb-page-btn--active) {
  background: var(--green-mint);
  border-color: var(--green-light);
  color: var(--green-dark);
}
.tb-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.tb-page-btn--active {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  border-color: var(--green);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, 0.45);
}
.tb-page-prev, .tb-page-next {
  font-size: 18px; font-weight: 600;
}
.tb-page-ellipsis {
  color: var(--muted);
  padding: 0 4px;
  font-size: 14px;
  user-select: none;
}
@media (max-width: 640px) {
  .tb-page-btn { min-width: 30px; height: 30px; font-size: 12.5px; padding: 0 8px; }
}

/* ─── Info strip снизу — продающая ─── */
.tb-info-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.tb-info-item {
  display: flex; gap: 12px; align-items: flex-start;
}
.tb-info-icon { font-size: 26px; flex-shrink: 0; }
.tb-info-title {
  font-size: 13.5px; font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.tb-info-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

@media (max-width: 720px) {
  .tb-info-strip { grid-template-columns: 1fr; gap: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD MODAL — Premium-отчёт
   ═══════════════════════════════════════════════════════════════════════ */
.dash-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.dash-modal.open { opacity: 1; visibility: visible; }

/* ─── INLINE-режим дашборда: открывается в том же окне ─── */
body.tb-dashboard .tb-hero { display: none !important; }
body.tb-dashboard .tb-main > *:not(.dash-modal) { display: none !important; }
body.tb-dashboard .dash-modal {
  position: static !important;
  inset: auto !important;
  z-index: auto;
  opacity: 1 !important;
  visibility: visible !important;
  transition: none;
}
body.tb-dashboard .dash-overlay { display: none !important; }
body.tb-dashboard .dash-card {
  position: static !important;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  /* overflow: hidden — чтобы цветной фон .dash-cover не выходил за
     скруглённые углы карточки (раньше тут было visible — фон бликовал) */
  overflow: hidden !important;
  margin: 0 !important;
  /* .dash-card по умолчанию opacity: 0 (раньше поднималось .dash-modal.open) —
     в inline-режиме .open класса нет, поэтому возвращаем видимость */
  opacity: 1 !important;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}
body.tb-dashboard .dash-sticky-close { display: none !important; }

/* На мобиле явно гасим любые модальные позиции/трансформы у инлайн-дашборда */
@media (max-width: 720px) {
  body.tb-dashboard .dash-modal,
  body.tb-dashboard .dash-card {
    position: static !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 !important;
  }
  body.tb-dashboard .dash-card { border-radius: 14px; }
  /* Sticky section-head липнет к window, скрываем стики чтобы не лез под nav */
  body.tb-dashboard .dash-section-head { position: static !important; }
}
/* Кнопка «← К списку компаний» над дашбордом */
.tb-dash-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: none;
  /* Симметричный padding — отступ над и под «← К списку компаний» одинаков
     (как у «← Назад»). main в compact/dashboard без верхнего padding (ниже). */
  padding: 18px 0;
  margin: 0;
  cursor: pointer;
  transition: color .15s;
}
.tb-dash-back:hover { color: var(--text); }
/* В режиме дашборда «← К списку» — первый элемент: убираем верхний padding
   main, чтобы отступ задавал только симметричный padding кнопки (на пк
   padding-top у .tb-main = 0, на мобиле 18 — иначе сверху разъезжается). */
body.tb-dashboard .tb-main { padding-top: 0; }
.dash-overlay {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.dash-card {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 28px 90px -16px rgba(0, 0, 0, 0.4);
  padding: 0;
  opacity: 0;
  transition: transform .3s cubic-bezier(.2,.7,.3,1.2), opacity .25s;
  /* Кастомный скролл — тонкий, фирменный */
  scrollbar-width: thin;
  scrollbar-color: var(--green-light) transparent;
}
.dash-card::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.dash-card::-webkit-scrollbar-track {
  background: transparent;
  /* Отступы сверху и снизу — чтобы scrollbar не доходил до скруглённых углов */
  margin: 24px 0;
}
.dash-card::-webkit-scrollbar-thumb {
  background: var(--green-light);
  border-radius: 4px;
  transition: background .15s;
}
.dash-card::-webkit-scrollbar-thumb:hover { background: #818CF8; }
.dash-card::-webkit-scrollbar-thumb:active { background: var(--green); }
/* Скрываем кнопки-стрелки сверху и снизу scrollbar (Windows, Linux) — везде на странице */
::-webkit-scrollbar-button,
::-webkit-scrollbar-button:single-button,
::-webkit-scrollbar-button:start,
::-webkit-scrollbar-button:end,
::-webkit-scrollbar-button:vertical,
::-webkit-scrollbar-button:horizontal {
  display: none !important;
  height: 0 !important;
  width: 0 !important;
  background: none !important;
}
/* Скрываем угол между вертикальным и горизонтальным scrollbar */
::-webkit-scrollbar-corner { background: transparent; }
.dash-modal.open .dash-card {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
/* Sticky-обёртка крестика — height: 0, не занимает поток, но прилипает наверху */
.dash-sticky-close {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 0;
  pointer-events: none;
}
.dash-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px -4px rgba(0,0,0,0.18);
  font-size: 16px;
  color: var(--text);
  cursor: pointer;
  pointer-events: auto;
  transition: all .15s;
  backdrop-filter: blur(10px);
}
.dash-close:hover { background: #fff; transform: rotate(90deg); box-shadow: 0 6px 18px -4px rgba(0,0,0,0.25); }

/* ─── Cover (как первая страница отчёта) ─── */
.dash-cover {
  background: #fff;
  padding: 40px 36px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.dash-report-stamp {
  position: absolute; top: 16px; left: 36px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--green-dark);
  background: rgba(255,255,255,0.7);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--green-light);
}
.dash-tools {
  position: absolute; top: 14px; right: 64px;
  display: flex; gap: 6px;
  z-index: 4;
}
.dash-tool-btn {
  font: inherit; font-size: 11px; font-weight: 600;
  padding: 5px 12px;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  color: var(--text);
  transition: all .12s;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}
.dash-tool-btn:hover { background: #fff; border-color: var(--green-light); }
@media (max-width: 640px) {
  .dash-tools { right: 56px; top: 12px; }
  .dash-tool-btn { padding: 4px 8px; font-size: 10px; }
}
.dash-head {
  display: flex; gap: 18px; align-items: flex-start;
  margin-top: 20px;
  position: relative; z-index: 1;
}
.dash-head-logo {
  width: 64px; height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px -6px rgba(79, 70, 229, 0.55);
  letter-spacing: -0.5px;
}
.dash-head-info { flex: 1; min-width: 0; }
.dash-head-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.dash-head-name {
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}
.dash-role {
  font-size: 11px; font-weight: 700;
  padding: 4px 12px;
  border-radius: 14px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.dash-role.role-import { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.dash-role.role-export { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.dash-role.role-both   { background: var(--green-light); color: var(--green-dark); border: 1px solid var(--green-light); }
.dash-role.role-none   { background: #F3F4F6; color: #6B7280; border: 1px solid #E5E7EB; }
.dash-head-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 12px; color: var(--muted);
  margin-bottom: 12px;
}
.dash-head-contacts {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dash-contact {
  font-size: 12px;
  background: rgba(255,255,255,0.9);
  color: var(--green-dark);
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid var(--green-light);
  text-decoration: none;
  white-space: nowrap;
  transition: all .12s;
  backdrop-filter: blur(4px);
}
.dash-contact:hover { background: #fff; transform: translateY(-1px); }

/* Insight */
.dash-insight {
  margin: 18px 36px 0;
  padding: 14px 18px;
  background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
  border: 1px solid #C7D2FE;
  border-radius: 12px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
}
.dash-insight strong { color: #3730A3; font-weight: 700; }

/* KPI — 4 крупных карточки */
.dash-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 20px 36px 20px;  /* равные отступы сверху/снизу — симметрично с section-head */
}
.dash-kpi {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  display: flex; flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: all .15s;
}
.dash-kpi::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green), #818CF8);
}
.dash-kpi:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -10px rgba(79, 70, 229, 0.28); border-color: var(--border-hover); }
/* Иконка в мягком тонированном чипе — единый стиль, цвет по смыслу метрики */
.dash-kpi-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; margin-bottom: 12px;
  background: var(--green-mint);
  transition: transform .15s;
}
.dash-kpi:hover .dash-kpi-icon { transform: scale(1.06); }
.dash-kpi-val {
  font-size: 27px; font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
/* Мини-спарклайн внизу KPI — помесячная динамика */
.dash-kpi-spark { width: 100%; height: 24px; display: block; margin-top: auto; padding-top: 10px; }
.dash-kpi { justify-content: flex-start; }
.dash-kpi-lbl {
  font-size: 11.5px; color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  line-height: 1.4;
}
/* Семантические тона KPI: индиго (оборот) · голубой (импорт) · изумруд
   (экспорт) · янтарь (партнёры). Цвет верхней полоски + фон чипа иконки. */
.dash-kpi--ind::before { background: linear-gradient(90deg, #4F46E5, #818CF8); }
.dash-kpi--ind  .dash-kpi-icon { background: #EEF2FF; }
.dash-kpi--sky::before { background: linear-gradient(90deg, #0EA5E9, #38BDF8); }
.dash-kpi--sky  .dash-kpi-icon { background: #E0F2FE; }
.dash-kpi--emr::before { background: linear-gradient(90deg, #10B981, #34D399); }
.dash-kpi--emr  .dash-kpi-icon { background: #ECFDF5; }
.dash-kpi--amb::before { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.dash-kpi--amb  .dash-kpi-icon { background: #FEF3C7; }
/* Лёгкое появление со сдвигом — KPI каскадом, карточки графиков плавно */
@keyframes dash-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.dash-kpi { animation: dash-rise .4s ease-out both; }
.dash-kpi:nth-child(2) { animation-delay: .05s; }
.dash-kpi:nth-child(3) { animation-delay: .10s; }
.dash-kpi:nth-child(4) { animation-delay: .15s; }
.dash-chart-card { animation: dash-rise .45s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .dash-kpi, .dash-chart-card { animation: none; }
}

/* ─── Секции Импорт / Экспорт ─── */
.dash-section { margin: 0; }
.dash-section + .dash-section { margin-top: 0; }
/* Симметричные паддинги: верх и низ одинаковые */
.dash-section-head {
  padding: 20px 36px;
  position: sticky;
  top: 0;
  z-index: 3;
}
.dash-section--import .dash-section-head {
  background: linear-gradient(135deg, var(--green-mint) 0%, #F5F3FF 100%);
  border-top: 1px solid var(--green-light);
  border-bottom: 1px solid var(--green-light);
}
.dash-section--export .dash-section-head {
  background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
  border-top: 1px solid #A7F3D0;
  border-bottom: 1px solid #A7F3D0;
}
.dash-section-title-wrap {
  display: flex; align-items: center; gap: 16px;
}
.dash-section-emoji {
  font-size: 32px;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.1));
}
.dash-section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin: 0 0 4px;
  text-transform: uppercase;
}
.dash-section--import .dash-section-title { color: var(--green-dark); }
.dash-section--export .dash-section-title { color: #047857; }
.dash-section-sub {
  font-size: 14px;
  color: var(--muted);
}
.dash-section-sub strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.dash-section--import .dash-section-sub strong { color: var(--green); }
.dash-section--export .dash-section-sub strong { color: #10B981; }
.dash-section-body {
  padding: 22px 36px 28px;
  background: #fff;
}
.dash-empty {
  text-align: center; padding: 50px 16px;
  color: var(--muted); font-size: 14px;
}

/* ─── CTA внизу — призыв купить расширенный отчёт ─── */
.dash-cta {
  background: linear-gradient(135deg, #1E1B4B 0%, var(--green-dark) 100%);
  color: #fff;
  padding: 28px 36px;
  /* Радиус совпадает с .dash-card (18px), низ закруглён */
  border-radius: 0 0 18px 18px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
  /* Не сжиматься внутри scroll-контейнера */
  flex-shrink: 0;
}
.dash-cta::before {
  content: ''; position: absolute; top: -50px; right: 100px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08), transparent 70%);
  pointer-events: none;
}
.dash-cta-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.dash-cta-sub {
  font-size: 13px;
  opacity: 0.85;
  line-height: 1.5;
}
.dash-cta-actions {
  display: flex; gap: 10px;
  flex-shrink: 0;
}
.dash-cta-btn {
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 11px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  border: none;
  white-space: nowrap;
}
.dash-cta-btn--primary {
  background: #fff;
  color: var(--green-dark);
}
.dash-cta-btn--primary:hover { background: var(--green-mint); transform: translateY(-1px); }
.dash-cta-btn--secondary {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.3);
}
.dash-cta-btn--secondary:hover { background: rgba(255,255,255,0.1); }

/* ─── Charts grid ─── */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.dash-grid:last-child { margin-bottom: 0; }
/* Full-width grid — для длинных блоков (товарная структура) */
.dash-grid--full {
  grid-template-columns: 1fr !important;
}
/* В full-width блоке: товары — в 2 колонки если их много */
.dash-grid--full .dash-products-list {
  column-count: 2;
  column-gap: 28px;
  column-rule: 1px solid #f3f4f6;
}
.dash-grid--full .dash-products-list .dash-product {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
@media (max-width: 800px) {
  .dash-grid--full .dash-products-list { column-count: 1; }
}
.dash-chart-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 20px 18px;
  display: flex; flex-direction: column;
  transition: all .15s;
}
.dash-chart-card:hover {
  border-color: var(--green-light);
  box-shadow: 0 8px 24px -10px rgba(79, 70, 229, 0.15);
  transform: translateY(-2px);
}
/* Ховер карточек графиков — в цвет своей секции */
.dash-section--import .dash-chart-card:hover { border-color: #C7D2FE; box-shadow: 0 10px 26px -10px rgba(79, 70, 229, 0.22); }
.dash-section--export .dash-chart-card:hover { border-color: #A7F3D0; box-shadow: 0 10px 26px -10px rgba(16, 185, 129, 0.22); }
.dash-chart-title {
  font-size: 13px; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.4;
}
.dash-chart-body { min-height: 100px; }
.dash-chart-empty {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 30px 16px;
  background: #fafafa;
  border-radius: 8px;
}

/* ─── SVG ─── */
/* max-width ограничивает растяжение SVG на широких экранах — иначе текст
   внутри (он в координатах viewBox) масштабируется и выглядит крупнее
   остальных виджетов. На мобильном SVG ужимается по ширине карточки. */
.dash-svg { width: 100%; height: auto; display: block; max-width: 860px; }
.dash-svg .dash-hit { cursor: pointer; }
.dash-svg [data-tip] { cursor: pointer; }
/* Плавающая подсказка графиков */
#tb-chart-tip {
  position: fixed; z-index: 2000; pointer-events: none;
  background: #111827; color: #fff;
  font-size: 12px; line-height: 1.4; font-weight: 600;
  padding: 7px 10px; border-radius: 8px;
  white-space: pre-line; max-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
#tb-chart-tip[hidden] { display: none; }
.dash-svg-lbl { font-size: 13px; fill: var(--text); font-family: inherit; font-weight: 600; }
.dash-svg-lbl-matched { fill: #3730A3; font-weight: 800; }
.dash-svg-val { font-size: 13px; fill: var(--green-dark); font-weight: 800; font-family: inherit; }
.dash-svg-lbl-sm { font-size: 11px; fill: var(--muted); font-family: inherit; }
.dash-svg-val-sm { font-size: 11px; fill: var(--text); font-weight: 700; font-family: inherit; }
.dash-svg-donut { max-width: 220px; margin: 0 auto; display: block; }
.dash-donut-center { font-size: 18px; font-weight: 800; fill: var(--text); font-family: inherit; letter-spacing: -0.3px; }
.dash-donut-sub { font-size: 10px; fill: var(--muted); font-family: inherit; text-transform: uppercase; letter-spacing: 0.5px; }

.dash-legend {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
}
.dash-legend-item {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0;
}
.dash-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-legend-name { flex: 1; color: var(--text); }
.dash-legend-pct { color: var(--muted); font-weight: 600; }

/* ─── Lists ─── */
.dash-products-list, .dash-partners-list {
  display: flex; flex-direction: column;
  gap: 0;
}
.dash-product {
  position: relative;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0;
  font-size: 13px;
  border-bottom: 1px solid #f3f4f6;
  line-height: 1.45;
}
.dash-product:last-child { border-bottom: none; }
/* Тонкая полоса доли товара поверх нижнего разделителя */
.dash-product-bar {
  position: absolute; left: 0; bottom: -1px; height: 2.5px;
  background: #C7D2FE; border-radius: 2px;
  max-width: 100%;
}
.dash-section--import .dash-product-bar { background: #C7D2FE; }
.dash-section--export .dash-section .dash-product-bar,
.dash-section--export .dash-product-bar { background: #A7F3D0; }
.dash-product--matched .dash-product-bar { background: #818CF8; height: 3px; }
.dash-products-list .dash-product:first-child { padding-top: 4px; }
/* Совпавший с запросом — жёлтый highlight + бейдж «★ ваш запрос» */
.dash-product--matched {
  background: linear-gradient(90deg, #F1F5F9 0%, #F8FAFC 100%);
  border-left: 3px solid #4F46E5;
  padding-left: 10px;
  margin-left: -10px;
  border-radius: 4px;
  border-bottom-color: #C7D2FE;
}
.dash-product--matched .dash-product-code {
  background: #EEF2FF;
  color: #3730A3;
}
.dash-product-match {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: #4F46E5;
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
}
.dash-product-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  font-weight: 700;
  background: var(--green-mint);
  color: var(--green-dark);
  padding: 4px 9px;
  border-radius: 5px;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  align-self: flex-start;
  margin-top: 1px;
}
.dash-product-name {
  flex: 1; min-width: 0;
  color: var(--text);
  word-break: break-word;
  font-size: 14px;
  line-height: 1.5;
}
.dash-product-name-pct {
  font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
}
.dash-product--matched .dash-product-name-pct { color: #3730A3; }
.dash-product-meta {
  display: flex; flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}
.dash-product-pct {
  font-size: 13px; font-weight: 700;
  color: var(--green-dark);
  background: var(--green-mint);
  padding: 3px 10px;
  border-radius: 5px;
}
.dash-product-usd {
  font-size: 12px;
  color: var(--muted);
}

.dash-partner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 14px;
  line-height: 1.45;
}
.dash-partner:last-child { border-bottom: none; }
.dash-partners-list .dash-partner:first-child { padding-top: 4px; }
.dash-partner-flag { font-size: 22px; flex-shrink: 0; line-height: 1; display: inline-flex; }
/* Сворачивание длинных списков в карточке (товары/контрагенты) */
.dash-more { display: contents; }
.dash-more[hidden] { display: none; }
.dash-more-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--green-dark); background: var(--green-mint);
  border: 1px solid var(--green-light); border-radius: 8px;
  padding: 7px 14px; cursor: pointer; transition: background .15s, border-color .15s;
}
.dash-more-btn:hover { background: var(--green-light); border-color: var(--green); }

.cc-badge {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  color: var(--green-dark);
  background: var(--green-mint);
  border: 1px solid var(--green-light);
  padding: 3px 6px; border-radius: 6px; line-height: 1;
  min-width: 30px; text-align: center;
}
.dash-partner-name {
  flex: 1; min-width: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.dash-partner-pct {
  font-size: 13px; font-weight: 700;
  color: var(--green-dark);
  flex-shrink: 0;
  background: var(--green-mint);
  padding: 3px 9px;
  border-radius: 4px;
}

/* ─── Print-стили: печатаем ЖИВОЙ дашборд (без клонирования) ─── */
@media print {
  @page { size: A4; margin: 10mm; }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    height: auto !important;
    width: auto !important;
    background: #fff !important;
  }

  /* Скрываем всё кроме дашборда внутри main */
  body.printing-dashboard nav,
  body.printing-dashboard .tb-hero,
  body.printing-dashboard footer,
  body.printing-dashboard .tb-pay-overlay,
  body.printing-dashboard .tb-search-card,
  body.printing-dashboard #t-metrics,
  body.printing-dashboard #t-paywall-banner,
  body.printing-dashboard #t-results,
  body.printing-dashboard .tb-back-btn,
  body.printing-dashboard .tb-compact-title,
  body.printing-dashboard .tb-howto,
  body.printing-dashboard .tb-final-cta,
  body.printing-dashboard .dash-overlay,
  body.printing-dashboard .dash-sticky-close,
  body.printing-dashboard .dash-tools,
  body.printing-dashboard .dash-tools-bar,
  body.printing-dashboard .dash-cta,
  body.printing-dashboard .dash-locked-cta,
  body.printing-dashboard .tb-dash-back {
    display: none !important;
  }

  /* Main и modal — обычные блоки */
  body.printing-dashboard .tb-main {
    display: block !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.printing-dashboard .dash-modal {
    display: block !important;
    position: static !important;
    inset: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: auto;
    transition: none !important;
  }
  body.printing-dashboard .dash-card {
    position: static !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
    inset: auto !important;
    top: auto !important; bottom: auto !important;
    left: auto !important; right: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }
  /* Компактный cover */
  body.printing-dashboard .dash-cover {
    padding: 14px 18px 12px !important;
    background: var(--green-mint) !important;
  }
  body.printing-dashboard .dash-head { margin-top: 8px !important; }
  body.printing-dashboard .dash-head-name { font-size: 18px !important; }
  body.printing-dashboard .dash-section-head {
    position: static !important;
    top: auto !important;
    padding: 12px 18px 10px !important;
  }
  body.printing-dashboard .dash-section-body { padding: 14px 18px 16px !important; }
  /* Каждый виджет — один под другим, не разрываются между страниц */
  body.printing-dashboard .dash-grid {
    display: block !important;
    grid-template-columns: none !important;
  }
  body.printing-dashboard .dash-chart-card {
    display: block !important;
    width: 100% !important;
    margin-bottom: 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    padding: 12px 14px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.printing-dashboard .dash-kpis {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    padding: 12px 18px !important;
  }
  body.printing-dashboard .dash-kpi { padding: 10px !important; }
  body.printing-dashboard .dash-kpi-val { font-size: 17px !important; }
  body.printing-dashboard .dash-kpi,
  body.printing-dashboard .dash-product,
  body.printing-dashboard .dash-partner,
  body.printing-dashboard .dash-insight {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
  body.printing-dashboard .dash-card::-webkit-scrollbar { display: none !important; }
  /* Цвета должны печататься (иначе чарты белые) */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* ─── Адаптив ─── */
@media (max-width: 720px) {
  /* Дашборд на мобиле: 12px по бокам + 24px сверху, низ через max-height */
  .dash-card {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 48px);
    border-radius: 16px;
  }
  .dash-modal.open .dash-card {
    top: 24px !important;
    transform: translate(-50%, 0) scale(1) !important;
  }
  /* Cover — компактно, отступы выровнены с body 16px.
     padding-top раздут до 48px чтобы под абсолютным «📊 ОТЧЁТ» стампом
     было свободное место и dash-head не цеплялся за него */
  .dash-cover { padding: 48px 16px 18px; }
  .dash-head { gap: 10px; flex-direction: column; align-items: flex-start; margin-top: 14px; }
  .dash-head-row { gap: 8px; margin-bottom: 6px; }
  .dash-head-name { font-size: 18px; line-height: 1.25; }
  .dash-role { font-size: 10px; padding: 3px 10px; }
  .dash-head-meta { gap: 4px 12px; font-size: 11px; margin-bottom: 10px; }
  .dash-head-contacts { gap: 5px; }
  .dash-contact { font-size: 11px; padding: 4px 10px; }
  .dash-report-stamp { font-size: 9px; padding: 3px 9px; top: 14px; left: 16px; }
  /* Insight — 16px сверху от cover (а не вплотную), горизонтальные отступы 16px */
  .dash-insight {
    margin: 16px 16px 0;
    padding: 12px 14px;
    font-size: 12px;
    border-radius: 10px;
  }
  /* KPI — 2 колонки, 16px отступы */
  .dash-kpis { grid-template-columns: repeat(2, 1fr); padding: 18px 16px; gap: 10px; }
  .dash-kpi { padding: 14px 14px 12px; border-radius: 12px; }
  .dash-kpi-icon { font-size: 19px; margin-bottom: 3px; }
  .dash-kpi-val { font-size: 18px; }
  .dash-kpi-lbl { font-size: 10px; margin-top: 3px; }
  /* Секции — отступы 16px (выровнены с KPI/insight) */
  .dash-section-head { padding: 14px 16px; }
  .dash-section-emoji { font-size: 26px; }
  .dash-section-title { font-size: 13px; letter-spacing: 0.3px; }
  .dash-section-sub { font-size: 12px; }
  .dash-section-sub strong { font-size: 15px; }
  .dash-section-body { padding: 14px 16px 18px; }
  /* Чарт-карточки — одинаковые отступы 12px между ними */
  .dash-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  .dash-grid:last-child { margin-bottom: 0; }
  .dash-chart-card { padding: 14px; border-radius: 12px; }
  .dash-chart-title { font-size: 11px; margin-bottom: 12px; padding-bottom: 10px; }
  /* CTA (старый) — отступы 16px, низ скруглён */
  .dash-cta {
    grid-template-columns: 1fr;
    padding: 22px 16px calc(22px + env(safe-area-inset-bottom, 0px));
    gap: 14px;
    border-radius: 0 0 16px 16px;
  }
  .dash-cta-actions { width: 100%; }
  .dash-cta-btn { flex: 1; }
  /* Sticky-крестик — компактнее */
  .dash-sticky-close { height: 0; }
  .dash-close { width: 34px; height: 34px; top: 10px; right: 10px; font-size: 17px; }
  /* Низ дашборда (locked/tools) — соответствует card-радиусу 16px */
  .dash-locked-cta { border-radius: 0 0 16px 16px; }
  .dash-tools-bar { border-radius: 0 0 16px 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   POPUP оплаты доступа — счёт / карта
   ═══════════════════════════════════════════════════════════════════════ */
.tb-pay-overlay {
  position: fixed; inset: 0;
  z-index: 1500;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  /* align-items:flex-start + margin:auto на попапе — центрируем когда влезает,
     но если попап выше экрана, его верх (с крестиком) остаётся доступен и
     прокручивается, а не обрезается над вьюпортом (баг align-items:center). */
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.tb-pay-overlay[hidden] { display: none !important; }
.tb-pay-popup {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 520px;
  margin: auto;
  padding: 28px 28px 22px;
  position: relative;
  box-shadow: 0 28px 80px -16px rgba(0, 0, 0, 0.35);
  animation: tb-pay-in .2s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes tb-pay-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.tb-pay-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  font-size: 18px; color: var(--muted);
  cursor: pointer; border-radius: 50%;
  transition: background .12s, color .12s;
}
.tb-pay-close:hover { background: #f3f4f6; color: var(--text); }
.tb-pay-head { text-align: center; margin-bottom: 18px; padding: 0 32px; }
.tb-pay-title {
  font-size: 19px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0 0 6px;
}
.tb-pay-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* Тарифы — 3 радио-кнопки в ряд */
.tb-pay-tariffs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.tb-pay-tariff-feat {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 5px;
  line-height: 1.3;
}
.tb-pay-tariff:has(input:checked) .tb-pay-tariff-feat { color: var(--green-dark); }
.tb-pay-tariff {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px 10px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  text-align: center;
}
.tb-pay-tariff input { position: absolute; opacity: 0; pointer-events: none; }
.tb-pay-tariff:hover { border-color: var(--green-light); }
.tb-pay-tariff:has(input:checked) {
  border-color: var(--green);
  background: var(--green-mint);
}
.tb-pay-tariff-name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-bottom: 4px;
}
.tb-pay-tariff:has(input:checked) .tb-pay-tariff-name { color: var(--green-dark); }
.tb-pay-tariff-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
/* Эквивалент цены в ₽ и сум под основной долларовой ценой */
.tb-pay-tariff-eq {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.3;
  white-space: nowrap;
}
.tb-pay-tariff--popular .tb-pay-tariff-badge {
  position: absolute;
  top: -8px;
  left: 50%; transform: translateX(-50%);
  font-size: 9.5px; font-weight: 700;
  background: linear-gradient(135deg, #4F46E5, #3730A3);
  color: #fff;
  padding: 2px 10px;
  border-radius: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Форма реквизитов */
.tb-pay-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin-bottom: 18px;
}
.tb-pay-field { display: flex; flex-direction: column; }
.tb-pay-field:nth-of-type(1) { grid-column: 1 / -1; }   /* Название организации — на всю ширину */
.tb-pay-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.tb-pay-field input {
  font: inherit; font-size: 14px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.tb-pay-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* Кнопки действия */
.tb-pay-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.tb-pay-actions--single { grid-template-columns: 1fr; }
.tb-pay-btn {
  font: inherit; font-size: 13.5px; font-weight: 600;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid var(--green-light);
  background: #fff;
  color: var(--green-dark);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.tb-pay-btn:hover { background: var(--green-mint); }
.tb-pay-btn--primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 2px 8px var(--green-glow);
}
.tb-pay-btn--primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  box-shadow: 0 4px 14px var(--green-glow);
}

/* Статус под кнопками: «Отправляем…» / «Заявка принята» / «Эквайринг…» */
.tb-pay-status {
  font-size: 12.5px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.tb-pay-status[hidden] { display: none; }
.tb-pay-status--info { background: var(--green-mint); color: var(--green-dark); border: 1px solid var(--green-light); }
.tb-pay-status--ok   { background: #DCFCE7; color: #166534; border: 1px solid #BBF7D0; }
.tb-pay-status a { color: var(--green); font-weight: 600; }

.tb-pay-hint {
  font-size: 11px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 560px) {
  .tb-pay-popup { padding: 22px 18px 18px; border-radius: 16px; }
  .tb-pay-title { font-size: 17px; }
  .tb-pay-tariffs { grid-template-columns: 1fr; gap: 6px; }
  .tb-pay-tariff { flex-direction: column; align-items: flex-start; padding: 11px 14px; text-align: left; }
  .tb-pay-tariff-name { margin: 0 0 2px; }
  .tb-pay-tariff-feat { margin-top: 4px; }
  .tb-pay-tariff--popular .tb-pay-tariff-badge { left: auto; right: 12px; top: 12px; transform: none; margin-top: 0; }
  .tb-pay-form { grid-template-columns: 1fr; }
  .tb-pay-field:nth-of-type(1) { grid-column: auto; }
  .tb-pay-actions { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════
   POPUP входа в платный доступ — отдельно от nav-dropdown
   ═══════════════════════════════════════════════════════════════════════ */
.tb-login-overlay {
  position: fixed; inset: 0;
  z-index: 1500;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.tb-login-overlay[hidden] { display: none !important; }
.tb-login-popup {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 28px 28px 22px;
  position: relative;
  box-shadow: 0 28px 80px -16px rgba(0, 0, 0, 0.35);
  animation: tb-login-popup-in .2s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes tb-login-popup-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.tb-login-popup-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  font-size: 18px; color: var(--muted);
  cursor: pointer; border-radius: 50%;
  transition: background .12s, color .12s;
}
.tb-login-popup-close:hover { background: #f3f4f6; color: var(--text); }
.tb-login-popup-head { text-align: center; margin-bottom: 22px; }
.tb-login-popup-title {
  font-size: 18px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0 0 6px;
}
.tb-login-popup-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}
.tb-login-popup-form {
  display: flex; flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.tb-login-popup-form[hidden] { display: none; }
.tb-login-popup-field { display: flex; flex-direction: column; }
.tb-login-popup-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}
.tb-login-popup-field input {
  font: inherit; font-size: 14px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.tb-login-popup-field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}
.tb-login-popup-error {
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}
.tb-login-popup-error[hidden] { display: none !important; }
.tb-login-popup-submit {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
  border: none;
  background: var(--green);
  color: #fff;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 2px 8px var(--green-glow);
  margin-top: 4px;
}
.tb-login-popup-submit:hover { background: var(--green-dark); box-shadow: 0 4px 14px var(--green-glow); }
.tb-login-popup-hint {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  border-top: 1px dashed var(--border);
  padding-top: 12px;
}
.tb-login-popup-hint code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  background: var(--green-mint);
  color: var(--green-dark);
  padding: 1px 6px;
  border-radius: 4px;
}
@media (max-width: 480px) {
  .tb-login-popup { padding: 22px 18px 18px; border-radius: 16px; }
}

/* ─── Заголовок-строка результатов: «Список компаний (N)» + Excel ─── */
.tb-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 4px 0;
  flex-wrap: wrap;
}
.tb-results-head[hidden] { display: none !important; }
.tb-results-head-hint { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.tb-results-head-hint::first-letter { color: #F59E0B; }
.tb-results-head-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.tb-results-head-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.tb-results-head-count {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
/* Excel-кнопка — крупнее, индиго-акцент, заметная */
.tb-export-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid var(--green);
  background: #fff;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.10);
}
.tb-export-btn:hover {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 12px var(--green-glow);
}
.tb-export-btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.tb-export-icon { font-size: 16px; line-height: 1; }
/* Кнопка выгрузки + подпись «Превышен лимит» */
.tb-export-wrap { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tb-export-btn--locked,
.tb-export-btn--locked:hover {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}
.tb-export-note {
  font-size: 11.5px;
  font-weight: 600;
  color: #b91c1c;
  white-space: nowrap;
}
.tb-export-note[hidden] { display: none; }
@media (max-width: 640px) {
  .tb-results-head { gap: 10px; }
  .tb-results-head-label { font-size: 14px; }
  .tb-results-head-count { font-size: 12.5px; }
  .tb-export-btn { padding: 9px 14px; font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   РЕДИЗАЙН SEARCH-CARD — белый card + ясная вертикальная форма
   ═══════════════════════════════════════════════════════════════════════ */
.tb-section--demo .tb-search-card {
  background: #fff !important;
  border: 1.5px solid var(--green-light) !important;
  border-radius: 18px !important;
  padding: 28px 28px 24px !important;
  /* margin-bottom: 28px — отделяем от paywall/metrics/results снизу */
  margin: 0 0 28px !important;
  box-shadow:
    0 1px 3px rgba(15, 23, 42, 0.06),
    0 10px 24px -6px rgba(79, 70, 229, 0.18),
    0 28px 50px -14px rgba(15, 23, 42, 0.14) !important;
}
.tb-search-card-head { text-align: center; margin-bottom: 22px; }
.tb-search-card-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  margin: 0 0 6px;
}
.tb-search-card-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.tb-search-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tb-search-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 640px) {
  .tb-search-pair { grid-template-columns: 1fr; gap: 14px; }
}
.tb-field { display: flex; flex-direction: column; }
.tb-field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.tb-field-required { color: #DC2626; font-weight: 700; margin-left: 2px; }
.tb-field-error {
  font-size: 12.5px; color: #DC2626; font-weight: 500;
  padding: 6px 10px; background: #FEE2E2; border-radius: 6px;
  margin-top: 4px;
}
.tb-field-input--error { border-color: #DC2626 !important; }
.tb-field-input {
  font: inherit;
  font-size: 14.5px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.tb-field-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}
.tb-field-input::placeholder { color: #94A3B8; }

/* iOS/мобильные браузеры автоматически зумят страницу при фокусе на input
   с font-size < 16px — экран «перескакивает» и виден лишь кусок сайта.
   На мобильном поднимаем до 16px у всех набираемых полей, чтобы убрать зум. */
@media (max-width: 640px) {
  .tb-field-input,
  .tb-pay-field input,
  .tb-login-form input,
  .tb-login-popup-form input,
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="search"], input[type="password"], input[type="number"] {
    font-size: 16px;
  }
}

/* Direction toggle — крупный сегментированный контрол */
.tb-section--demo .tb-direction {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr);
  background: #F1F5F9;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.tb-section--demo .tb-dir-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}
.tb-section--demo .tb-dir-btn:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.6); }
.tb-section--demo .tb-dir-btn.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
/* На узких экранах: «↔ Все» на всю ширину сверху, импорт/экспорт — двумя колонками под ней */
@media (max-width: 560px) {
  .tb-section--demo .tb-direction { grid-template-columns: 1fr 1fr; }
  .tb-section--demo .tb-dir-btn { white-space: normal; padding: 9px 6px; font-size: 12.5px; }
  .tb-section--demo .tb-dir-btn[data-dir="any"] { grid-column: 1 / -1; }
}

/* Search-кнопка — full-width, prominent, текст по центру */
.tb-section--demo .btn-tb-search {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 24px !important;
  font-size: 15.5px !important;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: var(--green) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
  box-shadow: 0 4px 12px var(--green-glow);
  margin-top: 2px;
}
.tb-section--demo .btn-tb-search:hover {
  background: var(--green-dark) !important;
  box-shadow: 0 6px 18px var(--green-glow);
}

/* Popular chips — обновлённый стиль */
.tb-section--demo .tb-search-chips {
  display: flex; flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}
.tb-section--demo .tb-chips-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}


/* ─── Блок «В каждом отчёте» — теги доступных метрик между hero-metrics и поиском ─── */
.tb-data-tags {
  margin: 32px auto 0;
  max-width: 760px;
  text-align: center;
}
.tb-data-tags-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.tb-data-tags-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.tb-data-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color .15s, background .15s, transform .15s;
  white-space: nowrap;
}
.tb-data-tag:hover {
  border-color: var(--green-light);
  background: var(--green-mint);
  transform: translateY(-1px);
}
.tb-data-tag-ic {
  font-size: 14px;
  line-height: 1;
}
@media (max-width: 640px) {
  .tb-data-tags { margin-top: 22px; padding: 0 4px; }
  .tb-data-tags-label { font-size: 10.5px; margin-bottom: 10px; }
  .tb-data-tags-grid { gap: 6px; }
  .tb-data-tag { font-size: 11.5px; padding: 6px 10px; }
  .tb-data-tag-ic { font-size: 13px; }
}

/* ─── Шаги «Как это работает» (под data-tags в hero) ──────────────── */
.tb-steps {
  margin: 24px auto 0; max-width: 960px;
  padding-top: 22px; border-top: 1px dashed rgba(59, 130, 246, 0.28);
}
.tb-steps-label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  text-align: center; margin-bottom: 16px;
}
.tb-steps-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
@media (max-width: 960px) { .tb-steps-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .tb-steps-grid { grid-template-columns: 1fr; } }
.tb-step {
  display: flex; gap: 12px; align-items: flex-start;
  text-align: left;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .2s;
}
.tb-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}
.tb-step-num {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}
.tb-step-title {
  font-size: 13.5px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.tb-step-text {
  font-size: 12.5px; color: var(--muted); line-height: 1.45;
}

/* ─── Default-hint: «Это первые 10 из 3 200» (после логина при пустом поиске) ─── */
.tb-default-hint {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--green-mint);
  border: 1px solid var(--green-light);
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--green-dark);
  line-height: 1.5;
}
.tb-default-hint[hidden] { display: none !important; }
.tb-default-hint-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.tb-default-hint-text { flex: 1; }
.tb-default-hint-text strong { color: var(--text); font-weight: 700; }
@media (max-width: 640px) {
  .tb-default-hint { font-size: 12.5px; padding: 14px; gap: 10px; }
  .tb-default-hint-icon { font-size: 19px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   Общие стандарты UX и доступности
   ═══════════════════════════════════════════════════════════════════════ */
html { scroll-behavior: smooth; }

/* Видимое фокус-кольцо при навигации с клавиатуры (Tab) на кликабельных
   элементах. У инпутов уже свой ring (.tb-field-input:focus) — дублировать не нужно. */
a:focus-visible,
button:focus-visible,
[role="radio"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.tb-field-input:focus-visible { outline: none; }

/* Тактильный «нажим» на основных кнопках */
.btn-primary:active,
.btn-tb-search:active,
.tb-cta-btn:active,
.tb-dir-btn:active,
.search-chip:active,
.tb-export-btn:active { transform: translateY(1px); }

/* Выделение текста — в фирменный indigo */
::selection { background: rgba(79, 70, 229, 0.18); }

/* Уважение к настройке «уменьшить движение» */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Личный кабинет: бейдж тарифа в шапке + выпадающее меню
   ═══════════════════════════════════════════════════════════════════════ */
.tb-user-menu { position: relative; }
.tb-plan-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 700;
  padding: 6px 11px 6px 9px; border-radius: 999px;
  border: 1.5px solid var(--green-light);
  background: linear-gradient(180deg, #fff, var(--green-mint));
  color: var(--green-dark); cursor: pointer;
  white-space: nowrap; line-height: 1;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.tb-plan-chip:hover { border-color: var(--green); box-shadow: 0 4px 14px -6px rgba(16,185,129,.5); }
.tb-plan-chip:active { transform: translateY(.5px); }
.tb-plan-chip-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--green); color: #fff;
}
.tb-plan-chip-dot { display: none; }
.tb-plan-chip-name { letter-spacing: -.1px; }
.tb-plan-chip-days {
  font-weight: 600; opacity: .82; padding-left: 8px;
  border-left: 1.5px solid rgba(16, 185, 129, .3);
}
.tb-plan-chip-days:empty { display: none; }
.tb-plan-chip-caret { font-size: 9px; opacity: .6; margin-left: -1px; transition: transform .2s; }
.tb-plan-chip[aria-expanded="true"] .tb-plan-chip-caret { transform: rotate(180deg); }
.tb-account-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 300px; max-width: 88vw;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 20px 50px -16px rgba(15, 23, 42, 0.30);
  padding: 18px; z-index: 200;
}
.tb-account-dropdown[hidden] { display: none; }
.tb-account-plan-row { display: flex; align-items: center; gap: 8px; }
.tb-account-plan-badge { font-size: 15px; font-weight: 800; color: var(--text); }
.tb-account-status {
  font-size: 10.5px; font-weight: 700; color: #15803D; background: #DCFCE7;
  padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px;
}
.tb-account-email { font-size: 12.5px; color: var(--muted); margin-top: 5px; word-break: break-all; }
.tb-account-meta {
  display: flex; flex-direction: column; gap: 7px;
  padding: 13px 0; margin-top: 13px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.tb-account-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.tb-account-row[hidden] { display: none; }
.tb-account-row strong { color: var(--text); font-weight: 600; }
.tb-account-bar { height: 6px; border-radius: 999px; background: #EEF2FF; margin: 13px 0; overflow: hidden; }
.tb-account-bar[hidden] { display: none; }
.tb-account-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--green), #818CF8); transition: width .4s; }
/* Квота открытых компаний — главный счётчик кабинета */
.tb-account-quota { margin: 13px 0 14px; }
.tb-account-quota-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.tb-account-quota-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.tb-account-quota-val { font-size: 14px; font-weight: 800; color: var(--text); letter-spacing: -.2px; }
.tb-account-quota-bar { height: 7px; border-radius: 999px; background: #EEF2FF; overflow: hidden; }
.tb-account-quota-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, var(--green), #34D399);
  transition: width .45s ease;
}
.tb-account-quota-note { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 6px; }
.tb-account-quota-note[hidden] { display: none; }
/* Близко к лимиту — янтарный */
.tb-account-quota.is-warn .tb-account-quota-fill { background: linear-gradient(90deg, #F59E0B, #FBBF24); }
.tb-account-quota.is-warn .tb-account-quota-val,
.tb-account-quota.is-warn .tb-account-quota-note { color: #B45309; }
/* Лимит исчерпан — красный */
.tb-account-quota.is-full .tb-account-quota-fill { background: linear-gradient(90deg, #DC2626, #F87171); }
.tb-account-quota.is-full .tb-account-quota-val,
.tb-account-quota.is-full .tb-account-quota-note { color: #B91C1C; }
/* Безлимитный тариф — спокойный зелёный, значение «без лимита» */
.tb-account-quota.is-unlim .tb-account-quota-fill { background: linear-gradient(90deg, var(--green), #34D399); opacity: .5; }
.tb-account-actions { display: flex; gap: 8px; margin-bottom: 10px; }
.tb-account-btn {
  flex: 1; font: inherit; font-size: 12.5px; font-weight: 600;
  padding: 9px 10px; border-radius: 9px; border: 1.5px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.tb-account-btn:hover { border-color: var(--green); color: var(--green-dark); }
.tb-account-btn--primary { background: var(--green); border-color: var(--green); color: #fff; }
.tb-account-btn--primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.tb-account-dropdown .tb-logout-btn { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════════════
   Сводка по базе (после входа, до первого поиска)
   ═══════════════════════════════════════════════════════════════════════ */
.tb-overview { display: none; margin-bottom: 24px; }
body:not(.tb-locked):not(.tb-compact) #t-overview { display: block; }
.tb-overview-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.tb-overview-title { font-size: 16px; font-weight: 800; color: var(--text); }
.tb-overview-sub { font-size: 12.5px; color: var(--muted); }
.tb-overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 680px) { .tb-overview-grid { grid-template-columns: 1fr 1fr; } }
.tb-ov-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; box-shadow: var(--shadow-md);
}
.tb-ov-card-ic { font-size: 16px; margin-bottom: 8px; display: block; line-height: 1; }
.tb-ov-card-val { font-size: 21px; font-weight: 800; color: var(--text); letter-spacing: -.4px; line-height: 1.1; }
.tb-ov-card-lbl { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.tb-overview-cats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tb-overview-cats-label { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-right: 2px; }

/* ═══════════════════════════════════════════════════════════════════════
   Бейджи тренда и индекса активности в строках результатов
   ═══════════════════════════════════════════════════════════════════════ */
.tb-row-badges { display: flex; align-items: center; gap: 7px; margin-top: 7px; flex-wrap: wrap; }
.tb-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tb-trend--up { color: #15803D; background: #DCFCE7; }
.tb-trend--down { color: #B91C1C; background: #FEE2E2; }
.tb-trend--flat { color: #64748B; background: #F1F5F9; }
.tb-activity { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tb-activity-stars { letter-spacing: 1px; color: #F59E0B; }
.tb-rowbadge { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tb-rowbadge--contact { color: #3730A3; background: #EEF2FF; }

/* ─── Скелетон-загрузка списка ─── */
.tb-skel { display: flex; flex-direction: column; gap: 10px; }
.tb-skel-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.tb-skel-badge { width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0; }
.tb-skel-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.tb-skel-line { height: 12px; border-radius: 6px; }
.tb-skel-line--lg { width: 58%; }
.tb-skel-line--sm { width: 34%; height: 10px; }
.tb-skel-val { width: 84px; height: 16px; border-radius: 6px; flex-shrink: 0; }
.tb-skel-badge, .tb-skel-line, .tb-skel-val {
  background: linear-gradient(90deg, #EEF2F7 25%, #E2E8F0 37%, #EEF2F7 63%);
  background-size: 400% 100%;
  animation: tb-shimmer 1.4s ease infinite;
}
@keyframes tb-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .tb-skel-badge, .tb-skel-line, .tb-skel-val { animation: none; } }

/* ═══ Избранное ⭐ ═══ */
.tb-fav {
  flex-shrink: 0; align-self: center;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; color: #F59E0B;
  background: #FFFBEB; border: 1px solid #FDE68A; cursor: pointer; padding: 0;
  transition: color .15s, background .15s, transform .15s, border-color .15s;
}
.tb-fav:hover { background: #FEF3C7; border-color: #F59E0B; transform: scale(1.1); }
.tb-fav--on { color: #F59E0B; background: #FEF3C7; border-color: #F59E0B; }
.tb-fav-chip { border-color: #FCD34D !important; color: #92400E !important; background: #FFFBEB !important; }
.tb-fav-chip:hover { background: #FEF3C7 !important; }
.tb-recent-chip { border-color: #BFDBFE !important; color: #1E40AF !important; background: #EFF6FF !important; }
.tb-recent-chip:hover { background: #DBEAFE !important; }

/* ═══ Премиум-тизер тарифа Про (апсейл в карточке) ═══ */
.dash-pro-tease {
  position: relative;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin: 24px 36px 8px;
  padding: 22px 24px;
  border: 1.5px dashed #C7D2FE;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(129,140,248,0.10));
  overflow: hidden;
}
.dash-pro-tease-lock { font-size: 26px; flex-shrink: 0; opacity: .85; }
.dash-pro-tease-body { flex: 1; min-width: 220px; }
.dash-pro-tease-title { font-size: 15px; font-weight: 800; color: var(--green-dark); margin-bottom: 10px; }
.dash-pro-tease-grid { display: flex; flex-direction: column; gap: 7px; }
.dash-pro-item { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.dash-pro-btn {
  flex-shrink: 0; font: inherit; font-size: 13px; font-weight: 700;
  padding: 11px 20px; border-radius: 10px; cursor: pointer;
  border: none; background: var(--green); color: #fff;
  box-shadow: 0 4px 14px var(--green-glow); transition: background .15s, transform .15s;
}
.dash-pro-btn:hover { background: var(--green-dark); transform: translateY(-1px); }
@media (max-width: 560px) { .dash-pro-btn { width: 100%; } }

/* ═══ Похожие компании ═══ */
/* Отдельный блок-панель: тонированный фон + рамка визуально отделяют
   «Похожие компании» от секций с данными выше. */
.dash-similar {
  margin: 28px 36px 32px;
  padding: 20px 22px 22px;
  background: linear-gradient(180deg, #F8FAFC, #F1F5F9);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.dash-similar[hidden] { display: none; }
/* На мобильном — боковой отступ как у остальных блоков карточки (16px) */
@media (max-width: 640px) {
  .dash-similar { margin: 20px 16px 28px; padding: 16px 16px 18px; }
  .dash-pro-tease { margin: 20px 16px 8px; }
}
.dash-similar-head { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.dash-similar-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
.dash-similar-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .dash-similar-list { grid-template-columns: 1fr; } }
.dash-similar-item {
  display: flex; align-items: center; gap: 11px;
  font: inherit; text-align: left; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: #fff; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.dash-similar-item:hover { border-color: var(--green); box-shadow: 0 6px 16px -6px var(--green-glow); transform: translateY(-2px); }
.dash-similar-rank {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: var(--green-dark); background: var(--green-mint);
}
.dash-similar-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-similar-val { font-size: 13px; font-weight: 700; color: var(--green-dark); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.dash-similar-arrow { flex-shrink: 0; color: var(--muted-light); font-weight: 700; transition: transform .15s, color .15s; }
.dash-similar-item:hover .dash-similar-arrow { color: var(--green); transform: translateX(3px); }

/* ═══ Табы режима поиска (по товару/стране · по компании) ═══ */
.tb-search-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: #F1F5F9; padding: 5px; border-radius: 12px;
}
.tb-search-tab {
  flex: 1; font: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 12px; border: none; border-radius: 9px;
  background: transparent; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.tb-search-tab:hover { color: var(--text); }
.tb-search-tab.active { background: #fff; color: var(--green-dark); box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12); }
.tb-search-panel { display: flex; flex-direction: column; gap: 16px; }
.tb-search-panel[hidden] { display: none; }
/* Поле «Период последней поставки» — два селекта в строку */
.tb-period { display: flex; align-items: center; gap: 8px; }
.tb-period select.tb-field-input { flex: 1; min-width: 0; cursor: pointer; }
.tb-period-sep { color: var(--muted); flex-shrink: 0; font-weight: 600; }
@media (max-width: 420px) { .tb-search-tab { font-size: 12px; padding: 9px 8px; } }

/* ─── Демо: заблюренные (locked) строки результатов ─────────────────────── */
.tb-row--locked .tb-row-sub,
.tb-row--locked .tb-row-codes,
.tb-row--locked .tb-row-badges,
.tb-row--locked .tb-row-stat {
  filter: blur(3.5px);
  opacity: .6;
  user-select: none;
  pointer-events: none;
}
.tb-row--locked .tb-row-name { opacity: .8; }
.tb-row--locked .tb-row-arrow { opacity: .4; }
.tb-row--locked::after {
  content: '🔒';
  position: absolute;
  right: 40px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: .55; pointer-events: none;
}

/* ─── Апселл при исчерпании лимита поисков ──────────────────────────────── */
.tb-limit-box {
  text-align: center;
  padding: 44px 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.tb-limit-ic { font-size: 40px; margin-bottom: 10px; }
.tb-limit-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.tb-limit-sub { font-size: 14px; color: var(--muted); max-width: 480px; margin: 0 auto 18px; line-height: 1.55; }
.tb-limit-btn {
  display: inline-block; padding: 11px 26px; border: none; border-radius: 10px;
  background: var(--green); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px var(--green-glow); transition: background .15s, transform .15s;
}
.tb-limit-btn:hover { background: var(--green-dark); transform: translateY(-1px); }

/* ─── Вход / регистрация: подсказки и переключатель ─────────────────────── */
.tb-login-note {
  font-size: 11px; color: var(--green-dark);
  background: var(--green-mint); border-radius: 8px;
  padding: 8px 10px; line-height: 1.45; margin-bottom: 6px;
}
.tb-login-switch { font-size: 11.5px; color: var(--muted); margin-top: 10px; text-align: center; }
/* Оверлей установки нового пароля по ссылке из письма (?reset=…) */
#t-newpass-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#t-newpass-overlay .tb-newpass-box {
  background: #fff; border-radius: 14px; padding: 24px;
  width: 100%; max-width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
#t-newpass-overlay .tb-newpass-box input {
  width: 100%; box-sizing: border-box; margin: 10px 0;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.tb-login-switch button {
  background: none; border: none; color: var(--green-dark); font-weight: 700;
  cursor: pointer; font-size: 11.5px; padding: 0; text-decoration: underline;
}

/* ─── Подтверждение выгрузки в Excel ─────────────────────────────────────── */
.tb-export-overlay {
  position: fixed; inset: 0; z-index: 1600;
  background: rgba(15, 23, 42, 0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}
.tb-export-overlay[hidden] { display: none !important; }
.tb-export-modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 440px;
  padding: 26px 26px 22px; position: relative; text-align: center;
  box-shadow: 0 28px 80px -16px rgba(0,0,0,0.35);
  animation: tb-pay-in .2s cubic-bezier(0.2,0.9,0.3,1.15);
}
.tb-export-modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border: none; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; border-radius: 8px;
}
.tb-export-modal-close:hover { background: #f1f5f9; color: var(--text); }
.tb-export-modal-ic { font-size: 34px; margin-bottom: 6px; }
.tb-export-modal-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.tb-export-modal-text { font-size: 14px; color: var(--muted); line-height: 1.55; margin-bottom: 18px; }
.tb-export-modal-text strong { color: var(--text); }
.tb-export-modal-actions { display: flex; flex-direction: column; gap: 8px; }
.tb-export-modal-btn {
  font: inherit; font-size: 14px; font-weight: 600; padding: 11px 16px;
  border: 1.5px solid var(--border); border-radius: 10px; background: #fff;
  color: var(--text); cursor: pointer; transition: border-color .15s, background .15s;
}
.tb-export-modal-btn:hover { border-color: var(--green); }
.tb-export-modal-btn--primary { background: var(--green); border-color: var(--green); color: #fff; }
.tb-export-modal-btn--primary:hover { background: var(--green-dark); }
.tb-export-modal-btn--ghost { border: none; color: var(--muted); font-weight: 500; padding: 6px; }
.tb-export-modal-btn--ghost:hover { color: var(--text); background: transparent; }
