p {
    margin-bottom: 16px;
}

h1, h2, h3, h4, h5, h6, h7 {
	margin-bottom: 0.5em;
}

/* ===== POST ===== */
.post-header {
    padding: 25px 16px 0px 16px;
    max-width: 700px;
    margin: 0 auto;
}

.post-content {
    padding: clamp(16px, 0vw, 30px) 16px;
    max-width: 700px;
    margin: 0 auto;
}

.post-content h1 {
    font-size: clamp(24px, 5vw, 32px);
    margin-bottom: 0.75em;
    color: var(--text-primary);
    font-weight: 600;
}

.post-content h2 {
    font-size: clamp(20px, 4vw, 26px);
    margin-top: clamp(32px, 4vw, 48px);
    margin-bottom: clamp(8px, 1vw, 16px);
    color: var(--text-primary);
    font-weight: 600;
}

.post-content h3 {
    font-size: clamp(18px, 3vw, 22px);
    margin-top: clamp(24px, 3vw, 40px);
    margin-bottom: clamp(12px, 2vw, 20px);
    color: var(--text-primary);
    font-weight: 600;
}

.post-content p {
    margin-bottom: clamp(16px, 2vw, 16px);
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: clamp(16px, 2vw, 17px);
}

.post-content ul,
.post-content ol {
    margin-bottom: clamp(16px, 2vw, 16px);
    padding-left: clamp(20px, 3vw, 28px);
}

.post-content li {
    margin-bottom: clamp(8px, 1vw, 10px);
    color: var(--text-secondary);
    line-height: 1.6;
}

.post-content .post-date {
    color: var(--text-tertiary);
    font-size: clamp(13px, 2vw, 14px);
    margin-top: clamp(32px, 4vw, 48px);
}

.post-header .breadcrumbs {
    margin-bottom: 12px;
}

.post-thumbnail, .post img {
    width: 100%;
    border-radius: 8px;
    margin: 10px 0;
}

.post-dates {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 8px;
}

.post-dates .date-separator {
    margin: 0 8px;
}

.post-dates .post-author {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

.post-dates .post-author:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* ===== NOTE (оранжевая плашка) ===== */
.note {
    padding: 15px 20px;
    border-left: 4px solid #f97316;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}


/* ===== FORMULA BLOCK ===== */
.formula-block {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent-primary);
    border-radius: 8px;
    padding: 18px 24px;
    margin: 24px 0;
}

.formula-block p {
    margin: 0;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
    font-size: clamp(15px, 2.5vw, 18px);
    color: var(--text-primary);
    line-height: 1.6;
    text-align: center;
}

.formula-block em {
    font-style: italic;
}

.post-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== TOC SIDEBAR (desktop) ===== */
.toc-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 15px 20px 0;
    margin-right: 20px;
}

.toc-sidebar::-webkit-scrollbar { width: 6px; }
.toc-sidebar::-webkit-scrollbar-track { background: transparent; }
.toc-sidebar::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}
.toc-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

.toc-sidebar-header {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    padding-left: 10px;
}

.toc-sidebar-list {
    list-style: none;
}

.toc-sidebar-list a {
    display: block;
    padding: 8px 12px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-tertiary);
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    border-radius: 0 4px 4px 0;
    word-break: break-word;
    line-height: 1.2;
}

.toc-sidebar-list a:hover {
    background-color: var(--bg-secondary);
    border-left-color: var(--accent-primary);
    color: var(--text-primary);
}

.toc-sidebar-list a.active {
    background-color: var(--bg-tertiary);
    border-left-color: var(--accent-primary);
    color: var(--text-primary);
}

.toc-level-2 {
    padding-top: 10px;
}

.toc-sidebar-list .toc-level-3 a {
    padding-left: 18px;
    font-size: 0.75rem;
}

.toc-sidebar-list .toc-level-3 a:before {
    content: '• ';
}

.toc-mobile {
    display: none;
    margin: 0 0 24px 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.toc-mobile-header {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.toc-mobile-header .toggle-indicator {
    font-size: 0.8rem;
    transition: transform 0.2s;
    color: var(--text-secondary);
}

.toc-mobile.collapsed .toggle-indicator {
    transform: rotate(-180deg);
}

.toc-mobile.collapsed .toc-mobile-list {
    display: none;
}

.toc-mobile-list {
    list-style: none;
    padding: 8px 0;
}

.toc-mobile-list li {
    margin: 0;
}

.toc-mobile-list a {
    display: block;
    padding: 5px 18px;
    text-decoration: none;
    color: var(--text-secondary);
    border-left: 3px solid transparent;
    transition: background 0.15s;
    font-size: 0.85rem;
}

.toc-mobile-list a:hover {
    background: var(--bg-primary);
}

.toc-mobile-list a.active {
    background: var(--bg-tertiary);
    border-left-color: var(--accent-primary);
    color: var(--text-primary);
    font-weight: 500;
}

.toc-mobile-list .toc-level-3 a {
    padding-left: 32px;
    font-size: 0.8rem;
}

.toc-mobile-list .toc-level-3 a:before {
    content: '• ';
}

/* ===== POST GRID (таблицы-сравнения) ===== */
.post-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 24px 0;
    font-family: sans-serif;
}

.grid-section {
    display: flex;
    flex-direction: column;
}

.section-header,
.grid-header-cell {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 12px 16px;
    line-height: 1.5;
    text-align: center;
}

.grid-header-row,
.grid-data-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.grid-data-cell {
    padding: 12px 16px;
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.5;
}

.grid-data-cell ul,
.grid-data-cell p {
    margin: 4px 0;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
    .post-wrapper {
        flex-direction: column;
    }

    .toc-sidebar {
        display: none;
    }

    .toc-mobile {
        display: block;
    }

    .post-content {
        padding: 15px;
    }
}

figure {
    margin: 15px 0;
}

figcaption {
    font-style: italic;
    color: var(--text-secondary);
}

strong, b {
    color: var(--text-primary);
}

b {
    font-weight: 500;
}

strong {
    font-weight: 600;
}


/* ===== GLOSSARY TOOLTIP (тултипы терминов) ===== */
.glossary-link {
    text-decoration: underline dotted var(--text-secondary);
    cursor: help;
    color: var(--text-secondary);
    font-style: italic;
}
a.glossary-link:hover {
    color: var(--text-tertiary);
}

.glossary-tooltip {
    position: absolute;
    z-index: 10000;
    max-width: 320px;
    width: max-content;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    line-height: 1.55;
    text-align: left;
    white-space: normal;
    display: none;
}

.glossary-tooltip__title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    padding-right: 18px;
    color: var(--text-primary);
}

