/* =====================================================================
   RichTrade Site - phone layout (loaded last so it wins)
   - compact header / news bar / tabs so more of the screen is content
   - Run bar always on top and never covered by the AI or risk buttons
   - 16px form fields so phones don't auto-zoom when you tap an input
   - lighter effects (no blur / glow animations) for smoother scrolling
   ===================================================================== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
button,
a,
input,
select,
textarea,
.dc-tabs__item {
    touch-action: manipulation;
}

@media (max-width: 767px) {
    /* ---------- fit the screen, use the real visible height ---------- */
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    /* ---------- no auto-zoom when a field is tapped ---------- */
    input,
    select,
    textarea,
    .blocklyHtmlInput,
    .tbf-search {
        font-size: 16px !important;
    }

    /* ---------- header: show the logo, compact height ---------- */
    .app-header {
        min-height: 44px !important;
        height: 44px !important;
    }
    /* logo shows when logged out; when logged in the balance + Deposit buttons need the room */
    .app-header.app-header--mobile:has(.auth-actions) .app-header__logo,
    .app-header:has(.auth-actions) .app-header__logo {
        display: flex !important;
        align-items: center;
        width: auto !important;
        height: 44px !important;
        padding: 0 6px !important;
    }
    .app-header .mobile-menu {
        order: -1;
        margin-right: 6px;
    }
    .app-header__logo-img {
        display: block !important;
        height: 22px !important;
        width: auto !important;
        max-width: 120px;
    }

    /* ---------- news bar: thinner ---------- */
    #dp-marquee {
        height: 22px !important;
        min-height: 22px !important;
        font-size: 11px !important;
        line-height: 22px !important;
    }
    #dp-marquee button {
        width: 22px !important;
        height: 22px !important;
        font-size: 11px !important;
    }

    /* ---------- tab bar: smaller, swipeable ---------- */
    .dc-tabs__list,
    .dc-tabs--top .dc-tabs__list {
        height: 40px !important;
        min-height: 40px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .dc-tabs__list::-webkit-scrollbar {
        display: none;
    }
    .dc-tabs__item {
        height: 40px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
        gap: 6px !important;
    }
    .dc-tabs__item svg {
        width: 17px !important;
        height: 17px !important;
    }

    /* ---------- page text a little smaller ---------- */
    .dp-tool h2,
    .dp-sig h2,
    .dp-sig-title,
    .tbd h2 {
        font-size: 20px !important;
        line-height: 1.2 !important;
    }
    .dp-tool,
    .dp-tool p {
        font-size: 14px;
    }
    .dp-tile {
        padding: 10px !important;
        font-size: 13px !important;
        min-height: 52px !important;
        gap: 8px !important;
    }
    .dp-tile i {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
    }
    .tbf-card {
        padding: 44px 14px 14px !important;
    }
    .tbf-card h3 {
        font-size: 17px !important;
    }
    .tbf-card p {
        font-size: 13px !important;
    }
    .tbf-card button {
        padding: 12px !important;
        font-size: 14px !important;
    }

    /* ---------- smoother scrolling: drop costly effects ---------- */
    *,
    *::before,
    *::after {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    /* NOTE: no overscroll-behavior on the inner boxes. .dc-tabs__content is a scroll
       container (Deriv sets overflow-x:auto) that never scrolls vertically; with
       overscroll-behavior:contain Chromium/Android refuses to hand the swipe on to
       .main-body, so the page could not be scrolled by touch at all. */

    /* dialogs fit the screen */
    .dc-modal__container,
    .dc-dialog__dialog,
    .rng-wp__card {
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100dvh - 40px) !important;
        overflow-y: auto !important;
    }
}

/* Phones and tablets (Deriv uses its touch layout up to 1279px): fixed Run bar at the bottom */
@media (max-width: 1279px) {
    /* ---------- Run bar: always visible, always on top ---------- */
    .controls__section {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 10050 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px) !important;
        box-shadow: 0 -4px 14px rgba(58,4,20, 0.12);
    }
    .controls__buttons {
        min-height: 56px;
    }
    #db-animation__run-button,
    #db-animation__stop-button {
        min-width: 104px !important;
        height: 42px !important;
        font-size: 15px !important;
        font-weight: 800 !important;
    }
    .run-panel .dc-drawer__toggle,
    .dc-drawer.run-panel .dc-drawer__toggle {
        height: 26px !important;
        min-height: 26px !important;
    }

    /* risk disclaimer: small, sits above the Run bar instead of on top of it */
    .risk-disclaimer-btn {
        top: auto !important;
        bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
        left: 8px !important;
        right: auto !important;
        padding: 3px 8px !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        z-index: 10040 !important;
        opacity: 0.92;
    }

    /* AI button: smaller, above the Run bar, no glow animation */
    #dp-ai {
        width: 46px !important;
        height: 46px !important;
        right: 10px !important;
        bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
        font-size: 17px !important;
        animation: none !important;
        z-index: 10040 !important;
    }
    #dp-ai::after,
    #dp-ai::before {
        animation: none !important;
    }

    /* toasts above the Run bar */
    .dc-toast,
    .notification-messages {
        bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Deriv's desktop Run toolbar is also rendered in the page flow here, under the
       fixed Run bar, where it only adds 64px of empty scroll: hide that copy */
    .main__run-strategy-wrapper > .toolbar__section {
        display: none !important;
    }
}

