/* AI Рейтинги — devrating.ru
   Дизайн-токены и стили. Ранее жили инлайном в React-компонентах. */

:root {
  --bg: #0a0d1a;
  --bg-card: #131729;
  --bg-card-hover: #1a1f36;
  --border: #1e2440;
  --border-light: #2a3050;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-bg: rgba(99, 102, 241, 0.1);
  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gold: #fbbf24;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shell: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Шапка ───────────────────────────────────────────── */

.site-header {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header__inner {
  max-width: var(--shell);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  gap: 8px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo__mark {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo__text { font-size: 16px; font-weight: 600; }

.site-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a[aria-current='page'] { color: var(--accent-light); background: var(--accent-bg); }

/* ── Каркас страницы ─────────────────────────────────── */

.shell { max-width: var(--shell); margin: 0 auto; padding: 32px 24px; width: 100%; }
main { flex: 1 0 auto; }

.narrow { max-width: 800px; }
.mid { max-width: 900px; margin-inline: auto; }

h1 { font-size: 28px; font-weight: 800; line-height: 1.25; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }

.lead { color: var(--text-secondary); }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* ── Хлебные крошки ──────────────────────────────────── */

.breadcrumbs { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; color: var(--border-light); }

/* ── Герой ───────────────────────────────────────────── */

.hero {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 32px;
  margin-bottom: 32px;
  text-align: center;
}
.hero h1 { font-size: 32px; margin-bottom: 12px; }
.hero__note { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.hero__lead {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 24px;
}
.hero__lead strong { color: var(--text); }

.stats { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 120px;
  text-align: center;
}
.stat__value { font-size: 24px; font-weight: 800; color: var(--accent); }
.stat__value--success { color: var(--success); }
.stat__value--warning { color: var(--warning); }
.stat__value--gold { color: var(--gold); }
.stat__label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Карточки ────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card--accent { border-color: rgba(99, 102, 241, 0.25); }
.card + .card { margin-top: 16px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.09);
  border: 1px solid rgba(99, 102, 241, 0.19);
}
.badge--warning { color: var(--warning); background: rgba(245, 158, 11, 0.09); border-color: rgba(245, 158, 11, 0.19); }
.badge--muted { color: var(--text-muted); background: rgba(100, 116, 139, 0.09); border-color: rgba(100, 116, 139, 0.19); }

/* ── Панель фильтров ─────────────────────────────────── */

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.chip:hover { border-color: var(--border-light); color: var(--text); }
.chip[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-light); }

select,
input[type='text'],
input[type='search'],
input:not([type]),
textarea {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  outline: none;
}
select { cursor: pointer; padding: 6px 12px; color: var(--text-secondary); }
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.search { flex: 1 1 200px; min-width: 0; padding: 8px 16px; font-size: 14px; }

.integrations-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.integrations-filter__label { font-size: 12px; color: var(--text-muted); margin-right: 4px; }

.int-toggle {
  padding: 5px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 11px;
  font-family: inherit;
}
.int-toggle:hover { color: var(--text-secondary); border-color: var(--border-light); }
.int-toggle[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-light); }

.link-button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.result-count { font-size: 13px; color: var(--text-muted); }
.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Таблицы рейтингов ───────────────────────────────── */

.table-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--bg-card); }
th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th.left, td.left { text-align: left; }
td {
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(30, 36, 64, 0.13);
  vertical-align: middle;
  text-align: center;
}
tbody tr:nth-child(even) { background: rgba(19, 23, 41, 0.38); }
tbody tr:hover { background: var(--accent-bg); }
.rank { width: 50px; font-size: 20px; }
.rank--plain { font-size: 14px; font-weight: 600; color: var(--text-muted); }

.row-link { color: inherit; display: block; font-weight: 600; }
.row-link:hover { color: var(--accent-light); text-decoration: none; }
.row-sub { display: block; font-size: 12px; color: var(--text-muted); font-weight: 400; }

.count {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-secondary);
}
.count--high { color: var(--success); background: rgba(34, 197, 94, 0.08); }
.count--mid { color: var(--warning); background: rgba(245, 158, 11, 0.08); }
.count--sm { font-size: 14px; }

.cell-secondary { font-size: 13px; color: var(--text-secondary); text-align: left; }
.cell-site { font-size: 13px; }
.cell-revenue { font-size: 12px; color: var(--text-muted); }