.glossary-tooltip__body {
    color: var(--text-secondary);
}

.glossary-tooltip__close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.glossary-tooltip__close:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* Крестик показываем только на тач-устройствах */
@media (hover: hover) and (pointer: fine) {
    .glossary-tooltip__close {
        display: none;
    }
}

/* ===== INTERNAL LINK TOOLTIP ===== */
.internal-link-tooltip {
    position: absolute;
    z-index: 10000;
    max-width: 320px;
    width: max-content;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 13px;
    line-height: 1.55;
    text-align: left;
    white-space: normal;
    display: none;
}

.internal-link-tooltip__title {
    font-style: italic;
    color: var(--link-color);
}

/* Стили для приставки "Читайте также:" */
.internal-link-tooltip__prefix {
font-style: italic;
color: var(--text-secondary);
}

/* ===== БЛОК ИНФО/УСПЕХ/ПРЕДУПРЕЖДЕНИЕ  ===== */
.universal-block {
    max-width: 640px;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

/* Верхняя полоса-акцент — плоский цвет */
.universal-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-primary);
    transition: background 0.2s ease;
}

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

/* Иконка — плоская */
.block-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    position: relative;
}

/* SVG через псевдоэлемент (background-image) */
.block-icon::before {
    content: '';
    width: 22px;
    height: 22px;
    display: block;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
}

.universal-block:hover .block-icon {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.universal-block:hover .block-icon::before {
    transform: scale(1.05);
}

/* ===== SVG-ИКОНКИ ДЛЯ КАЖДОГО ТИПА ===== */

/* INFO */
.universal-block.info .block-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%234facfe' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='12' x2='12' y2='16'/%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'/%3E%3C/svg%3E");
}
.universal-block.info::before {
    background: #4facfe;
}
.universal-block.info .block-icon {
    border-color: rgba(79, 172, 254, 0.2);
}

/* WARNING */
.universal-block.warning .block-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f7971e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3Cpath d='M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z'/%3E%3C/svg%3E");
}
.universal-block.warning::before {
    background: #f7971e;
}
.universal-block.warning .block-icon {
    border-color: rgba(247, 151, 30, 0.2);
}

/* SUCCESS */
.universal-block.success .block-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2300b09b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'/%3E%3Cpolyline points='22 4 12 14.01 9 11.01'/%3E%3C/svg%3E");
}
.universal-block.success::before {
    background: #00b09b;
}
.universal-block.success .block-icon {
    border-color: rgba(0, 176, 155, 0.2);
}

/* DANGER */
.universal-block.danger .block-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23e74c3c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E");
}
.universal-block.danger::before {
    background: #e74c3c;
}
.universal-block.danger .block-icon {
    border-color: rgba(231, 76, 60, 0.2);
}

/* QUESTION */
.universal-block.question .block-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236c5ce7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}
.universal-block.question::before {
    background: #6c5ce7;
}
.universal-block.question .block-icon {
    border-color: rgba(108, 92, 231, 0.2);
}

/* IDEA */
.universal-block.idea .block-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23f39c12' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}
.universal-block.idea::before {
    background: #f39c12;
}
.universal-block.idea .block-icon {
    border-color: rgba(243, 156, 18, 0.2);
}

/* ===== ОСТАЛЬНЫЕ СТИЛИ ===== */
.block-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.block-title small {
    font-weight: 400;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-left: 6px;
}

.block-text {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.65;
    margin: 0 0 16px 0;
    font-weight: 400;
}

.block-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.block-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

