/* ============================================================================
   3PAY.SHOP — ?v=210_1 MODULAR STYLESHEET
   1) Desktop Collapsible Left Sidebar (>=1025px, --sidebar-w, zero FOUC)
   2) Safe start1810 Header & Footer Additions (.s1810-*, Dark + Light)
   3) Animated Signature Bell in #sound-unlock-modal (.su-anim-bell-*)
   4) P2P Partner Quick Trade Workspace «⚡ Швидкі кнопки для торгівлі» (5 Slots)
      + Settings Modal, Quick Rate Modal (Screenshot 3 Emerald Neon), AI Radar, Shift Stats
   Zero inline styles, zero duplicate selectors, full 360px+ responsive support.
   ============================================================================ */

html[data-auth] {
    --sidebar-w: 0px;
    --sidebar-expanded-w: 256px;
    --sidebar-collapsed-w: 68px;
    --s1810-utility-h: 64px;
    --header-total-h: calc(var(--header-height, 62px) + var(--s1810-utility-h));
}

/* Точні ступенчасті класи висоти дворядкової шапки (синхронізуються base.js, 0 .style.*) */
html[data-auth].hdr-h-120 { --header-total-h: 120px; }
html[data-auth].hdr-h-126 { --header-total-h: 126px; }
html[data-auth].hdr-h-132 { --header-total-h: 132px; }
html[data-auth].hdr-h-138 { --header-total-h: 138px; }
html[data-auth].hdr-h-146 { --header-total-h: 146px; }
html[data-auth].hdr-h-156 { --header-total-h: 156px; }
html[data-auth].hdr-h-168 { --header-total-h: 168px; }
html[data-auth].hdr-h-184 { --header-total-h: 184px; }
html[data-auth].hdr-h-204 { --header-total-h: 204px; }
html[data-auth].hdr-h-228 { --header-total-h: 228px; }

/* ==================== 1. SAFE START1810 HEADER ADDITIONS (?v=210_3: 2-РЯДКОВА ЦЕНТРОВАНА СМУГА БЕЗ ОБРІЗКИ) ==================== */
.s1810-hdr-utility-bar {
    display: block;
    width: 100%;
    min-height: 58px;
    background: linear-gradient(90deg, rgba(6, 13, 28, 0.96) 0%, rgba(10, 22, 44, 0.96) 50%, rgba(6, 13, 28, 0.96) 100%);
    border-bottom: 1px solid rgba(56, 189, 248, 0.22);
    font-size: 0.76rem;
    color: var(--text-secondary);
}

html[data-theme="light"] .s1810-hdr-utility-bar {
    background: linear-gradient(90deg, #edf4ff 0%, #f5f9ff 50%, #edf4ff 100%);
    border-bottom-color: #d6e4f7;
    color: #334155;
}

.s1810-hdr-utility-inner {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 6px 16px 7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
}

.s1810-hdr-row-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.s1810-hdr-brand-pos {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
    gap: 7px;
    min-width: 0;
}

.s1810-hdr-ua-pill {
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: var(--accent-primary);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.s1810-hdr-pos-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
    flex-shrink: 0;
}

.s1810-hdr-pos-text {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.32;
    white-space: normal;
    overflow: visible;
    text-align: center;
}

.s1810-hdr-hotline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.s1810-hdr-hotline:hover {
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.28);
}

.s1810-hdr-hotline-tag {
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
    font-size: 0.66rem;
    font-weight: 800;
}

html[data-theme="light"] .s1810-hdr-hotline-tag {
    color: #047857;
}

.s1810-hdr-hotline-num {
    font-weight: 800;
    font-size: 0.8rem;
    color: var(--text-primary);
}

@media (max-width: 640px) {
    .s1810-hdr-utility-inner {
        padding: 5px 10px 6px;
        gap: 4px;
    }
    .s1810-hdr-hotline {
        padding: 3px 9px;
        gap: 4px;
        font-size: 0.69rem;
    }
    .s1810-hdr-hotline-num {
        font-size: 0.74rem;
    }
    .s1810-hdr-pos-text {
        font-size: 0.68rem;
    }
}

/* ==================== 2. DESKTOP COLLAPSIBLE SIDEBAR (STRICTLY >= 1025px) ==================== */
.s1810-desktop-sidebar,
.s1810-desktop-dock {
    display: none;
}

