/* =====================================================================
   RichTrade Site theme (loaded last, so it wins)
   - vivid crimson / orange / gold palette with white as a main colour
   - glassy, smooth tab borders
   - Rich AI orb: round robot face, spinning "RICH AI" ring, glow
   - DTrader tab styles
   - smoother interaction + automated motion (respects reduced-motion)
   ===================================================================== */
:root {
    --rt-crimson: #e0113f;
    --rt-crimson-2: #ff1654;
    --rt-deep: #3a0414;
    --rt-deeper: #22030a;
    --rt-orange: #ff5e00;
    --rt-orange-2: #ff7a00;
    --rt-gold: #ffc61a;
    --rt-amber: #ffb000;
    --rt-white: #ffffff;
    --rt-snow: #fff7f8;
    --rt-ink: #1a0610;
    --rt-grad: linear-gradient(120deg, #e0113f 0%, #ff1654 30%, #ff5e00 65%, #ffb000 100%);
    --rt-grad-soft: linear-gradient(135deg, #ffffff 0%, #fff3f5 55%, #fff1e3 100%);
    --rt-glass: rgba(255, 255, 255, 0.14);
    --rt-glass-line: rgba(255, 255, 255, 0.38);
    --rt-ease: cubic-bezier(0.22, 1, 0.36, 1);

    --dp-navy: #3a0414;
    --dp-navy-2: #8f0a2c;
    --dp-blue: #e0113f;
    --dp-blue-2: #ff5e00;
    --dp-mint: #ffffff;
    --dp-purple: #e0113f;
}

/* ---------- smooth everything ---------- */
html {
    scroll-behavior: smooth;
}
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}
button,
a,
.dp-tab,
.dc-tabs__item,
.dc-btn,
input,
select {
    transition: background-color 0.25s var(--rt-ease), color 0.25s var(--rt-ease), border-color 0.25s var(--rt-ease), box-shadow 0.3s var(--rt-ease), transform 0.25s var(--rt-ease), opacity 0.25s var(--rt-ease);
}
*:focus-visible {
    outline: 2px solid var(--rt-amber) !important;
    outline-offset: 2px;
}
::selection {
    background: rgba(224, 17, 63, 0.18);
}
/* thin branded scrollbars (desktop) */
@media (pointer: fine) {
    * {
        scrollbar-width: thin;
        scrollbar-color: rgba(224, 17, 63, 0.45) transparent;
    }
    *::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    *::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #ff5e00, #e0113f);
        border-radius: 8px;
    }
    *::-webkit-scrollbar-track {
        background: transparent;
    }
}

/* ---------- white header with a vivid live line ---------- */
body.theme--light .app-header {
    background: rgba(255, 255, 255, 0.92) !important;
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
    position: relative;
}
.app-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--rt-grad);
    background-size: 220% 100%;
    animation: rtFlow 6s linear infinite;
    pointer-events: none;
}
.dp-cash {
    background: var(--rt-grad) !important;
    background-size: 200% 100% !important;
    animation: rtFlow 5s linear infinite;
    box-shadow: 0 6px 18px rgba(224, 17, 63, 0.35) !important;
}
.dc-btn--primary,
.auth-actions .dc-btn--primary {
    background: var(--rt-grad) !important;
    background-size: 200% 100% !important;
    box-shadow: 0 6px 16px rgba(255, 94, 0, 0.28);
}
.dc-btn--primary:hover {
    background-position: 100% 0 !important;
    transform: translateY(-1px);
}