.block-tag {
    background: var(--bg-tertiary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.block-tag::before {
    content: '◆';
    font-size: 6px;
    color: currentColor;
    opacity: 0.5;
}

.block-tag:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.block-footer {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 2px solid var(--border-light);
    padding-left: 14px;
    transition: border-color 0.2s ease;
}

.block-footer .footer-icon {
    font-size: 14px;
}

.block-footer strong {
    color: var(--text-secondary);
    font-weight: 500;
}

@media (max-width: 480px) {
    .universal-block {
        padding: 16px 16px;
        border-radius: 8px;
    }
    .block-title {
        font-size: 16px;
    }
    .block-text {
        font-size: 14px;
    }
    .block-icon {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    .block-icon::before {
        width: 20px;
        height: 20px;
    }
}



/* ===== GLOBAL LINK STYLES ===== */
a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.2s;
}
a:hover {
    color: var(--link-hover);
}
a.external-link {
    color: var(--link-color);
}
a.external-link:hover {
    color: var(--link-hover);
}


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

:root {
    /* Основные цвета */
    --bg-primary: #191b21;
    --bg-secondary: #1e2329;
    --bg-tertiary: #2b3139;

    /* Текст */
    --text-primary: #eaecef;
    --text-secondary: #dfdfdf;
    --text-tertiary: #c3c4c4;   

    /* Акценты — жёлтый для кнопок/лого, синий для ссылок */
    --accent-primary: #EFBF04;
    --accent-secondary: #FBCC13;
    --accent-hover: #FBD12D;
    --accent-hover-light: #fef3c7;
    --link-color: #1e80ff;
    --link-hover: #4a9eff;

    /* Статусы */
    --green: #0ecb81;
    --red: #f6465d;
    --orange: #e1ab00;
    --blue: #1e80ff;

    /* Бордеры */
    --border-color: #2b3139;
    --border-light: #2b3139;

    /* Радиусы */
    --radius-btn: 4px;
    --radius-card: 6px;
    --radius-input: 4px;
    --radius-table: 4px;
}

/* ===== GLIGHTBOX OVERRIDES (цвета по переменным сайта) ===== */
body .glightbox-clean .gslide-description {
    background: var(--bg-secondary);
}

body .glightbox-clean .gslide-title {
    color: var(--text-primary);
}

body .glightbox-clean .gslide-desc {
    color: var(--text-secondary);
}

/* мобильный вид лайтбокса */
body .glightbox-mobile .glightbox-container .gslide-title {
    color: var(--text-primary);
}

body .glightbox-mobile .glightbox-container .gslide-desc {
    color: var(--text-secondary);
}

/* ===== THEMES ===== */
html[data-theme="dark"] {
    --bg-primary: #0b0e11;
    --bg-secondary: #1e2329;
    --bg-tertiary: #2b3139;
    --text-primary: #eaecef;
    --text-secondary: #cbcbcb;
    --text-tertiary: #bdbec0;
    --accent-primary: #EFBF04;
    --accent-secondary: #FBCC13;
    --accent-hover: #FBD12D;
    --link-color: #1e80ff;
    --link-hover: #4a9eff;
    --border-color: #3f4040;
    --border-light: #3f4040;
}

html[data-theme="clean"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f8f8;
    --bg-tertiary: #e8ecf0;
    --text-primary: #1e2329;
    --text-secondary: #565656;
    --text-tertiary: #9ea6b4;
    --accent-primary: #EFBF04;
    --accent-secondary: #FBCC13;
    --accent-hover: #FBD12D;
    --link-color: #1e80ff;
    --link-hover: #0052cc;
    --border-color: #dadada;
    --border-light: #dadada;
}

html[data-theme="clean"] body {
    background: #ffffff;
}

/* ===== LAYOUT SWITCHER ===== */
html[data-layout="boxed"] .container {
    max-width: 1200px;
    margin: 0 auto;
}

html[data-layout="boxed"] .navbar-container {
    max-width: 1200px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 2045px;
    margin: 0 auto;
    padding: 20px 16px 0px 16px;
}

/* ===== HEADER ===== */
header {
    margin: clamp(20px, 4vw, 28px) 0;
}

h1 {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

h1 i {
    color: var(--accent-primary);
}

.description {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.navbar-container {
    max-width: 1645px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    margin-right: 5px;
    align-self: center;
    height: 64px;
}

.site-logo svg {
    width: auto;
    height: 42px;
    display: block;
    margin: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    color: var(--accent-primary);
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}


.icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-logo {
    width: 22px;
    height: 22px;
    color: var(--accent-primary);
}

.logo-text {
    display: inline;
}

.navbar-menu {
    display: block;
    flex: 1;
    margin-left: 20px;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 12px;
}

.nav-item {
    position: relative;
}

/* Dropdown menu styles */
.nav-item.has-dropdown {
    position: relative;
}

.nav-item.has-dropdown .dropdown-toggle {
    cursor: pointer;
}

.nav-item.has-dropdown .chevron {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.nav-item.has-dropdown:hover .chevron {
    transform: rotate(180deg);
}

.nav-item.has-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    min-width: 200px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.nav-link {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 5px 0;
    transition: all 0.2s;
    border-bottom: 1px solid transparent;
}

.nav-link:hover {
    color: var(--accent-primary);
}

.nav-link.active,
.nav-link[aria-current="page"] {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* ===== MOBILE MENU BUTTON ===== */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: clamp(4px, 1vw, 5px);
    width: clamp(36px, 8vw, 40px);
    height: clamp(36px, 8vw, 40px);
    padding: clamp(6px, 1.5vw, 8px);
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 1000;
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.burger-line {
    display: block;
    width: 100%;
    height: 2.2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active .burger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== MOBILE MENU ===== */
.mobile-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 clamp(12px, 3vw, 16px);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.mobile-menu.show {
    max-height: clamp(300px, 70vh, 600px);
    padding: clamp(12px, 3vw, 16px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1.5vw, 8px);
}

.mobile-nav-item {
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav-item:last-child {
    border-bottom: none;
}

/* Mobile dropdown */
.mobile-dropdown-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(10px, 2.5vw, 12px) clamp(6px, 1.5vw, 8px);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: clamp(14px, 3.5vw, 15px);
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.mobile-dropdown-toggle:focus,
.mobile-dropdown-toggle:focus-visible {
    outline: none;
    background: transparent;
    color: inherit;
    box-shadow: none;
}

.mobile-dropdown-toggle:hover {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.mobile-dropdown-toggle .mobile-chevron {
    transition: transform 0.2s;
}

.mobile-dropdown-toggle.active .mobile-chevron {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-dropdown-menu.show {
    max-height: 500px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-dropdown-menu li {
    border-bottom: none;
}

.mobile-dropdown-menu .mobile-nav-link {
    padding-left: clamp(20px, 5vw, 28px);
}

.mobile-nav-link {
    display: block;
    padding: clamp(10px, 2.5vw, 12px) clamp(6px, 1.5vw, 8px);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: clamp(14px, 3.5vw, 15px);
    font-weight: 400;
    transition: all 0.2s;
}

.mobile-nav-link:hover {
    color: var(--accent-primary);
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.mobile-nav-link.active {
    color: var(--accent-primary);
}

/* ===== TABLET/MOBILE NAVBAR ===== */
@media (max-width: 1535px) {
#donate-menuitem {
    display: none;
}
}

@media (max-width: 1370px) {
#blog-menuitem {
    display: none;
}
}

@media (max-width: 1330px) {
    .navbar-menu {
        display: none;
    }

    .settings-trigger {
        order: 2;
        margin-left: auto;
    }

    .mobile-menu-btn {
        display: flex;
        order: 3;
    }

    .navbar-container {
        height: clamp(56px, 12vw, 64px);
    }

    .site-logo svg {
        height: clamp(32px, 8vw, 42px);
    }

    .logo {
        font-size: clamp(16px, 4vw, 18px);
    }
}

/* ===== CONTROLS ===== */
.controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 120px;
    max-width: 350px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-input);
    font-size: 13px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-box .search-icon svg {
    width: 16px;
    height: 16px;
}

.search-box input::placeholder {
    color: var(--text-tertiary);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.15);
}

.search-box .search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: var(--text-tertiary);
    transition: all 0.2s;
}

.search-box .search-clear:hover {
    background: var(--accent-primary);
    color: #1e2329;
}

.search-box .search-clear svg {
    width: 12px;
    height: 12px;
}

/* ===== DUPLICATES FILTER ===== */
.duplicates-filter-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
    transition: all 0.2s;
}

.duplicates-filter-label:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.duplicates-filter-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

.duplicates-filter-text {
    white-space: nowrap;
}

.duplicates-help-icon {
    display: flex;
    cursor: help;
    opacity: 0.6;
    transition: opacity 0.2s;
    align-items: center;
    vertical-align: middle;
}

.duplicates-help-icon:hover {
    opacity: 1;
}

/* ===== EXCHANGE FILTER ===== */
.exchange-filter-container {
    position: relative;
}

.exchange-filter-btn {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.exchange-filter-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-primary);
}

.max-spread-filter-btn {
    padding: 6px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
}
.max-spread-filter-btn input[type="number"] {
    width: 70px;
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}
.max-spread-filter-btn input[type="number"]:focus {
    border-color: var(--accent-primary);
}

.exchange-count {
    background: var(--accent-primary);
    color: #1e2329;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.exchange-dropdown { 
    position: absolute;
    left: -68px;
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 16px;
    min-width: 200px;
    z-index: 1000;
    display: none;
}

.exchange-dropdown.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
}

.small-btn {
    padding: 5px 10px;
    font-size: 11px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    cursor: pointer;
    color: var(--text-secondary);
    margin-left: 4px;
    transition: all 0.2s;
}

.small-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #1e2329;
}

.exchange-checkboxes {
    max-height: 300px;
    overflow-y: auto;
}

.exchange-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.exchange-checkboxes::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 10px;
}

.exchange-checkboxes::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.exchange-checkbox {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.exchange-checkbox:last-child {
    border-bottom: none;
}

.exchange-checkbox input {
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.exchange-checkbox label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    width: 100%;
}

.exchange-checkbox input:checked + label {
    color: var(--text-primary);
}

.exchange-name-with-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    vertical-align: middle;
}

.exchange-icon {
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.exchange-icon-small {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.dropdown-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
    text-align: right;
}

.apply-btn {
    padding: 8px 16px;
    background: var(--accent-primary);
    color: #1e2329;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.apply-btn:hover {
    background: var(--accent-hover);
}

/* ===== REFRESH BUTTON ===== */
.refresh-btn {
    padding: 8px 14px;
    background: var(--accent-primary);
    color: #1e2329;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 3px;
}

.refresh-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform-origin: 50% 50%;
    will-change: transform;
    backface-visibility: hidden;
}

.refresh-status {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(6px);
    font-size: 12px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 6px 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    z-index: 5;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.refresh-status.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.refresh-btn:hover {
    background: var(--accent-hover) !important;
}

.refresh-btn#gainersBtn:hover {
    background: var(--green) !important;
    opacity: 1 !important;
}

.refresh-btn#losersBtn:hover {
    background: var(--red) !important;
    opacity: 1 !important;
}

.refresh-btn:active {
    box-shadow: none;
}

.refresh-btn#gainersBtn:active,
.refresh-btn#gainersBtn.active {
    opacity: 1 !important;
}

