/* ═══════════════════════════════════════════════════════════
   Profans.pro Design Tokens — MP088 Palette
   Hei Se Black #142030 · Blue Whale #1E3442 · Pico Eggplant #732553
   Stellar Strawberry #FF5C8D · Grauzone #85A3B2 · Siesta Tan #E9D8C8
   ═══════════════════════════════════════════════════════════ */
:root {
  /* ── Core palette ── */
  --c-black:      #142030;
  --c-whale:      #1E3442;
  --c-eggplant:   #732553;
  --c-strawberry: #FF5C8D;
  --c-grauzone:   #85A3B2;
  --c-siesta:     #E9D8C8;

  /* Strawberry scale */
  --pink-50:  #FFF2F6;
  --pink-100: #FFE0EA;
  --pink-200: #FFC2D4;
  --pink-300: #FF97B6;
  --pink-400: #FF7AA0;
  --pink-500: #FF5C8D;
  --pink-600: #E8407A;
  --pink-700: #C42D65;
  --pink-800: #9A1F4E;
  --pink-900: #73163B;

  /* Wine / Eggplant scale */
  --wine-400: #A33A7C;
  --wine-500: #8A2D6A;
  --wine-600: #732553;
  --wine-700: #5A1D42;
  --wine-800: #421532;
  --wine-900: #2A0D20;

  /* Navy / Whale scale */
  --navy-300: #4A6A82;
  --navy-400: #2F4D63;
  --navy-500: #264253;
  --navy-600: #1E3442;
  --navy-700: #182935;
  --navy-800: #142030;
  --navy-900: #0D1722;
  --navy-950: #080F18;

  /* Steel / Grauzone scale */
  --steel-200: #C4D2D9;
  --steel-300: #A6BBC4;
  --steel-400: #85A3B2;
  --steel-500: #6B8A9A;
  --steel-600: #526F7F;

  /* Sand / Siesta scale */
  --sand-50:  #FBF6F0;
  --sand-100: #F5EBDF;
  --sand-200: #E9D8C8;
  --sand-300: #D8BFA6;
  --sand-400: #C2A286;

  /* Signal colors */
  --emerald: #2FB58A;
  --ruby:    #FF5C8D;
  --sky:     #85A3B2;
  --gold:    #E9C48A;
  --plum:    #A33A7C;

  /* Form W/D/L */
  --form-w: #2FB58A;
  --form-d: #85A3B2;
  --form-l: #FF5C8D;

  /* Typography */
  --font-ui:      'Manrope', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Unbounded', 'Manrope', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, monospace;

  /* Radii */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm:   0 1px 2px rgba(8,15,24,.18);
  --shadow-md:   0 4px 16px rgba(8,15,24,.28);
  --shadow-lg:   0 14px 40px rgba(8,15,24,.45);
  --shadow-glow: 0 0 0 1px rgba(255,92,141,.30), 0 8px 28px rgba(255,92,141,.24);

  --elev-lo: var(--shadow-sm);
  --elev-md: var(--shadow-md);
  --elev-hi: var(--shadow-lg);
}

