/* ── VC PROMO BLOCK ────────────────────────────────────────── */
.vc-promo-block {
    margin: 0 0 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #bbf7d0;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
body.dark-mode .vc-promo-block {
    background: linear-gradient(135deg, #052e16 0%, #14532d 100%);
    border-color: #166534;
}
.vc-promo-block__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #16a34a;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(22,163,74,.2);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%,100% { box-shadow: 0 0 0 3px rgba(22,163,74,.2); }
    50%      { box-shadow: 0 0 0 6px rgba(22,163,74,.06); }
}
.vc-promo-block__text-wrap {
    flex: 1;
    min-width: 180px;
}
.vc-promo-block__title {
    font-size: 15px;
    font-weight: 700;
    color: #14532d;
    margin: 0 0 2px;
    line-height: 1.3;
}
body.dark-mode .vc-promo-block__title { color: #bbf7d0; }
.vc-promo-block__sub {
    font-size: 13px;
    color: #166534;
    margin: 0;
    line-height: 1.4;
}
body.dark-mode .vc-promo-block__sub { color: #9ed4b4; }
.vc-promo-block__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #16a34a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s, transform .15s;
    box-shadow: 0 3px 12px rgba(22,163,74,.25);
}
.vc-promo-block__btn:hover {
    background: #15803d;
    transform: translateY(-1px);
}
.vc-promo-block__btn svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform .15s; }
.vc-promo-block__btn:hover svg { transform: translateX(2px); }
/* ── /VC PROMO BLOCK ───────────────────────────────────────── */

/* ── SCROLLABLE TABS ───────────────────────────────────────── */

.tab-img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity .15s;
}
.tab-btn.active .tab-img {
    opacity: 1;
}