.refresh-btn#losersBtn:active,
.refresh-btn#losersBtn.active {
    opacity: 1 !important;
}

.refresh-btn.rotating .refresh-icon {
    animation: rotate 0.9s linear infinite;
}

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

/* ===== FILTER BUTTONS (GAINERS/LOSERS) ===== */
.filter-btn-green {
    background: var(--green) !important;
    border: none !important;
    opacity: 0.6;
}

.filter-btn-green:hover {
    background: var(--green) !important;
    opacity: 1 !important;
}

.filter-btn-red {
    background: var(--red) !important;
    border: none !important;
    opacity: 0.6;
}

.filter-btn-red:hover {
    background: var(--red) !important;
    opacity: 1 !important;
}

.btn-icon {
    font-size: 16px;
}

/* ===== STATS ===== */
.stats {
    display: flex;
    gap: 12px;
    margin: 20px 0;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-table);
    border: 1px solid var(--border-light);
    align-items: center;
    flex-wrap: wrap;
}

.stats-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 80px;
    min-width: 200px;
    flex-wrap: wrap;
}

.stats-controls .search-box {
    flex: 1 1 37px;
    min-width: 56px;
    max-width: 100%;
}

.refresh-group {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    position: relative;
}

.stats-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    white-space: nowrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== TABS ===== */
.tabs-section {
    padding: 0 clamp(16px, 3vw, 24px);
}

