/* Подчёркиваем полосу прокрутки у уже существующих списков, не создавая новых меню */
:where([role="listbox"],[role="menu"],[role="tree"],.dropdown-menu,.sub-dropdown-menu,.dropdown-content,.select-options,.custom-select-options,.autocomplete-list,.suggestions,.suggestion-list,.options-list,.menu-list,.modal-box,.modal-content,.popup,.popover,[data-scrollable]) {
  scrollbar-width: auto;
  scrollbar-color: #8da5d2 rgba(130,150,190,.18);
}
:where([role="listbox"],[role="menu"],[role="tree"],.dropdown-menu,.sub-dropdown-menu,.dropdown-content,.select-options,.custom-select-options,.autocomplete-list,.suggestions,.suggestion-list,.options-list,.menu-list,.modal-box,.modal-content,.popup,.popover,[data-scrollable])::-webkit-scrollbar { width: 11px; height: 11px; }
:where([role="listbox"],[role="menu"],[role="tree"],.dropdown-menu,.sub-dropdown-menu,.dropdown-content,.select-options,.custom-select-options,.autocomplete-list,.suggestions,.suggestion-list,.options-list,.menu-list,.modal-box,.modal-content,.popup,.popover,[data-scrollable])::-webkit-scrollbar-track { background: rgba(130,150,190,.18); border-radius: 10px; }
:where([role="listbox"],[role="menu"],[role="tree"],.dropdown-menu,.sub-dropdown-menu,.dropdown-content,.select-options,.custom-select-options,.autocomplete-list,.suggestions,.suggestion-list,.options-list,.menu-list,.modal-box,.modal-content,.popup,.popover,[data-scrollable])::-webkit-scrollbar-thumb { background: #8da5d2; border: 2px solid rgba(235,240,250,.8); border-radius: 10px; }

/* Выпадающие меню — выше любых элементов страницы */
html body .header-nav { position: sticky; z-index: 2147483000 !important; overflow: visible !important; }
html body .header-nav .nav-container,
html body .header-nav .nav-menu,
html body .header-nav .nav-item,
html body .header-nav .dropdown-item { overflow: visible !important; }
html body .dropdown-menu { z-index: 2147483001 !important; }
html body .sub-dropdown-menu { z-index: 2147483002 !important; }
html body :is(.custom-select-options,.select-options,.autocomplete-list,.suggestions,.suggestion-list,.options-list,.dropdown-content,[role="listbox"]) { z-index: 2147483001 !important; }

/* Жидкое стекло под стиль сайта */
html body :is(.dropdown-menu,.sub-dropdown-menu,.custom-select-options,.select-options,.autocomplete-list,.dropdown-content) {
  background: rgba(30, 34, 48, .42);
  background: color-mix(in srgb, var(--bg-card, #1e2230) 46%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 18px;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.35), inset 0 -1px 1px rgba(255,255,255,.08), 0 14px 36px rgba(0,0,0,.35);
}
html body :is(.dropdown-menu,.sub-dropdown-menu) button { background: transparent; border-radius: 12px; }
html body :is(.dropdown-menu,.sub-dropdown-menu) button:hover { background: var(--accent-pink, #e0457b); color: #fff; }

/* Шапка всегда в своём слое над контентом (в т.ч. над стеклом с рефракцией) */
html body .header-nav { isolation: isolate; transform: translateZ(0); will-change: transform; }
html body main, html body .main-container { position: relative; z-index: 0; }
html body :is(.search-bar-box,.hero-banner,.card,.upload-box) { z-index: auto; }

select.pdd-native{display:none!important}
.pdd-trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;text-align:left;font:inherit;color:inherit;max-width:100%}
.pdd-trigger .pdd-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.pdd-trigger svg{flex:none;width:14px;height:14px;transition:transform .2s;opacity:.75}
.pdd-trigger[aria-expanded="true"] svg{transform:rotate(180deg)}
.pdd-trigger:disabled{opacity:.5;cursor:not-allowed}
.pdd-list{position:fixed;inset:auto;margin:0;padding:7px;overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;
  z-index:2147483647;color:var(--text-main,#fff);border-radius:18px;
  background:rgba(30,34,48,.42);background:color-mix(in srgb,var(--bg-card,#1e2230) 46%,transparent);
  -webkit-backdrop-filter:blur(24px) saturate(180%);backdrop-filter:blur(24px) saturate(180%);
  border:1px solid rgba(255,255,255,.28);
  box-shadow:inset 0 1px 1px rgba(255,255,255,.4),inset 0 -1px 1px rgba(255,255,255,.1),0 16px 40px rgba(0,0,0,.35)}
.pdd-item{display:flex;align-items:center;gap:8px;padding:9px 11px;border-radius:12px;cursor:pointer;font-size:14px;line-height:1.25;user-select:none}
.pdd-item .pdd-ck{width:14px;flex:none;font-size:13px;opacity:0}
.pdd-item[aria-selected="true"]{background:rgba(110,130,230,.22);font-weight:700}
.pdd-item[aria-selected="true"] .pdd-ck{opacity:1}
.pdd-item:hover,.pdd-item.pdd-act{background:rgba(255,255,255,.22)}
.pdd-item[aria-disabled="true"]{opacity:.4;pointer-events:none}
.pdd-group{padding:8px 11px 4px;font-size:12px;opacity:.6;font-weight:700}
/* =====================================================================
   MODERN UI LAYER — только внешний вид. Разметка, JS и PHP не затронуты.
   Жидкое стекло (body.liquid-glass) сохранено: поверхности стекла не
   переопределяются, добавлены лишь типографика, отступы и микро-анимации.
   ===================================================================== */
:root:not([data-theme="light"]) {
  --bg-main: #0a0c12;
  --bg-card: #131722;
  --bg-input: #0d1018;
  --header-bg: #0f121a;
  --border-color: #232838;
  --text-muted: #94a3b8;
  --tag-bg: #1a1f2e;
}
:root[data-theme="light"] {
  --bg-main: #eef1f6;
  --bg-card: #ffffff;
  --border-color: #d8deea;
  --tag-bg: #eef1f7;
  --text-muted: #4b5a70;
}
:root {
  --m-r-sm: 10px; --m-r: 14px; --m-r-lg: 20px;
  --m-ease: cubic-bezier(.2,.8,.2,1);
  --m-shadow: 0 1px 2px rgba(0,0,0,.18), 0 8px 24px -10px rgba(0,0,0,.35);
  --m-shadow-hover: 0 2px 4px rgba(0,0,0,.2), 0 18px 40px -14px rgba(0,0,0,.5);
}
:root[data-theme="light"] {
  --m-shadow: 0 1px 2px rgba(30,45,80,.06), 0 8px 24px -12px rgba(30,45,80,.18);
  --m-shadow-hover: 0 2px 4px rgba(30,45,80,.08), 0 18px 40px -16px rgba(30,45,80,.28);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html body {
  font-family: 'Inter', 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px; line-height: 1.55; letter-spacing: .005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
html body :is(button, input, select, textarea) { font-family: inherit; }
::selection { background: color-mix(in srgb, var(--accent-pink) 35%, transparent); }
:focus-visible { outline: 2px solid var(--accent-pink); outline-offset: 2px; border-radius: 6px; }

/* Шапка */
html body .header-nav { backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
html body:not(.liquid-glass) .header-nav {
  background: color-mix(in srgb, var(--header-bg) 86%, transparent);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 6px 24px -14px rgba(0,0,0,.45);
}
html body .header-nav .brand-logo { font-weight: 800; letter-spacing: -.01em; }
html body .nav-btn { border-radius: var(--m-r-sm); padding: 8px 14px; font-weight: 600; transition: background-color .2s var(--m-ease), color .2s var(--m-ease), transform .2s var(--m-ease); }
html body .nav-btn:hover, html body .nav-item:hover > .nav-btn, html body .nav-btn.active { background: color-mix(in srgb, var(--accent-pink) 12%, var(--tag-bg)); }
html body .dropdown-item > button, html body .sub-dropdown-menu button { transition: background-color .15s, color .15s, padding-left .2s var(--m-ease); }
html body .dropdown-item:hover > button { padding-left: 20px; }

/* Кнопки */
html body .btn, html body .site-dialog-btn {
  border-radius: var(--m-r-sm); padding: 9px 16px; font-size: 13px; font-weight: 650; letter-spacing: .01em;
  transition: transform .2s var(--m-ease), box-shadow .2s var(--m-ease), filter .2s, background-color .2s, border-color .2s;
}
html body:not(.liquid-glass) .btn:not(.btn-outline) { box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -8px rgba(0,0,0,.5); }
html body:not(.liquid-glass) .btn:not(.btn-outline):hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 1px 0 rgba(255,255,255,.22) inset, 0 12px 22px -10px rgba(0,0,0,.55); }
html body:not(.liquid-glass) .btn:active { transform: translateY(0) scale(.98); }
html body .btn-outline:hover { background: color-mix(in srgb, var(--accent-pink) 10%, transparent); }
html body .btn:disabled, html body .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
html body .theme-toggle-btn { border-radius: var(--m-r-sm); }

/* Герой и поиск */
html body:not(.liquid-glass) .hero-banner {
  border-radius: var(--m-r-lg); padding: 44px 24px 32px; border: 1px solid var(--border-color);
  background:
    radial-gradient(600px 220px at 15% -20%, color-mix(in srgb, var(--accent-pink) 22%, transparent), transparent 70%),
    radial-gradient(500px 200px at 95% 120%, color-mix(in srgb, var(--accent-blue) 20%, transparent), transparent 70%),
    var(--bg-card);
  box-shadow: var(--m-shadow);
}
html body .hero-title { font-size: clamp(26px, 4.2vw, 42px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
html body .hero-subtitle { font-size: clamp(14px, 1.6vw, 16px); max-width: 680px; margin-left: auto; margin-right: auto; }
html body:not(.liquid-glass) .search-bar-box { border-radius: var(--m-r); padding: 10px; box-shadow: var(--m-shadow); }
html body :is(.form-control, .search-input, select, textarea, input[type="text"], input[type="search"], input[type="password"], input[type="email"]) {
  border-radius: var(--m-r-sm); transition: border-color .2s, box-shadow .2s, background-color .2s;
}
html body :is(.form-control, .search-input, select, textarea, input):focus {
  outline: none; border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-pink) 22%, transparent);
}

/* Карточки */
html body .main-container { max-width: 1400px; padding: 0 24px; margin-top: 28px; }
html body .cards-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; }
html body:not(.liquid-glass) .card {
  border-radius: var(--m-r-lg); box-shadow: var(--m-shadow);
  transition: transform .3s var(--m-ease), box-shadow .3s var(--m-ease), border-color .3s;
}
html body:not(.liquid-glass) .card:hover { transform: translateY(-5px); box-shadow: var(--m-shadow-hover); border-color: color-mix(in srgb, var(--accent-pink) 45%, var(--border-color)); }
html body .card-img { height: 180px; transition: transform .5s var(--m-ease); }
html body .card:hover .card-img { transform: scale(1.04); }
html body .card { overflow: hidden; }
html body .card-body { padding: 16px 18px 18px; }
html body .card-title { font-size: 16.5px; line-height: 1.3; letter-spacing: -.005em; }
html body .card-desc { font-size: 13.5px; line-height: 1.5; }
html body .tag { border-radius: 999px; padding: 3px 10px; font-size: 11.5px; }
html body .like-btn { border-radius: 999px; transition: transform .2s var(--m-ease), background-color .2s, border-color .2s; }
html body .like-btn:hover { transform: scale(1.06); }

/* Панели, модалки, таблицы */
html body:not(.liquid-glass) :is(.upload-box, .admin-block, .comment-item, .sub-nav-bar) { border-radius: var(--m-r); box-shadow: var(--m-shadow); }
html body:not(.liquid-glass) .modal-box { border-radius: var(--m-r-lg); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
html body .modal-overlay { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html body .sub-nav-btn { border-radius: 999px; font-weight: 600; transition: background-color .2s, color .2s, transform .2s var(--m-ease); }
html body .sub-nav-btn:hover { transform: translateY(-1px); }
html body :is(.table-custom, .stats-table) { border-collapse: separate; border-spacing: 0; border-radius: var(--m-r-sm); overflow: hidden; }
html body .table-custom tbody tr { transition: background-color .15s; }
html body .table-custom tbody tr:hover { background: color-mix(in srgb, var(--accent-pink) 6%, transparent); }
html body .site-notice { border-radius: var(--m-r); box-shadow: var(--m-shadow); }
html body .tab-content.active { animation: mFadeUp .35s var(--m-ease); }
@keyframes mFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Тонкие современные скроллбары страницы */
html { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-muted) 55%, transparent) transparent; }
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-muted) 45%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* Мобильные */
@media (max-width: 768px) {
  html body .main-container { padding: 0 14px; margin-top: 18px; }
  html body .cards-grid { grid-template-columns: 1fr; gap: 16px; }
  html body:not(.liquid-glass) .hero-banner { padding: 30px 16px 22px; }
  html body .btn { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html body *, html body *::before, html body *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   STRUCTURE LAYER — главная-«бенто», подвал, подписи разделов, иконки.
   ===================================================================== */
html body .brand-logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .04em; }
html body .brand-logo::before {
  content: ""; width: 12px; height: 12px; border-radius: 4px; transform: rotate(45deg); flex: none;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-blue));
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent-pink) 60%, transparent);
}
html body .search-input {
  padding-left: 42px !important;
  background-repeat: no-repeat; background-position: 15px 50%; background-size: 17px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
}

/* Бенто-блок главной */
.home-bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; margin-bottom: 30px; }
html body .home-bento > .hero-banner {
  margin: 0; text-align: left; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  grid-column: span 3; padding: 26px 26px 24px; position: relative; overflow: hidden;
}
html body .home-bento > .home-hero { grid-column: 1 / -1; padding: 44px 40px 40px; }
html body .home-bento .hero-subtitle { margin: 0 0 18px; max-width: 620px; }
html body .home-bento .home-tile .hero-title { font-size: 21px; letter-spacing: -.01em; margin-bottom: 6px; }
html body .home-bento .home-tile .hero-subtitle { font-size: 14px; flex: 1; }
html body .home-bento .home-hero .hero-title { font-size: clamp(30px, 5vw, 54px); line-height: 1.05; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; margin-bottom: 14px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
  background: color-mix(in srgb, var(--accent-pink) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-pink) 28%, transparent);
}
.hero-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-green) 25%, transparent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
html body .hero-actions .btn { padding: 11px 20px; font-size: 14px; }
.tile-ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; margin-bottom: 14px;
  background: color-mix(in srgb, var(--tile-c, var(--accent-pink)) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--tile-c, var(--accent-pink)) 35%, transparent);
}
.home-tile.t-yt { --tile-c: #ef4444; }
.home-tile.t-help { --tile-c: var(--accent-green); }
html body .home-bento .home-tile { transition: transform .3s var(--m-ease), box-shadow .3s var(--m-ease); }
html body:not(.liquid-glass) .home-bento .home-tile:hover { transform: translateY(-4px); box-shadow: var(--m-shadow-hover); }
#support-btn-wrap { display: inline-flex; align-items: center; gap: 8px; }

/* Заголовок секции */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 2px 16px; }
.section-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.015em; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 5px; height: 22px; border-radius: 4px; background: linear-gradient(var(--accent-pink), var(--accent-blue)); }
.section-head span { font-size: 13px; color: var(--text-muted); }