/* Десктоп: іконка збоку, нормальний колір тексту */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color .15s, background .15s, border-color .15s;
    text-decoration: none;
}
.tab-btn:hover {
    color: #334155;
    background: rgba(0,0,0,.04);
}
.tab-btn.active {
    color: #059669;
    background: rgba(16,185,129,.08);
    border-color: rgba(16,185,129,.25);
    font-weight: 600;
}
body.dark-mode .tab-btn { color: #94a3b8; }
body.dark-mode .tab-btn:hover { color: #f4f4f5; background: rgba(255,255,255,.06); }
body.dark-mode .tab-btn.active { color: #6fae8c; background: rgba(52,211,153,.1); border-color: rgba(52,211,153,.25); }

.tab-label { display: inline; }

/* ── ДЕСКТОП: таби по центру ── */
.tabs-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 0 0 8px;
}
.tabs {
    display: inline-flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 4px;
    padding-bottom: 4px;
    max-width: 100%;
    background: rgba(0,0,0,.03);
    border-radius: 999px;
    padding: 4px;
}
body.dark-mode .tabs { background: rgba(255,255,255,.05); }
.tabs::-webkit-scrollbar { display: none; }
.tabs-scroll-hint { display: none; }

/* ── МОБІЛЬНИЙ: bottom navigation bar ── */
@media (max-width: 768px) {

    body { padding-bottom: 72px; }

    .dark-mode-toggle { bottom: 80px !important; }

    .arch-controls { bottom: 76px !important; }
    .arch-progress { bottom: 116px !important; }

    .tabs-wrap {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 300;
        margin: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: rgba(255,255,255,0.97);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid rgba(0,0,0,.06);
        box-shadow: 0 -4px 24px rgba(0,0,0,.08);
        display: block;
        transition: transform .25s ease;
    }
    body.dark-mode .tabs-wrap {
        background: rgba(15,23,42,0.97);
        border-top-color: rgba(255,255,255,.07);
    }

    .tabs-wrap.nav-hidden {
        transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
    }

    /* На мобільному скидаємо стиль "pill" */
    .tabs {
        display: flex;
        width: 100%;
        overflow-x: auto;
        padding: 8px 8px 6px;
        gap: 2px;
        background: transparent;
        border-radius: 0;
        -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
        mask-image: linear-gradient(to right, black 88%, transparent 100%);
    }

    .tab-btn {
        flex: 0 0 auto;
        flex-direction: column;
        gap: 3px;
        padding: 5px 14px 4px;
        font-size: 10px;
        font-weight: 500;
        border-radius: 10px;
        border: none;
        background: transparent;
        color: #94a3b8;
        min-width: 60px;
        justify-content: center;
    }
    .tab-btn:hover { background: rgba(0,0,0,.04); color: #64748b; }
    .tab-btn.active {
        background: rgba(16,185,129,.10);
        color: #059669;
        font-weight: 700;
        border: none;
    }
    body.dark-mode .tab-btn { color: #64748b; }
    body.dark-mode .tab-btn.active { background: rgba(52,211,153,.12); color: #6fae8c; }

    .tab-img {
        width: 22px;
        height: 22px;
        display: block;
        opacity: 0.45;
    }
    .tab-btn.active .tab-img { opacity: 1; }

    .tab-label {
        display: block;
        font-size: 10px;
        line-height: 1.2;
        text-align: center;
    }

    .tabs-scroll-hint {
        display: flex;
        position: absolute;
        right: 4px;
        top: 50%;
        transform: translateY(-50%);
        align-items: center;
        color: #94a3b8;
        pointer-events: none;
        animation: hint-fade 3.5s ease forwards;
    }
    .tabs-scroll-hint svg { width: 14px; height: 14px; animation: hint-slide 1s ease-in-out infinite; }
    .tabs-wrap.scrolled .tabs-scroll-hint,
    .tabs-wrap.scrolled-end .tabs-scroll-hint { display: none; }

    @keyframes hint-slide {
        0%,100% { transform: translateX(0); }
        50%      { transform: translateX(5px); }
    }
    @keyframes hint-fade {
        0%,65% { opacity:1; }
        100%   { opacity:0; }
    }
}

/* ── /SCROLLABLE TABS ──────────────────────────────────────── */

/* ── COMPACT ARCHIVE TESTS (same as krokTestView) ──────────── */

/* Менший відступ між картками архіву */
#panel-archive .test-item {
    margin-bottom: 14px !important;
    padding: 16px 18px 16px !important;
}

/* Питання */
#panel-archive .test-item h3 {
    font-size: 17px !important;
    margin-bottom: 10px !important;
    line-height: 1.45 !important;
}

/* Список варіантів — без зайвих відступів */
#panel-archive .test-item ul {
    margin: 8px 0 0 !important;
}

/* Варіант відповіді — компактний */
#panel-archive .test-item ul li {
    padding: 11px 46px 11px 14px !important;
    margin: 6px 0 !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    cursor: pointer;
}
#panel-archive .test-item ul li:last-child {
    margin-bottom: 0 !important;
}

/* Хедер картки */
#panel-archive .test-info {
    margin-bottom: 10px !important;
}

/* Номер питання */
#panel-archive .question-number {
    font-size: 13px !important;
    padding: 5px 11px !important;
}

@media (max-width: 480px) {
    #panel-archive .test-item {
        padding: 14px 14px 14px !important;
        margin-bottom: 10px !important;
    }
    #panel-archive .test-item ul li {
        padding: 10px 42px 10px 12px !important;
        margin: 5px 0 !important;
        font-size: 13px !important;
    }
    #panel-archive .test-item h3 {
        font-size: 15px !important;
    }
}
/* ── /COMPACT ARCHIVE TESTS ─────────────────────────────────── */

/* ── COMPACT ARCH PROGRESS BAR & CONTROLS ───────────────────── */

/* Тонший прогрес-бар архіву */
.arch-progress {
    height: 6px !important;
    bottom: 8px !important;
    width: min(900px, 88vw) !important;
    box-shadow: none !important;
    border: none !important;
    z-index: 9990 !important;
}