.tabs {
    display: flex;
    gap: 4px;
    padding-bottom: 0;
}

.tab {
    padding: 10px 6px;
    background: var(--bg-secondary);
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 4px 4px 0 0;
}

.tab:hover {
    color: var(--accent-hover);
    background: var(--bg-tertiary);
}

.tab.active {
    color: var(--accent-primary);
    background-color: var(--bg-tertiary);
}

.tab.dimmed {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* ===== POST TABLES ===== */
/*
 * Шаблоны:
 *   post-table--scroll      — таблица с горизонтальным скроллом
 *   post-table--responsive  — адаптивная таблица (карточки на мобильных)
 *   post-grid               — сетка для сравнения (колонки)
 */

/* --- Base: общие стили для scroll и responsive --- */
.post-content .post-table--scroll,
.post-content .post-table--responsive {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.post-content .post-table--scroll th,
.post-content .post-table--responsive th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 500;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    /*white-space: nowrap;*/
    font-size: 0.8rem;
}

.post-content .post-table--scroll td,
.post-content .post-table--responsive td {
    padding: 5px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.6;
    font-size: 0.7rem;
}

.post-content .post-table--scroll tr:last-child td,
.post-content .post-table--responsive tr:last-child td {
    border-bottom: none;
}

/* --- Scroll variant --- */
.post-content .post-table--scroll {
    display: inline-block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* --- Responsive variant (cards on mobile) --- */
@media (max-width: 768px) {
    .post-content .post-table--responsive,
    .post-content .post-table--responsive thead,
    .post-content .post-table--responsive tbody,
    .post-content .post-table--responsive tr,
    .post-content .post-table--responsive th,
    .post-content .post-table--responsive td {
        display: block;
    }

    .post-content .post-table--responsive thead {
        display: none;
    }

    .post-content .post-table--responsive th[colspan] {
        display: block;
        background: var(--bg-tertiary);
        padding: 10px 14px;
        font-weight: 600;
        text-align: center;
        border-bottom: 2px solid var(--border-color);
        margin-bottom: 8px;
        border-radius: var(--radius-card) var(--radius-card) 0 0;
    }

    .post-content .post-table--responsive tbody tr {
        border: 1px solid var(--border-color);
        border-radius: var(--radius-card);
        padding: 12px;
        margin-bottom: 12px;
        background: var(--bg-secondary);
    }

    .post-content .post-table--responsive tbody tr:last-child {
        margin-bottom: 0;
    }

    .post-content .post-table--responsive td {
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 8px;
        font-size: 0.7rem;
    }

    .post-content .post-table--responsive td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-primary);
        flex-shrink: 0;
        min-width: 35%;
    }
}

/* --- POST GRID (comparison tables) --- */
.post-content .post-grid {
    display: grid;
    border: 1px solid var(--border-color);
    background: transparent;
    margin: 24px 0;
    border-radius: var(--radius-card);
    overflow: hidden;
}

.post-content .grid-section {
    display: contents;
}

.post-content .grid-header-cell,
.post-content .section-header {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    padding: 10px 14px;
    border-right: 1px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    text-align: center;
    font-size: 0.8rem;
}

.post-content .grid-data-cell {
    padding: 10px 14px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.6;
    font-size: 0.7rem;
    background: var(--bg-secondary);
}

.post-content .grid-header-row > .grid-header-cell:last-child,
.post-content .grid-data-row > .grid-data-cell:last-child {
    border-right: none;
}

.post-content .grid-section:last-child .grid-data-cell {
    border-bottom: none;
}

@media (max-width: 480px) {
    .post-content .grid-header-row,
    .post-content .grid-data-row {
        grid-template-columns: 1fr;
    }
    
    .post-content .grid-header-cell,
    .post-content .grid-data-cell {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
        text-align: left;
    }
}

/* ===== SCREENER TABLES ===== */

.th-sort-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ===== TABLE RESERVED SPACE ===== */
.table-section {
    position: relative;
}

/* ===== TICKERS TABLE ===== */
.table-section .table-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    position: relative;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-secondary);
    border-radius: 0;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    border-radius: var(--radius-table);
}

.table-section .table-wrapper::-webkit-scrollbar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.table-section .table-wrapper::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 8px;
}

.table-section .table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

table, .table-section .table-wrapper {
    scrollbar-color: var(--text-tertiary) var(--bg-secondary);
    scrollbar-width: thin;
}

.table-section .table-wrapper.is-hidden {
    visibility: hidden;
}

.table-section table {
    border-collapse: collapse;
    position: relative;
    width: 100%;
}

.table-section thead {
    background: var(--bg-tertiary);
}

.table-section thead th {
    position: static;
    padding: 8px 8px;
    font-weight: 500;
    text-align: center;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    white-space: nowrap;
    cursor: default;
    user-select: none;
    transition: color 0.2s;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-right: 1px solid var(--border-light);
}

.table-section thead th:nth-child(3),
.table-section tbody td:nth-child(3) {
    white-space: nowrap;
}

.table-section th.col-index {
    text-align: center;
    vertical-align: middle;
}

.table-section thead th[data-sort]:hover {
    color: var(--link-color);
}

.table-section thead th[data-sort] {
    cursor: pointer;
}

.table-section thead th.sorted {
    color: var(--accent-primary);
}

.sort-icon {
    font-size: 11px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.table-section thead th.sorted .sort-icon {
    opacity: 1;
}

/* ===== TABLE BODY ===== */
.table-section tbody tr {
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}

.table-section tbody tr:hover {
    background: var(--bg-tertiary);
}

.table-section tbody td {
    padding: 5px;
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-primary);
    border-right: 1px solid var(--border-light);
    vertical-align: middle;
}