/* small phones */
@media (max-width: 380px) {
    .dc-tabs__item {
        padding: 0 10px !important;
        font-size: 12.5px !important;
    }
    .dp-tile {
        font-size: 12.5px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- tab bar: native, smooth horizontal swipe ---------- */
.dp-tabhost {
    display: flex !important;
    align-items: stretch;
    overflow: hidden !important;
}
.dp-tabhost > ul.dc-tabs__list--main__tabs {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-behavior: smooth;
    scrollbar-width: none;
    contain: layout paint;
}
.dp-tabhost > ul.dc-tabs__list--main__tabs::-webkit-scrollbar {
    display: none;
}
ul.dc-tabs__list--main__tabs > li {
    flex: 0 0 auto !important;
}
.dp-tab-off {
    display: none !important;
}
.dp-tabmenu {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-right: 1px solid rgba(255,198,26, 0.35);
    background: linear-gradient(135deg, #ff7a00, #ffc61a);
    color: #3a0414;
    font: 800 13px/1 Inter, 'Segoe UI', Arial, sans-serif;
    cursor: pointer;
    z-index: 2;
}
.dp-tabmenu:active {
    filter: brightness(0.95);
}

/* ---------- tabs sheet ---------- */
.dp-sheet-bg {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    background: rgba(34,3,10, 0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.dp-sheet {
    width: 100%;
    max-width: 480px;
    max-height: 82vh;
    max-height: 82dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 14px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    font-family: Inter, 'Segoe UI', Roboto, Arial, sans-serif;
    color: #3a0414;
}
@media (min-width: 768px) {
    .dp-sheet-bg {
        align-items: center;
    }
    .dp-sheet {
        border-radius: 18px;
    }
}
.dp-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.dp-sheet-head b {
    font-size: 18px;
}
.dp-sheet-head button {
    border: 0;
    background: #ffffff;
    color: #e0113f;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
}
.dp-sheet-search {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid #ffc9a0;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
}
.dp-sheet-search:focus {
    border-color: #ff7a00;
}
.dp-sheet-hint {
    margin: 8px 2px;
    font-size: 12.5px;
    color: #8a6158;
}
.dp-sheet-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    margin: 0 -4px;
    padding: 0 4px;
}
.dp-sheet-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid #fbe7dc;
}
.dp-sheet-row.cur .dp-sheet-go {
    color: #e0113f;
}
.dp-sheet-go {
    flex: 1;
    text-align: left;
    border: 0;
    background: none;
    padding: 12px 6px;
    font: 600 15px/1.2 Inter, Arial, sans-serif;
    color: #3a0414;
    cursor: pointer;
}
.dp-sheet-go small {
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 99px;
    background: #ffffff;
    color: #ff4d00;
    font-size: 11px;
}
.dp-sheet-foot {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.dp-sheet-foot button {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #ffc9a0;
    background: #fff;
    color: #e0113f;
    font: 700 14px Inter, Arial, sans-serif;
    cursor: pointer;
}
.dp-sheet-foot button.on {
    border: 0;
    background: linear-gradient(135deg, #e0113f, #ff7a00);
    color: #fff;
}

/* switch */
.dp-sw {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex: 0 0 auto;
}
.dp-sw input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.dp-sw i {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 99px;
    background: #e5d3cc;
    transition: background 0.2s;
}
.dp-sw i::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
}
.dp-sw input:checked + i {
    background: linear-gradient(135deg, #ff7a00, #ffc61a);
}
.dp-sw input:checked + i::after {
    transform: translateX(18px);
}

/* ---------- pause / resume ---------- */
.dp-pause {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    min-width: 96px;
    margin: 0 0 0 8px;
    padding: 0 14px;
    border: 2px solid #ff7a00;
    border-radius: 6px;
    background: #fffaf5;
    color: #e0113f;
    font: 800 14px/1 Inter, Arial, sans-serif;
    cursor: pointer;
    flex: 0 0 auto;
}
.dp-pause.is-paused {
    background: linear-gradient(135deg, #ff7a00, #ffc61a);
    border-color: transparent;
    color: #3a0414;
    animation: dpPausePulse 1.4s ease-in-out infinite;
}
@keyframes dpPausePulse {
    50% {
        box-shadow: 0 0 0 5px rgba(255,122,0, 0.25);
    }
}
body.dp-bot-paused .animation__container,
body.dp-bot-paused .db-animation__container {
    opacity: 0.55;
}

/* ---------- AI bar (dashboard) ---------- */
.dp-aibar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, #760c26, #3a0414);
    color: #fff1ea;
    box-shadow: 0 8px 22px rgba(118,12,38, 0.25);
    border: 1px solid rgba(255,198,26, 0.3);
    font-family: Inter, 'Segoe UI', Arial, sans-serif;
}
.dp-aibar-face {
    position: relative;
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
}
.dp-aibar-face svg {
    width: 52px;
    height: 52px;
    display: block;
}
.dp-aibar .ab-eye {
    transform-box: fill-box;
    transform-origin: center;
    transition: transform 0.12s ease;
}
/* blink is toggled from JS every few seconds (no frame-by-frame repaint) */
.dp-aibar.blink .ab-eye {
    transform: scaleY(0.1);
}
.dp-aibar-waves {
    position: absolute;
    right: -8px;
    bottom: 2px;
    display: none;
    gap: 2px;
    align-items: flex-end;
    height: 16px;
}
.dp-aibar-waves i {
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: #ffc61a;
    transform: scaleY(0.27);
    transform-origin: 50% 100%;
    animation: abWave 0.7s ease-in-out infinite;
}
.dp-aibar-waves i:nth-child(2) { animation-delay: 0.1s; }
.dp-aibar-waves i:nth-child(3) { animation-delay: 0.2s; }
.dp-aibar-waves i:nth-child(4) { animation-delay: 0.3s; }
.dp-aibar-waves i:nth-child(5) { animation-delay: 0.4s; }
@keyframes abWave {
    50% { transform: scaleY(1); }
}
body.dp-ai-scanning .dp-aibar-waves,
.dp-aibar.speaking .dp-aibar-waves,
.dp-aibar.listening .dp-aibar-waves {
    display: flex;
}
body.dp-ai-scanning .dp-aibar .ab-eye {
    animation: abScan 0.9s ease-in-out infinite;
}
@keyframes abScan {
    0%, 100% { transform: translateX(-3px); }
    50% { transform: translateX(3px); }
}
.dp-aibar.speaking .ab-mouth rect {
    animation: abTalk 0.35s ease-in-out infinite alternate;
}
@keyframes abTalk {
    to { opacity: 0.3; }
}
.dp-aibar-txt {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.dp-aibar-txt b {
    display: block;
    font-size: 15px;
    color: #fff;
}
.dp-aibar-txt small {
    display: block;
    font-size: 12px;
    color: #ffc61a;
}
.dp-aibar-txt em {
    display: block;
    font-size: 12px;
    font-style: normal;
    color: #f6dccf;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 15px;
}
.dp-aibar-sw span {
    font-size: 12px;
    font-weight: 700;
    color: #f6dccf;
}
.dp-aibar-mic {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, #ff7a00, #ffc61a);
    color: #3a0414;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(255,122,0, 0.35);
}
.dp-aibar.listening .dp-aibar-mic {
    background: #ef4444;
    color: #fff;
    animation: dpPausePulse 1s ease-in-out infinite;
}

/* voice command dialog */
.dp-vc-heard {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #ffffff;
    color: #e0113f;
    font-weight: 600;
    font-size: 14px;
}
.dp-vc-scan {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0;
}
.dp-vc-scan > div:last-child {
    flex: 1;
    min-width: 0;
}
.dp-vc-scan small {
    display: block;
    margin-top: 6px;
    color: #8a6158;
}
.dp-vc-radar {
    position: relative;
    flex: 0 0 auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle, #760c26 0 30%, #3a0414 31%);
    border: 2px solid #ff7a00;
    overflow: hidden;
}
.dp-vc-radar i {
    position: absolute;
    inset: 0;
    background: conic-gradient(from 0deg, rgba(255,198,26, 0.75), transparent 35%);
    animation: dpRadar 1.2s linear infinite;
}
body:not(.dp-ai-scanning) .dp-vc-radar i {
    animation-play-state: paused;
    opacity: 0.4;
}
@keyframes dpRadar {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    .dp-tabmenu {
        padding: 0 10px;
    }
    .dp-tabmenu span {
        display: none;
    }
    .dp-pause {
        min-width: 84px;
        height: 42px;
        margin: 0 6px;
        padding: 0 10px;
    }
    .dp-aibar {
        gap: 10px;
        padding: 9px 10px;
    }
    .dp-aibar-face,
    .dp-aibar-face svg {
        width: 44px;
        height: 44px;
    }
}
@media (min-width: 768px) {
    .dp-pause {
        height: auto;
        align-self: stretch;
        min-width: 88px;
        font-size: 13px;
    }
}

/* live dot: pulse with opacity only (runs on the GPU, no repaint every frame) */
.dp-dot {
    position: relative;
    box-shadow: none !important;
    animation: none !important;
}
.dp-dot::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: currentColor;
    color: rgba(255,176,0, 0.35);
    animation: dpDotFade 1.6s ease-in-out infinite;
    will-change: opacity, transform;
}
@keyframes dpDotFade {
    0%, 100% { opacity: 0.2; transform: scale(0.8); }
    50% { opacity: 0.9; transform: scale(1.15); }
}

/* =====================================================================
   APP SHELL (all screen sizes)
   One scrolling area (.main-body) sized from measured bar heights
   (see "LAYOUT METRICS" in dp-ui-extra.js) instead of Deriv's fixed
   "100vh - Xrem" guesses, which overflowed by 4-46px and created a
   second, nested scroll on most tabs.
   ===================================================================== */
/* Deriv declares these on .bot from "100vh - Xrem"; use the real space instead */
html.dp-shell .bot {
    --tab-content-height: calc(var(--dp-mb) - var(--dp-tabs) - var(--dp-mainpad, 0px)) !important;
    --tab-content-height-mobile: calc(var(--dp-mb) - var(--dp-tabs)) !important;
    --bot-content-height: calc(var(--dp-mb) - var(--dp-tabs) - var(--dp-mainpad, 0px)) !important;
}
/* .main has 0.8rem padding on wide screens */
@media (min-width: 1280px) {
    html.dp-shell {
        --dp-mainpad: 1.6rem;
    }
}
html.dp-shell,
html.dp-shell body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}
html.dp-shell #root,
html.dp-shell .layout {
    height: var(--dp-vh) !important;
    min-height: 0 !important;
    max-width: 100vw;
}
/* the single scroller */
html.dp-shell .main-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
    padding-bottom: var(--dp-bottom) !important;
    box-sizing: border-box;
}
html.dp-shell .bot-dashboard {
    min-height: var(--dp-mb) !important;
    box-sizing: border-box;
}
html.dp-shell .main {
    min-height: var(--dp-mb) !important;
    box-sizing: border-box;
    overflow: visible !important;
}
html.dp-shell .free-bots-wrapper,
html.dp-shell .analysis-tool-wrapper,
html.dp-shell .copy-trading-wrapper,
html.dp-shell .rng-insights-wrapper,
html.dp-shell .d-circles-wrapper {
    min-height: calc(var(--dp-mb) - var(--dp-tabs) - var(--dp-mainpad, 0px)) !important;
    box-sizing: border-box;
}
/* dashboard: no inner scroll box, it scrolls with the page */
html.dp-shell .tab__dashboard__content {
    height: auto !important;
    min-height: calc(var(--dp-mb) - var(--dp-tabs) - var(--dp-mainpad, 0px)) !important;
    overflow: visible !important;
    box-sizing: border-box;
}
/* tab bar stays on top while the page scrolls */
html.dp-shell .dc-tabs__list--header--main__tabs {
    position: sticky !important;
    top: 0;
    z-index: 6;
    background: var(--general-section-1, #fff);
}
/* fixed-height views (Bot Builder, Charts) fill exactly the space under the tab bar */
html.dp-shell .bot-builder {
    top: var(--dp-tabs) !important;
}

/* =====================================================================
   Touch targets (phones + tablets) and wide-screen width limits
   ===================================================================== */
@media (max-width: 1279px) {
    .app-header .mobile-menu__toggle,
    .app-header .mobile-menu__toggle > button {
        min-width: 40px;
        min-height: 40px;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    .dp-aibar-sw {
        min-height: 40px;
    }
    .copy-trading-wrapper a {
        display: inline-flex;
        align-items: center;
        min-height: 36px;
    }
    .dcc__market,
    .d-circles-wrapper select {
        min-height: 40px;
    }
    .risk-disclaimer-btn {
        min-height: 32px;
        display: inline-flex !important;
        align-items: center;
    }
}
/* large screens: keep pages readable instead of stretching edge to edge */
@media (min-width: 1440px) {
    .tbf,
    .copy-trading-wrapper > *,
    .rng-insights-wrapper > *,
    .d-circles-wrapper > * {
        max-width: 1320px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* let the browser skip rendering cards that are off screen (faster scrolling on long pages) */
.tbf-card,
#dp-sig-list > .dp-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 320px;
}

/* desktop: keep the site's own panels clear of Deriv's docked run panel */
@media (min-width: 1280px) {
    html.dp-shell #dp-panel {
        margin-right: var(--dp-rp, 0px);
        transition: margin-right 0.2s ease;
    }
}
/* smallest phones: keep the AI bar on one tidy row */
@media (max-width: 380px) {
    .dp-aibar {
        gap: 8px;
        padding: 8px;
    }
    .dp-aibar-face,
    .dp-aibar-face svg {
        width: 38px;
        height: 38px;
    }
    .dp-aibar-txt b {
        font-size: 14px;
        white-space: nowrap;
    }
    .dp-aibar-txt small {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .dp-aibar-sw span {
        display: none;
    }
    .dp-aibar-mic {
        width: 40px;
        height: 40px;
    }
}

/* =====================================================================
   SCROLL PERFORMANCE
   ===================================================================== */
/* The Bot Builder (Blockly) stays mounted behind every other tab with z-index:-1.
   Its SVG keeps animating (Blockly's blinking cursor uses SMIL <animate>) and is
   repainted on every frame. Skip rendering it entirely while another tab is open. */
.bot-builder:not(.bot-builder--active) {
    content-visibility: hidden;
}
/* the one scroller gets an opaque background so Chromium can scroll it as a plain composited layer */
html.dp-shell .main-body {
    background-color: var(--general-section-1, #f6f8fb);
}

/* Touch screens (Android Chrome / WebView and iOS): drop paint-heavy effects that
   Chromium rasterises on the CPU/GPU every time new content scrolls into view. */
@media (hover: none) and (pointer: coarse) {
    *,
    *::before,
    *::after {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }
    /* D-Circles: one filtered offscreen surface per ring + animations restarting on every tick */
    .dcc__ring svg,
    .dcc__pointer svg {
        filter: none !important;
    }
    .dcc__bar-fill,
    .dcc__ring-progress,
    .dcc__ring-pct {
        transition: none !important;
    }
    /* icon glows */
    .tb-bolt,
    .tb-rocket {
        filter: none !important;
    }
    /* softer shadows: same look, far cheaper to rasterise */
    .tbf-card {
        box-shadow: 0 3px 8px rgba(118,12,38, 0.08) !important;
    }
    .tbf-card button,
    .dp-load,
    .dp-start,
    .dp-aibar-mic {
        box-shadow: 0 2px 6px rgba(255,122,0, 0.25) !important;
    }
    .dp-aibar {
        box-shadow: 0 3px 10px rgba(118,12,38, 0.18) !important;
    }
    /* small animations that run on the main thread in Chromium (pseudo-element / SVG) */
    .dp-dot::after {
        animation: none !important;
        opacity: 0.55;
        transform: none;
    }
    .dp-aibar .ab-eye {
        transition: none !important;
    }
}


/* Phones/tablets: the run panel (Summary / Transactions / Journal) slides up from the Run bar.
   Deriv sizes it from 100vh, so on tall phones its own tabs ended up under the site's header and
   tab bar. Size it from the measured bars so it opens right below the tab bar. */
@media (max-width: 1279px) {
    html.dp-shell .dc-drawer.run-panel {
        height: calc(var(--dp-vh) - var(--dp-hdr) - var(--dp-tabs) - var(--dp-ctl)) !important;
    }
    html.dp-shell .bot {
        /* list area: from just under the panel's own tabs (toggle 26px + tabs 40px + gap)
           down to the stats box (pinned 15.7rem above the Run bar) */
        --drawer-content-height-mobile: calc(var(--dp-vh) - var(--dp-hdr) - var(--dp-tabs) - var(--dp-ctl) - 157px - 70px) !important;
    }
}
/* while the run panel is open, the floating Risk / AI buttons would sit on its stats */
@media (max-width: 1279px) {
    body:has(.dc-drawer.run-panel.dc-drawer--open) #dp-ai,
    body:has(.dc-drawer.run-panel.dc-drawer--open) #dp-ai-tip,
    body:has(.dc-drawer.run-panel.dc-drawer--open) .risk-disclaimer-btn {
        display: none !important;
    }
}