/* Контроли — над тонким баром */
.arch-controls {
    bottom: 20px !important;
    gap: 8px !important;
    z-index: 9991 !important;
}

/* Кнопка Завершити — менша */
.arch-finish {
    padding: 9px 16px !important;
    font-size: 13px !important;
    box-shadow: 0 3px 10px rgba(239,68,68,.3) !important;
}

/* Лічильник — менший */
.arch-counter {
    font-size: 13px !important;
    padding: 8px 14px !important;
    box-shadow: 0 2px 8px rgba(15,23,42,.1) !important;
}

/* Перемикач темного режиму — менший */
.dark-mode-toggle {
    width: 38px !important;
    height: 38px !important;
    right: 16px !important;
    bottom: 80px !important;
    z-index: 9992 !important;
}

.dark-mode-toggle #mode-icon,
#mode-icon {
    font-size: 18px !important;
}

/* На мобільному з bottom nav — підняти вище */
@media (max-width: 768px) {
    .arch-progress {
        bottom: 80px !important;
        transition: bottom .25s ease;
    }
    .arch-controls {
        bottom: 94px !important;
        transition: bottom .25s ease;
    }
    .dark-mode-toggle {
        bottom: 136px !important;
        transition: bottom .25s ease;
    }

    /* Коли нижня навігація прихована при скролі —
       прогрес-бар та контроли «приклеюються» до низу в'юпорта,
       щоб не висіти у повітрі. */
    body.nav-hidden .arch-progress {
        bottom: 8px !important;
    }
    body.nav-hidden .arch-controls {
        bottom: 22px !important;
    }
    body.nav-hidden .dark-mode-toggle {
        bottom: 64px !important;
    }
}
/* ── /COMPACT ARCH PROGRESS BAR & CONTROLS ──────────────────── */

/* ── MISTAKES BUTTON ──────────────────────────────────────── */
.mistakes-btn {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #b91c1c;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(220, 38, 38, .15);
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
    flex-shrink: 0;
}
.mistakes-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}
.mistakes-btn:hover {
    transform: translateY(-2px);
    filter: saturate(110%);
    box-shadow: 0 8px 24px rgba(220, 38, 38, .25);
}
.mistakes-btn:active { transform: translateY(0); }
.mistakes-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}
body.dark-mode .mistakes-btn {
    background: linear-gradient(135deg, rgba(239,68,68,.18) 0%, rgba(220,38,38,.25) 100%);
    color: #fecaca;
}

/* Inline variant — компактна кнопка біля заголовка картки */
.mistakes-btn--inline {
    width: 30px;
    height: 30px;
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(220, 38, 38, .12);
}
.mistakes-btn--inline img {
    width: 16px;
    height: 16px;
}
.mistakes-btn--inline:hover {
    box-shadow: 0 4px 12px rgba(220, 38, 38, .22);
}
.test-title { min-width: 0; }
.test-title > .mistakes-btn--inline { flex-shrink: 0; }
/* ── /MISTAKES BUTTON ─────────────────────────────────────── */