.table-section thead th:nth-child(2) {
    background: var(--bg-tertiary);
}


.table-section tbody tr.highlighted {
    background: rgba(240, 185, 11, 0.06) !important;
}

.table-section tbody tr.highlighted td:first-child {
    background: rgba(240, 185, 11, 0.06);
}

/* ===== COIN CELL ===== */
.coin-cell {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
}

.coin-name {
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s;
    user-select: none;
    color: var(--text-secondary);
}


.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.4;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 22px;
    height: 22px;
}

.copy-btn:hover {
    opacity: 1;
    color: var(--link-color);
}

.copy-btn.copied {
    color: var(--green);
    opacity: 1;
}

.copy-btn svg {
    width: 12px;
    height: 12px;
}

.copy-btn:active {
    transform: scale(0.95);
}

/* ===== RATE CELLS ===== */
.rate-value {
    font-weight: 600;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
    letter-spacing: 0.3px;
}

.rate-value.positive {
    color: var(--green);
}

.rate-value.negative {
    color: var(--red);
}

.rate-value.neutral {
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
}

/* ===== CHART BUTTON ===== */
.chart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--accent-primary);
    background: var(--bg-primary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-btn);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1;
    opacity: 1;
}

.has-tooltip {
    position: relative;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 2;
}

.has-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chart-btn:hover {
    background: transparent;
    border-color: var(--accent-hover);
    color: var(--accent-hover);
    background: var(--bg-secondary);
}


.chart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 14px;
}

.chart-icon svg {
    width: 11px;
    height: 11px;
    vertical-align: middle;
}

.chart-text {
    white-space: nowrap;
    line-height: 1;
}

/* ===== EXCHANGE CELL (бирка + график вертикально) ===== */
.exchange-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* ===== PRICE BLOCK (двухстрочная цена Bid/Ask) ===== */
.price-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}
.price-row {
    font-size: 13px;
    white-space: nowrap;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
}
.price-row.ask {
    color: var(--red);
}
.price-row.bid {
    color: var(--green);
}

/* ===== FEE BLOCK (двухстрочная комиссия taker/maker) ===== */
.fee-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}
.fee-row {
    font-size: 12px;
    white-space: nowrap;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
    color: var(--text-primary);
}

/* ===== TICKERS SCREENER STYLES ===== */

.positive {
    color: var(--green);
    font-weight: 600;
}

.negative {
    color: var(--red);
    font-weight: 600;
}

.positive {
    color: var(--green);
    font-weight: 600;
}

.negative {
    color: var(--red);
    font-weight: 600;
}

.chart-cell {
    text-align: center;
    white-space: nowrap;
    min-width: 100px;
    width: 100%;
}

.price-cell,
.high-cell,
.low-cell,
.open-cell,
.bid-cell,
.ask-cell {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
    white-space: nowrap;
}

.volume-cell,
.base-volume-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.change-cell {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
    white-space: nowrap;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    padding: 0 4px;
}

#initialData {
    display: none !important;
}

@media (max-width: 1200px) {
    #tickersTable {
        min-width: 1100px;
    }
}

/* ===== CELL UPDATE ANIMATION ===== */
td.cell-updated-animate,
#lastUpdate.cell-updated-animate {
    animation: cell-update-flash 0.8s ease-out forwards;
}

@keyframes cell-update-flash {
    0% {
        background: rgba(14, 203, 129, 0.1);
    }
    100% {
        background: transparent;
    }
}

.arbitrage-rate-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
}

.td-break {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal !important;
}

.empty-table-row {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

/* ============================================
   LOADING/ERROR STATES
   ============================================ */
.loading {
    padding: 80px 20px;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Анимированная полоска загрузки (создаётся через JS, без текста для SEO) */
.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.loading-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 40%;
    background: var(--accent-primary);
    border-radius: 2px;
    animation: loading-slide 1.2s ease-in-out infinite;
}

@keyframes loading-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

.error-state,
.empty-state {
    display: none;
}

.retry-margin {
    margin-top: 15px;
}

.error-state h3 {
    margin: 10px 0;
    color: var(--red);
}

/* ===== PAGINATION ===== */
.pagination-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 10px 5px;
    background: var(--bg-secondary);
    border-radius: var(--radius-table);
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.pagination-container[style*="display: none"] {
    display: none !important;
}

.pagination-info {
    font-size: 12px;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #1e2329;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 11px;
    border: 1px solid var(--border-light);
    background: var(--bg-tertiary);
    transition: all 0.2s;
    font-weight: 500;
    color: var(--text-secondary);
}

.page-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #1e2329;
}

.page-btn.active {
    background: var(--accent-primary);
    color: #1e2329;
    border-color: var(--accent-primary);
}

.pagination-jump {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.pagination-jump input {
    width: 50px;
    padding: 6px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-input);
    font-size: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.pagination-jump input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(240, 185, 11, 0.1);
}

/* ===== SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-primary);
    color: #1e2329;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ===== FOOTER ===== */
footer {
    margin-top: clamp(40px, 6vw, 80px);
    padding: clamp(24px, 4vw, 40px) clamp(12px, 2vw, 24px) clamp(16px, 3vw, 20px);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

footer ul {
    list-style: none;
}

footer li ul {
    padding-left: 8px;
    margin-top: 4px;
}

footer li ul li {
    padding: 3px 7px;
}

footer li ul li a {
    font-size: 12px;
}

footer h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: clamp(24px, 4vw, 40px);
}

.footer-content li
 {
    padding: 7px;
}

.footer-section {
	font-size: 13px;
    display: flex;
    flex-direction: column;
}