/* Статьи и фото */
html body .ph-rules {
  text-align: left; font-size: 13px; line-height: 1.65; margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  border-left: 3px solid var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 9%, transparent);
}
html body .article-detail-box { max-width: 880px; margin: 0 auto; }
html body .article-content { font-size: 16.5px; line-height: 1.75; }
html body :is(.article-cover, .article-content img, .ph-big) { border-radius: var(--m-r); }
html body .video-container { border-radius: var(--m-r); overflow: hidden; }
html body :is(#articles-grid, #photos-grid) { margin-top: 4px; }
html body #photos-grid .card-img { height: 200px; }

/* Подвал */
.site-footer { margin-top: 48px; padding: 30px 24px 34px; border-top: 1px solid var(--border-color); background: color-mix(in srgb, var(--header-bg) 78%, transparent); }
.site-footer-in { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.site-footer .sf-brand { font-weight: 800; letter-spacing: .06em; font-size: 16px; }
.site-footer .sf-brand small { display: block; font-weight: 500; letter-spacing: 0; color: var(--text-muted); font-size: 12.5px; margin-top: 3px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 4px; }
.site-footer nav a { color: var(--text-muted); text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 7px 12px; border-radius: 999px; transition: color .2s, background-color .2s; }
.site-footer nav a:hover { color: var(--text-main); background: var(--tag-bg); }

@media (max-width: 768px) {
  .home-bento { gap: 14px; margin-bottom: 22px; }
  html body .home-bento > .hero-banner, html body .home-bento > .home-tile { grid-column: 1 / -1; padding: 22px 18px; }
  html body .home-bento > .home-hero { padding: 28px 20px; }
  .section-head h2 { font-size: 19px; }
  .site-footer-in { flex-direction: column; align-items: flex-start; }
}

/* Отступы главной: сетка во внутренней обёртке (скрипт сайта меняет display у #home-banners) */
#home-banners { margin-bottom: 8px; }
html body .home-bento { gap: 22px; margin-bottom: 32px; }
html body .home-bento > .home-hero { padding: 46px 44px 42px; }
html body .home-bento > .home-tile { padding: 30px 30px 28px; }
html body .main-container > .search-bar-box { margin-bottom: 28px; }
html body .cards-grid { margin-top: 6px; margin-bottom: 30px; }
@media (max-width: 768px) { html body .home-bento { gap: 16px; margin-bottom: 24px; } html body .home-bento > .home-hero { padding: 28px 20px; } html body .home-bento > .home-tile { padding: 22px 18px; } }