/* ---------- tab bar: vivid gradient + glassy pills ---------- */
.dc-tabs--main__tabs .dc-tabs__list--main__tabs,
.dc-tabs__list--header--main__tabs,
.dp-tabhost {
    background: linear-gradient(100deg, #4a0418 0%, #a30a2e 38%, #e0113f 62%, #ff5e00 100%) !important;
    background-size: 200% 100% !important;
    animation: rtFlow 14s ease-in-out infinite alternate;
}
.dp-tabhost > ul.dc-tabs__list--main__tabs {
    background: transparent !important;
    animation: none;
}
.dc-tabs__list--main__tabs {
    padding: 0 6px !important;
}
.dc-tabs__item--main__tabs,
.dp-tab {
    position: relative !important;
    isolation: isolate;
    background: transparent !important;
}
/* the glass pill (::after; ::before holds the tab icon) sits inside each tab, so tab heights (and the page layout) stay the same */
.dc-tabs__item--main__tabs::after,
.dp-tab::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 6px 3px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.32);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(255, 255, 255, 0.08), 0 4px 14px rgba(34, 3, 10, 0.18);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
    backdrop-filter: blur(8px) saturate(150%);
    transition: background 0.3s var(--rt-ease), border-color 0.3s var(--rt-ease), box-shadow 0.3s var(--rt-ease), transform 0.3s var(--rt-ease);
    pointer-events: none;
}
.dc-tabs__item--main__tabs:hover::after,
.dp-tab:hover::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.12));
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}
.dc-tabs__item--main__tabs:hover,
.dp-tab:hover {
    background: transparent !important;
}
/* active tab: solid white glass with crimson text */
.dc-tabs__active--main__tabs,
.dp-tab.dp-tab--on {
    background: transparent !important;
}
.dc-tabs__active--main__tabs::after,
.dp-tab.dp-tab--on::after,
.dp-tab-replaced.dp-tab--on::after {
    background: linear-gradient(180deg, #ffffff, #fff1f3) !important;
    border-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 0 0 1px rgba(255, 198, 26, 0.55), 0 6px 18px rgba(255, 94, 0, 0.35), 0 0 22px rgba(255, 255, 255, 0.35) !important;
}
.dc-tabs__list--main__tabs .dc-tabs__active--main__tabs,
.dc-tabs__list--main__tabs .dc-tabs__active--main__tabs *,
.dc-tabs__list--main__tabs .dp-tab.dp-tab--on,
.dc-tabs__list--main__tabs .dp-tab.dp-tab--on *,
.dc-tabs__list--main__tabs .dp-tab-replaced.dp-tab--on,
.dc-tabs__list--main__tabs .dp-tab-replaced.dp-tab--on * {
    color: var(--rt-crimson) !important;
}
.dc-tabs__list--main__tabs .dc-tabs__active--main__tabs svg,
.dc-tabs__list--main__tabs .dc-tabs__active--main__tabs svg *,
.dc-tabs__list--main__tabs .dp-tab.dp-tab--on svg,
.dc-tabs__list--main__tabs .dp-tab.dp-tab--on svg *,
.dc-tabs__list--main__tabs .dp-tab-replaced.dp-tab--on svg,
.dc-tabs__list--main__tabs .dp-tab-replaced.dp-tab--on svg * {
    stroke: var(--rt-crimson) !important;
}
.dc-tabs__list--main__tabs .dc-tabs__active--main__tabs svg path[fill]:not([fill='none']),
.dc-tabs__list--main__tabs .dc-tabs__active--main__tabs svg rect[fill]:not([fill='none']) {
    fill: var(--rt-crimson) !important;
    stroke: none !important;
}
/* when one of our own tabs is open, Deriv's active tab looks like a normal tab again */
body.dp-own-tab .dc-tabs__list--main__tabs .dc-tabs__active--main__tabs:not(.dp-tab--on)::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)) !important;
    border-color: rgba(255, 255, 255, 0.32) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}
body.dp-own-tab .dc-tabs__list--main__tabs .dc-tabs__active--main__tabs:not(.dp-tab--on),
body.dp-own-tab .dc-tabs__list--main__tabs .dc-tabs__active--main__tabs:not(.dp-tab--on) * {
    color: #fff !important;
}
body.dp-own-tab .dc-tabs__list--main__tabs .dc-tabs__active--main__tabs:not(.dp-tab--on) svg,
body.dp-own-tab .dc-tabs__list--main__tabs .dc-tabs__active--main__tabs:not(.dp-tab--on) svg * {
    stroke: #fff !important;
}