@media (min-width: 1025px) {
    html[data-auth="0"],
    html.desktop-sidebar-none {
        --sidebar-w: 0px;
    }

    html[data-auth="1"].desktop-sidebar-expanded {
        --sidebar-w: var(--sidebar-expanded-w);
    }

    html[data-auth="1"].desktop-sidebar-collapsed {
        --sidebar-w: var(--sidebar-collapsed-w);
    }

    html[data-auth="1"].desktop-sidebar-docked {
        --sidebar-w: 0px;
    }

    .app-layout-shell {
        padding-left: var(--sidebar-w);
        transition: padding-left 0.26s cubic-bezier(0.4, 0, 0.2, 1), padding-right 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        min-width: 0;
        width: 100%;
    }

    body.right-chat-open .app-layout-shell {
        padding-right: 432px;
    }

    body.right-chat-open .s1810-ftr-grid {
        grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
        gap: 14px;
    }

    html[data-auth="1"].desktop-sidebar-docked .site-footer {
        padding-left: 78px;
    }

    .s1810-desktop-sidebar {
        position: fixed;
        top: var(--header-total-h);
        left: 0;
        bottom: 0;
        width: var(--sidebar-collapsed-w);
        background: var(--bg-sidebar);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-right: 1px solid var(--border-color);
        z-index: 940;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
        will-change: width, transform;
        transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease, box-shadow 0.28s ease;
    }

    html.desktop-sidebar-expanded .s1810-desktop-sidebar {
        width: var(--sidebar-expanded-w);
        box-shadow: 10px 0 32px rgba(0, 0, 0, 0.28);
    }

    html[data-theme="light"].desktop-sidebar-expanded .s1810-desktop-sidebar {
        box-shadow: 8px 0 26px rgba(15, 23, 42, 0.12);
    }

    html.desktop-sidebar-docked .s1810-desktop-sidebar {
        transform: translateY(105%);
        opacity: 0;
        pointer-events: none;
    }

    .s1810-ds-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 10px 16px;
        border-bottom: 1px solid var(--border-color);
        min-height: 54px;
        overflow: hidden;
        transition: padding 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    html.desktop-sidebar-collapsed .s1810-ds-head {
        padding: 10px 16px;
        gap: 0;
    }

    .s1810-ds-brand {
        display: flex;
        flex-direction: column;
        min-width: 0;
        max-width: 170px;
        white-space: nowrap;
        overflow: hidden;
        opacity: 1;
        transition: opacity 0.2s ease, max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .s1810-ds-brand-title {
        font-size: 0.88rem;
        font-weight: 900;
        color: var(--accent-primary);
        letter-spacing: 0.4px;
    }

    .s1810-ds-brand-sub {
        font-size: 0.69rem;
        color: var(--text-secondary);
    }

    .s1810-ds-toggle-btn {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        border: 1px solid rgba(56, 189, 248, 0.42);
        background: rgba(56, 189, 248, 0.12);
        color: var(--accent-primary);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.22s ease;
    }

    .s1810-ds-toggle-btn:hover {
        background: rgba(56, 189, 248, 0.22);
        border-color: var(--accent-primary);
    }

    .s1810-ds-toggle-arrow {
        display: inline-block;
        font-size: 0.88rem;
        font-weight: 900;
        transition: transform 0.25s ease;
    }

    html.desktop-sidebar-collapsed .s1810-ds-toggle-arrow {
        transform: rotate(180deg);
    }

    .s1810-ds-scroll {
        flex: 1 1 auto;
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 6px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(56, 189, 248, 0.35) transparent;
    }

    .s1810-ds-group-label {
        font-size: 0.65rem;
        font-weight: 800;
        color: var(--text-muted);
        letter-spacing: 0.75px;
        padding: 6px 12px 2px;
        text-transform: uppercase;
        white-space: nowrap;
        overflow: hidden;
        max-height: 26px;
        opacity: 1;
        transition: opacity 0.18s ease, max-height 0.24s ease, padding 0.24s ease;
    }

    .s1810-ds-divider {
        height: 1px;
        background: var(--border-color);
        margin: 4px 6px;
        flex-shrink: 0;
    }

    .s1810-ds-list {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .s1810-ds-item {
        position: relative;
        width: 100%;
        min-height: 42px;
        padding: 9px 11px;
        border-radius: 10px;
        border: 1px solid transparent;
        background: transparent;
        color: var(--text-secondary);
        font-family: inherit;
        font-size: 0.84rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 11px;
        cursor: pointer;
        text-align: left;
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
        transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    }

    .s1810-ds-item:hover {
        background: var(--bg-elevated);
        color: var(--text-primary);
        border-color: var(--border-color);
    }

    .s1810-ds-item.is-active {
        background: rgba(56, 189, 248, 0.14);
        color: var(--accent-primary);
        border-color: rgba(56, 189, 248, 0.42);
    }

    .s1810-ds-item.is-qt-highlight {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(56, 189, 248, 0.12));
        border-color: rgba(16, 185, 129, 0.4);
        color: var(--text-primary);
    }

    .s1810-ds-item.is-qt-highlight:hover {
        border-color: #10b981;
        box-shadow: 0 4px 14px rgba(16, 185, 129, 0.22);
    }

    .s1810-ds-icon {
        width: 24px;
        text-align: center;
        font-size: 1.08rem;
        flex-shrink: 0;
    }

    .s1810-ds-text {
        flex: 1 1 auto;
        overflow: hidden;
        text-overflow: ellipsis;
        opacity: 1;
        max-width: 180px;
        transition: opacity 0.18s ease, max-width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .s1810-ds-badge {
        padding: 2px 6px;
        border-radius: 6px;
        font-size: 0.62rem;
        font-weight: 800;
        background: rgba(16, 185, 129, 0.18);
        color: #34d399;
        border: 1px solid rgba(16, 185, 129, 0.36);
        flex-shrink: 0;
        opacity: 1;
        transition: opacity 0.16s ease, max-width 0.24s ease;
    }

    html[data-theme="light"] .s1810-ds-badge {
        color: #047857;
    }

    .s1810-ds-badge.is-cyan {
        background: rgba(56, 189, 248, 0.16);
        color: var(--accent-primary);
        border-color: rgba(56, 189, 248, 0.38);
    }

    .s1810-ds-legal {
        padding: 10px 10px 12px;
        border-top: 1px solid var(--border-color);
    }

    .s1810-ds-legal-card {
        background: var(--bg-elevated);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        padding: 9px 11px;
        display: flex;
        flex-direction: column;
        gap: 3px;
    }

    .s1810-ds-legal-name {
        font-size: 0.76rem;
        font-weight: 800;
        color: var(--text-primary);
    }

    .s1810-ds-legal-code {
        font-size: 0.68rem;
        font-weight: 700;
        color: var(--accent-primary);
    }

    .s1810-ds-legal-sub {
        font-size: 0.64rem;
        color: var(--text-secondary);
        line-height: 1.35;
    }

    .s1810-ds-legal-phone {
        margin-top: 4px;
        padding-top: 5px;
        border-top: 1px solid var(--border-color);
        font-size: 0.7rem;
        font-weight: 800;
        color: var(--text-primary);
        text-decoration: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* Collapsed Rail Mode (68px): єдина фіксована вісь X іконок без стрибків тексту та ширини (?v=210_4_4a) */
    html.desktop-sidebar-collapsed .s1810-ds-brand {
        max-width: 0;
        opacity: 0;
        pointer-events: none;
    }

    html.desktop-sidebar-collapsed .s1810-ds-group-label {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 0;
        pointer-events: none;
    }

    html.desktop-sidebar-collapsed .s1810-ds-text,
    html.desktop-sidebar-collapsed .s1810-ds-badge {
        max-width: 0;
        opacity: 0;
        padding-left: 0;
        padding-right: 0;
        border-width: 0;
        pointer-events: none;
    }

    html.desktop-sidebar-collapsed .s1810-ds-legal {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-top-color: transparent;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
    }

    html.desktop-sidebar-collapsed .s1810-ds-item {
        justify-content: flex-start;
        padding: 9px 11px;
        gap: 0;
    }

    /* Pyramid collapse-down footer button & bottom-left restore dock from start1810 */
    .s1810-ds-dock-down-wrap {
        display: none;
        padding: 8px;
        border-top: 1px solid var(--border-color);
        justify-content: center;
    }

    html.desktop-sidebar-collapsed .s1810-ds-dock-down-wrap {
        display: flex;
    }

    .s1810-ds-dock-down-btn {
        width: 100%;
        min-height: 42px;
        border-radius: 10px;
        background: linear-gradient(180deg, rgba(56, 189, 248, 0.12) 0%, rgba(0, 82, 255, 0.18) 100%);
        border: 1.5px solid rgba(56, 189, 248, 0.45);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: border-color 0.2s ease, transform 0.2s ease;
    }

    .s1810-ds-dock-down-btn:hover {
        border-color: var(--accent-primary);
        transform: translateY(2px);
    }

    .s1810-pyr-svg {
        width: 30px;
        height: 24px;
        display: block;
    }

    .s1810-pyr-path {
        fill: none;
        stroke: var(--accent-primary);
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2.5px;
    }

    .s1810-desktop-dock {
        position: fixed;
        left: 12px;
        bottom: 14px;
        width: 52px;
        height: 46px;
        background: var(--bg-sidebar);
        border: 1.5px solid rgba(56, 189, 248, 0.62);
        border-radius: 12px;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
        z-index: 1020;
        display: none;
        align-items: center;
        justify-content: center;
    }

    html.desktop-sidebar-docked .s1810-desktop-dock {
        display: flex;
    }

    .s1810-dock-restore-btn {
        width: 100%;
        height: 100%;
        border: none;
        background: transparent;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Smart Orders relocation: ONLY on desktop >=1025px when enabled & slotted on /uk-UA/market */
    body.qt-orders-relocated #header-orders-dropdown-wrap {
        display: none !important;
    }
}

/* Anti-clipping safeguard for /uk-UA/market cards on 1280px-1480px laptops with expanded sidebar */
@media (min-width: 1025px) and (max-width: 1480px) {
    html.desktop-sidebar-expanded .market-table-head-v210,
    html.desktop-sidebar-expanded .p2p-wide-card-v210 {
        grid-template-columns: minmax(175px, 1.3fr) minmax(88px, 0.66fr) minmax(126px, 0.9fr) minmax(136px, 0.95fr) minmax(128px, 0.88fr) minmax(138px, 158px);
        gap: 10px;
        padding-left: 14px;
        padding-right: 14px;
    }

    html.desktop-sidebar-expanded .btn-card-action,
    html.desktop-sidebar-expanded .btn-deal-details-blue {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 0.78rem;
    }
}

@media (min-width: 1025px) and (max-width: 1240px) {
    html.desktop-sidebar-expanded .market-table-head-v210 {
        display: none;
    }

    html.desktop-sidebar-expanded .p2p-wide-card-v210 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
        padding: 15px;
    }

    html.desktop-sidebar-expanded .mcard-actions-col {
        grid-column: 1 / -1;
        flex-direction: row;
    }
}

/* ==================== 3. SAFE START1810 FOOTER ADDITIONS (.s1810-ftr-*) ==================== */
.s1810-ftr-addon {
    width: 100%;
    max-width: 1360px;
    margin: 12px auto 0;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

body[data-active-nav="consultant"] .s1810-ftr-addon {
    margin-top: 0;
    padding-top: 2px;
    border-top: none;
}

@media (min-width: 861px) and (max-width: 1024px) {
    body.right-chat-open .app-layout-shell {
        padding-right: 380px;
        transition: padding-right 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    }
}

.s1810-ftr-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
    gap: 16px;
    text-align: left;
    align-items: start;
}

.s1810-ftr-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.s1810-ftr-heading {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--accent-primary);
}

.s1810-ftr-legal-desc {
    font-size: 0.76rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.s1810-ftr-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.s1810-ftr-link {
    font-size: 0.77rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.18s ease;
}

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

.s1810-ftr-link-btn {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}

.s1810-ftr-hotline-row {
    width: 100%;
    margin-top: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.s1810-ftr-hotline-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.s1810-ftr-hotline-pill:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.24);
}

.s1810-ftr-hotline-pill strong {
    color: var(--accent-primary);
    font-weight: 800;
}

/* ==================== 4. ANIMATED SIGNATURE BELL IN #sound-unlock-modal ==================== */
.su-anim-bell-stage {
    position: relative;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.su-anim-bell-wave {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 22px;
    border: 2px solid #38bdf8;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.su-anim-bell-wave.is-left {
    left: -3px;
    border-right-color: transparent;
    border-top-color: transparent;
    border-bottom-color: transparent;
    transform: translateY(-50%);
    animation: suBellWavePulseL 1.9s infinite ease-out;
}

.su-anim-bell-wave.is-right {
    right: -3px;
    border-left-color: transparent;
    border-top-color: transparent;
    border-bottom-color: transparent;
    transform: translateY(-50%);
    animation: suBellWavePulseR 1.9s infinite ease-out;
}

.su-anim-bell-svg {
    width: 36px;
    height: 36px;
    display: block;
    transform-origin: 50% 14%;
    animation: suBellRingSwing 2s infinite ease-in-out;
    filter: drop-shadow(0 3px 10px rgba(0, 82, 255, 0.55));
}

.su-anim-bell-clapper {
    transform-origin: 16px 24px;
    animation: suBellClapperSwing 2s infinite ease-in-out;
}

.su-btn-bell-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 6px;
    vertical-align: middle;
}

.su-btn-bell-svg {
    width: 19px;
    height: 19px;
    display: block;
    transform-origin: 50% 14%;
    animation: suBellRingSwing 2.2s infinite ease-in-out;
}

@keyframes suBellRingSwing {
    0%, 100% { transform: rotate(0deg); }
    10%, 30%, 50% { transform: rotate(15deg); }
    20%, 40% { transform: rotate(-15deg); }
    62% { transform: rotate(6deg); }
    72% { transform: rotate(-4deg); }
    80% { transform: rotate(0deg); }
}

@keyframes suBellClapperSwing {
    0%, 100% { transform: translateX(0); }
    12%, 32%, 52% { transform: translateX(-2px); }
    22%, 42% { transform: translateX(2px); }
    75% { transform: translateX(0); }
}

@keyframes suBellWavePulseL {
    0%, 100% { opacity: 0; transform: translateY(-50%) translateX(3px) scale(0.75); }
    25% { opacity: 0.95; transform: translateY(-50%) translateX(-2px) scale(1.08); }
    55% { opacity: 0; transform: translateY(-50%) translateX(-6px) scale(1.25); }
}

@keyframes suBellWavePulseR {
    0%, 100% { opacity: 0; transform: translateY(-50%) translateX(-3px) scale(0.75); }
    25% { opacity: 0.95; transform: translateY(-50%) translateX(2px) scale(1.08); }
    55% { opacity: 0; transform: translateY(-50%) translateX(6px) scale(1.25); }
}

/* ==================== 5. PARTNER QUICK TRADE WORKSPACE (5 SLOTS ON /uk-UA/market) ==================== */
.qt-workspace-bar {
    position: relative;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(11, 20, 38, 0.95) 0%, rgba(15, 29, 52, 0.92) 100%);
    border: 1.5px solid rgba(56, 189, 248, 0.36);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.36), 0 0 24px rgba(16, 185, 129, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

html[data-theme="light"] .qt-workspace-bar {
    background: linear-gradient(135deg, #ffffff 0%, #f1f7ff 100%);
    border-color: #bfd7f8;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.qt-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.qt-bar-title-group {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.qt-bar-kicker {
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.35px;
    color: var(--text-primary);
}

.qt-bar-count-pill {
    padding: 2px 9px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.42);
    color: #34d399;
    font-size: 0.72rem;
    font-weight: 800;
}

html[data-theme="light"] .qt-bar-count-pill {
    color: #047857;
}

.qt-bar-head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.qt-head-btn {
    padding: 6px 12px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.qt-head-btn:hover {
    border-color: var(--accent-primary);
}

.qt-head-btn.is-done {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #34d399;
    color: #ffffff;
}

.qt-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
    gap: 10px;
    align-items: stretch;
}

.qt-slot-card {
    position: relative;
    border-radius: 13px;
    background: rgba(15, 23, 42, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.24);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    min-height: 76px;
    transition: border-color 0.18s ease, transform 0.16s ease, box-shadow 0.18s ease;
}

html[data-theme="light"] .qt-slot-card {
    background: #ffffff;
    border-color: #d6e2f0;
}

.qt-slot-card:hover {
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 6px 18px rgba(0, 82, 255, 0.12);
}

.qt-slot-card.is-rate-card {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, rgba(10, 29, 34, 0.85), rgba(15, 23, 42, 0.8));
}