/* ═══ DARK THEME (default) ═══ */
:root, [data-theme="dark"] {
  --bg:            #142030;
  --bg-0:          #142030;
  --bg-1:          #1A2A3A;
  --bg-2:          #1E3442;
  --surface:       #1E3442;
  --surface-2:     #264253;
  --surface-3:     #2F4D63;
  --border:        rgba(133,163,178,.14);
  --border-strong: rgba(133,163,178,.28);
  --text:          #F3E9DD;
  --text-muted:    #A6BBC4;
  --text-dim:      #6B8A9A;
  /* Безопасный цвет для имён клубов/игроков когда их primary_color экстремальный
     (чисто белый/чёрный). На тёмной теме — светло-серый, на светлой — тёмно-серый. */
  --text-club-safe: #D6CDC2;

  --accent:        #FF5C8D;
  --accent-hover:  #FF7AA0;
  --accent-ink:    #FFFFFF;

  --accent-2:      #A33A7C;
  --accent-2-ink:  #FFFFFF;

  /* Legacy aliases */
  --purple-50:  #FFF2F6;
  --purple-100: #FFE0EA;
  --purple-200: #FFC2D4;
  --purple-300: #FF97B6;
  --purple-400: #A33A7C;
  --purple-500: #8A2D6A;
  --purple-600: #732553;
  --purple-700: #5A1D42;
  --purple-800: #421532;
  --purple-900: #2A0D20;
  --purple-950: #18081A;

  --rose-300: #FF97B6;
  --rose-400: #FF7AA0;
  --rose-500: #FF5C8D;
  --rose-600: #E8407A;

  --teal-200: #C4D2D9;
  --teal-300: #A6BBC4;
  --teal-400: #85A3B2;
  --teal-500: #6B8A9A;
  --teal-600: #526F7F;
  --teal-700: #3D5766;

  --amber-300: #FFC2D4;
  --amber-400: #FF97B6;
  --amber-500: #FF5C8D;
  --amber-600: #E8407A;

  --chip-bg:    rgba(133,163,178,.10);
  --chip-hover: rgba(133,163,178,.18);
  --scrim:      rgba(8,15,24,.78);
}

/* ═══ LIGHT THEME ═══ */
[data-theme="light"] {
  --bg:            #FBF6F0;
  --bg-0:          #FBF6F0;
  --bg-1:          #FFFFFF;
  --bg-2:          #F5EBDF;
  --surface:       #FFFFFF;
  --surface-2:     #F5EBDF;
  --surface-3:     #E9D8C8;
  --border:        rgba(115,37,83,.14);
  --border-strong: rgba(115,37,83,.28);
  --text:          #142030;
  --text-muted:    #5A1D42;
  --text-dim:      #8A2D6A;
  /* На светлой теме — тёмно-серый (не чисто чёрный) для имён клубов с экстремальным цветом. */
  --text-club-safe: #3D4756;

  --accent:        #E8407A;
  --accent-hover:  #FF5C8D;
  --accent-ink:    #FFFFFF;

  --accent-2:      #732553;
  --accent-2-ink:  #FFFFFF;

  --purple-50:  #FFF2F6;
  --purple-100: #FFE0EA;
  --purple-200: #FFC2D4;
  --purple-300: #FF97B6;
  --purple-400: #A33A7C;
  --purple-500: #8A2D6A;
  --purple-600: #732553;
  --purple-700: #5A1D42;
  --purple-800: #421532;
  --purple-900: #2A0D20;
  --purple-950: #18081A;

  --rose-300: #FF97B6;
  --rose-400: #FF7AA0;
  --rose-500: #FF5C8D;
  --rose-600: #E8407A;

  --teal-200: #C4D2D9;
  --teal-300: #A6BBC4;
  --teal-400: #85A3B2;
  --teal-500: #6B8A9A;
  --teal-600: #526F7F;
  --teal-700: #3D5766;

  --amber-300: #FFC2D4;
  --amber-400: #FF97B6;
  --amber-500: #FF5C8D;
  --amber-600: #E8407A;

  --navy-500: #264253;
  --navy-600: #1E3442;
  --navy-700: #182935;
  --navy-800: #142030;
  --navy-900: #0D1722;

  --chip-bg:    rgba(115,37,83,.07);
  --chip-hover: rgba(115,37,83,.13);
  --scrim:      rgba(20,32,48,.5);
}

