/* ═══════════════════════════════════════════════════════════════
   Mobile sticky TOC для раздела «Западная астрология».
   Образец: /assets/css/calculators.css (.calcn-toolbar / #calcnTocMenu).
   Видим только на ≤980px — на десктопе работает minimap-toc слева.
   ═══════════════════════════════════════════════════════════════ */

/* На десктопе полностью скрыт — там есть minimap-toc. */
@media (min-width: 981px) {
    .zwa-toc-toolbar,
    .zwa-toc-menu {
        display: none !important;
    }
}

.zwa-toc-toolbar {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.zwa-toc-toolbar > * {
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.zwa-toc-back-to-top {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 999px;
    background: #ffffff;
    border: 0.5px solid rgba(17, 19, 20, 0.12);
    color: #10142a;
    font-family: 'Manrope', sans-serif;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.35);
}
.zwa-toc-back-to-top.is-shown { display: inline-flex; }
.zwa-toc-back-to-top svg { display: block; width: 14px; height: 14px; }
.zwa-toc-back-to-top:hover {
    background: #fbd890;
    border-color: #fbd890;
    color: #10142a;
    transform: translateY(-2px);
}

.zwa-toc-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 150px;
    height: 44px;
    flex: none;
    flex-shrink: 0;
    padding: 0 18px;
    border-radius: 999px;
    background: #ffffff;
    border: 0.5px solid rgba(17, 19, 20, 0.12);
    color: #10142a;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.35);
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.zwa-toc-fab:hover { background: #fbd890; border-color: #fbd890; color: #10142a; }
.zwa-toc-fab:active { transform: translateY(1px); }
.zwa-toc-fab .zwa-toc-fab-label { flex: 0 0 auto; }
.zwa-toc-fab .zwa-toc-fab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    color: #10142a;
    transition: color .2s ease, transform .25s cubic-bezier(.4,0,.2,1);
}
.zwa-toc-fab .zwa-toc-fab-icon svg { display: block; width: 14px; height: 14px; }
.zwa-toc-fab.is-open { background: #fbd890; border-color: #fbd890; color: #10142a; }
.zwa-toc-fab.is-open .zwa-toc-fab-icon { color: #10142a; transform: rotate(180deg); }

.zwa-toc-menu {
    position: fixed;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    z-index: 99;
    min-width: 280px;
    max-width: 340px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: #ffffff;
    border: 0.5px solid rgba(204, 166, 86, 0.35);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .2s ease, transform .25s cubic-bezier(.4,0,.2,1);
    list-style: none;
    margin: 0;
}
.zwa-toc-menu.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.zwa-toc-menu .zwa-toc-eyebrow {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: rgba(17, 19, 20, 0.55);
    padding: 8px 14px 10px;
}
.zwa-toc-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.zwa-toc-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.zwa-toc-menu li a {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    color: #111314;
    text-decoration: none;
    font-size: 16px;
    line-height: 1.35;
    transition: background .15s ease, color .15s ease;
}
.zwa-toc-menu li a:hover,
.zwa-toc-menu li a:focus {
    background: rgba(204, 166, 86, 0.12);
    color: #ba8923;
}

@media (max-width: 580px) {
    .zwa-toc-toolbar {
        bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        gap: 8px;
    }
    .zwa-toc-fab {
        width: 140px;
        height: 40px;
        font-size: 13px;
        padding: 0 14px;
    }
    .zwa-toc-back-to-top {
        width: 40px;
        height: 40px;
    }
    .zwa-toc-back-to-top svg { width: 12px; height: 12px; }
    .zwa-toc-menu {
        left: 16px;
        right: 16px;
        max-width: none;
        bottom: calc(120px + env(safe-area-inset-bottom, 0px));
        max-height: calc(100vh - 240px);
        padding: 14px 10px 10px;
    }
}