html[data-theme="light"] .qt-slot-card.is-rate-card {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
    border-color: #6ee7b7;
}

.qt-slot-card.is-radar-card {
    border-color: rgba(168, 85, 247, 0.45);
}

.qt-slot-action-btn {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
    text-decoration: none;
}

.qt-slot-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.qt-slot-text-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.qt-slot-title {
    font-size: 0.82rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
}

.qt-slot-sub {
    font-size: 0.71rem;
    color: var(--text-secondary);
    line-height: 1.25;
}

/* Edit controls on filled slot */
.qt-slot-edit-tools {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    z-index: 4;
}

.qt-slot-mini-btn {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qt-slot-mini-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.qt-slot-mini-btn.is-remove:hover {
    color: #fca5a5;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

/* Blinking dashed placeholder frame for free slots in edit mode */
.qt-slot-placeholder {
    border-radius: 13px;
    min-height: 76px;
    padding: 12px;
    background: rgba(56, 189, 248, 0.05);
    border: 2px dashed rgba(56, 189, 248, 0.72);
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

.qt-slot-placeholder.is-blinking {
    animation: qtDashedBlink 1.35s ease-in-out infinite;
}

.qt-slot-placeholder:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: #38bdf8;
}

@keyframes qtDashedBlink {
    0%, 100% {
        border-color: rgba(56, 189, 248, 0.35);
        box-shadow: 0 0 0 rgba(56, 189, 248, 0);
    }
    50% {
        border-color: #34d399;
        box-shadow: 0 0 18px rgba(52, 211, 153, 0.32);
    }
}

/* Slot 1: Buy/Sell + Shared Amount Memory + Spread */
.qt-bs-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.qt-bs-btn {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.qt-bs-btn.is-buy {
    background: rgba(16, 185, 129, 0.16);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.qt-bs-btn.is-buy.is-active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.qt-bs-btn.is-sell {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
    color: #fca5a5;
}

.qt-bs-btn.is-sell.is-active {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}

html[data-theme="light"] .qt-bs-btn.is-buy:not(.is-active) {
    color: #047857;
}

html[data-theme="light"] .qt-bs-btn.is-sell:not(.is-active) {
    color: #b91c1c;
}

.qt-bs-amount-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.qt-bs-amount-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
}

.qt-bs-asset-btn,
.qt-bs-save-btn {
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent-primary);
    font-family: inherit;
    font-size: 0.7rem;
    font-weight: 900;
    cursor: pointer;
    flex-shrink: 0;
}

.qt-bs-save-btn {
    border-color: rgba(16, 185, 129, 0.48);
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
}

html[data-theme="light"] .qt-bs-save-btn {
    color: #047857;
}

.qt-spread-strip {
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.32);
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Slot 2: Relocated Orders live badge + hover preview popover */
.qt-orders-slot-wrap {
    position: relative;
}

.qt-orders-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    flex-shrink: 0;
}

.qt-orders-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 340px;
    max-width: calc(100vw - 24px);
    background: var(--bg-modal-panel);
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
    z-index: 1050;
    overflow: hidden;
}