.int-list { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.int-list span {
  display: inline-flex;
  padding: 2px;
  border-radius: 3px;
  background: rgba(30, 36, 64, 0.5);
  color: var(--text-muted);
  border: 1px solid transparent;
}

/* ── Сетки карточек ──────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 16px;
}
.grid--narrow { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid--single { grid-template-columns: 1fr; }
.grid .card + .card { margin-top: 0; }

.case-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}
.case-card__brand { font-size: 18px; font-weight: 700; margin-top: 2px; }
.case-card__bot { font-size: 16px; font-weight: 600; color: var(--accent-light); margin-bottom: 8px; }
.case-card__details { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; line-height: 1.6; }
.case-card__tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.case-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  flex-wrap: wrap;
  gap: 4px;
}

/* ── Страница компании ───────────────────────────────── */

.profile {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}
.profile__title { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.profile__full { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.profile__desc { font-size: 14px; color: var(--text-secondary); max-width: 600px; margin-bottom: 16px; }
.profile__stats { display: flex; gap: 12px; flex-wrap: wrap; }

.section { margin-bottom: 32px; }
.section > h2 { margin-bottom: 16px; }

.pill-list { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.channel {
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  opacity: 0.4;
}
.channel--on { background: var(--accent-bg); border-color: rgba(99, 102, 241, 0.25); color: var(--accent-light); opacity: 1; }

.metric__label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.metric__value { font-size: 24px; font-weight: 700; }
.metric__value--success { color: var(--success); }
.metric__value--danger { color: var(--danger); }
.metric__value--accent { color: var(--accent); }
.metric__delta { font-size: 13px; margin-top: 4px; }
.up { color: var(--success); }
.down { color: var(--danger); }

.definition {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  font-size: 14px;
  color: var(--text-secondary);
}
.definition dt { color: var(--text-muted); }

/* ── Формы ───────────────────────────────────────────── */

.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label,
.field__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.field textarea { resize: vertical; }

.button {
  padding: 12px 32px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
  display: inline-block;
}
.button:hover { opacity: 0.9; text-decoration: none; }
.button[disabled] { opacity: 0.6; cursor: default; }
.button--ghost {
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  color: var(--accent-light);
  padding: 10px 20px;
  font-size: 14px;
}
.button--full { width: 100%; }

.audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.note {
  margin-top: 24px;
  padding: 16px;
  background: var(--accent-bg);
  border-radius: var(--radius);
  border: 1px solid rgba(99, 102, 241, 0.19);
}
.note__title { font-size: 13px; color: var(--accent-light); font-weight: 600; margin-bottom: 4px; }
.note p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.form-status { text-align: center; padding: 64px 0; max-width: 600px; margin: 0 auto; }
.form-status__mark { font-size: 48px; margin-bottom: 16px; }
.form-status h2 { font-size: 24px; margin-bottom: 12px; }
.form-status p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
[hidden] { display: none !important; }

/* ── Текстовые блоки ─────────────────────────────────── */

.prose h2 { font-size: 18px; margin-top: 32px; margin-bottom: 12px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.prose p { font-size: 14px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 12px; }
.prose ul { font-size: 14px; color: var(--text-secondary); line-height: 2; padding-left: 20px; margin-bottom: 12px; }
.prose strong { color: var(--text); }
.prose > :last-child { margin-bottom: 0; }

.method {
  margin-top: 48px;
  padding: 32px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.method h2 { margin-bottom: 12px; }

.contact-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  margin-top: 12px;
}

/* ── Развилка на главной ─────────────────────────────── */

.section-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
a.tile:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.tile--soon { opacity: 0.55; }

.tile__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile__title { font-size: 18px; font-weight: 700; }
.tile__desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; flex: 1; }
.tile__stats { display: flex; gap: 8px; flex-wrap: wrap; }
.tile__stats span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}
.tile__go { font-size: 13px; font-weight: 600; color: var(--accent-light); margin-top: 4px; }

/* ── Плитки авторов ──────────────────────────────────── */

.creator-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.creator-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.creator-tile:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.creator-tile__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.creator-tile__followers { font-size: 20px; font-weight: 800; color: var(--accent-light); }
.creator-tile__tier { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.creator-tile__name { font-size: 15px; font-weight: 700; margin-top: 2px; }
.creator-tile__headline {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.creator-tile__meta { font-size: 12px; color: var(--text-muted); }
.creator-tile__badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* ── Матрицы каналов и функций ───────────────────────── */

.matrix-wrap { overflow-x: auto; }
.matrix { min-width: 720px; }
.matrix caption { text-align: left; font-size: 13px; color: var(--text-muted); padding: 12px 16px; }
.matrix th[scope='row'] { font-size: 14px; font-weight: 600; white-space: nowrap; }
.matrix__col { font-size: 11px; }
.cell-yes { color: var(--success); font-weight: 700; }
.cell-no { color: var(--text-muted); }
.cell-unknown { color: var(--warning); font-weight: 700; }

.flag-list { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.flag {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
}
.chip--sm { padding: 4px 10px; font-size: 12px; }
.channel--unknown { border-style: dashed; opacity: 0.6; }

/* ── Карта сайта ─────────────────────────────────────── */

.sitemap-list { list-style: none; display: grid; gap: 8px; }
.sitemap-list--columns { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 8px 24px; }
.sitemap-list li { font-size: 14px; }
.sitemap-list .small { margin-left: 4px; }

/* ── Подвал ──────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 48px 24px 32px;
  margin-top: 64px;
}
.site-footer__inner { max-width: var(--shell); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.footer-col a { font-size: 13px; color: var(--text-muted); }
.footer-col p { font-size: 13px; color: var(--text-muted); line-height: 1.8; }
.footer-brand { font-size: 18px; font-weight: 700; color: var(--accent-light); display: block; margin-bottom: 8px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.footer-bottom nav { display: flex; gap: 16px; }
.footer-bottom a { color: var(--text-muted); font-size: 12px; }

/* ── Пусто / 404 ─────────────────────────────────────── */

.empty { text-align: center; padding: 64px 0; color: var(--text-secondary); }
.empty h2 { margin-bottom: 12px; }

/* ── Адаптив ─────────────────────────────────────────── */

@media (max-width: 768px) {
  .shell { padding: 24px 16px; }
  .stats { flex-direction: column; align-items: stretch; }
  .audit-grid { grid-template-columns: 1fr; gap: 32px; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .col-brands, .col-site, .col-type { display: none; }
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 24px; }
  .profile { padding: 24px; }
  h1 { font-size: 24px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .definition { grid-template-columns: 1fr; gap: 2px 0; }
  .definition dd { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Печать: только контент */
@media print {
  .site-header, .site-footer, .toolbar, .integrations-filter { display: none; }
  body { background: #fff; color: #000; }
}
