/* ===== Базовые токены ===== */
:root {
  --bg: #F3F6FB;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --text: #121826;
  --text-2: #4A5468;
  --muted: #7B8599;
  --line: #E4E9F2;
  --primary: #1F8FE5;
  --primary-2: #1478C8;
  --primary-soft: #E7F3FD;
  --accent: #FF7A1A;
  --ok: #1E9E5A;
  --ok-soft: #E3F6EC;
  --warn: #B7791F;
  --warn-soft: #FFF5E0;
  --err: #D93A3A;
  --err-soft: #FDEBEB;
  --hl: #FFF8E6;
  --hl-line: #F6C94E;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .10);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3, .h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; font-size: 13px; word-break: break-all; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.container.narrow { max-width: 820px; }
.main { min-height: 60vh; padding-bottom: 48px; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  font: 700 14px/1 var(--font); letter-spacing: 0; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .05s;
  color: var(--text); background: var(--surface); -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn .ic { flex: 0 0 auto; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; }
/* основная — заливка */
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(20, 120, 200, .25); }
.btn-primary:hover { background: var(--primary-2); color: #fff; }
/* второстепенная — светлая с рамкой */
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.btn-ghost:hover { border-color: #C5D0E0; background: var(--surface-2); color: var(--text); }
/* мягкие цветные */
.btn-tg, .btn-soft { background: var(--primary-soft); color: var(--primary-2); }
.btn-tg:hover, .btn-soft:hover { background: #D6EBFC; color: var(--primary-2); }
.btn-success { background: var(--ok); color: #fff; box-shadow: 0 1px 2px rgba(30, 158, 90, .25); }
.btn-success:hover { background: #17844A; color: #fff; }
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { background: #B92E2E; color: #fff; }
.btn-danger-soft { background: var(--err-soft); color: var(--err); border-color: #F5C9C9; }
.btn-danger-soft:hover { background: #FBDCDC; color: #B92E2E; }
.btn-danger-text { color: var(--err); }
.btn-danger-text:hover { color: #B92E2E; border-color: #F5C9C9; background: var(--err-soft); }
.btn-white { background: #fff; color: var(--primary-2); }
.btn-white:hover { background: #F0F7FF; color: var(--primary-2); }
/* размеры */
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 14px; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13.5px; border-radius: 10px; gap: 6px; }
.btn-xs { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; gap: 5px; }
.btn-icon { width: 36px; padding: 0; }
.btn-xs.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row form { margin: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px; border: 0; background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

/* ===== Шапка ===== */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 16px; height: var(--header-h); }
.burger { display: none; flex: 0 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; min-width: 0; }
.logo:hover { color: var(--text); }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #34B3F7, #1A7FD9);
  box-shadow: 0 4px 12px rgba(31, 143, 229, .35);
}
.logo-mark svg { margin-left: -2px; }
.logo-text { font-weight: 800; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; flex: 1 1 auto; max-width: 520px; margin: 0 auto; }
.search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
  font: 500 14px var(--font); color: var(--text); outline: none; transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-soft); }
.search-ic { position: absolute; left: 13px; top: 12px; color: var(--muted); pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.usermenu { position: relative; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 6px; display: none;
}
.usermenu.open .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: 14px; }
.dropdown a:hover { background: var(--surface-2); }
.dropdown-head { padding: 8px 12px 10px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Мобильное меню ===== */
.drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.drawer.open { visibility: visible; }
.drawer-bg { position: absolute; inset: 0; background: rgba(10, 18, 32, .45); opacity: 0; transition: opacity .2s; }
.drawer.open .drawer-bg { opacity: 1; }
.drawer-panel {
  position: absolute; left: 0; top: 0; bottom: 0; width: min(86vw, 340px);
  background: #fff; transform: translateX(-100%); transition: transform .25s ease;
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain;
  padding-bottom: env(safe-area-inset-bottom);
}
.drawer.open .drawer-panel { transform: none; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 8px 20px; position: sticky; top: 0; background: #fff; }
.drawer-title { font-weight: 800; font-size: 18px; }
.drawer-sub { padding: 16px 20px 6px; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.drawer-nav { display: flex; flex-direction: column; padding: 0 10px; }
.drawer-nav a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--text); font-weight: 600; }
.drawer-nav a:hover { background: var(--surface-2); }
.drawer-cats a .cn, .side-cats a .cn { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-cats a .ci, .side-cats a .ci { width: 22px; text-align: center; flex: 0 0 auto; }
.drawer-cats a .cc, .side-cats a .cc { font-size: 12px; color: var(--muted); font-weight: 700; flex: 0 0 auto; }
body.no-scroll { overflow: hidden; }

/* ===== Hero ===== */
.hero {
  background:
    radial-gradient(900px 300px at 85% -10%, rgba(52, 179, 247, .25), transparent 60%),
    radial-gradient(700px 300px at 0% 0%, rgba(26, 127, 217, .15), transparent 60%),
    linear-gradient(180deg, #fff, var(--bg));
  padding: 56px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.hero h1 { font-size: 42px; margin-bottom: 12px; }
.hero-sub { font-size: 17px; color: var(--text-2); max-width: 620px; margin: 0 auto 26px; }
.hero-search {
  display: flex; gap: 8px; max-width: 640px; margin: 0 auto;
  background: #fff; padding: 6px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.hero-search input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: none; padding: 0 14px; height: 48px;
  font: 600 16px var(--font); color: var(--text); background: transparent;
}
.hero-search .btn { height: 48px; padding: 0 26px; }
.hero-search-page { margin: 0 0 24px; max-width: none; box-shadow: var(--shadow); }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 30px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; align-items: center; }
.hero-stats b { font-size: 26px; font-weight: 800; color: var(--text); }
.hero-stats span { font-size: 13px; color: var(--muted); }

/* ===== Секции ===== */
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.more { font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ===== Сетка категорий ===== */
.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cat-tile {
  display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 68px;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: var(--text); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cat-tile:hover { border-color: #BFD9F3; box-shadow: var(--shadow); color: var(--text); transform: translateY(-1px); }
.cat-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; font-size: 21px; line-height: 1; background: var(--surface-2);
}
.cat-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.cat-name { font-weight: 700; font-size: 14.5px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cat-count { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.cat-all { display: none; margin-top: 12px; }

/* ===== Карточки каналов ===== */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); transition: box-shadow .15s, border-color .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: #D3DDEB; transform: translateY(-2px); }
.card--hl { background: linear-gradient(180deg, var(--hl), #fff 70%); border-color: var(--hl-line); }
.card--top { border-color: #FFC9A3; }
.card-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-meta { min-width: 0; flex: 1 1 auto; }
.card-title {
  font-size: 15px; font-weight: 800; margin: 0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere;
}
.card-title a { color: var(--text); }
.card-title a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); z-index: 1; }
.card-title a:hover { color: var(--primary); }
.card-user { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-badges, .card-tags { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; min-width: 0; }
.badge-cat { position: relative; z-index: 2; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 20px; font-weight: 700; }
a.badge-cat:hover { color: var(--primary); border-color: #BFD9F3; }
.card-desc {
  margin: 12px 0 16px; font-size: 13.5px; color: var(--text-2); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  overflow-wrap: anywhere; height: calc(1.5em * 3); flex: 0 0 auto;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; min-width: 0; padding-top: 12px; border-top: 1px solid var(--line); }
.card--hl .card-foot { border-top-color: #F3E2B0; }
.card-foot .btn { margin-left: auto; position: relative; z-index: 2; flex: 0 0 auto; }
.card-foot .chip { position: relative; z-index: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subs { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 13px; color: var(--text); flex: 0 0 auto; }
.subs svg { color: var(--muted); }
.verified {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: 2px;
  width: 16px; height: 16px; margin-left: 5px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 900;
}

/* Аватары */
.ava {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border-radius: 50%; color: #fff; font-weight: 800; object-fit: cover; background: var(--surface-2);
}
.ava-sm { width: 34px; height: 34px; font-size: 14px; }
.ava-md { width: 52px; height: 52px; font-size: 20px; }
.ava-xl { width: 112px; height: 112px; font-size: 42px; }

/* Чипы, бейджи, статусы */
.chip {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; font-weight: 700;
}
a.chip:hover { border-color: #BFD9F3; color: var(--primary); }
.chip-lg { height: 34px; padding: 0 14px; font-size: 14px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 800; }
.badge-top { background: #FFEDE0; color: #C2410C; }
.badge-hl { background: #FFF1C2; color: #8A5A00; }
.status { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 800; white-space: nowrap; flex: 0 0 auto; }
.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-err { background: var(--err-soft); color: var(--err); }

/* ===== Страницы ===== */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); padding: 18px 0 6px; min-width: 0; }
.crumbs a { color: var(--muted); font-weight: 600; }
.crumbs a:hover { color: var(--primary); }
.crumbs > span:last-child { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.page-head { display: flex; gap: 16px; align-items: flex-start; padding: 12px 0 20px; }
.page-head-row { align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 28px; }
.page-head-ico {
  width: 60px; height: 60px; border-radius: 18px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: 30px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.page-head-txt { min-width: 0; }
.page-head h1 { margin-bottom: 6px; }
.page-head h1 small { font-size: .6em; color: var(--muted); font-weight: 700; }
.lead { color: var(--text-2); font-size: 15.5px; margin: 0; max-width: 760px; }

.layout-side { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
.side-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.side-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 8px; }
.side-cats { display: flex; flex-direction: column; }
.side-cats a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; color: var(--text); font-size: 14px; font-weight: 600; }
.side-cats a:hover { background: var(--surface-2); }
.side-cats a.active { background: var(--primary-soft); color: var(--primary-2); }
.content { min-width: 0; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 7px 14px; border-radius: 9px; color: var(--text-2); font-weight: 700; font-size: 14px; white-space: nowrap; }
.tab span { color: var(--muted); font-size: 12px; margin-left: 2px; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--primary); color: #fff; }
.tab.active span { color: rgba(255, 255, 255, .8); }
.sort { display: flex; gap: 14px; font-size: 14px; font-weight: 700; }
.sort a { color: var(--muted); }
.sort a.active { color: var(--text); }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 28px 0 8px; }
.pg { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: #fff; border: 1px solid var(--line); color: var(--text); }
a.pg:hover { border-color: var(--primary); color: var(--primary); }
.pg-cur { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-dots { border: 0; background: none; min-width: 20px; }

.empty { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-ico { font-size: 44px; margin-bottom: 10px; }
.empty-404 { margin-top: 40px; border-style: solid; }

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-top: 40px; padding: 28px 32px; border-radius: 20px; color: #fff;
  background: linear-gradient(120deg, #1A7FD9, #34B3F7);
  box-shadow: 0 12px 30px rgba(31, 143, 229, .25);
}
.cta h2 { color: #fff; margin-bottom: 6px; }
.cta p { margin: 0; opacity: .92; max-width: 640px; }
.cta-sm { padding: 20px 24px; margin-top: 28px; }
.cta-sm h2 { font-size: 18px; }

.seo-text {
  margin-top: 40px; padding: 28px 32px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text-2); font-size: 15px;
}
.seo-text h2 { font-size: 19px; color: var(--text); margin-top: 1.2em; }
.seo-text h2:first-child { margin-top: 0; }
.seo-text p:last-child { margin-bottom: 0; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 6px; }

/* ===== Страница канала ===== */
.channel-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-top: 8px; }
.channel-side { position: sticky; top: calc(var(--header-h) + 16px); }
.channel-head { display: flex; gap: 20px; align-items: center; min-width: 0; }
.channel-info { min-width: 0; }
.channel-info h1 { font-size: 26px; margin-bottom: 4px; overflow-wrap: anywhere; }
.channel-user { color: var(--muted); font-weight: 600; margin-bottom: 10px; overflow-wrap: anywhere; }
.channel-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.channel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.channel-stats div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.channel-stats b { display: block; font-size: 19px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-stats span { font-size: 12.5px; color: var(--muted); }
.channel-desc { margin-top: 24px; }
.channel-desc h2 { font-size: 18px; }
.desc-text { color: var(--text-2); overflow-wrap: anywhere; white-space: normal; }
.channel-link { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.owner-bar { margin-top: 16px; }

/* ===== Формы ===== */
.form { display: flex; flex-direction: column; gap: 16px; }
.form h3 { margin: 10px 0 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; min-width: 0; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  width: 100%; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font: 500 15px var(--font); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
.form textarea { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form .check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.form .check input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.packages { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.packages legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.pkg { position: relative; cursor: pointer; display: block !important; }
.pkg input { position: absolute; opacity: 0; pointer-events: none; }
.pkg-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .15s, background .15s; }
.pkg input:checked + .pkg-body { border-color: var(--primary); background: var(--primary-soft); }
.pkg input:focus-visible + .pkg-body { box-shadow: 0 0 0 3px var(--primary-soft); }
.pkg-name { font-weight: 800; font-size: 14px; }
.pkg-desc { font-weight: 500; font-size: 12.5px; color: var(--muted); flex: 1 1 auto; }
.pkg-price { font-weight: 800; font-size: 16px; color: var(--primary-2); }
.pkg-hint { grid-column: 1 / -1; margin: 0; }

.preview { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); min-width: 0; }
.preview img, .preview .ava { width: 48px; height: 48px; border-radius: 50%; flex: 0 0 auto; object-fit: cover; }
.preview-txt { min-width: 0; flex: 1 1 auto; }
.preview-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.preview.err { background: var(--err-soft); border-color: #F5C2C2; color: var(--err); font-weight: 600; }

/* Алерты */
.flashes { padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.alert { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; border: 1px solid transparent; overflow-wrap: anywhere; }
.alert-success { background: var(--ok-soft); color: #126B3D; border-color: #BFE8D1; }
.alert-error { background: var(--err-soft); color: #A62828; border-color: #F5C2C2; }
.alert-info { background: var(--primary-soft); color: #0F5E9C; border-color: #C5E2FA; }
.alert-warn { background: var(--warn-soft); color: #7A5110; border-color: #F3DEB0; }

/* Авторизация */
.auth-wrap { display: flex; justify-content: center; padding-top: 40px; }
.auth { width: 100%; max-width: 440px; }
.auth h1 { font-size: 26px; }
.auth-switch { text-align: center; margin: 18px 0 0; font-size: 14px; }
.tg-login { display: flex; justify-content: center; margin: 8px 0; min-height: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Мои каналы */
.my-list { display: flex; flex-direction: column; gap: 12px; }
.my-item { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.my-row { display: flex; align-items: center; gap: 14px; min-width: 0; }
.my-info { min-width: 0; flex: 1 1 auto; }
.my-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-title a { color: var(--text); }
.my-info .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 18+ */
.age-gate { position: fixed; inset: 0; z-index: 200; background: rgba(10, 18, 32, .85); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.age-box { background: #fff; border-radius: 20px; padding: 32px; max-width: 420px; width: 100%; text-align: center; }
.age-ico { font-size: 48px; }
.age-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== Подвал ===== */
.footer { background: #0F1724; color: #A9B3C6; padding: 44px 0 24px; margin-top: 40px; }
.footer a { color: #D5DCE8; }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.3fr .8fr 1.4fr; gap: 32px; }
.logo-footer .logo-text { color: #fff; }
.footer-about p { font-size: 14px; margin-top: 14px; }
.footer-h { color: #fff; font-weight: 800; margin-bottom: 12px; font-size: 15px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-cats-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 14px; }
.footer-cats-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid #222D3F; font-size: 13px; }

/* ===== Адаптив ===== */
@media (max-width: 1180px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .burger { display: inline-flex; margin-left: -8px; }
  .channel-layout { grid-template-columns: minmax(0, 1fr); }
  .channel-side { position: static; }
}
@media (max-width: 860px) {
  .cards, .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .btn-add span { display: none; }
  .btn-add { width: 42px; padding: 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  :root { --header-h: 58px; }
  body { font-size: 15px; }
  .container { padding: 0 14px; }
  h1 { font-size: 24px; }
  h2 { font-size: 19px; }
  .header-in { gap: 8px; }
  .logo-text { display: none; }
  .search { margin: 0; }
  .search input { height: 40px; font-size: 16px; }
  .btn-login { padding: 0 12px; height: 40px; }
  .btn-add { height: 40px; width: 40px; }
  .hero { padding: 32px 0 28px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 15px; margin-bottom: 18px; }
  .hero-search { padding: 4px; border-radius: 14px; }
  .hero-search input { height: 44px; font-size: 16px; padding: 0 10px; }
  .hero-search .btn { height: 44px; padding: 0 16px; }
  .hero-stats { gap: 8px; margin-top: 22px; display: grid; grid-template-columns: repeat(3, 1fr); }
  .hero-stats b { font-size: 19px; }
  .hero-stats span { font-size: 11.5px; line-height: 1.3; text-align: center; }
  .section { margin-top: 30px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat-tile { flex-direction: column; align-items: flex-start; padding: 12px; gap: 8px; min-height: 108px; border-radius: 14px; }
  .cat-ico { width: 36px; height: 36px; font-size: 19px; border-radius: 10px; }
  .cat-txt { width: 100%; flex: 1 1 auto; justify-content: space-between; }
  .cat-name { font-size: 14px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
  .cat-count { font-size: 12px; margin-top: 4px; }
  .cat-all { display: flex; }
  .cards, .cards-3 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .card { padding: 14px; }
  .card:hover { transform: none; }
  .card-desc { height: auto; max-height: calc(1.5em * 3); -webkit-line-clamp: 3; margin: 10px 0 12px; }
  .ava-md { width: 46px; height: 46px; font-size: 18px; }
  .ava-xl { width: 80px; height: 80px; font-size: 32px; }
  .page-head { gap: 12px; padding-bottom: 14px; }
  .page-head-ico { width: 46px; height: 46px; font-size: 24px; border-radius: 14px; }
  .lead { font-size: 14.5px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tabs { width: 100%; }
  .tab { flex: 1 0 auto; text-align: center; }
  .sort { justify-content: flex-end; }
  .cta { flex-direction: column; align-items: stretch; text-align: left; padding: 22px 20px; }
  .cta .btn { width: 100%; }
  .seo-text { padding: 20px 18px; font-size: 14.5px; }
  .panel { padding: 18px; border-radius: 14px; }
  .channel-head { gap: 14px; align-items: flex-start; }
  .channel-info h1 { font-size: 21px; }
  .channel-stats { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
  .channel-stats div { padding: 10px; }
  .channel-stats b { font-size: 15px; }
  .channel-stats span { font-size: 11px; line-height: 1.3; display: block; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .packages { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; }
  .pg { min-width: 36px; height: 36px; }
  .auth-wrap { padding-top: 20px; }

}

/* ===== Админка ===== */
.admin { padding-top: 24px; }
.admin-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.admin-nav { position: sticky; top: calc(var(--header-h) + 16px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; }
.admin-nav-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 10px 8px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--text); font-weight: 700; font-size: 14px; }
.admin-nav a:hover { background: var(--surface-2); }
.admin-nav a.active { background: var(--primary-soft); color: var(--primary-2); }
.admin-nav .an { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-badge { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 800; }
.admin-body { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.admin-body > p { margin: 0; }
.admin-h1 { font-size: 26px; margin: 0; }
.admin-2col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.admin-2col-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.admin-side { display: flex; flex-direction: column; gap: 16px; }
.admin-tabs { align-self: flex-start; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); box-shadow: var(--shadow); }
.stat:hover { border-color: #BFD9F3; color: var(--text); }
.stat b { display: block; font-size: 26px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 13px; }
.stat-warn b { color: var(--accent); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters input, .filters select, .input-xs, .input-sm {
  height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 500 14px var(--font); color: var(--text); min-width: 0;
}
.filters input[type=search] { flex: 1 1 220px; }
.input-xs { height: 28px; font-size: 12px; padding: 0 8px; border-radius: 8px; }
.check-inline { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; }
.bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px 12px 0 0; border-bottom: 0; }
.bulk-move { display: inline-flex; gap: 4px; }
.table-wrap { width: 100%; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 0 0 12px 12px; -webkit-overflow-scrolling: touch; }
.panel .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFCFF; }
.tr-hl td { background: var(--hl); }
.tr-off td { opacity: .55; }
.td-cb { width: 36px; }
.td-ch { min-width: 220px; max-width: 340px; }
.td-ch-in { display: flex; align-items: center; gap: 10px; min-width: 0; }
.td-ch-txt { min-width: 0; display: flex; flex-direction: column; }
.td-ch-txt > a { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-ch-txt small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-ch-txt small a { color: var(--muted); }
.td-actions { white-space: nowrap; text-align: right; }
.td-actions form { display: inline-flex; gap: 4px; margin: 0; }
.td-name { white-space: nowrap; font-weight: 700; }
.td-name a { color: var(--text); }
.t-warn { color: var(--warn); }
.input-num { width: 110px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; font: 600 14px var(--font); }
.input-sort { width: 74px; }
.link-btn { border: 0; background: none; color: var(--primary); font: 700 11px var(--font); cursor: pointer; padding: 0 0 0 4px; text-transform: none; letter-spacing: 0; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 40%); z-index: 5; }
.panel .sticky-save { background: linear-gradient(transparent, #fff 40%); margin-bottom: -12px; }
.kv { list-style: none; padding: 0; margin: 14px 0; font-size: 14px; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.kv li span { color: var(--muted); }
.kv li b { text-align: right; overflow-wrap: anywhere; }
.kv-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
.checklist { padding-left: 20px; margin: 0; }
.checklist li { margin-bottom: 8px; }
.serp { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; font-family: Arial, sans-serif; }
.serp-url { font-size: 13px; color: #1E6E3A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 18px; color: #1A0DAB; margin: 2px 0; }
.serp-desc { font-size: 13.5px; color: #4D5156; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 420px; overflow-y: auto; padding: 4px; }
.pick { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px !important; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; font-weight: 600 !important; font-size: 13px !important; overflow: hidden; }
.pick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-ex { opacity: .5; }
.refresh-ctl { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }
.progress { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: linear-gradient(90deg, #34B3F7, #1A7FD9); transition: width .3s; }
.refresh-log { margin-top: 14px; max-height: 360px; overflow-y: auto; font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; background: #0F1724; color: #C9D3E3; border-radius: 12px; padding: 12px 14px; }
.refresh-log:empty { display: none; }

@media (max-width: 1024px) {
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav-title { display: none; }
  .admin-nav a { flex: 0 0 auto; }
  .admin-2col, .admin-2col-even { grid-template-columns: minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.form input[type=file] { height: auto !important; padding: 10px 12px !important; font-size: 14px !important; background: var(--surface-2) !important; cursor: pointer; }
.refresh-state { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; }

/* ===== Новое: главная, закреп, права ===== */
.hero-in { display: flex; flex-direction: column; align-items: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 14px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 16px; box-shadow: var(--shadow); }
.hero-search { width: 100%; }
.hero-stats { width: 100%; max-width: 640px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-stats div { background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 14px; padding: 12px 8px; }
.section-pin { background: linear-gradient(180deg, #FFF7EC, #fff); border: 1px solid #FFE1B8; border-radius: 20px; padding: 20px; }
.section-pin .card { box-shadow: 0 2px 10px rgba(255, 150, 40, .10); }
.badge-pin { background: #FFE9D6; color: #B4500C; }
.pkg-off { opacity: .55; cursor: not-allowed; }
.packages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-info { background: var(--primary-soft); color: var(--primary-2); }
.t-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grant-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.grant-row label { flex: 1 1 220px; }
.grant-row .btn { height: 46px; }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.user-row.is-off { opacity: .6; }
.user-info { flex: 1 1 auto; min-width: 0; }
.user-name { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; flex-wrap: wrap; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin: 0; flex: 0 0 auto; }
.cta-txt { min-width: 0; }
@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero-badge { margin-bottom: 12px; font-size: 12px; }
  .hero-stats { gap: 8px; }
  .hero-stats div { padding: 10px 4px; }
  .section-pin { padding: 14px; border-radius: 16px; margin-left: -4px; margin-right: -4px; }
  .packages { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-row { flex-wrap: wrap; }
  .user-actions { width: 100%; justify-content: flex-start; }
  .grant-row .btn { width: 100%; }
}

@media (max-width: 640px) {
  .section-head h2 { font-size: 18px; }
  .card-foot { padding-top: 10px; }
}

.channel-link code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; }
@media (max-width: 640px) {
  .page-head .page-head-ico { display: none; }
  .channel-head { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .channel-info { width: 100%; }
  .channel-tags { justify-content: center; }
  .channel-link { flex-wrap: nowrap; }
  .channel-link-label { display: none; }
  .channel-link code { flex: 1 1 auto; }
  .channel-link .btn { flex: 0 0 auto; }
  .sidebar { display: none; }
}

.lbl { display: block; }
.my-info { flex: 1 1 0; }
.my-status { margin-top: 6px; }
.form input[type=file]::file-selector-button { border: 1px solid var(--line); background: #fff; color: var(--text); font: 700 13px var(--font); padding: 7px 12px; border-radius: 9px; margin-right: 10px; cursor: pointer; }
.pkg-price { white-space: nowrap; }

/* Таблицы админки на телефоне — карточками */
@media (max-width: 760px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr { display: block; width: 100%; }
  .table-cards tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table-cards tr:last-child { border-bottom: 0; }
  .table-cards td { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; min-width: 0; }
  .table-cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; flex: 0 0 auto; }
  .table-cards td.td-ch { max-width: none; min-width: 0; padding: 0 34px 6px 0; display: block; text-align: left; }
  .table-cards td.td-name { white-space: normal; padding-right: 0; display: block; text-align: left; font-size: 15px; margin-bottom: 4px; }
  .table-cards td.td-cb { position: absolute; top: 14px; right: 14px; width: auto; padding: 0; }
  .table-cards td.td-actions { justify-content: flex-start; padding-top: 8px; }
  .table-cards tr:hover td { background: none; }
  .table-cards .input-num { width: 130px; }
  .bulk { border-radius: 12px 12px 0 0; }
}
.user-info { flex: 1 1 0; }

.nowrap { white-space: nowrap; }
.td-author { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-ch { max-width: 300px; }
.sticky-save, .panel .sticky-save { background: rgba(255,255,255,.96); border-top: 1px solid var(--line); margin: 0 -24px -24px; padding: 12px 24px; border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -6px 16px rgba(16,24,40,.06); }
form.form > .sticky-save { margin: 0; border-radius: 14px; border: 1px solid var(--line); }
@media (max-width: 760px) {
  .table-prices.table-cards tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
  .table-prices.table-cards td { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 4px; text-align: left; padding: 0; }
  .table-prices.table-cards td[data-label]::before { font-size: 11px; }
  .table-prices.table-cards td.td-name { grid-column: 1 / -1; display: block; }
  .table-prices.table-cards .input-num { width: 100%; }
  .table-prices.table-cards td.td-actions { flex-direction: row; align-items: center; padding: 0; }
  .sticky-save, .panel .sticky-save { margin: 0 -18px -18px; padding: 10px 18px; }
}
@media (max-width: 640px) { .logo-footer .logo-text { display: inline; } }
@media (max-width: 760px) {
  .table-prices.table-cards td[data-label="Каналов"] { display: none; }
  .table-prices.table-cards td.td-actions { justify-content: flex-start; align-self: end; }
  .table-prices.table-cards td[data-label="Показывать"] { align-items: flex-start; }
  .table-prices.table-cards td[data-label="Показывать"] input { width: 20px; height: 20px; margin: 8px 0; }
}

/* ===== Панель массовых действий ===== */
.bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 0 0; border-bottom: 0; }
.bulk-count { font-size: 13.5px; font-weight: 700; color: var(--text-2); margin-right: 4px; white-space: nowrap; }
.bulk-count b { color: var(--text); }
.bulk-more { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.bulk-more select, .bulk-move-to { height: 36px; border: 1px solid var(--line); border-radius: 10px; padding: 0 30px 0 12px; font: 600 13.5px var(--font); color: var(--text); background: #fff 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='%237B8599' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance: none; appearance: none; max-width: 220px; }
.filters select, .input-sm, .input-xs { -webkit-appearance: none; appearance: none; background: #fff 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='%237B8599' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; padding-right: 30px; }
.filters input[type=search] { background: #fff; }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.1fr) auto auto; gap: 8px; align-items: center; }
.filters > * { min-width: 0; }
.filters input, .filters select { width: 100%; height: 40px; }
.filters .btn { height: 40px; }
.check-inline { white-space: nowrap; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--primary); }
@media (max-width: 760px) {
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input[type=search] { grid-column: 1 / -1; }
  .filters .btn { grid-column: 1 / -1; }
  .bulk { position: sticky; top: calc(var(--header-h) + 4px); z-index: 20; box-shadow: 0 6px 16px rgba(16,24,40,.08); border-radius: 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
  .bulk-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .bulk-more { width: 100%; margin-left: 0; }
  .bulk-more select { flex: 1 1 auto; max-width: none; }
  .bulk-count { width: 100%; }
}
.bulk-main { display: inline-flex; gap: 8px; }
.user-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.user-filters form { display: flex; gap: 8px; flex: 1 1 280px; }
.user-filters input { flex: 1 1 auto; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: 500 14px var(--font); min-width: 0; }
.user-filters .btn { height: 40px; }

/* ===== Продвижение ===== */
.promo-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 16px 18px; }
.promo-wait { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; border-color: #F3DEB0; background: var(--warn-soft); }
.promo-wait-title { font-weight: 800; margin-bottom: 4px; }
.promo-wait form { margin: 0; }
.promo-list { display: flex; flex-direction: column; gap: 12px; }
.promo-opt { display: flex; align-items: center; gap: 16px; padding: 18px; }
.promo-opt.is-active { border-color: #BFE8D1; background: linear-gradient(180deg, #F3FBF6, #fff); }
.promo-opt.is-off { opacity: .6; }
.promo-ico { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 24px; flex: 0 0 auto; }
.promo-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.promo-name { font-weight: 800; font-size: 16px; }
.promo-active { display: inline-flex; align-items: center; gap: 5px; color: var(--ok); font-weight: 700; font-size: 13px; }
.promo-act { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.promo-price { font-weight: 800; font-size: 17px; color: var(--primary-2); white-space: nowrap; }
@media (max-width: 640px) {
  .promo-opt { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .promo-ico { width: 42px; height: 42px; font-size: 21px; }
  .promo-act { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
  .promo-wait .btn-row .btn, .promo-wait .btn-row form { width: 100%; }
  .promo-wait .btn-row form .btn { width: 100%; }
}
.my-item .btn-row .btn { flex: 0 0 auto; }
@media (max-width: 640px) {
  .my-item .btn-row { display: grid; grid-template-columns: 1fr 1fr; }
  .my-item .btn-row form, .my-item .btn-row form .btn { width: 100%; }
}

.tag-18 { display: inline-block; vertical-align: 1px; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--err); border-radius: 5px; padding: 1px 5px; margin-left: 4px; line-height: 1.3; }

@media (max-width: 760px) {
  .table-cards td.td-author { max-width: none; }
  .bulk-more { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .bulk-more .bulk-move-to { grid-column: 1 / -1; max-width: none; width: 100%; grid-row: 2; }
  .bulk-more select { width: 100%; min-width: 0; }
}
@media (max-width: 640px) { .btn-login .ic { display: none; } .hero-search .ic { display: none; } }

/* ===== Статистика ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); min-width: 0; }
.kpi-l { font-size: 13px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.kpi-v { font-size: 28px; font-weight: 800; margin: 4px 0 2px; color: var(--text); }
.kpi-d { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.kpi-d.up { color: var(--ok); }
.kpi-d.down { color: var(--err); }
.kpi-note { margin: -4px 0 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 3px var(--ok-soft); flex: 0 0 auto; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-bar { width: 12px; height: 12px; border-radius: 3px; background: #1F8FE5; display: inline-block; }
.lg-line { width: 16px; height: 3px; border-radius: 2px; background: #F28C28; display: inline-block; }
.chart-wrap { position: relative; width: 100%; overflow-x: auto; }
.chart-svg { width: 100%; min-width: 560px; height: auto; display: block; }
.ch-grid { stroke: #E8EDF4; stroke-width: 1; }
.ch-base { stroke: #C9D3E3; stroke-width: 1; }
.ch-ax { fill: var(--muted); font: 600 11px var(--font); }
.ch-bar { fill: #1F8FE5; opacity: .85; }
.ch-line { fill: none; stroke: #F28C28; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-dot { fill: #F28C28; stroke: #fff; stroke-width: 2; }
.ch-hit { fill: transparent; cursor: crosshair; }
.ch-hit:hover { fill: rgba(31, 143, 229, .06); }
.chart-tip { position: absolute; pointer-events: none; background: #0F1724; color: #fff; font-size: 12.5px; font-weight: 600; padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -110%); z-index: 3; }
.stats-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.stable { width: 100%; border-collapse: collapse; font-size: 14px; }
.stable td { padding: 7px 0; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.stable tr:last-child td { border-bottom: 0; }
.stable td + td { padding-left: 10px; }
.stable .num { text-align: right; white-space: nowrap; }
.stable .sb { width: 38%; }
.sbar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.sbar span { display: block; height: 100%; border-radius: 99px; background: #1F8FE5; }
.t-path { max-width: 0; width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h3.mt { margin-top: 22px; }
.num { font-variant-numeric: tabular-nums; }
.today-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 16px 20px; color: var(--text); }
.today-stats:hover { border-color: #BFD9F3; color: var(--text); }
.ts-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.ts-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 14px; }
.ts-item b { color: var(--text); font-size: 16px; }
.ts-more { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--primary); font-weight: 700; font-size: 14px; }
.my-stats { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
@media (max-width: 1024px) { .stats-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px 14px; }
  .kpi-v { font-size: 22px; }
  .ts-more { margin-left: 0; width: 100%; }
}

.panel > .section-head { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 640px) { .legend { width: 100%; } .chart-svg { min-width: 640px; } }

/* ===== Карусель закрепа ===== */
.pin-ctl { display: flex; align-items: center; gap: 8px; }
.pin-ctl .more { margin-right: 6px; }
.pin-carousel { position: relative; margin: 0 -4px; }
.pin-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 16px) / 4); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; padding: 4px 4px 8px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.pin-track::-webkit-scrollbar { display: none; }
.pin-slide { scroll-snap-align: start; display: flex; min-width: 0; }
.pin-slide .card { width: 100%; }
.pin-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.pin-dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: #F3D3A9; cursor: pointer; transition: width .2s, background .2s; }
.pin-dots button.on { width: 22px; background: #E58A1F; }
@media (max-width: 1180px) { .pin-track { grid-auto-columns: calc((100% - 2 * 16px) / 3); } }
@media (max-width: 860px) { .pin-track { grid-auto-columns: calc((100% - 16px) / 2); } }
@media (max-width: 640px) {
  .pin-track { grid-auto-columns: 86%; gap: 10px; }
  .section-pin .section-head h2 { font-size: 18px; }
  .pin-ctl .btn-icon { display: none; }
}