/* Slot picker drawer inside workspace */
.qt-picker-panel {
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-modal-box);
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qt-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.qt-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}

.qt-picker-opt {
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    transition: border-color 0.18s ease, background-color 0.18s ease;
}

.qt-picker-opt:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.qt-picker-opt strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
}

.qt-picker-opt span {
    display: block;
    font-size: 0.71rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 2px;
}

/* ==================== 6. MODAL: SETTINGS FOR QUICK TRADE ==================== */
.qt-switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1.5px solid rgba(56, 189, 248, 0.38);
}

.qt-switch-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.qt-switch-copy strong {
    font-size: 0.92rem;
    color: var(--text-primary);
}

.qt-switch-copy span {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.38;
}

.qt-toggle-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.qt-toggle-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.qt-toggle-track {
    width: 52px;
    height: 28px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.45);
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.qt-toggle-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease;
}

.qt-toggle-input:checked + .qt-toggle-track {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #34d399;
}

.qt-toggle-input:checked + .qt-toggle-track::after {
    transform: translateX(24px);
}

.qt-cfg-slots-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.qt-cfg-slot-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 13px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-color);
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.qt-cfg-slot-item.is-selected {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.11);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
}

.qt-cfg-slot-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.qt-cfg-slot-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.qt-cfg-slot-title-wrap strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.qt-cfg-slot-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.3px;
    background: rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
}

