/* ================================================================
   ШПАРГАЛКА ПО VBA
   Отдельный файл — не смешивать с tools.css
   ================================================================ */

.vba-root {
    padding: 30px 34px;
}

@media (max-width: 640px) {
    .vba-root { padding: 18px 14px; }
}

/* Панель управления */
.vba-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--line, #E8E2DA);
}

.vba-search-wrap {
    position: relative;
}

.vba-search {
    width: 100%;
    padding: 14px 46px 14px 18px;
    border: 2px solid var(--line, #E8E2DA);
    background: #fff;
    border-radius: 14px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    color: #1A1420;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.vba-search:focus {
    border-color: #6B3FA0;
    box-shadow: 0 0 0 4px rgba(107, 63, 160, .12);
}

.vba-search__clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #EDE4FF;
    color: #2A1745;
    font-size: 17px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.vba-search__clear:hover {
    background: #6B3FA0;
    color: #FFD23F;
}

/* Категории */
.vba-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vba-cat {
    padding: 7px 14px;
    border-radius: 999px;
    background: #EDE4FF;
    color: #2A1745;
    border: 1.5px solid transparent;
    font-family: 'Manrope', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    white-space: nowrap;
}

.vba-cat:hover {
    background: #6B3FA0;
    color: #FFD23F;
}

.vba-cat.is-active {
    background: #2A1745;
    color: #FFD23F;
    border-color: #C6F432;
}

.vba-counter {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    color: #6B6470;
    text-transform: uppercase;
    letter-spacing: .08em;
    min-height: 18px;
}

.vba-counter strong {
    color: #2A1745;
    font-weight: 700;
}

/* Список */
.vba-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.vba-item {
    padding: 20px 22px;
    background: #fff;
    border: 1px solid #E8E2DA;
    border-radius: 14px;
    transition: border-color .2s, box-shadow .2s;
}

.vba-item:hover {
    border-color: #6B3FA0;
    box-shadow: 0 4px 16px rgba(107, 63, 160, .06);
}

.vba-item__title {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 17px;
    color: #2A1745;
    margin: 0 0 8px;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.vba-item__title mark,
.vba-item__desc mark {
    background: #FFD23F;
    color: #2A1745;
    padding: 0 3px;
    border-radius: 3px;
}

.vba-item__desc {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #6B6470;
    margin: 0 0 14px;
}

/* Блок кода */
.vba-code-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
}

.vba-code {
    flex: 1;
    margin: 0;
    padding: 14px 16px;
    background: #2A1745;
    color: #F5F0E8;
    border-radius: 12px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.55;
    overflow-x: auto;
    white-space: pre;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
    tab-size: 4;
}

.vba-code code {
    font-family: inherit;
    font-size: inherit;
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
}

.vba-copy {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 10px 14px;
    background: #EDE4FF;
    border: 1px solid #E8E2DA;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    transition: background .2s;
}

.vba-copy:hover {
    background: #D6C4F0;
}

/* Теги */
.vba-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 8px;
    border-top: 1px dashed #E8E2DA;
}

.vba-tag {
    padding: 3px 10px;
    background: transparent;
    border: 1px solid #E8E2DA;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: #6B6470;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.vba-tag:hover {
    background: #EDE4FF;
    color: #2A1745;
    border-color: #6B3FA0;
}

/* Пусто */
.vba-empty {
    text-align: center;
    padding: 50px 20px 30px;
}

.vba-empty p {
    margin-bottom: 16px;
    font-size: 15px;
}

/* Адаптив */
@media (max-width: 640px) {
    .vba-item {
        padding: 16px 14px;
    }

    .vba-item__title {
        font-size: 16px;
    }

    .vba-code {
        font-size: 12px;
        padding: 12px 14px;
    }

    .vba-copy {
        padding: 8px 10px;
    }
}

/* Печать */
@media print {
    .nav, .footer, .cursor-dot, .cursor-ring, .mobile-menu,
    .feedback-modal, #feedbackModal, #feedbackToast {
        display: none !important;
    }

    .vba-controls,
    .tool-details,
    .cell--wide,
    .cell--section-title .tag,
    .cell--section-title p,
    .cell--section-title a,
    .vba-copy,
    .vba-tags {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt;
        cursor: auto;
    }

    .wrap { max-width: 100%; padding: 0; margin: 0; }
    .bento { display: block !important; gap: 0 !important; }

    .cell {
        border: none !important;
        padding: 0 !important;
        margin: 0 0 16pt 0 !important;
        background: #fff !important;
    }

    .cell--section-title h2 {
        font-size: 16pt;
        color: #000 !important;
        border-bottom: 1pt solid #333;
        padding-bottom: 8pt;
        margin-bottom: 12pt;
    }

    .cell--section-title h2::after {
        content: " — шпаргалка";
    }

    .vba-item {
        border: 1pt solid #ccc !important;
        page-break-inside: avoid;
        margin-bottom: 12pt;
    }

    .vba-item__title { color: #000 !important; }
    .vba-item__desc { color: #333 !important; }

    .vba-code {
        background: #f5f5f5 !important;
        color: #000 !important;
        border: 1pt solid #999 !important;
        page-break-inside: avoid;
    }
}