/* Сетка для скринеров бирж в футере (2 колонки) */
.footer-exchanges-grid {
    display: grid;
    grid-template-columns: 0.35fr 0.35fr;
    gap: 8px;
}

.footer-exchanges-grid ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.footer-exchanges-grid li {
    margin: 0;
    border-bottom: none;
}

.footer-exchanges-grid a {
    font-size: 13px;
    padding: 0;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-section a:hover {
    color: var(--accent-hover);
}

.social-links {
    display: flex !important;
    gap: 16px !important;
    flex-direction: row !important;
}

.social-links li a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-light);
    transition: all 0.2s;
    font-size: 16px;
}

.social-links li a:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #1e2329;
    transform: translateY(-2px);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

.rate-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    justify-content: center;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .footer-exchanges-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .footer-exchanges-grid a {
        font-size: 12px;
    }

    .rate-chart-container {
        gap: 10px;
        min-height: 54px;
    }
}


@media (max-width: 1240px) {
    .stats {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
        align-items: stretch;
    }

    .stats-metrics {
        margin-left: 0;
        justify-content: flex-end;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-box {
        max-width: 100%;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
        align-items: stretch;
    }

    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }
}

/* ===== COOKIE NOTICE ===== */
.cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-color);
    padding: 15px 20px;
    z-index: 9999;
    transition: opacity 0.3s ease;
    display: none;
}

.cookie-notice.show {
    display: block;
}

.cookie-notice.hidden {
    display: none;
}

.cookie-notice-content {
    max-width: 1550px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-notice p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    flex: 1;
    min-width: 200px;
}

.cookie-notice-link {
    color: var(--link-color);
    text-decoration: underline;
    font-size: 14px;
}

.cookie-notice-link:hover {
    color: var(--link-hover);
}

.cookie-accept-btn {
    background: var(--accent-primary);
    color: #1e2329;
    border: none;
    padding: 10px 25px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.cookie-accept-btn:hover {
    background: var(--accent-hover);
}

@media (max-width: 768px) {
    .cookie-notice-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .cookie-notice p {
        min-width: auto;
    }

    .cookie-accept-btn {
        width: 100%;
    }
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--accent-primary);
    color: #1e2329;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9998;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
}

.scroll-to-top svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
    }

    .scroll-to-top svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   SETTINGS TRIGGER + DROPDOWN
   ============================================ */

.settings-trigger {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-trigger #settings-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 6px;
    margin-right: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.settings-trigger #settings-toggle:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.settings-trigger #settings-toggle svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.settings-trigger #settings-toggle[aria-expanded="true"] svg {
    transform: rotate(60deg);
}

/* Settings dropdown */
.settings-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-input);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 220px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.settings-dropdown.show {
    display: block;
    animation: settingsFadeIn 0.15s ease-out;
}

@keyframes settingsFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-dropdown-header {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.settings-dropdown-body {
    padding: 16px;
}

.theme-toggle-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Theme pill switch */
.theme-pill {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border-light);
}

.theme-pill-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.theme-pill-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.theme-pill-btn:hover {
    color: var(--text-primary);
}

.theme-pill-btn.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}


.theme-pill-btn.active[data-theme="clean"] svg {
    stroke: #f59e0b;
}

@media (max-width: 768px) {
    .settings-dropdown {
        right: -5px;
        min-width: 200px;
    }
}



/* ============================================
   TICKERS SCREENER STYLES
   ============================================ */

.positive {
    color: var(--green);
    font-weight: 600;
}

.negative {
    color: var(--red);
    font-weight: 600;
}

.positive {
    color: var(--green);
    font-weight: 600;
}

.negative {
    color: var(--red);
    font-weight: 600;
}

.chart-cell {
    text-align: center;
    white-space: nowrap;
    min-width: 100px;
    width: 100%;
}

.price-cell,
.high-cell,
.low-cell,
.open-cell,
.bid-cell,
.ask-cell {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
    white-space: nowrap;
}

.volume-cell,
.base-volume-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.change-cell {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', Courier, monospace;
    white-space: nowrap;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    padding: 0 4px;
}

#initialData {
    display: none !important;
}

@media (max-width: 1200px) {
    #tickersTable {
        min-width: 1100px;
    }
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 12px;
    }

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .stats {
        padding: 10px 12px;
        gap: 10px;
    }

    .stats-controls {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .search-box {
        flex: 1 1 100%;
        max-width: 100%;
        min-width: 0;
        order: -1;
    }

    .search-box input {
        width: 100%;
    }

    .exchange-filter-container {
        flex: 0 0 auto;
    }

    .exchange-filter-btn {
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 12px;
    }

    .refresh-group {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        flex: 1 1 100%;
        justify-content: flex-end;
    }

    .refresh-btn {
        flex: 1 1 auto;
        min-width: 0;
        white-space: nowrap;
        padding: 8px 10px;
        font-size: 11px;
    }

    .refresh-btn .btn-icon {
        font-size: 12px;
    }

    .stats-metrics {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
        margin-left: 0;
    }

    .stat-item {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        white-space: nowrap;
    }

    .has-tooltip::after {
        display: none;
    }

    thead th {
        font-size: 11px;
        padding: 8px 6px;
        letter-spacing: 0.3px;
    }

    tbody td {
        font-size: 13px;
        padding: 8px 6px;
    }

}

/* ===== EXTRA SMALL SCREENS ===== */
@media (max-width: 380px) {

    .exchange-filter-btn {
        padding: 8px;
        font-size: 11px;
    }

    .refresh-btn {
        padding: 8px;
        font-size: 10px;
    }

    .refresh-btn span:not(.refresh-icon):not(.btn-icon) {
        display: none;
    }

    thead th {
        font-size: 10px;
        padding: 6px 4px;
    }

    tbody td {
        font-size: 12px;
        padding: 6px 4px;
    }
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
    margin-bottom: 12px;
}

.breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    font-size: 0.8rem;
}

.breadcrumbs-item {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.breadcrumbs-item:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-secondary);
}

.breadcrumbs-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs-link:hover {
    color: var(--link-color);
}

.breadcrumbs-item--active .breadcrumbs-link {
    color: var(--text-primary);
    font-weight: 500;
}

#main-content header .breadcrumbs {
    margin-bottom: 12px;
}

/* ===== FAQ SECTION ===== */
.faq-section {
    margin-top: clamp(40px, 6vw, 80px);
    margin-bottom: clamp(40px, 6vw, 80px);
}

.post-content .faq-section {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
}

.faq-section h2 {
    font-size: clamp(18px, 3vw, 24px);
    color: var(--text-primary);
    margin-bottom: clamp(20px, 3vw, 32px);
    text-align: center;
    font-weight: 600;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-table);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(14px, 3vw, 18px) clamp(16px, 3vw, 20px);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}

.faq-question:hover {
    background: var(--bg-secondary);
}

.faq-question[aria-expanded="true"] {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.faq-question-text {
    flex: 1;
    padding-right: 16px;
    margin-bottom: 0;
}

.faq-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer p,
.faq-answer ul,
.faq-answer ol {
    padding: 7px 10px;
    margin: 0;
    color: var(--text-tertiary);
    line-height: 1.6;
    font-size: clamp(14px, 2.5vw, 15px);
}

.faq-answer ul,
.faq-answer ol {
    padding-left: 24px;
}

.faq-answer li {
    margin-bottom: 8px;
}

.faq-answer strong {
    color: var(--text-primary);
    font-weight: 600;
}

@media (max-width: 768px) {
    .faq-question {
        padding: 14px 16px;
    }

    .faq-answer p,
    .faq-answer ul,
    .faq-answer ol {
        padding: 14px 16px;
    }

    .breadcrumbs-list {
        gap: 4px;
        font-size: 0.75rem;
    }

    .breadcrumbs-item:not(:last-child)::after {
        margin-left: 4px;
    }

    #main-content header .breadcrumbs-list {
        gap: 4px;
        font-size: 0.75rem;
    }
    #main-content header .breadcrumbs-item:not(:last-child)::after {
        margin-left: 4px;
    }
}

/* ===== MARKET TYPE BADGES ===== */
.market-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    vertical-align: middle;
    margin-left: 2px;
    margin-right: 1px;
}

.market-badge.spot {
    background: #0ecb81;
}

.market-badge.future {
    background: #f6465d;
}

/* ===== BOOKMARK BUTTON ===== */
.bookmark-btn {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.bookmark-btn:hover {
    color: var(--accent-primary);
}

.bookmark-btn .bookmark-star {
    fill: #f0b90b;
    stroke: #f0b90b;
    filter: drop-shadow(0 0 4px rgba(240, 185, 11, 0.3));
    transition: transform 0.2s, filter 0.2s;
    flex-shrink: 0;
}

.bookmark-btn:hover .bookmark-star {
    transform: scale(1.15) rotate(-8deg);
    filter: drop-shadow(0 0 8px rgba(240, 185, 11, 0.6));
}

/* ===== BOOKMARK TOAST ===== */
.bookmark-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 99999;
    max-width: 460px;
    width: calc(100% - 32px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.bookmark-toast.bookmark-toast--visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.bookmark-toast-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookmark-toast-text {
    flex: 1;
    min-width: 0;
}

.bookmark-toast-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.bookmark-toast-text span {
    display: block;
    font-size: 13px;
    color: var(--text-tertiary);
}

.bookmark-toast-text kbd {
    display: inline-block;
    padding: 1px 6px;
    font-size: 12px;
    font-family: inherit;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 4px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.bookmark-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 20px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s;
}

.bookmark-toast-close:hover {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .bookmark-toast {
        top: 16px;
        padding: 14px 16px;
    }

    .bookmark-toast-text strong {
        font-size: 13px;
    }

    .bookmark-toast-text span {
        font-size: 12px;
    }
}

/* ===== ТАЙМЕР ОБРАТНОГО ОТСЧЁТА ДО СЛЕДУЮЩЕГО ФАНДИНГА ===== */
.funding-countdown {
    display: block;
    font-size: 12px;
    font-weight: normal;
    line-height: 1.1;
    margin-top: 5px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
    white-space: nowrap;
    pointer-events: none;
}

.density-card .funding-countdown {
    color: rgba(255, 255, 255, 0.55);
}

.density-card.circle-card .funding-countdown {
    font-size: 8px;
    margin-top: 1px;
}

/* ===== ИКОНКА ВНЕШНЕЙ ССЫЛКИ ===== */
a.external-link::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 3px;
    margin-bottom: 2px;
    vertical-align: middle;
    mask: url('/img/external_link.svg') no-repeat center / contain;
    -webkit-mask: url('/img/external_link.svg') no-repeat center / contain;
    background: currentColor;
    flex-shrink: 0;
}

/* ===== ADMIN BAR ===== */
#admin-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: #1a1a2e;
    color: #fff;
    padding: 6px 16px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #76767654;
}
#admin-bar span {
    font-weight: 600;
}
.admin-bar-logout {
    color: #f87171;
    text-decoration: none;
}
.admin-bar-logout:hover {
    text-decoration: underline;
}
body.has-admin-bar {
    padding-top: 36px !important;
}

/* ===== DRAFT BADGE ===== */
.draft-badge {
    background: #f6465d;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    width: fit-content;
}
.draft-badge--post {
    width: 100%;
    text-align: center;
    text-transform: uppercase;
}
.draft-badge--card {
    width: 100%;
    text-align: center;
}