.qt-cfg-slot-badge.is-on {
    background: rgba(16, 185, 129, 0.22);
    border: 1px solid rgba(52, 211, 153, 0.52);
    color: #34d399;
}

html[data-theme="light"] .qt-cfg-slot-badge.is-on {
    color: #047857;
}

.qt-cfg-slot-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.qt-cfg-slot-order-btns {
    display: inline-flex;
    gap: 3px;
}

.qt-cfg-order-btn {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qt-cfg-order-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.qt-toggle-label.is-compact {
    width: 44px;
    height: 24px;
}

.qt-toggle-label.is-compact .qt-toggle-track::after {
    width: 16px;
    height: 16px;
    top: 3px;
    left: 3px;
}

.qt-toggle-label.is-compact .qt-toggle-input:checked + .qt-toggle-track::after {
    transform: translateX(20px);
}

.qt-cfg-slot-desc {
    display: block;
    font-size: 0.74rem;
    color: var(--text-secondary);
    line-height: 1.38;
}

/* ==================== 7. MODAL: QUICK RATE UPDATE (EXACT SCREENSHOT 3 EMERALD NEON DESIGN) ==================== */
.qt-rate-neon-card {
    position: relative;
    width: min(440px, calc(100vw - 24px));
    border-radius: 22px;
    padding: 28px 26px 26px;
    background: linear-gradient(180deg, #1c2638 0%, #151e2e 100%);
    border: 1.5px solid #22c58b;
    box-shadow: 0 0 36px rgba(16, 185, 129, 0.36), 0 24px 64px rgba(0, 0, 0, 0.78);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

html[data-theme="light"] .qt-rate-neon-card {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf8 100%);
    border-color: #10b981;
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.22), 0 20px 50px rgba(15, 23, 42, 0.18);
}

.qt-rate-close-x {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.18s ease, background-color 0.18s ease;
}

.qt-rate-close-x:hover {
    color: var(--text-primary);
    background: rgba(148, 163, 184, 0.14);
}

.qt-rate-emblem {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.36);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.24);
}

