@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  src: url('../fonts/inter-500.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  src: url('../fonts/inter-600.woff2') format('woff2');
}

@font-face {
  font-display: swap;
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  src: url('../fonts/inter-700.woff2') format('woff2');
}

:root {
    --primary: #2c5aa0;
    --primary-dark: #1e3d72;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --lighter: #ffffff;
    --dark: #343a40;
    --border: #3e3e3e;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.12);

    --bg: #111418;
    --bg-2: #181c21;
    --card: #1e2329;
    --muted: #8b93a1;
    --text: #e7e9ed;
    --accent: #4aa3a3;
    --accent-2: #6fbaba;
    --radius: 14px;
    --shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    --maxw: 1100px;
    --gap: 20px;
    --ff: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    --dark-bg: #0c0e11;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 70%);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    padding-top: 85px;
}

a {
    color: #4aa3a3;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

img, iframe, video, svg {
    max-width: 100%;
    height: auto;
}

/* Базовый размер inline-SVG иконок: как у шрифтовых — от font-size родителя */
svg.icon {
    width: 1em;
    height: 1em;
    max-width: none;
    vertical-align: -0.125em;
    flex-shrink: 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
}

.main-content {
    border-radius: 12px;
}

.sidebar {
    margin: 2rem 0;
}

.wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 12px;
}

@media (max-width: 768px) {
    .wrapper {
        padding: 0 8px;
    }
}

/* ========== ЗАКРЕПЛЕННАЯ ШАПКА (FIXED) С ПРОЗРАЧНОСТЬЮ ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(17, 20, 24, 0.88);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    transition: all 0.3s ease;
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1.5rem;
    background: transparent;
    color: white;
    border-radius: 0;
    border: none;
    position: relative;
    padding: 10px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

@media (max-width: 1024px) {
    .header-container {
        flex-wrap: wrap;
        gap: 0.6rem;
        padding: 10px 15px;
    }
}

.header-nav {
    display: flex;
    gap: 0.75rem 1.25rem;
    align-items: center;
    flex-wrap: nowrap;
    margin-left: auto;
}

@media (max-width: 1100px) {
    .header-nav {
        gap: 0.5rem 0.9rem;
    }
    .header-search {
        flex: 0 1 200px;
        min-width: 140px;
    }
}

@media (max-width: 1024px) {
    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.4rem 0.6rem;
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .header-nav {
        gap: 0.5rem;
    }
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 15px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

@media (max-width: 580px) {
    .nav-link {
        white-space: normal;
        word-break: keep-all;
        padding: 0.4rem 0.7rem;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .nav-link {
        white-space: nowrap;
        padding: 0.3rem 0.5rem;
        font-size: 10px;
    }
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::before {
    width: 80%;
}

.nav-link:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

@media (max-width: 768px) {
    .nav-link {
        padding: 0.4rem 0.8rem;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .nav-link {
        padding: 0.35rem 0.7rem;
        font-size: 10px;
    }
}

.logo {
    width: 70px;
    height: auto;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .logo {
        width: 60px;
    }
}

.bookmarks {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 16px;
}

.bookmarks-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.bookmarks-icon {
    color: var(--accent);
    font-size: 13px;
}

.bookmarks-title {
    font-size: 13px;
    color: #9aa0aa;
    letter-spacing: 0.02em;
}

.bookmarks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bookmark-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 9px 12px;
    background: rgb(26 30 35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--bm-color, var(--accent));
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bookmark-item:hover {
    transform: translateY(-2px);
    background: rgba(74, 163, 163, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    border-left-color: var(--bm-color, var(--accent));
}

.bookmark-item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.bookmark-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bm-color, var(--accent));
    font-size: 14px;
    flex-shrink: 0;
}

.bookmark-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.bookmark-hint-icon {
    color: #6b6f78;
    font-size: 11px;
    flex-shrink: 0;
    transition: color 0.3s;
}

.bookmark-item:hover .bookmark-hint-icon {
    color: var(--bm-color, var(--accent));
}

.bookmarks-note {
    margin-top: 10px;
    text-align: center;
    font-size: 10px;
    color: #6a6a6a;
}

@media (max-width: 480px) {
    .bookmark-text {
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bookmark-item,
    .bookmark-item:hover {
        transform: none;
        transition: none;
    }
}

.banner {
    justify-content: center;
    display: flex;
    max-width: 900px;
    padding: 0 20px;
    box-sizing: border-box;
    margin: 15px auto 0;
}

.banner + .banner {
    margin-top: 1px;
}

/* Отступ под последним футерным баннером */
.footer-banners {
    margin-bottom: 15px;
}