/* ═══ BASE RESET ═══ */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-ui) !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body {
  font-size: 15px !important;
  line-height: 1.5 !important;
}
h1, h2, h3, h4, h5, h6,
.entry-title, .post-title, .ast-blog-single-title {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  margin: 0;
  text-wrap: balance;
  color: var(--text) !important;
}
h1 { font-size: clamp(28px, 3vw, 44px) !important; line-height: 1.05 !important; }
h2 { font-size: clamp(22px, 2vw, 30px) !important; line-height: 1.1 !important; }
h3 { font-size: 18px !important; line-height: 1.2 !important; }
h4 { font-size: 16px !important; line-height: 1.25 !important; }
p  { margin: 0; text-wrap: pretty; color: var(--text) !important; }
a  { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* Text in articles */
.entry-content p, .post-content p, article p {
  font-size: 15px !important;
  line-height: 1.75 !important;
  font-weight: 400 !important;
  color: var(--text) !important;
}

/* Selection */
::selection { background: var(--accent); color: var(--accent-ink); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--steel-400); }

/* ═══ UTILITY CLASSES ═══ */
.u-mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.u-tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.u-caps { text-transform: uppercase; letter-spacing: .08em; font-size: 11px; font-weight: 700; color: var(--text-muted); }
.u-accent { color: var(--accent); }

/* ═══ COMPONENT CLASSES ═══ */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  font-family: var(--font-ui); font-weight: 600; font-size: 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--chip-bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--chip-hover); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--chip-bg); }
.btn-danger { background: rgba(239,68,68,.12); color: var(--ruby); }
.btn-danger:hover { background: rgba(239,68,68,.2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }

/* Chips / Tags */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  background: var(--chip-bg); color: var(--text-muted);
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chip:hover { background: var(--chip-hover); color: var(--text); }
.chip.is-active { background: #8A1E45; color: #fff; }
[data-theme="light"] .chip.is-active { background: #8A1E45; color: #fff; }
.chip-sq { border-radius: var(--r-sm); height: 26px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-hover { transition: border-color .15s, transform .15s; }
.card-hover:hover { border-color: var(--border-strong); }

/* Forms */
.pf-input, .pf-textarea, .pf-select {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s, background .15s;
}
.pf-textarea { padding: 10px 14px; height: auto; resize: vertical; min-height: 88px; }
.pf-input:focus, .pf-textarea:focus, .pf-select:focus {
  outline: none; border-color: var(--accent); background: var(--bg-1);
}
.pf-input::placeholder, .pf-textarea::placeholder { color: var(--text-dim); }

/* Avatar */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  font-weight: 700; font-size: 13px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl { width: 96px; height: 96px; font-size: 28px; }

/* Rank badges */
.rank {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--r-pill);
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--chip-bg); color: var(--text-muted);
  border: 1px solid var(--border);
  height: 20px;
  white-space: nowrap;
}
.rank::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.rank-profan  { color: #8FA0BF; }
.rank-fanat   { color: #94A3B8; background: rgba(148,163,184,.12); }
.rank-profi   { color: var(--amber-400); background: rgba(248,194,74,.10); border-color: rgba(248,194,74,.25); }
.rank-expert  { color: var(--sky); background: rgba(56,189,248,.10); border-color: rgba(56,189,248,.25); }
.rank-scout   { color: var(--emerald); background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.28); }
.rank-ast     { color: #A78BFA; background: rgba(167,139,250,.12); border-color: rgba(167,139,250,.28); }
.rank-manager { color: var(--accent); background: rgba(245,165,36,.12); border-color: rgba(245,165,36,.3); }
.rank-legend  { color: #EC4899; background: rgba(236,72,153,.12); border-color: rgba(236,72,153,.3); }

/* Section header */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  letter-spacing: .02em; text-transform: uppercase;
  color: var(--text);
}
.section-title::before {
  content: ""; width: 3px; height: 14px; background: var(--accent); border-radius: 2px;
}
.section-link {
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.section-link:hover { color: var(--accent); }

/* Form-pill (WDL) */
.form-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  font-size: 10px; font-weight: 800;
  border-radius: 5px; color: #fff;
}
.form-pill.w { background: var(--form-w); }
.form-pill.d { background: var(--form-d); color: var(--navy-900); }
.form-pill.l { background: var(--form-l); }

/* Live dot */
.live-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--ruby);
  text-transform: uppercase;
}
.live-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ruby); box-shadow: 0 0 0 0 rgba(255,92,141,.5);
  animation: livePulse 1.8s infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,92,141,.5); }
  70%  { box-shadow: 0 0 0 6px rgba(255,92,141,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,92,141,0); }
}