.qt-rate-title {
    margin: 0;
    font-size: 1.24rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    color: #20c997;
    text-transform: uppercase;
}

html[data-theme="light"] .qt-rate-title {
    color: #059669;
}

.qt-rate-subtitle {
    margin: 0;
    max-width: 340px;
    font-size: 0.88rem;
    line-height: 1.48;
    color: #cbd5e1;
}

html[data-theme="light"] .qt-rate-subtitle {
    color: #475569;
}

.qt-rate-scope-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(8, 13, 24, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

html[data-theme="light"] .qt-rate-scope-tabs {
    background: #e9f5f0;
    border-color: #bbf7d0;
}

.qt-rate-scope-btn {
    padding: 7px 6px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.18s ease;
}

.qt-rate-scope-btn.is-active {
    background: rgba(16, 185, 129, 0.22);
    border-color: #22c58b;
    color: #ecfdf5;
}

html[data-theme="light"] .qt-rate-scope-btn.is-active {
    background: #10b981;
    color: #ffffff;
}

.qt-rate-single-select {
    width: 100%;
    padding: 9px 12px;
    border-radius: 11px;
    border: 1px solid rgba(52, 211, 153, 0.48);
    background: rgba(11, 17, 30, 0.82);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 700;
}

html[data-theme="light"] .qt-rate-single-select {
    background: #ffffff;
}

.qt-rate-current-hint {
    width: 100%;
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.qt-rate-steps-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.qt-rate-step-btn {
    padding: 6px 4px;
    border-radius: 9px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.qt-rate-step-btn:hover {
    background: rgba(16, 185, 129, 0.24);
    border-color: #34d399;
}

html[data-theme="light"] .qt-rate-step-btn {
    color: #047857;
}

.qt-rate-input-box {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px;
    height: 56px;
    border-radius: 13px;
    background: rgba(13, 21, 35, 0.86);
    border: 1.5px solid #22c58b;
    box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.08);
}

html[data-theme="light"] .qt-rate-input-box {
    background: #ffffff;
}

.qt-rate-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.08rem;
    font-weight: 800;
}

.qt-rate-input::placeholder {
    color: #64748b;
    font-weight: 600;
}

.qt-rate-suffix {
    font-size: 0.96rem;
    font-weight: 900;
    color: #20c997;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.qt-rate-submit-btn {
    width: 100%;
    height: 50px;
    border-radius: 13px;
    border: 1.5px solid #22c58b;
    background: rgba(16, 185, 129, 0.18);
    color: #20c997;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.18s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.qt-rate-submit-btn:hover {
    background: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

html[data-theme="light"] .qt-rate-submit-btn {
    background: #10b981;
    color: #ffffff;
}

.qt-rate-risk-box {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.14);
    border: 1.5px solid rgba(248, 113, 113, 0.65);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qt-rate-risk-title {
    font-size: 0.84rem;
    font-weight: 900;
    color: #fca5a5;
}

html[data-theme="light"] .qt-rate-risk-title {
    color: #b91c1c;
}

.qt-rate-risk-text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.42;
    color: var(--text-primary);
}

.qt-rate-risk-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==================== 8. MODAL: AI RATE RADAR & 3 STRATEGIES ==================== */
.qt-radar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.qt-radar-side-tabs {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.qt-radar-side-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.qt-radar-side-btn.is-active {
    background: rgba(56, 189, 248, 0.18);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.qt-radar-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.qt-radar-kpi {
    padding: 11px 12px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.qt-radar-kpi span {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.qt-radar-kpi strong {
    font-size: 0.96rem;
    font-weight: 900;
    color: var(--text-primary);
}

.qt-radar-ai-box {
    padding: 13px 15px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.12), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.42);
    font-size: 0.84rem;
    line-height: 1.48;
    color: var(--text-primary);
}

.qt-strategies-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.qt-strategy-card {
    padding: 14px;
    border-radius: 14px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    transition: border-color 0.2s ease, transform 0.16s ease;
}

.qt-strategy-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.qt-strategy-card.is-calm {
    border-color: rgba(56, 189, 248, 0.42);
}

.qt-strategy-card.is-middle {
    border-color: rgba(16, 185, 129, 0.5);
}

.qt-strategy-card.is-turbo {
    border-color: rgba(245, 158, 11, 0.55);
}

.qt-strategy-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qt-strategy-title {
    font-size: 0.88rem;
    font-weight: 900;
    color: var(--text-primary);
}

.qt-strategy-quote {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.qt-strategy-price-box {
    padding: 9px 11px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}

.qt-strategy-rate {
    font-size: 1.16rem;
    font-weight: 900;
    color: #34d399;
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

html[data-theme="light"] .qt-strategy-rate {
    color: #059669;
}

.qt-strategy-meta {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.qt-strategy-guard-note {
    font-size: 0.71rem;
    color: #fbbf24;
    line-height: 1.35;
}

html[data-theme="light"] .qt-strategy-guard-note {
    color: #b45309;
}

.qt-strategy-apply-btn {
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(52, 211, 153, 0.6);
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 900;
    cursor: pointer;
}

.qt-strategy-apply-btn:hover {
    filter: brightness(1.08);
}

/* ==================== 9. MODAL: PARTNER SHIFT ANALYTICS & CSV ==================== */
.qt-stats-head-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.qt-stats-period-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qt-stats-period-btn {
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
}

.qt-stats-period-btn.is-active {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: var(--text-primary);
}

.qt-stats-csv-btn {
    padding: 7px 14px;
    border-radius: 9px;
    border: 1px solid rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.16);
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.qt-stats-csv-btn:hover {
    background: rgba(56, 189, 248, 0.28);
}

.qt-stats-status-pill {
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.qt-stats-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.qt-stats-kpi-tile {
    padding: 12px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qt-stats-kpi-tile.is-profit {
    border-color: rgba(16, 185, 129, 0.52);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0.55));
}

html[data-theme="light"] .qt-stats-kpi-tile.is-profit {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.qt-stats-kpi-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.qt-stats-kpi-val {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--text-primary);
}

.qt-stats-kpi-sub {
    font-size: 0.71rem;
    color: var(--text-secondary);
}

.qt-stats-split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.qt-stats-split-card {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qt-stats-section-title {
    margin: 4px 0 0;
    font-size: 0.82rem;
    font-weight: 900;
    color: var(--text-primary);
}

.qt-cards-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.qt-cards-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.qt-cards-table th,
.qt-cards-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.qt-cards-table th {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    text-transform: uppercase;
}

.qt-saas-quota-card {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

/* ==================== 10. MOBILE & TABLET RESPONSIVE (360px+) ==================== */
@media (max-width: 1024px) {
    .s1810-ftr-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .qt-radar-kpi-row,
    .qt-stats-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qt-strategies-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .qt-workspace-bar {
        padding: 12px;
        border-radius: 14px;
    }

    .qt-slots-grid {
        grid-template-columns: 1fr;
    }

    .qt-rate-neon-card {
        padding: 22px 16px 20px;
    }

    .qt-rate-scope-tabs {
        grid-template-columns: 1fr;
    }

    .qt-radar-kpi-row,
    .qt-stats-kpi-grid,
    .qt-stats-split-grid {
        grid-template-columns: 1fr;
    }

    .qt-orders-popover {
        left: 0;
        right: 0;
        width: 100%;
    }
}
