:root {
  --bg: #0a0b10;
  --bg-2: #0c0e15;
  --surface: #12141d;
  --surface-2: #171a24;
  --border: #242939;
  --border-2: #1b1f2a;
  --text: #e9ecf5;
  --muted: #8b93a7;
  --muted-2: #7b8398;
  --accent: #6f4bf5;
  --accent-2: #a78bfa;
  --grad-a: #7b5af7;
  --grad-b: #5f3ce8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 92, 255, .14);
  --good: #3ddc97;
  --good-soft: rgba(61, 220, 151, .12);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, .12);
  --shadow: 0 30px 60px -40px rgba(0, 0, 0, .9);
  --glow: radial-gradient(920px 460px at 50% -180px, rgba(124, 92, 255, .30), transparent 72%);
}
:root[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3fa;
  --border: #e3e7f0;
  --border-2: #edf0f7;
  --text: #111420;
  --muted: #5f6779;
  --muted-2: #677084;
  --accent: #6540f0;
  --accent-2: #5b34d6;
  --grad-a: #6a45f0;
  --grad-b: #5530cf;
  --accent-ink: #ffffff;
  --accent-soft: rgba(101, 64, 240, .08);
  --good: #0a7a4e;
  --good-soft: rgba(10, 122, 78, .10);
  --bad: #cf2e39;
  --bad-soft: rgba(207, 46, 57, .09);
  --shadow: 0 24px 48px -32px rgba(21, 27, 51, .35);
  --glow: radial-gradient(900px 420px at 50% -180px, rgba(101, 64, 240, .14), transparent 70%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ol, ul { margin: 0; padding: 0; list-style: none; }
img { display: block; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }
.ico { width: 18px; height: 18px; flex: none; }
.ico-xs { width: 14px; height: 14px; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-2);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  color: #fff; background: linear-gradient(145deg, var(--grad-a), var(--grad-b));
  box-shadow: 0 8px 18px -8px var(--accent);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { letter-spacing: .04em; font-weight: 600; }
.brand-name b { font-weight: 800; }
.main-nav { display: flex; gap: 4px; margin-right: auto; }
.main-nav a {
  padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 500;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.header-search {
  position: relative;
  display: flex; align-items: center; gap: 8px; width: 250px; height: 40px;
  padding: 0 12px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--muted);
}
.header-search input { width: 100%; border: 0; outline: 0; background: none; }
.header-search input::placeholder { color: var(--muted-2); }
.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); border-radius: 11px; background: var(--surface);
  color: var(--muted); cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.theme-toggle .ico-sun { display: block; }
.theme-toggle .ico-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ico-moon { display: block; }
.mobile-tools { display: none; }

/* ---------- герой ---------- */
.hero { background: var(--glow); border-bottom: 1px solid var(--border-2); }
.hero-inner { padding: 74px 0 46px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 18px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-size: 13px; background: var(--surface);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.hero h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -.035em; }
.hero .lead { max-width: 620px; margin: 16px auto 0; color: var(--muted); font-size: 17px; }
.search {
  position: relative;
  display: flex; align-items: center; gap: 10px; width: min(620px, 100%);
  margin: 28px auto 0; padding: 6px 6px 6px 16px;
  border: 1px solid var(--border); border-radius: 15px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--muted);
}
.search input { flex: 1; min-width: 0; height: 44px; border: 0; outline: 0; background: none; }
.search input::placeholder { color: var(--muted-2); }
.search button {
  height: 44px; padding: 0 22px; border: 0; border-radius: 11px; cursor: pointer;
  background: linear-gradient(145deg, var(--grad-a), var(--grad-b)); color: var(--accent-ink); font-weight: 600;
}
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px;
  margin-top: 30px; color: var(--muted); font-size: 14px;
}
.hero-stats b { color: var(--text); font-size: 17px; letter-spacing: -.01em; }