/* Отступ под последним верхним баннером */
.header-banners {
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .banner {
        padding: 0 15px;
    }
}

.banner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.banner img:hover {
    transform: scale(1.02);
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-header .site-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0;
    flex: 1;
    font-size: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.site-prefix {
    flex-shrink: 0;
    color: #fff;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.3s ease;
}

@media (max-width: 580px) {
    .site-prefix {
        white-space: normal;
        word-break: keep-all;
        font-size: 0.55rem;
        padding: 0.3rem 0.7rem;
    }
}

.site-prefix:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .site-header {
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .site-prefix {
        align-self: flex-start;
    }
}

.sites-count {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.site-header .site-description {
    color: var(--muted);
    line-height: 1.5;
    font-size: 0.9rem;
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.categories-list {
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .categories-list {
        margin: 1rem 0;
    }
}

.category-item {
    margin-bottom: 2rem;
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.category-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .category-item {
        padding: 15px;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .category-item {
        padding: 12px;
        border-radius: 12px;
    }
}

.category-header {
    color: var(--text);
    padding: 12px 14px 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-header:hover {
    transform: translateX(5px);
}

.category-header:hover .category-title {
    color: #ffffff;
}

@media (max-width: 480px) {
    .category-header {
        padding: 8px 10px 12px;
        gap: 10px;
        margin-bottom: 10px;
    }
}

.category-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.4px;
    flex: 1;
    transition: color 0.3s ease;
}

@media (max-width: 480px) {
    .category-title {
        font-size: 14px;
    }
}

.category-toggle {
    font-size: 0.75rem;
    color: var(--muted);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: transform 0.3s ease, color 0.3s ease, background 0.3s ease;
    flex-shrink: 0;
}

/* SVG-шеврон внутри переключателя: базовый .icon = 1em от font-size 0.75rem,
   что вдвое меньше прежнего inline-SVG 24px — фиксируем явный размер */
.category-toggle svg.icon {
    width: 24px;
    height: 24px;
}

.category-header:hover .category-toggle {
    color: #8fb4e8;
    background: rgba(255, 255, 255, 0.05);
}

.category-toggle.rotated {
    transform: rotate(180deg);
}

.sites-list {
    color: var(--muted);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sites-list.expanded {
    max-height: 8000px;
}

.site-item {
    background: var(--bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
    position: relative;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.site-item:last-child {
    margin-bottom: 0;
}

.site-item:hover {
    border-color: rgba(44, 90, 160, 0.55);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .site-item {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .site-item {
        padding: 10px 10px 6px 20px;
    }
    
    .site-item::before {
        left: 0.3rem;
        top: 12px;
    }
}

.site-title {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: var(--text);
    margin-bottom: 1px;
}

.site-description {
    color: var(--muted);
    line-height: 1.5;
    font-size: 13px;
}

/* ===== Ссылки сайтов (Web / Tor) ===== */
.site-links {
    margin-top: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
}
.site-link-line {
    font-size: 0.85rem;
    line-height: 1.5;
}

.site-link-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 65px;
    min-width: 58px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 0.14rem 0.5rem;
    border-radius: 4px;
    border: 1px solid transparent;
    transform: translateY(-1px);
    box-sizing: border-box;
}
.site-link-tag i, .site-link-tag svg.icon {
    font-size: 0.7rem;
    width: 0.7rem;
    height: 0.7rem;
}
/* Web — приглушённый шалфейно-бирюзовый в тон акценту сайта */
.site-link-web .site-link-tag {
    color: #6ec7b8;
    border-color: rgba(111, 179, 168, 0.35);
    background: rgba(111, 179, 168, 0.08);
}
/* Tor — приглушённая лаванда */
.site-link-tor .site-link-tag {
    color: #b0aae9;
    border-color: rgba(154, 148, 204, 0.35);
    background: rgba(154, 148, 204, 0.08);
}
.site-link-line a {
    color: #9aa3b2;
    border-bottom: 1px solid rgba(139, 147, 161, 0.35);
    padding-bottom: 1px;
    word-break: break-all;
    transition: color 0.2s, border-color 0.2s;
}
.site-link-web a:hover {
    color: #6fb3a8;
    border-bottom-color: rgba(111, 179, 168, 0.7);
}
.site-link-tor a:hover {
    color: #9a94cc;
    border-bottom-color: rgba(154, 148, 204, 0.7);
}
.site-link-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 193, 7, 0.08);
    color: #d9a514;
    border: 1px solid rgba(255, 193, 7, 0.35);
    border-radius: 4px;
    padding: 0.15rem 0.6rem;
    margin-left: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.site-link-badge i, .site-link-badge svg.icon {
    animation: linkspin 3s linear infinite;
}
@keyframes linkspin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .site-title,
    .site-description {
        margin-left: 0;
    }
    .site-links {
        margin-left: 0;
    }
    .site-link-badge {
      margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 13px;
        margin-left: 0;
    }
    
    .site-description {
        font-size: 12px;
    }
}

@media (min-width: 580px) and (max-width: 1024px) {
    .sites-list.expanded {
        max-height: 8000px;
    }
    
    .sites-list {
        display: flex;
        flex-wrap: wrap;
        margin: -6px;
    }
    
    .sites-list .site-item {
        width: calc(50% - 12px);
        margin: 6px;
        display: inline-block;
        vertical-align: top;
        box-sizing: border-box;
        border-radius: 10px;
        border: 1px solid rgb(255 255 255 / 24%);
        background: rgb(0 0 0 / 15%);
    }
    
    .site-item::before {
        left: 0.8rem;
        top: 13px;
    }
    
    .site-item {
        padding: 12px 14px 12px 14px;
    }
    
    .site-item:hover {
        transform: translateY(-3px);
        background: rgba(74, 163, 163, 0.1);
    }
    
    .site-title, .site-description {
        margin-left: 0;
    }
}

.no-category-sites {
    background: var(--card);
    padding: 2rem;
    border-radius: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    text-align: center;
    margin: 2rem 0;
}

.no-category-title {
    color: var(--muted);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.sidebar-banners {
    position: sticky;
    top: 100px;
}

@media (max-width: 1024px) {
    .sidebar-banners {
        position: static;
        margin-top: 1rem;
    }
}

.sidebar-banners .banner {
    padding: 0;
    margin: 0 0 20px 0;
}

.admin-login {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 20px;
}

@media (max-width: 768px) {
    .admin-login {
        top: auto;
        bottom: 10px;
        right: 10px;
        transform: none;
    }
}

.admin-login-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.admin-login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.footer-block {
    display: flex;
    justify-content: space-between;
    background: #111418;
    color: var(--muted);
    border-radius: 14px;
    padding: 20px;
    margin-top: 4rem;
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 12px;
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 768px) {
    .footer-block {
        padding: 15px;
        margin-top: 2rem;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

@media (max-width: 480px) {
    .footer-top {
        justify-content: center;
    }
}

.footer-admin-link {
    color: var(--accent-2);
    font-size: 13px;
    transition: all 0.3s ease;
}

.footer-admin-link:hover {
    color: var(--accent);
    transform: translateX(3px);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

@media (max-width: 640px) {
    .footer-links {
        justify-content: center;
        gap: 12px;
    }
}

.footer-link {
    color: var(--text);
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    word-break: break-word;
    white-space: normal;
}

.footer-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

@media (max-width: 640px) {
    .footer-link {
        justify-content: center;
        padding: 8px 12px;
    }
}

.block-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

/* Мобильные: логотип слева, лупа-триггер закреплена справа в первой строке */
@media (max-width: 1024px) {
    .block-logo {
        justify-content: flex-start;
        padding-right: 44px;
    }
}

.description {
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    word-break: break-word;
}

@media (max-width: 480px) {
    .description {
        font-size: 10px;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-item, .banner, .bookmarks {
    animation: fadeInUp 0.5s ease forwards;
}

.category-item:nth-child(1) { animation-delay: 0.1s; }
.category-item:nth-child(2) { animation-delay: 0.2s; }
.category-item:nth-child(3) { animation-delay: 0.3s; }
.category-item:nth-child(4) { animation-delay: 0.4s; }
.category-item:nth-child(5) { animation-delay: 0.5s; }

html {
    scroll-behavior: smooth;
}

html {
    scrollbar-color: var(--accent) var(--bg);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-2);
}

.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
    width: 100%;
}

@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    .sidebar-banners {
        order: -1;
        margin: 20px 0;
    }
}

p, span, a, div, .site-title, .site-description, .category-title, .bookmark-item, .footer-link {
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.bookmark-item, .footer-link {
    overflow-wrap: anywhere;
    word-break: break-all;
}

/* Шапка: пункты меню не переносим и не рвём по буквам */
.nav-link {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
}

/* ========== ЗАКРЕПЛЕННАЯ ПОЛОСКА ВНИЗУ ========== */
.sticky-footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 0;
    z-index: 9999;
}

.sticky-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.sticky-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 8px 24px;
    background: #15191d;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    border: 1px solid rgba(255,255,255,0.1);
}

.sticky-footer-link:hover {
    background: #4aa3a3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220,53,69,0.35);
    border-color: transparent;
}

.sticky-footer-link i, .sticky-footer-link svg.icon {
    font-size: 1rem;
    width: 1rem;
    height: 1rem;
}

.footer {
    margin-top: 0;
}

@media (max-width: 768px) {
    .sticky-footer-container {
        gap: 0.8rem;
        padding: 0 12px;
    }
    .sticky-footer-link {
        padding: 6px 14px;
        font-size: 0.8rem;
        border-radius: 0;
    }
}

@media (max-height: 500px) {
    .sticky-footer-bar {
        padding: 6px 0;
    }
    .sticky-footer-link {
        padding: 4px 12px;
        font-size: 0.75rem;
    }
}

/* Стили для баннеров между категориями */
.between-categories-banners {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
}

.between-categories-banners .banner {
    flex: 1;
    min-width: 250px;
    margin: 0;
    text-align: center;
}

.between-categories-banners .banner img {
    /*width: 100%;*/
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

/* Адаптация для планшетов */
@media (max-width: 768px) {
    .between-categories-banners .banner {
        flex: 1 1 calc(50% - 10px);
    }
}

/* Адаптация для телефонов */
@media (max-width: 480px) {
    .between-categories-banners {
        flex-direction: column;
        gap: 15px;
    }
    
    .between-categories-banners .banner {
        flex: 1;
        max-width: 100%;
        min-width: auto;
    }
}
.cycle-card {
    background: #1e2329;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 15px;
}
.cycle-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
/*.cycle-dot {

}*/
.cycle-label {
    font-size: 13px;
    color: #9aa0aa;
    letter-spacing: 0.02em;
}
.cycle-countdown-block {
    text-align: center;
    margin-bottom: 14px;
}
.cycle-countdown {
    font-size: 20px;
    font-weight: 500;
    color: #e7e9ed;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}
.cycle-sub {
    font-size: 12px;
    color: #6b6f78;
    margin-top: 2px;
}
.cycle-progress {
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.cycle-progress-fill {
    height: 100%;
    background: #3ecf8e;
    border-radius: 4px;
    transition: width 1s linear;
}
.cycle-times {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}
.cycle-times-right { text-align: right; }
.cycle-times-label {
    color: #6b6f78;
    margin-bottom: 2px;
}
.cycle-times-value {
    color: #9aa0aa;
    font-weight: 500;
}
.cycle-tz {
    text-align: center;
    font-size: 11px;
    color: #6a6a6a;
    margin-top: 10px;
}

/* ===== Видимый фокус при навигации с клавиатуры (WCAG) ===== */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

/* ===== Кнопка «наверх» ===== */
.back-to-top {
    position: fixed;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease, color 0.2s ease;
    z-index: 10000;
    box-shadow: var(--shadow);
    bottom: 72px;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
@media (max-width: 480px) {
    .back-to-top {
        right: 12px;
        bottom: 64px;
        width: 40px;
        height: 40px;
    }
}

/* ===== Уважение к prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
    .site-link-badge i, .site-link-badge svg.icon {
        animation: none;
    }
    .back-to-top,
    .site-item,
    .site-prefix {
        transition: none;
    }
}
/* ===== Поиск по сайтам =====
.header-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 280px;
    min-width: 200px;
}*/

.header-search { display: none !important; }

/* Триггер виден только на мобильных; на десктопе панель просто в строке */
.header-search-trigger {
    display: none;
}

.header-search-panel {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.header-search-icon {
    position: absolute;
    left: 13px;
    color: var(--muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.header-search input {
    width: 100%;
    padding: 0.55rem 2.2rem;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

/* Когда введено от 3 символов — справа появляется кнопка запуска поиска */
.header-search.has-text input {
    padding-right: 3.2rem;
}

.header-search input::placeholder {
    color: var(--muted);
}

.header-search input:focus {
    outline: none;
    /*border-color: var(--primary);*/
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.25);
}

.header-search input::-webkit-search-cancel-button {
    display: none;
}

.header-search-clear {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.7rem;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.header-search-clear:hover {
    color: var(--text);
    border-color: var(--accent);
}

/* Кнопка «найти» справа в поле — видна только когда введено от 3 символов */
.header-search-btn {
    position: absolute;
    right: 6px;
    width: 26px;
    height: 26px;
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.header-search.has-text .header-search-btn {
    display: flex;
}

.header-search.has-text .header-search-clear {
    right: 36px;
}

.header-search-btn:hover {
    color: var(--text);
}

/* Статус поиска и «ничего не найдено» */
.search-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.search-reset {
    margin-left: auto;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.search-reset:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.search-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    text-align: center;
    padding: 2.5rem 1rem;
    margin-bottom: 1rem;
    color: var(--muted);
    background: var(--bg-2);
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
}

/* Подсветка совпадений */
.site-title mark,
.site-description mark {
    background: rgba(44, 90, 160, 0.5);
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* Мобильные: лупа-триггер в шапке, по тапу выдвигается панель с полем */
@media (max-width: 1024px) {
    /* Лупа закреплена справа в первой строке шапки, рядом с логотипом */
    .header-search {
        position: absolute;
        top: 8px;
        right: 15px;
        flex: none;
        min-width: 0;
        width: 32px;
        height: 32px;
        justify-content: center;
        margin: 0;
    }

    .header-search-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.07);
        border: 1px solid var(--border);
        border-radius: 50%;
        color: var(--muted);
        cursor: pointer;
        font-size: 0.95rem;
        transition: color 0.2s ease, border-color 0.2s ease;
    }

    .header-search-trigger:hover {
        color: var(--text);
        border-color: var(--accent);
    }

    /* Панель с полем: выпадает под иконкой */
    .header-search-panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        width: min(260px, calc(100vw - 30px));
        background: var(--bg-2);
        border: 1px solid var(--border);
        border-radius: 10px;
        box-shadow: var(--shadow-hover);
        padding: 4px 8px;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
        z-index: 100;
    }

    .header-search.open .header-search-panel {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .header-search-icon {
        display: none;
    }

    /* Поле без своей рамки — рамку даёт панель */
    .header-search input {
        border: none;
        background: transparent;
        box-shadow: none;
        padding: 0.45rem 3.2rem 0.45rem 0.4rem;
        font-size: 0.95rem;
    }

    .header-search input:focus {
        background: var(--bg);
        box-shadow: none;
    }
}

.search-status[hidden],
.search-empty[hidden],
.header-search-clear[hidden] {
    display: none;
}
/* ===== Сетка контента с сайдбаром (перенесено из index.php) ===== */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    .sidebar-banners {
        order: -1;
        margin: 20px 0;
    }
}

/* Вводный блок с h1 над категориями */
.page-intro {
    margin: 0 0 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
}
.page-intro h1 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
}
.page-intro p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
}
.page-intro-accent {
    color: var(--accent);
}

/* Заголовки h2-h3: сбрасываем стили браузера, внешний вид остаётся на классах */
h2.category-title, h3.site-title {
    margin: 0;
}