/* Layout shell */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container {
  width: 100%; max-width: 1300px;
  margin: 0 auto; padding: 0 24px;
}
.container-wide { max-width: 1600px; }
@media (max-width: 768px) { .container { padding: 0 16px; } }

/* Home grid — defined in profans-homepage.php */

/* Show/hide responsive */
.mobile-only { display: none; }
.desktop-only { display: block; }
@media (max-width: 768px) {
  .mobile-only { display: block; }
  .desktop-only { display: none; }
}

/* Skeleton image placeholder */
.img-ph {
  position: relative; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 12px, var(--surface) 12px 24px);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em;
}
.img-ph::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(6,14,29,.5));
}
.img-ph > span { position: relative; z-index: 1; }

/* Horizontal scroll helper */
.h-scroll {
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.h-scroll::-webkit-scrollbar { display: none; }

/* Club crest placeholder */
.crest {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-family: var(--font-display); font-size: 10px; font-weight: 700;
  color: #fff; flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.15);
  background: var(--bg-2);
  letter-spacing: 0;
}
.crest-lg { width: 44px; height: 44px; font-size: 13px; }
.crest-xl { width: 72px; height: 72px; font-size: 18px; border-width: 2px; }
.crest-sm { width: 22px; height: 22px; font-size: 9px; border-width: 1px; }

/* Club selector row */
.club-row {
  display: grid;
  grid-template-columns: repeat(20, minmax(0, 1fr));
  gap: 4px;
}
.club-row-btn {
  padding: 0 4px; gap: 4px; min-width: 0;
  justify-content: center; height: 30px;
}
.club-row-label {
  font-size: 11px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
@media (max-width: 1080px) {
  .club-row { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .club-row { gap: 4px; }
  .club-row-label { display: none; }
  .club-row-btn { padding: 0; }
}

@keyframes podcast-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ═══ LAYOUT: HEADER, TICKER, FOOTER, BOTTOM NAV, DRAWER, CHAT ═══ */

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,22,40,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .site-header {
  background: rgba(251,246,240,.92);
  border-bottom-color: rgba(115,37,83,.14);
  box-shadow: 0 1px 0 rgba(115,37,83,.04);
}
.header-row {
  height: 64px;
  display: flex; align-items: center; gap: 18px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 700;
  font-size: 16px; letter-spacing: .02em; color: var(--text);
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: url('/wp-content/mu-plugins/assets/logo-mark.png') center/contain no-repeat;
  flex: none; font-size: 0; line-height: 0;
}
.brand-mark::after { content: none; }
.brand-dot { color: var(--amber-500); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; flex: 1; }
.nav a {
  padding: 8px 14px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--chip-bg); color: var(--text); }
.nav a.is-active { color: var(--text); background: var(--chip-bg); }
.nav a.is-active::after {
  content: ""; display: block; margin-top: 4px; height: 2px; border-radius: 1px;
  background: var(--accent); width: 18px; margin-left: auto; margin-right: auto;
}
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-btn {
  display: inline-flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 12px;
  background: var(--chip-bg); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-muted);
  font-size: 13px; min-width: 220px;
}
.search-btn kbd {
  margin-left: auto; font-size: 11px; font-family: var(--font-mono);
  background: var(--surface); color: var(--text-muted);
  border-radius: 4px; padding: 1px 6px; border: 1px solid var(--border);
}
.search-btn:hover { border-color: var(--border-strong); color: var(--text); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--chip-bg); border: 1px solid var(--border);
  color: var(--text-muted); position: relative; padding: 0; flex: none;
}
.icon-btn svg { flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ruby); border: 2px solid var(--bg-1);
}
.header-avatar { padding: 0; }
.burger { display: none; }
@media (max-width: 1100px) {
  .nav { display: none; }
  .search-btn { display: none; }
  .burger { display: inline-flex; }
}
@media (max-width: 768px) {
  .header-row { height: 56px; gap: 12px; }
  .header-actions { gap: 6px; }
  .header-actions .icon-btn:nth-of-type(2) { display: none; }
}