/* ---------- блоки ---------- */
.block { padding: 46px 0 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.block-head h2 { font-size: 23px; }
.more { display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; color: var(--accent-2); font-size: 14px; font-weight: 500; }
.more:hover { color: var(--accent); }

/* ---------- топ ---------- */
.top-head {
  display: grid; grid-template-columns: 28px minmax(0, 1.6fr) auto 108px 116px 16px;
  gap: 14px; padding: 0 16px 9px; color: var(--muted-2); font-size: 12px; letter-spacing: .02em;
}
.ta-r { text-align: right; }
.top-list { border: 1px solid var(--border-2); border-radius: 16px; overflow: hidden; background: var(--surface); }
.top-row {
  display: grid; grid-template-columns: 28px minmax(0, 1.6fr) auto 108px 116px 16px;
  align-items: center; gap: 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--border-2);
}
.top-row:last-child { border-bottom: 0; }
.top-row:hover { background: var(--surface-2); }
.top-rank { color: var(--muted-2); font-variant-numeric: tabular-nums; font-size: 14px; text-align: center; }
.top-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-id { display: flex; flex-direction: column; min-width: 0; }
.top-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-handle { color: var(--muted-2); font-size: 13px; }
.top-subs { color: var(--muted); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.top-subs b { color: var(--text); font-size: 15px; margin-right: 3px; }
.growth { color: var(--good); font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.growth em { color: var(--muted-2); font-style: normal; }
.growth.muted { color: var(--muted-2); }
.row-chev { color: var(--muted-2); }

/* ---------- карточки ---------- */
.card-grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 12px; min-height: 190px;
  padding: 16px; border: 1px solid var(--border-2); border-radius: 16px;
  background: var(--surface); transition: border-color .15s, transform .15s, background .15s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); transform: translateY(-2px); }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.card-name {
  font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.handle { color: var(--muted-2); font-size: 13px; }
.card-arrow { color: var(--muted-2); transition: color .15s, transform .15s; }
.card:hover .card-arrow { color: var(--accent-2); transform: translateX(2px); }
.card-desc {
  color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.card-subs { color: var(--muted); font-size: 12px; white-space: nowrap; }
.card-subs b { color: var(--text); font-size: 14px; margin-right: 4px; }
.open-link { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-2); font-size: 13px; font-weight: 500; }

.avatar { border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.avatar-sm { width: 34px; height: 34px; }
.avatar-md { width: 46px; height: 46px; }
.avatar-xs { width: 34px; height: 34px; }
.avatar-xl { width: 92px; height: 92px; border-radius: 24px; }
.avatar-letter {
  display: grid; place-items: center; color: var(--accent-2);
  background: var(--accent-soft); font-weight: 700; font-size: 18px;
}

/* ---------- чипы ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; line-height: 1.5; white-space: nowrap;
}
.chip-sm { padding: 3px 9px; font-size: 11.5px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 26px 0 0; }
.chip-filter {
  padding: 8px 12px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 500; border-radius: 10px;
}
.chip-filter:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.chip-filter.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip-n { color: var(--muted-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chip-filter.is-active .chip-n { color: color-mix(in srgb, var(--accent-ink) 75%, transparent); }
.chip-more { color: var(--accent-2); border-style: dashed; background: none; }

/* ---------- категории на главной ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.cat-tile {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 16px; border: 1px solid var(--border-2); border-radius: 12px;
  background: var(--surface); font-size: 14px;
}
.cat-tile:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.cat-tile b { color: var(--muted-2); font-size: 13px; font-variant-numeric: tabular-nums; }

.note-band {
  display: flex; align-items: flex-start; gap: 14px; margin: 46px 0 60px;
  padding: 18px 20px; border: 1px solid var(--border-2); border-radius: 14px;
  background: var(--surface); color: var(--muted); font-size: 14px;
}
.note-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-2); flex: none; }

/* ---------- служебные страницы ---------- */
.page { display: none; scroll-margin-top: 66px; }
.page:target { display: block; }
body:not(:has(.page:target)) #home { display: block; }
.page-head { padding: 34px 0 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted-2); font-size: 13px; }
.crumbs a:hover { color: var(--accent-2); }
.crumbs .ico { opacity: .6; }
.page-head h1 { margin-top: 12px; font-size: clamp(28px, 3.4vw, 38px); }
.page-head .lead { max-width: 720px; margin-top: 10px; color: var(--muted); font-size: 16px; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 20px 0 16px;
}
.toolbar-group { display: flex; gap: 10px; flex-wrap: wrap; }
.select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-2); font-size: 13px; }
.select select {
  height: 38px; padding: 0 30px 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b93a7' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--text); font-size: 13px; appearance: none;
}
.toolbar-count { color: var(--muted-2); font-size: 13px; white-space: nowrap; }
.toolbar-count b { color: var(--text); }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 34px 0 60px; }
.pager a, .pager-cur, .pager-gap {
  display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--border-2); border-radius: 10px; color: var(--muted); font-size: 14px;
}
.pager a:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); color: var(--text); }
.pager-cur { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.pager-gap { border: 0; }
.pager-next { padding: 0 8px; }

/* ---------- карточка канала ---------- */
.ch-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 22px; padding: 24px 0 20px;
}
.ch-hero h1 { font-size: clamp(25px, 3vw, 34px); }
.ch-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.ch-meta .handle { font-size: 14px; }
.ch-lead { max-width: 760px; margin-top: 12px; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: 12px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn-primary { background: linear-gradient(145deg, var(--grad-a), var(--grad-b)); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-wide { width: 100%; }
.ch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; padding-bottom: 70px; }
.ch-main, .ch-side { display: flex; flex-direction: column; gap: 14px; }
.ch-side { position: sticky; top: 82px; }
.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  border: 1px solid var(--border-2); border-radius: 14px; background: var(--surface);
}
.stat-label { color: var(--muted-2); font-size: 12.5px; }
.stat-value { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value.good { color: var(--good); }
.stat-note { color: var(--muted-2); font-size: 12.5px; }
.panel { padding: 22px; border: 1px solid var(--border-2); border-radius: 16px; background: var(--surface); }
.panel h2 { font-size: 18px; margin-bottom: 12px; }
.panel p { color: var(--muted); font-size: 14.5px; }
.panel p + p { margin-top: 10px; }
.steps { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.step-n {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-2); font-size: 13px; font-weight: 700; flex: none;
}
.step-body { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.step-body span { color: var(--muted); }
code { padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 13px; }
.cta { border-color: color-mix(in srgb, var(--accent) 35%, var(--border-2)); background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface); }
.cta p { margin-bottom: 14px; }
.share { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted-2); font-size: 13px; }
.share a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 12.5px; }
.mini-list { display: flex; flex-direction: column; gap: 4px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px; border-radius: 10px; }
.mini-row:hover { background: var(--surface-2); }
.mini-id { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.mini-id b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-id span { color: var(--muted-2); font-size: 12.5px; }

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--border-2); background: var(--bg-2); }
.footer-inner { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 30px; padding: 40px 0 28px; }
.footer-brand p { max-width: 300px; margin-top: 12px; color: var(--muted-2); font-size: 13.5px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.footer-col h3 { margin-bottom: 4px; color: var(--muted-2); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 20px; padding: 16px 0 26px;
  border-top: 1px solid var(--border-2); color: var(--muted-2); font-size: 12.5px;
}

/* ---------- адаптив ---------- */
@media (max-width: 1080px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-layout { grid-template-columns: minmax(0, 1fr); }
  .ch-side { position: static; }
  .top-head, .top-row { grid-template-columns: 26px minmax(0, 1fr) 100px 112px 16px; }
  .top-head span:nth-child(3), .top-row .chip { display: none; }
}
@media (max-width: 700px) {
  body { font-size: 14.5px; }
  .container { width: min(1200px, 100% - 32px); }
  .main-nav, .header-inner > .header-search { display: none; }
  .header-inner { height: 56px; }
  .theme-toggle { margin-left: auto; width: 40px; height: 40px; }
  .mobile-tools { display: block; }
  .mobile-bar { padding: 12px 16px 0; }
  .mobile-bar .header-search { display: flex; width: 100%; height: 42px; background: var(--surface-2); border-color: transparent; }
  .mobile-nav {
    display: flex; gap: 4px; overflow-x: auto; padding: 0 12px 10px; scrollbar-width: none;
  }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .mobile-nav a {
    padding: 6px 9px; border: 1px solid var(--border-2); border-radius: 999px;
    color: var(--muted); font-size: 12.5px; white-space: nowrap; background: var(--surface);
  }
  .hero-inner { padding: 40px 0 32px; text-align: left; }
  .eyebrow { margin-bottom: 14px; }
  .hero h1 { font-size: 32px; }
  .hero .lead { margin-top: 12px; font-size: 15px; }
  .search { margin-top: 20px; }
  .search input { height: 42px; }
  .search button { height: 42px; padding: 0 16px; }
  .hero-stats {
    display: grid; grid-template-columns: repeat(2, minmax(0, auto)); justify-content: start;
    gap: 8px 22px; margin-top: 22px; font-size: 13px;
  }
  .more { font-size: 13px; }
  .hero-stats b { font-size: 15px; }
  .block { padding-top: 32px; }
  .block-head h2 { font-size: 19px; }
  .top-list { border-radius: 14px; }
  .top-head, .top-row { grid-template-columns: 22px minmax(0, 1fr) auto 14px; gap: 10px; padding: 10px 12px; }
  .top-head { display: none; }
  .top-row .top-subs, .top-row .growth { display: none; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .card { min-height: 0; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-tile { padding: 12px 13px; font-size: 13.5px; }
  .note-band { margin: 32px 0 40px; padding: 14px 16px; font-size: 13.5px; }
  .page-head { padding-top: 22px; }
  .page-head .lead { font-size: 14.5px; }
  .chips-row { flex-wrap: nowrap; overflow-x: auto; padding: 16px 0 0; scrollbar-width: none; }
  .chips-row::-webkit-scrollbar { display: none; }
  .chip-filter { flex: none; }
  .toolbar { flex-direction: column; align-items: flex-start; gap: 10px; margin: 14px 0; }
  .toolbar .select span { display: none; }
  .select select { height: 36px; }
  .ch-hero { grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 18px 0 8px; }
  .avatar-xl { width: 68px; height: 68px; border-radius: 20px; }
  .ch-open { grid-column: 1 / -1; width: 100%; }
  .ch-lead { display: none; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 19px; }
  .stat-note { font-size: 11px; }
  .panel { padding: 18px; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 30px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 6px; padding-bottom: 90px; }
}

/* ---------- каркас страниц (задача 11) ---------- */
.site-main { display: block; min-height: 40vh; padding-bottom: 40px; }
.main-nav a.is-active { color: var(--text); background: var(--surface-2); }
.empty-state {
  padding: 26px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14.5px;
}
.empty-state p { max-width: 680px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { border-color: var(--accent); }

/* ---------- каталог (задача 12) ---------- */
.catalog-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 18px 0 4px;
}
.catalog-search {
  position: relative;
  display: flex; align-items: center; gap: 8px; flex: 1 1 320px; min-width: 240px;
  height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--muted);
}
.catalog-search input { width: 100%; border: 0; outline: 0; background: none; color: var(--text); }
.catalog-search input::placeholder { color: var(--muted-2); }
.catalog-submit { height: 40px; }

/* подсказки поиска (typeahead) */
.suggest {
  position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 50;
  padding: 6px; border: 1px solid var(--border-2); border-radius: 13px;
  background: var(--surface); box-shadow: var(--shadow);
  max-height: min(50vh, 380px); overflow: auto;
}
.suggest[hidden] { display: none; }
.suggest-list { margin: 0; padding: 0; }
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 9px; color: inherit; }
.suggest-item.is-active { background: var(--accent-soft); }
.suggest-item:not(.is-active):hover { background: var(--surface-2); }
.suggest-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.suggest-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-handle { color: var(--muted-2); font-size: 12.5px; }
.suggest-cat { color: var(--muted-2); font-size: 12px; white-space: nowrap; }
.suggest mark { background: color-mix(in srgb, var(--accent) 26%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.suggest-all { display: block; margin-top: 4px; padding: 9px 10px 7px; border-top: 1px solid var(--border); color: var(--accent-2); font-size: 13px; }
.suggest-empty { padding: 12px 10px; color: var(--muted); font-size: 13.5px; }
.suggest-empty p { margin: 0 0 8px; }
.suggest-other { color: var(--accent-2); }
.suggest-empty .suggest-other + .suggest-other { margin-left: 10px; }
@media (min-width: 901px) {
  .header-inner .header-search .suggest { width: 360px; left: auto; right: -1px; }
}
.catalog-more { display: flex; justify-content: center; padding: 26px 0 10px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (max-width: 700px) {
  .catalog-filters { gap: 8px; }
  .catalog-search { flex: 1 1 100%; }
  .catalog-submit { display: none; }
}

/* ---------- страница канала (задача 13) ---------- */
.growth-grid { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 14px; }
.growth-cell { display: flex; flex-direction: column; gap: 2px; }
.growth-cell span { color: var(--muted-2); font-size: 12.5px; }
.growth-cell b { font-size: 20px; font-variant-numeric: tabular-nums; }
.growth-cell b.good { color: var(--good); }
.spark { display: block; width: 100%; height: 64px; color: var(--accent-2); margin-top: 4px; }
.spark-note, .panel-note { margin-top: 8px; color: var(--muted-2); font-size: 12.5px; }
.spark-empty { color: var(--muted-2); font-size: 13.5px; }
.share-copy {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: none; color: var(--text); font-size: 12.5px; cursor: pointer;
}
.share-copy:hover { border-color: var(--accent); }

/* выравнивание кнопок «поделиться» */
.share a, .share .share-copy { display: inline-flex; align-items: center; height: 26px; }

/* ---------- раздел ботов (задача 14) ---------- */
a.card-name { color: inherit; }
a.card-name:hover { color: var(--accent-2); }
.bot-card .card-desc { flex: 1; }
.bots-note { margin: 26px 0 10px; color: var(--muted-2); font-size: 13.5px; }
.bots-note a { color: var(--accent-2); }
.top-cat { color: var(--muted-2); font-size: 12.5px; }

/* рейтинг: на мобильном подписчики важны, поэтому не скрываем их */
.empty-state { margin-top: 22px; }
@media (max-width: 700px) {
  .rank-list .top-row { grid-template-columns: 24px minmax(0, 1fr) 84px 14px; }
  .rank-list .top-subs { display: block; text-align: right; }
}

/* ---------- политика конфиденциальности ---------- */
.legal { max-width: 820px; padding: 30px 0 20px; }
.legal .crumbs { margin-bottom: 10px; }
.legal h1 { font-size: clamp(26px, 4vw, 38px); }
.legal-date { margin-top: 10px; color: var(--muted-2); font-size: 13.5px; }
.legal h2 { margin: 32px 0 10px; padding-top: 18px; border-top: 1px solid var(--border-2); font-size: 20px; }
.legal p, .legal li { color: var(--muted); font-size: 15px; line-height: 1.65; }
.legal p + p { margin-top: 10px; }
.legal ul { margin: 10px 0 0; padding-left: 22px; list-style: disc; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.legal-toggle { margin-top: 12px; height: 36px; padding: 0 14px; font-size: 13px; }
.legal-status { margin-left: 8px; color: var(--muted-2); font-size: 13px; }

/* уведомление о политике для новых посетителей */
.privacy-notice {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  width: min(420px, calc(100% - 32px));
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--muted);
  font-size: 13.5px; line-height: 1.5;
}
.privacy-notice[hidden] { display: none; }
.privacy-notice b { display: block; margin-bottom: 4px; color: var(--text); font-size: 14px; }
.privacy-notice p { margin: 0; }
.privacy-notice a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.privacy-notice .btn { margin-top: 12px; height: 34px; padding: 0 22px; border-radius: 10px; font-size: 13px; }
@media (max-width: 520px) {
  .privacy-notice { left: 10px; right: 10px; bottom: 10px; width: auto; }
}

/* ---------- о проекте и помощь ---------- */
.about-text { max-width: 760px; color: var(--muted); font-size: 15px; line-height: 1.7; }
.about-text p + p { margin-top: 10px; }
.about-text a, .faq a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.about-grid .panel h3 { margin-bottom: 6px; font-size: 16px; }
.about-grid .panel p { color: var(--muted); font-size: 14px; }
.about-stats { display: flex; flex-wrap: wrap; gap: 30px; padding: 20px 22px; border: 1px solid var(--border-2); border-radius: 16px; background: var(--surface); }
.about-stat { display: flex; flex-direction: column; gap: 2px; }
.about-stat b { font-size: 26px; letter-spacing: -.02em; }
.about-stat span { color: var(--muted-2); font-size: 12.5px; }
.about-cta p { max-width: 700px; margin: 8px 0 16px; color: var(--muted); }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.help-card { display: block; transition: border-color .15s; }
.help-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.help-card h3 { margin-bottom: 6px; font-size: 16px; }
.help-card p { color: var(--muted); font-size: 14px; }
.soon { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.faq { border-top: 1px solid var(--border-2); padding: 14px 0; }
.faq summary { cursor: pointer; color: var(--text); font-weight: 600; }
.faq p { margin-top: 8px; color: var(--muted); }
@media (max-width: 700px) {
  .about-grid, .help-grid { grid-template-columns: 1fr; }
  .about-stats { gap: 20px; }
}

/* ---------- админка (задача 18) ---------- */
.admin-login { display: flex; flex-direction: column; gap: 14px; max-width: 420px; margin-top: 22px; }
.admin-login input[type="password"] {
  height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text);
}
.admin-error { padding: 10px 14px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 14px; }
.admin-check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border-2); border-radius: 14px; background: var(--surface); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-2); text-align: left; vertical-align: top; }
.admin-table th { color: var(--muted-2); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr.is-hidden { opacity: .55; }
.admin-channel a { display: block; font-weight: 600; color: var(--text); }
.admin-channel a:hover { color: var(--accent-2); }
.admin-channel .handle { font-size: 12.5px; }
.admin-subs { white-space: nowrap; color: var(--muted); }
.admin-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-inline select {
  height: 32px; max-width: 220px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 12.5px;
}
.admin-source { display: inline-block; margin-top: 4px; color: var(--muted-2); font-size: 11.5px; }
.admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.share-copy.danger { color: #e5484d; border-color: color-mix(in srgb, #e5484d 40%, var(--border)); }


/* ---------- полировка (QA) ---------- */
.catalog-filters .select select { height: 40px; }
.top-head.no-growth,
.top-list.no-growth .top-row { grid-template-columns: 28px minmax(0, 1.6fr) auto 108px 16px; }
.top-head.no-growth span:nth-child(5),
.top-list.no-growth .top-row .growth { display: none; }
@media (max-width: 1080px) {
  .top-head.no-growth,
  .top-list.no-growth .top-row { grid-template-columns: 26px minmax(0, 1fr) 100px 16px; }
}
.admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.admin-head .btn { margin-top: 6px; }
@media (max-width: 700px) {
  .admin-head { flex-direction: column; }
  .admin-head .btn { margin-top: 0; }
}


/* мобильная полировка */
@media (max-width: 700px) {
  /* имена в топах не режем до «Мир сегод…» */
  .top-list .top-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* админка: фильтры в столбик, таблица со своей прокруткой */
  .admin-filters { flex-direction: column; align-items: stretch; gap: 10px; }
  .admin-filters .catalog-search { flex: 1 1 auto; }
  .admin-filters .admin-check { justify-content: flex-start; }
  .admin-filters .btn { width: 100%; }
  .admin-table { min-width: 720px; }
  .admin-table th:first-child,
  .admin-table td:first-child {
    position: sticky; left: 0; z-index: 1;
    background: var(--surface);
    box-shadow: 1px 0 0 var(--border-2);
  }
}