/* ── MOBILE COMPACT TWEAKS — зменшуємо все на телефоні ──────── */
@media (max-width: 640px) {
    /* Заголовок KROK • HUB — менший */
    .krok-pill { margin: 6px auto 12px !important; gap: 6px !important; }
    .krok-pill__badge { padding: 8px 16px !important; }
    .krok-logo { height: 22px !important; }
    .krok-pill__underline { height: 2px !important; width: min(180px, 60vw) !important; }

    /* Пошук — нижчий і компактніший */
    .hub-search { gap: 8px !important; margin: 4px 0 12px !important; }
    .hub-search input,
    .hub-search select {
        height: 42px !important;
        line-height: 42px !important;
        font-size: 14px !important;
        padding: 0 14px !important;
    }
    .hub-search select { padding-right: 38px !important; }

    /* Картки тестів — менший внутрішній padding */
    .test-item {
        padding: 14px 14px 16px !important;
        border-radius: 18px !important;
    }
    .test-title {
        font-size: 15px !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
    }
    .test-progress {
        min-width: 78px !important;
        height: 30px !important;
        font-size: 13px !important;
        padding: 0 12px !important;
    }

    /* Кнопки в картках — менші */
    .test-buttons { gap: 8px !important; margin-top: 12px !important; }
    .start-btn,
    .history-btn {
        padding: 10px 12px !important;
        font-size: 12px !important;
        border-radius: 999px !important;
    }

    /* Кнопка помилок inline — менша */
    .mistakes-btn--inline {
        width: 26px !important;
        height: 26px !important;
    }
    .mistakes-btn--inline img {
        width: 14px !important;
        height: 14px !important;
    }

    /* VC-промо блок — компактний */
    .vc-promo-block {
        padding: 12px 14px !important;
        gap: 10px !important;
        margin: 0 0 14px !important;
        border-radius: 12px !important;
    }
    .vc-promo-block__title { font-size: 13px !important; }
    .vc-promo-block__sub { font-size: 11px !important; line-height: 1.35 !important; }
    .vc-promo-block__btn {
        font-size: 12px !important;
        padding: 7px 14px !important;
    }

    /* Demo буклет — менше «велике» оформлення */
    .test-item.demo-booklet { transform: none !important; }

    /* Архівні заголовки — компактніше */
    .arch-headbar { padding: 10px 12px !important; }
    .arch-headbar__title { font-size: 14px !important; }
    .arch-summary { font-size: 11px !important; }
}

@media (max-width: 480px) {
    /* Ще менший — для маленьких екранів */
    .krok-logo { height: 20px !important; }
    .krok-pill__badge { padding: 6px 14px !important; }

    .test-item { padding: 12px 12px 14px !important; }
    .test-title { font-size: 14px !important; }
    .test-progress {
        height: 28px !important;
        font-size: 12px !important;
        min-width: 70px !important;
    }
    .start-btn, .history-btn {
        padding: 9px 10px !important;
        font-size: 11px !important;
    }

    .vc-promo-block__title { font-size: 12px !important; }
    .vc-promo-block__sub { font-size: 10.5px !important; }
}

/* ── DARK MODE FIX для systems-warning блоку ───────────────── */
body.dark-mode .systems-warning > div {
    background: rgba(245, 158, 11, 0.10) !important;
    border-color: rgba(245, 158, 11, 0.30) !important;
}
body.dark-mode .systems-warning > div > div > div:first-child {
    color: #fcd34d !important;
}
body.dark-mode .systems-warning > div > div > div:last-child {
    color: #fde68a !important;
}

/* Модалка результату архіву + demo2026 — текст у dark-mode */
body.dark-mode #archResultModal .modal-content > div[style*="color:#334155"],
body.dark-mode #archResultModal .modal-content > div {
    color: #cbd5e1 !important;
}
body.dark-mode #demo2026PayModal .modal-content p[style*="color:#334155"],
body.dark-mode #demo2026PayModal .modal-content p {
    color: #cbd5e1 !important;
}

/* Demo booklet progress — в dark-mode читабельний */
body.dark-mode .test-item.demo-booklet {
    background: linear-gradient(135deg, rgba(16,185,129,0.10) 0%, rgba(5,150,105,0.06) 100%) !important;
    border-color: rgba(16,185,129,0.45) !important;
}
body.dark-mode .test-item.demo-booklet .test-progress[style] {
    background: rgba(16,185,129,0.16) !important;
    color: #a7f3d0 !important;
}

/* AI-баннер у dark-mode */
body.dark-mode li.test-item[style*="rgba(99,102,241"] {
    background: rgba(255,255,255,0.04) !important;
    border-color: rgba(255,255,255,0.12) !important;
}
/* ── /MOBILE COMPACT TWEAKS ─────────────────────────────────── */