/* tab icons (drawn by ::before masks): white, crimson on the active tab */
ul.dc-tabs__list--main__tabs > li::before {
    background: #ffffff !important;
    position: relative;
    z-index: 1;
}
ul.dc-tabs__list--main__tabs > li.dc-tabs__active--main__tabs::before,
ul.dc-tabs__list--main__tabs > li.dp-tab--on::before {
    background: var(--rt-crimson) !important;
}
body.dp-own-tab ul.dc-tabs__list--main__tabs > li.dc-tabs__active--main__tabs:not(.dp-tab--on)::before {
    background: #ffffff !important;
}
#dp-tab-proai::before {
    background: #ffe14d !important;
}
#dp-tab-proai.dp-tab--on::before {
    background: var(--rt-crimson) !important;
}
#rt-tab-dtrader {
    order: 6 !important;
    --dp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7l4-4 4 4M7 16l3-3 3 2 4-4'/%3E%3C/svg%3E");
}
/* Rich AI tab gets a soft gold glow */
#dp-tab-proai::after {
    border-color: rgba(255, 198, 26, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 14px rgba(255, 198, 26, 0.45);
    animation: rtTabGlow 2.8s ease-in-out infinite;
}
/* DTrader tab badge */
#rt-tab-dtrader > span::after {
    content: 'NEW';
    margin-left: 6px;
    padding: 2px 5px;
    border-radius: 6px;
    background: #fff;
    color: var(--rt-crimson) !important;
    font: 800 9px/1 Inter, Arial, sans-serif;
    letter-spacing: 0.4px;
    vertical-align: 2px;
}

/* ---------- content: white cards that lift ---------- */
#dp-panel {
    animation: rtIn 0.45s var(--rt-ease) both;
}
.dp-box,
.dp-tile,
.dp-card,
.dpx-card {
    transition: transform 0.3s var(--rt-ease), box-shadow 0.3s var(--rt-ease);
}
@media (hover: hover) {
    .dp-tile:hover,
    .dp-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 30px rgba(224, 17, 63, 0.14), 0 2px 0 rgba(255, 198, 26, 0.6) inset;
    }
}
.dp-tool h2,
.dpx-h {
    background: var(--rt-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
}

/* ---------- Rich AI orb ---------- */
#dp-ai {
    width: 74px !important;
    height: 74px !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 50% 38%, #ff2e5b 0%, #e0113f 45%, #8f0a2c 100%) !important;
    color: #fff !important;
    font-size: 0 !important;
    overflow: visible !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 0 0 6px rgba(255, 198, 26, 0.7), 0 0 26px 6px rgba(255, 94, 0, 0.55), 0 0 60px 10px rgba(224, 17, 63, 0.35) !important;
    animation: rtOrbGlow 2.6s ease-in-out infinite !important;
}
#dp-ai::after {
    content: '' !important;
    position: absolute;
    right: 3px !important;
    top: 3px !important;
    width: 13px !important;
    height: 13px !important;
    border-radius: 50%;
    background: #22c55e !important;
    border: 2px solid #fff !important;
    z-index: 3;
    animation: rtPing 1.8s ease-out infinite;
}
#dp-ai::before {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 198, 26, 0.45) 0%, rgba(255, 94, 0, 0.18) 45%, transparent 70%);
    z-index: -1;
    animation: rtHalo 2.6s ease-in-out infinite;
    pointer-events: none;
}
#dp-ai .rt-orb-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: rtSpin 12s linear infinite;
    pointer-events: none;
}
#dp-ai .rt-orb-ring text {
    font: 900 10.5px/1 Inter, Arial, sans-serif;
    letter-spacing: 1.2px;
    fill: rgba(255, 255, 255, 0.92);
}
#dp-ai .rt-orb-face {
    position: relative;
    z-index: 2;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, #ffffff 0%, #ffe9ee 70%, #ffd2dc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(255, 198, 26, 0.9), 0 0 14px rgba(255, 255, 255, 0.85), inset 0 -3px 6px rgba(224, 17, 63, 0.15);
    pointer-events: none;
}
#dp-ai .rt-orb-face svg {
    width: 40px;
    height: 40px;
    display: block;
}
#dp-ai .rt-eye {
    transform-origin: center;
    transform-box: fill-box;
    animation: rtBlink 4.2s infinite;
}
#dp-ai .rt-bulb {
    animation: rtBulb 1.4s ease-in-out infinite;
}
#dp-ai.dp-ai--drag {
    transform: scale(1.08) !important;
}
#dp-ai-tip {
    background: #fff !important;
    color: var(--rt-ink) !important;
    border: 1px solid rgba(224, 17, 63, 0.25) !important;
    box-shadow: 0 14px 34px rgba(224, 17, 63, 0.25) !important;
}
#dp-ai-tip b {
    color: var(--rt-crimson) !important;
}
body.dp-ai-scanning #dp-ai .rt-orb-ring {
    animation-duration: 2.5s;
}
/* AI Assistant bar is removed */
.dp-aibar {
    display: none !important;
}