/* Ticker */
.ticker {
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  overflow: hidden; position: relative;
}
.ticker-inner {
  display: flex; align-items: center; height: 44px; gap: 0; white-space: nowrap;
}
.ticker-label {
  position: sticky; left: 0; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 16px; height: 44px;
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--navy-900); background: var(--amber-500);
}
.ticker-track {
  display: flex; align-items: center; gap: 0;
  animation: tickerScroll 80s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 18px; height: 44px;
  font-size: 13px; font-weight: 600;
  border-right: 1px solid var(--border);
}
.ticker-item .crest { width: 20px; height: 20px; font-size: 8px; }
.ticker-item .score {
  font-family: var(--font-mono); font-weight: 700; color: var(--text);
  padding: 2px 6px; background: var(--surface); border-radius: 4px; font-size: 12px;
}
.ticker-item .score.live { color: var(--amber-400); }
.ticker-item .date { color: var(--text-dim); font-size: 11px; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (max-width: 768px) {
  .ticker-label { padding: 0 12px; font-size: 10px; }
  .ticker-item { padding: 0 14px; font-size: 12px; }
}

/* Footer */
.site-footer {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  margin-top: 60px; padding: 48px 0 80px;
}
[data-theme="light"] .site-footer {
  background: var(--bg-2);
  border-top-color: rgba(115,37,83,.14);
}
.footer-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h5 {
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted); margin-bottom: 14px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-muted); font-size: 14px; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-dim); gap: 16px; flex-wrap: wrap;
}

/* Bottom nav (mobile) */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(10,22,40,.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
[data-theme="light"] .bottom-nav { background: rgba(255,255,255,.94); }
.bottom-nav-inner { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; }
.bn-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px; border-radius: 8px; min-height: 48px;
  font-size: 10px; font-weight: 600; color: var(--text-dim); position: relative;
}
.bn-item svg { width: 22px; height: 22px; }
.bn-item.is-active { color: var(--accent); }
.bn-item .bn-badge {
  position: absolute; top: 6px; left: calc(50% + 6px);
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--ruby); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
@media (max-width: 768px) {
  .bottom-nav { display: block; }
  .site-footer { margin-bottom: 72px; }
}

/* Mobile drawer */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 80;
  background: var(--scrim);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 81;
  width: 320px; max-width: 85vw;
  background: var(--bg-1); border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform .24s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; padding: 20px;
}
.drawer.is-open { transform: translateX(0); }
.drawer-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px;
}

/* Chat floating widget */
.chat-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 55;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform .15s, background .15s;
}
.chat-fab:hover { transform: scale(1.06); background: var(--accent-hover); }
.chat-fab .dot {
  position: absolute; top: 6px; right: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--ruby); color: #fff;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
