/**
 * BVI-style toolbar panel: a strip above the page content with blocks of buttons.
 * The panel keeps its own light palette in every colour scheme.
 */

.vi-panel--bvi,
.vi-panel--bvi * {
    box-sizing: border-box;
}

/*
 * position: relative keeps the strip in the page flow and puts it above
 * template layers such as fixed, transparent background divs that would
 * otherwise swallow clicks (seen on 21vmc.ru, .templ-bg).
 */
.vi-panel--bvi {
    position: relative;
    inset: auto;
    z-index: 100000;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    border-bottom: 2px solid #0b4f9c;
    border-radius: 0;
    background: #ffffff !important;
    color: #1a1a1a !important;
    font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    letter-spacing: normal !important;
    word-spacing: normal !important;
}

.vi-panel--bvi[hidden],
.vi-panel--bvi:not([open]) {
    display: none !important;
}

.vi-bvi__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 16px 12px;
}

.vi-bvi__title {
    margin: 0 0 8px;
    color: #1a1a1a !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vi-bvi__bar,
.vi-bvi__extra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 0;
}

.vi-bvi__extra {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #c9c9c9;
}

.vi-bvi__extra[hidden] {
    display: none !important;
}

.vi-bvi__group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border-left: 1px solid #e0e0e0;
}

.vi-bvi__group:first-child {
    padding-left: 0;
    border-left: 0;
}

.vi-bvi__group--end {
    margin-left: auto;
}

.vi-bvi__label {
    margin-right: 6px;
    color: #5a5a5a !important;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.vi-bvi__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #c9c9c9;
    border-radius: 6px;
    background: #ffffff !important;
    color: #0b4f9c !important;
    font: 600 15px/1.2 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.vi-bvi__btn:hover {
    background: #eef4fb !important;
}

.vi-bvi__btn[aria-pressed="true"] {
    border-color: #0b4f9c !important;
    background: #0b4f9c !important;
    color: #ffffff !important;
}

.vi-bvi__btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.vi-bvi__btn--font {
    min-width: 52px;
    font-size: 18px;
}

.vi-bvi__swatch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid #c9c9c9;
    border-radius: 6px;
    font: 700 16px/1 system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.vi-bvi__swatch[aria-pressed="true"] {
    border-color: #0b4f9c !important;
    outline: 3px solid #0b4f9c;
    outline-offset: 2px;
}

.vi-panel--bvi button:focus-visible {
    outline: 3px solid #0b4f9c;
    outline-offset: 2px;
}

/* Scheme previews */
.vi-panel--bvi .vi-bvi__swatch--wb {
    background: #ffffff !important;
    color: #000000 !important;
}

.vi-panel--bvi .vi-bvi__swatch--bw {
    background: #000000 !important;
    color: #ffffff !important;
}

.vi-panel--bvi .vi-bvi__swatch--blue {
    background: #9dd1ff !important;
    color: #063462 !important;
}

.vi-panel--bvi .vi-bvi__swatch--yellow {
    background: #ffff00 !important;
    color: #000000 !important;
}

.vi-panel--bvi .vi-bvi__swatch--green {
    background: #000000 !important;
    color: #00ff00 !important;
}

.vi-panel--bvi .vi-bvi__swatch--beige {
    background: #f5f5dc !important;
    color: #8b4513 !important;
}

/*
 * Colour schemes must not repaint the panel itself.
 * Specificity here is higher than the generic "html[data-vi-scheme] button" rule in themes.css.
 */
html[data-vi-scheme] .vi-panel--bvi .vi-bvi__title {
    color: #1a1a1a !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__label {
    color: #5a5a5a !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__btn {
    border-color: #c9c9c9 !important;
    background: #ffffff !important;
    color: #0b4f9c !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__btn[aria-pressed="true"] {
    border-color: #0b4f9c !important;
    background: #0b4f9c !important;
    color: #ffffff !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__swatch--wb {
    background: #ffffff !important;
    color: #000000 !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__swatch--bw {
    background: #000000 !important;
    color: #ffffff !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__swatch--blue {
    background: #9dd1ff !important;
    color: #063462 !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__swatch--yellow {
    background: #ffff00 !important;
    color: #000000 !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__swatch--green {
    background: #000000 !important;
    color: #00ff00 !important;
}

html[data-vi-scheme] .vi-panel--bvi .vi-bvi__swatch--beige {
    background: #f5f5dc !important;
    color: #8b4513 !important;
}

@media (max-width: 767px) {
    .vi-bvi__inner {
        padding: 8px 10px 10px;
    }

    .vi-bvi__bar,
    .vi-bvi__extra {
        gap: 8px 0;
    }

    .vi-bvi__group {
        padding: 0 8px;
    }

    .vi-bvi__label {
        margin-right: 4px;
    }
}