/* ---------- landing: vivid with white glass ---------- */
.dpl-top {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 0 !important;
    box-shadow: 0 6px 24px rgba(34, 3, 10, 0.25);
}
.dpl-top::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--rt-grad);
    background-size: 220% 100%;
    animation: rtFlow 6s linear infinite;
}
.dpl-logo .g {
    color: var(--rt-crimson) !important;
}
.dpl-logo .r {
    background: linear-gradient(90deg, #ff5e00, #ffb000);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
}
.dpl-login {
    background: var(--rt-grad) !important;
    background-size: 200% 100% !important;
    color: #fff !important;
    animation: rtFlow 5s linear infinite;
    box-shadow: 0 6px 18px rgba(224, 17, 63, 0.35);
}
.dpl-bg {
    background: radial-gradient(60% 40% at 15% 20%, rgba(255, 122, 0, 0.32), transparent 70%), radial-gradient(50% 35% at 85% 30%, rgba(255, 198, 26, 0.26), transparent 70%),
        radial-gradient(70% 50% at 50% 100%, rgba(255, 22, 84, 0.3), transparent 70%), linear-gradient(180deg, #6a0620 0%, #3a0414 55%, #22030a 100%) !important;
}
.dpl-slide {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 16px 40px rgba(0, 0, 0, 0.25);
}
.dpl-signup {
    background: #fff !important;
    color: var(--rt-crimson) !important;
    border-color: #fff !important;
}
.dpl-start {
    background-size: 200% 100% !important;
    animation: rtFlow 5s linear infinite;
}

/* =====================================================================
   DTrader tab
   ===================================================================== */
#dp-panel.rtd-panel {
    background: var(--rt-grad-soft);
}
.rtd {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
    padding: 14px;
    max-width: 1320px;
    margin: 0 auto;
    font-family: Inter, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--rt-ink);
}
.rtd-main,
.rtd-side {
    background: #fff;
    border: 1px solid rgba(224, 17, 63, 0.12);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(224, 17, 63, 0.08), inset 0 1px 0 #fff;
    min-width: 0;
}
.rtd-main {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rtd-top {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.rtd-mk {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 6px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fff, #fff3f5);
    border: 1px solid rgba(224, 17, 63, 0.18);
    min-width: 0;
}
.rtd-mk-ico {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    flex: none;
    background: var(--rt-grad);
    box-shadow: 0 4px 10px rgba(224, 17, 63, 0.3);
    -webkit-mask: none;
    position: relative;
}
.rtd-mk-ico::after {
    content: '';
    position: absolute;
    inset: 7px 6px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: skewY(-25deg);
}
.rtd-mk select {
    border: 0;
    background: transparent;
    font: 700 15px Inter, Arial, sans-serif;
    color: var(--rt-ink);
    max-width: 230px;
    outline: none;
    cursor: pointer;
}
.rtd-spot b {
    font: 800 22px/1 Inter, Arial, sans-serif;
    color: var(--rt-ink);
    font-variant-numeric: tabular-nums;
}
.rtd-spot small {
    display: block;
    font: 700 12px/1.4 Inter, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}
.rtd-spot small.up {
    color: #16a34a;
}
.rtd-spot small.down {
    color: #e0113f;
}
.rtd-live {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: 800 11px Inter, Arial, sans-serif;
    letter-spacing: 1px;
    color: var(--rt-crimson);
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(224, 17, 63, 0.08);
}
.rtd-live i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rt-crimson);
    animation: rtPing 1.6s ease-out infinite;
}
.rtd-chart {
    position: relative;
    height: 340px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fff 0%, #fff8f5 100%);
    border: 1px solid rgba(255, 94, 0, 0.12);
    overflow: hidden;
}
.rtd-chart canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.rtd-wm {
    position: absolute;
    left: 14px;
    bottom: 8px;
    font: 800 11px Inter, Arial, sans-serif;
    letter-spacing: 1px;
    color: rgba(224, 17, 63, 0.18);
    text-transform: uppercase;
    pointer-events: none;
}
.rtd-digits {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}
.rtd-digits::-webkit-scrollbar {
    display: none;
}
.rtd-digits i {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font: 800 13px Inter, Arial, sans-serif;
    font-style: normal;
    background: #fff;
    border: 1.5px solid rgba(224, 17, 63, 0.25);
    color: var(--rt-crimson);
}
.rtd-digits i.odd {
    border-color: rgba(255, 94, 0, 0.4);
    color: var(--rt-orange);
}
.rtd-digits i.cur {
    background: var(--rt-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(224, 17, 63, 0.35);
    animation: rtPop 0.35s var(--rt-ease);
}
.rtd-pos {
    border-top: 1px solid rgba(224, 17, 63, 0.1);
    padding-top: 8px;
}
.rtd-ptabs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}
.rtd-ptabs button {
    border: 1px solid rgba(224, 17, 63, 0.2);
    background: #fff;
    color: var(--rt-ink);
    border-radius: 999px;
    padding: 6px 12px;
    font: 700 13px Inter, Arial, sans-serif;
    cursor: pointer;
}
.rtd-ptabs button i {
    font-style: normal;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(224, 17, 63, 0.1);
    font-size: 11px;
}
.rtd-ptabs button.on {
    background: var(--rt-grad);
    color: #fff;
    border-color: transparent;
}
.rtd-ptabs button.on i {
    background: rgba(255, 255, 255, 0.25);
}
.rtd-ptot {
    margin-left: auto;
    font: 800 13px Inter, Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}