@media (max-width: 768px) {
  .chat-fab { bottom: 84px; right: 16px; width: 52px; height: 52px; }
}
.chat-dock {
  position: fixed; bottom: 24px; right: 24px; z-index: 56;
  width: 380px; height: 560px; max-height: calc(100vh - 48px);
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
@media (max-width: 500px) {
  .chat-dock {
    bottom: 0; right: 0; left: 0; top: 0;
    width: 100%; height: 100%; max-height: 100%; border-radius: 0;
  }
}

/* Top progress bar */
.route-progress {
  position: fixed; top: 0; left: 0; height: 2px;
  background: var(--accent); z-index: 100; transition: width .2s;
}

/* ═══ GENERATEPRESS OVERRIDE ═══ */
#site-header, .rh-header, .wsite-header,
header.site-header, .sticky-header { display: none !important; }
footer.site-footer, #colophon, .rh-footer, #footer,
.site-footer:not(#pf-footer-wrap), footer#footer { display: none !important; }
/* Hide GP mobile menu — we use our own drawer */
.main-navigation .menu-toggle,
.main-navigation.toggled,
.menu-toggle,
#site-navigation,
.mobile-menu-control-wrapper,
nav.toggled .main-nav { display: none !important; }

.site, .entry-content, .site-content, .inside-article,
.generate-columns-container, .generate-column {
  font-family: var(--font-ui) !important;
}

/* ═══ WP CONTENT DARK/LIGHT ═══ */
.inside-article, .comments-area,
.one-container .container,
.separate-containers .inside-article {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.site, #page { background: var(--bg) !important; }

input:not(#pf-header input), textarea, select {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
input::placeholder, textarea::placeholder { color: var(--text-dim) !important; }

.sidebar .widget {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.sidebar .widget-title { color: var(--text) !important; }

/* ══ MOBILE UX: скрыть лишнее на нужных страницах ══ */
@media (max-width: 768px) {
  /* Глобальный fix: ВСЁ не шире экрана */
  *, *::before, *::after { box-sizing: border-box !important; }
  .site, #page, .site-content, .content-area,
  .inside-article, .entry-content, main,
  #primary, #content {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  /* Fixed elements тоже не шире */
  #pf-header {
    max-width: 100vw !important;
    overflow: visible !important;
  }
  .pf-ticker, .pf-bottom-nav {
    max-width: 100vw !important;
    overflow: hidden !important;
  }
  .entry-content, .entry-content p, .entry-content h2,
  .entry-content h3, .entry-content blockquote {
    overflow-wrap: anywhere !important;
  }
  /* Только таблицы скроллятся горизонтально, контент НЕ скроллится */
  .entry-content table, .v7g2 table {
    display: block;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* GP grid containers — полная ширина без overflow */
  .grid-container {
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    box-sizing: border-box !important;
  }

  /* Статьи: скрыть sidebar — юзеру нужны только статья + комменты */
  .single #right-sidebar,
  .single .sidebar,
  .single #secondary,
  .single .widget-area { display: none !important; }
  .single .content-area { width: 100% !important; max-width: 100% !important; float: none !important; }

  /* Статьи: убрать лишние GP обёртки */
  .single .inside-article { padding: 16px 14px !important; }
  .single .entry-header .entry-title { font-size: 22px !important; line-height: 1.25 !important; }

  /* Категории/архивы: скрыть sidebar */
  .archive #right-sidebar,
  .archive .sidebar,
  .archive #secondary,
  .category #right-sidebar,
  .category .sidebar,
  .category #secondary { display: none !important; }
  .archive .content-area,
  .category .content-area { width: 100% !important; max-width: 100% !important; float: none !important; }

  /* Archive/single: убрать загромождающий footer.entry-meta (cat+tags+comments повторяют заголовок) */
  .archive footer.entry-meta,
  .category footer.entry-meta { display: none !important; }
  .archive .inside-article { padding: 16px 14px !important; }
  .archive .entry-title { font-size: 18px !important; line-height: 1.3 !important; margin-bottom: 4px !important; }
  .archive .entry-meta { font-size: 12px !important; }
  .archive .post-image img { border-radius: 8px !important; }

  /* BuddyPress профиль: чистый layout */
  .buddypress #right-sidebar,
  .buddypress .sidebar,
  .buddypress #secondary { display: none !important; }
  .buddypress .content-area { width: 100% !important; max-width: 100% !important; float: none !important; }
  .buddypress .site-content,
  .buddypress #content,
  .buddypress .inside-article,
  .buddypress .entry-content { padding: 0 !important; margin: 0 !important; }
  .buddypress #page { padding-top: 0 !important; }
  .buddypress .grid-container { padding-top: 0 !important; }
  .buddypress .hfeed { padding-top: 0 !important; }
  /* BuddyPress: контент вплотную к тикеру */
  body.buddypress { padding-top: 100px !important; }
  .buddypress .pfp-wrap { margin-top: 0 !important; padding-top: 0 !important; }

  /* Форум: sidebar уже скрыт через no-sidebar, но страховка */
  body.wpforo #right-sidebar,
  body.wpforo .sidebar { display: none !important; }

  /* Глобально: GeneratePress container — не обрезать контент */
  .site-content .content-area { overflow-x: hidden; }
}

/* ══ TABLET 769-1100px: хедер уже бургер, sidebar занимает 30% — синхронизируем
   layout с мобильным (sidebar вниз/прочь), иначе контент сжимается до 500-600px ══ */
@media (min-width: 769px) and (max-width: 1100px) {
  .archive #right-sidebar, .archive .sidebar, .archive #secondary,
  .category #right-sidebar, .category .sidebar, .category #secondary,
  .single #right-sidebar, .single .sidebar, .single #secondary,
  .single .widget-area { display: none !important; }
  .archive .content-area, .category .content-area,
  .single .content-area {
    width: 100% !important; max-width: 100% !important; float: none !important;
  }
  .archive footer.entry-meta,
  .category footer.entry-meta { display: none !important; }
}

a:not(#pf-header a):not(#pf-footer-wrap a) { color: var(--accent); }
a:not(#pf-header a):not(#pf-footer-wrap a):hover { color: var(--accent-hover); }

table, th, td { border-color: var(--border) !important; color: var(--text) !important; }
th { background: var(--bg-2) !important; color: var(--text) !important; }
hr { border-color: var(--border) !important; }

code, pre {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.profans-card, .pf-news-card, .wp-block-group,
article.post, .type-post {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

#buddypress, .buddypress,
.activity-list li, .bp-list li {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.entry-meta { color: var(--text-muted) !important; }

/* ══ CATEGORY NEWS: чистый list-only layout — без sidebar, без page-title ══ */
.category-news #right-sidebar,
.category-news .sidebar,
.category-news #secondary,
.category-news .widget-area { display: none !important; }
.category-news .content-area { width: 100% !important; max-width: 100% !important; float: none !important; }
.category-news .page-header,
.category-news .page-title,
body.category-news header.page-header { display: none !important; }

/* ══ ARCHIVE NEWS CARDS — миниатюра слева, текст справа ══ */
.archive footer.entry-meta,
.category footer.entry-meta { display: none !important; }
.archive article.post { margin-bottom: 16px !important; }
.archive .inside-article {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-areas:
    "img header"
    "img summary";
  gap: 6px 18px;
  align-items: start;
}
.archive .inside-article > .post-image { grid-area: img; margin: 0 !important; }
.archive .inside-article > .entry-header { grid-area: header; margin: 0 !important; }
.archive .inside-article > .entry-summary { grid-area: summary; margin: 0 !important; }
.archive .inside-article > .post-image a { display: block; }
.archive .inside-article > .post-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
}
/* Статьи без миниатюры — одна колонка */
.archive article.post:not(.has-post-thumbnail) .inside-article {
  grid-template-columns: 1fr;
  grid-template-areas: "header" "summary";
}
.archive .entry-title { font-size: 20px !important; line-height: 1.3 !important; margin: 0 0 6px !important; }
.archive .entry-title a { color: var(--text) !important; }
.archive .entry-title a:hover { color: var(--accent) !important; }
.archive .entry-summary { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.archive .entry-summary p { margin: 0 !important; }
.archive .entry-summary a.read-more { color: var(--accent) !important; font-weight: 600; }

@media (max-width: 768px) {
  .archive .inside-article {
    grid-template-columns: 120px 1fr !important;
    gap: 4px 12px !important;
  }
  .archive .entry-title { font-size: 15px !important; line-height: 1.25 !important; }
  .archive .entry-meta { font-size: 11px !important; }
  .archive .entry-summary {
    font-size: 13px !important;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