.rtd-empty {
    padding: 18px;
    text-align: center;
    color: #8a6170;
    font-size: 13px;
    border: 1px dashed rgba(224, 17, 63, 0.2);
    border-radius: 12px;
}
.rtd-prow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(224, 17, 63, 0.08);
    margin-bottom: 6px;
    animation: rtIn 0.35s var(--rt-ease) both;
}
.rtd-prow.is-open {
    border-color: rgba(255, 176, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.1);
}
.rtd-pdot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex: none;
    background: #16a34a;
}
.rtd-pdot.down {
    background: var(--rt-crimson);
}
.rtd-pmain {
    flex: 1;
    min-width: 0;
}
.rtd-pmain b,
.rtd-pres b {
    display: block;
    font: 700 13px/1.3 Inter, Arial, sans-serif;
}
.rtd-pmain small,
.rtd-pres small {
    display: block;
    color: #8a6170;
    font-size: 11.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rtd-pres {
    text-align: right;
    font-variant-numeric: tabular-nums;
    max-width: 45%;
}
.win {
    color: #16a34a !important;
}
.loss {
    color: var(--rt-crimson) !important;
}
.rtd-sell {
    border: 0;
    border-radius: 10px;
    padding: 7px 11px;
    background: var(--rt-ink);
    color: #fff;
    font: 800 12px Inter, Arial, sans-serif;
    cursor: pointer;
    white-space: nowrap;
}
.rtd-sell:hover {
    background: var(--rt-crimson);
}
.rtd-side {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
    position: sticky;
    top: 8px;
}
.rtd-sec[hidden],
.rtd-side [hidden] {
    display: none !important;
}
.rtd-sec > label {
    display: block;
    font: 800 11px Inter, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #8a6170;
    margin-bottom: 6px;
}
.rtd-sec > label small {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}
.rtd-grp {
    margin-bottom: 6px;
}
.rtd-grp > small {
    display: block;
    font: 700 10.5px Inter, Arial, sans-serif;
    color: var(--rt-orange);
    margin: 2px 0 4px;
}
.rtd-grp > div,
.rtd-chips,
.rtd-units {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rtd-types button,
.rtd-chips button,
.rtd-units button,
.rtd-dg button {
    border: 1px solid rgba(224, 17, 63, 0.18);
    background: #fff;
    color: var(--rt-ink);
    border-radius: 10px;
    padding: 7px 10px;
    font: 700 12.5px Inter, Arial, sans-serif;
    cursor: pointer;
}
.rtd-types button:hover,
.rtd-chips button:hover,
.rtd-units button:hover,
.rtd-dg button:hover {
    border-color: var(--rt-orange);
    transform: translateY(-1px);
}
.rtd-types button.on,
.rtd-chips button.on,
.rtd-units button.on,
.rtd-dg button.on {
    background: var(--rt-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 14px rgba(224, 17, 63, 0.28);
}
.rtd-units {
    margin-bottom: 6px;
}
.rtd-chips {
    margin-top: 6px;
}
.rtd-dg {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.rtd-dg button {
    padding: 8px 0;
}
.rtd-dur {
    display: flex;
    align-items: stretch;
    border: 1px solid rgba(224, 17, 63, 0.2);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.rtd-dur button {
    width: 42px;
    border: 0;
    background: #fff3f5;
    color: var(--rt-crimson);
    font: 800 18px Inter, Arial, sans-serif;
    cursor: pointer;
}
.rtd-dur button:hover {
    background: #ffe3e9;
}
.rtd-dur input,
.rtd-sec input[type='text'],
.rtd-lim input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 10px;
    font: 700 15px Inter, Arial, sans-serif;
    color: var(--rt-ink);
    text-align: center;
    background: #fff;
    outline: none;
}
.rtd-sec input[type='text'],
.rtd-lim input {
    width: 100%;
    border: 1px solid rgba(224, 17, 63, 0.2);
    border-radius: 12px;
    box-sizing: border-box;
}
.rtd-lim {
    display: flex;
    gap: 6px;
}
.rtd-note {
    font-size: 12px;
    color: #8a6170;
    margin: 6px 0 0;
    line-height: 1.4;
}
.rtd-buys {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rtd-buy {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    border-radius: 14px;
    padding: 13px 14px;
    color: #fff;
    cursor: pointer;
    font-family: Inter, Arial, sans-serif;
    box-shadow: 0 10px 22px rgba(22, 163, 74, 0.28);
    background: linear-gradient(135deg, #16a34a, #22c55e);
}
.rtd-buy.down {
    background: linear-gradient(135deg, #e0113f, #ff1654 60%, #ff5e00);
    box-shadow: 0 10px 22px rgba(224, 17, 63, 0.32);
}
.rtd-buy::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    left: -60%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: skewX(-20deg);
    animation: rtShine 3.6s ease-in-out infinite;
}
.rtd-buy:hover {
    transform: translateY(-2px);
}
.rtd-buy:active {
    transform: scale(0.98);
}
.rtd-buy:disabled {
    opacity: 0.65;
}
.rtd-buy .l {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rtd-buy .l b {
    font-size: 16px;
    font-weight: 800;
}
.rtd-arrow {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    position: relative;
}
.rtd-arrow::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-left: 2.5px solid #fff;
    border-top: 2.5px solid #fff;
    transform: rotate(45deg);
}
.rtd-buy.down .rtd-arrow::after {
    top: 5px;
    transform: rotate(225deg);
}
.rtd-buy .r {
    text-align: right;
}
.rtd-buy .r small {
    display: block;
    font-size: 11px;
    opacity: 0.9;
}
.rtd-buy .r b {
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.rtd-err {
    color: var(--rt-crimson);
    font-size: 12.5px;
    min-height: 1em;
}
.rtd-acct {
    font-size: 12px;
    color: #8a6170;
}

/* ---------- phones & tablets ---------- */
@media (max-width: 1024px) {
    .rtd {
        grid-template-columns: minmax(0, 1fr) 290px;
    }
}
@media (max-width: 767px) {
    .rtd {
        grid-template-columns: 1fr;
        padding: 8px;
        gap: 8px;
    }
    .rtd-main,
    .rtd-side {
        border-radius: 14px;
    }
    .rtd-side {
        position: static;
    }
    .rtd-chart {
        height: 220px;
    }
    .rtd-mk select {
        max-width: 160px;
        font-size: 14px;
    }
    .rtd-spot b {
        font-size: 18px;
    }
    .rtd-dur input,
    .rtd-sec input[type='text'],
    .rtd-lim input,
    .rtd-mk select {
        font-size: 16px; /* no zoom on focus */
    }
    .rtd-types button,
    .rtd-chips button,
    .rtd-units button {
        padding: 8px 10px;
    }
    /* trade types as one compact row of chips on phones */
    .rtd-types {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .rtd-grp,
    .rtd-grp > div {
        display: contents;
    }
    .rtd-grp > small {
        display: none;
    }
    /* buy buttons stay in reach at the bottom of the trade card */
    .rtd-buys {
        flex-direction: row;
    }
    .rtd-buy {
        flex: 1;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 11px 12px;
    }
    .rtd-buy .r {
        text-align: left;
    }
    .dc-tabs__item--main__tabs::after,
    .dp-tab::after {
        inset: 5px 2px;
        border-radius: 12px;
        -webkit-backdrop-filter: none;
        backdrop-filter: none; /* blur is costly on phones; the glass look stays via gradients */
    }
    #dp-ai {
        width: 58px !important;
        height: 58px !important;
        animation: rtOrbGlowLite 2.6s ease-in-out infinite !important;
    }
    #dp-ai .rt-orb-face {
        width: 36px;
        height: 36px;
    }
    #dp-ai .rt-orb-face svg {
        width: 32px;
        height: 32px;
    }
    #dp-ai .rt-orb-ring text {
        font-size: 11.5px;
    }
    #dp-ai::after,
    #dp-ai::before {
        animation: rtHalo 2.6s ease-in-out infinite !important;
    }
    #dp-ai::after {
        width: 11px !important;
        height: 11px !important;
        animation: none !important;
    }
    .dc-tabs--main__tabs .dc-tabs__list--main__tabs,
    .dc-tabs__list--header--main__tabs,
    .dp-tabhost {
        animation: none;
    }
    #rt-tab-dtrader > span::after {
        display: none;
    }
    .dpl-slide {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }
}
@media (max-width: 380px) {
    .rtd-dg {
        grid-template-columns: repeat(5, 1fr);
        gap: 4px;
    }
    .rtd-buy .l b {
        font-size: 14px;
    }
}

/* ---------- motion ---------- */
@keyframes rtFlow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}
@keyframes rtIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes rtPop {
    0% {
        transform: scale(0.6);
    }
    70% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}
@keyframes rtSpin {
    to {
        transform: rotate(360deg);
    }
}
@keyframes rtPing {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
}
@keyframes rtHalo {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(0.94);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}
@keyframes rtOrbGlow {
    0%,
    100% {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 0 0 6px rgba(255, 198, 26, 0.7), 0 0 22px 4px rgba(255, 94, 0, 0.5), 0 0 48px 8px rgba(224, 17, 63, 0.3);
    }
    50% {
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 1), 0 0 0 7px rgba(255, 198, 26, 0.95), 0 0 34px 10px rgba(255, 94, 0, 0.7), 0 0 72px 16px rgba(224, 17, 63, 0.45);
    }
}
@keyframes rtOrbGlowLite {
    0%,
    100% {
        box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgba(255, 198, 26, 0.75), 0 0 18px 3px rgba(255, 94, 0, 0.45);
    }
    50% {
        box-shadow: 0 0 0 2px #fff, 0 0 0 6px rgba(255, 198, 26, 0.95), 0 0 28px 8px rgba(255, 94, 0, 0.65);
    }
}
@keyframes rtTabGlow {
    0%,
    100% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 8px rgba(255, 198, 26, 0.3);
    }
    50% {
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 0 18px rgba(255, 198, 26, 0.75);
    }
}
@keyframes rtBlink {
    0%,
    92%,
    100% {
        transform: scaleY(1);
    }
    95% {
        transform: scaleY(0.1);
    }
}
@keyframes rtBulb {
    0%,
    100% {
        fill: #ff7a00;
    }
    50% {
        fill: #ffe100;
    }
}
@keyframes rtShine {
    0%,
    60% {
        left: -60%;
    }
    100% {
        left: 130%;
    }
}
@media (prefers-reduced-motion: reduce) {
    #dp-ai,
    #dp-ai *,
    #dp-ai::before,
    #dp-ai::after,
    .app-header::after,
    .dpl-top::after,
    .rtd-buy::after {
        animation: none !important;
    }
}
