/* Local overrides and features not yet on production style.css */

.app-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.platform-maintenance-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: rgba(245, 158, 11, 0.14);
    border-bottom: 1px solid rgba(245, 158, 11, 0.28);
    color: var(--text-primary, #f3f4f6);
    font-size: 0.8125rem;
    font-weight: 500;
}

.trade-topbar-balance {
    cursor: pointer;
    color: inherit;
    font: inherit;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.trade-topbar-balance:hover,
.trade-topbar-account--open .trade-topbar-balance {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
}

.trade-topbar-balance__caret {
    font-size: 0.55rem;
    opacity: 0.65;
    margin-left: 0.1rem;
    transition: transform 0.15s ease;
}

.trade-topbar-account--open .trade-topbar-balance__caret {
    transform: rotate(180deg);
}

.trade-topbar-balance__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
    min-width: 0;
}

.trade-topbar-balance__label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
    line-height: 1.1;
    white-space: nowrap;
}

.trade-topbar-account {
    position: relative;
}

.trade-topbar-account-menu {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    width: min(17rem, calc(100vw - 1.25rem));
    padding: 0.5rem;
    border-radius: 0.9rem;
    background: var(--app-surface, #1f2937);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
    z-index: 120;
}

.trade-topbar-account-menu__title {
    margin: 0.15rem 0.4rem 0.5rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
}

.trade-topbar-account-option {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.6rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    background: transparent;
    color: var(--text-primary, #fff);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.trade-topbar-account-option + .trade-topbar-account-option {
    margin-top: 0.3rem;
}

.trade-topbar-account-option:hover,
.trade-topbar-account-option:focus-visible {
    background: rgba(255, 255, 255, 0.05);
}

.trade-topbar-account-option--active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(96, 165, 250, 0.4);
}

.trade-topbar-account-option__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    font-weight: 800;
}

.trade-topbar-account-option__body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.trade-topbar-account-option__label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    line-height: 1.15;
}

.trade-topbar-account-option__amount {
    font-size: 0.72rem;
    color: var(--text-muted, #9ca3af);
    font-variant-numeric: tabular-nums;
}

.trade-topbar-account-option__status {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #34d399;
    background: rgba(52, 211, 153, 0.14);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.trade-topbar-account-option__status[hidden] {
    display: none;
}

.trade-topbar-account-reset {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    margin-top: 0.45rem;
    padding: 0.55rem 0.65rem 0.2rem;
    border: none;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 0;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: color 0.15s ease;
}

.trade-topbar-account-reset:hover,
.trade-topbar-account-reset:focus-visible {
    color: var(--text-primary, #f3f4f6);
}

.trade-topbar-account-reset__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 0.5rem;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.75rem;
}

/* On mobile the switcher sits mid-header, so anchoring the menu to its
   trigger pushes the card off the left edge. Pin it to the viewport's
   top-right instead so it always stays fully on screen. */
@media (max-width: 1023px) {
    .trade-topbar-account-menu {
        position: fixed;
        top: calc(3.4rem + env(safe-area-inset-top, 0px));
        right: calc(0.8rem + env(safe-area-inset-right, 0px));
        left: auto;
        width: min(15rem, calc(100vw - 1.6rem - env(safe-area-inset-right, 0px)));
        padding: 0.4rem;
        z-index: 200;
    }

    .trade-topbar-account-menu__title {
        margin: 0.1rem 0.35rem 0.35rem;
    }

    .trade-topbar-account-option {
        gap: 0.55rem;
        padding: 0.5rem 0.55rem;
    }

    .trade-topbar-account-option__badge {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 0.78rem;
    }

    .trade-topbar-account-option__label {
        font-size: 0.76rem;
    }

    .trade-topbar-account-option__amount {
        font-size: 0.7rem;
    }
}

.trade-topbar-menu {
    position: relative;
}

/* Desktop header: unified nav pills + tools */
@media (min-width: 1024px) {
    .app-topbar--trade {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.75rem;
        padding: 0.55rem 1rem;
    }

    .app-topbar--trade .app-topbar-logo {
        margin-right: 0.15rem;
    }

    .trade-topbar-nav {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex: 1 1 auto;
        min-width: 0;
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .trade-topbar-nav::-webkit-scrollbar {
        display: none;
    }

    .trade-topbar-nav__link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        height: 2.05rem;
        padding: 0 0.85rem;
        border: 1px solid transparent;
        border-radius: 999px;
        background: transparent;
        color: var(--text-muted, #9ca3af);
        font-size: 0.8125rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        line-height: 1;
        white-space: nowrap;
        text-decoration: none;
        transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    }

    .trade-topbar-nav__link i {
        font-size: 0.78rem;
        opacity: 0.85;
        flex-shrink: 0;
    }

    .trade-topbar-nav__link:hover {
        color: var(--text-primary, #f3f4f6);
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .trade-topbar-nav__link--active {
        color: var(--primary, #00df9a);
        background: rgba(0, 223, 154, 0.1);
        border-color: rgba(0, 223, 154, 0.28);
    }

    .trade-topbar-nav__link--active i {
        opacity: 1;
        color: var(--primary, #00df9a);
    }

    .trade-topbar-actions {
        flex-wrap: nowrap;
        gap: 0.45rem;
        margin-left: 0;
        flex-shrink: 0;
    }
}

.trade-topbar-icon-btn,
.trade-topbar-profile-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
}

.trade-topbar-tools {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.trade-topbar-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 2rem;
    min-width: 2rem;
    padding: 0 0.72rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #9ca3af);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.trade-topbar-tool-btn i {
    font-size: 0.78rem;
    flex-shrink: 0;
}

.trade-topbar-tool-btn__label {
    display: inline;
}

.trade-topbar-tool-btn:hover,
.trade-topbar-tool-btn:focus-visible {
    color: var(--text-primary, #f3f4f6);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
}

.trade-topbar-tool-btn--ai {
    color: var(--text-primary, #e5e7eb);
}

.trade-topbar-tool-btn--ai i {
    color: #93c5fd;
}

.trade-topbar-tool-btn--ai:hover,
.trade-topbar-tool-btn--ai:focus-visible {
    color: var(--text-primary, #f3f4f6);
}

.trade-topbar-tool-btn--ai:hover i,
.trade-topbar-tool-btn--ai:focus-visible i {
    color: #bfdbfe;
}

.trade-topbar-tool-btn--sound {
    color: var(--text-primary, #e5e7eb);
}

.trade-topbar-tool-btn--sound i {
    color: #6ee7b7;
}

.trade-topbar-tool-btn--sound[aria-pressed="false"] {
    opacity: 0.72;
    color: var(--text-muted, #9ca3af);
}

.trade-topbar-tool-btn--sound[aria-pressed="false"] i {
    color: var(--text-muted, #9ca3af);
}

.trade-topbar-tool-btn--sound[aria-pressed="false"]:hover,
.trade-topbar-tool-btn--sound[aria-pressed="false"]:focus-visible {
    color: var(--text-primary, #e5e7eb);
}

.trade-topbar-tool-btn--sound[aria-pressed="false"]:hover i,
.trade-topbar-tool-btn--sound[aria-pressed="false"]:focus-visible i {
    color: #94a3b8;
}

@media (min-width: 1024px) {
    .trade-topbar-tools {
        gap: 0.4rem;
        padding-left: 0.15rem;
        margin-left: 0.1rem;
        border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
        border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
        padding-right: 0.15rem;
        margin-right: 0.1rem;
    }

    .trade-topbar-tool-btn {
        height: 2.05rem;
        padding: 0 0.85rem;
        font-size: 0.8125rem;
    }

    .trade-topbar-tool-btn i {
        font-size: 0.82rem;
    }
}

@media (max-width: 1023px) {
    .trade-topbar-tool-btn--sound .trade-topbar-tool-btn__label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .trade-topbar-tool-btn--sound {
        display: none !important;
    }

    .trade-topbar-tool-btn--ai {
        width: auto;
        min-width: 2.35rem;
        padding: 0 0.55rem;
    }
}

.trade-topbar-icon-btn__badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

.trade-topbar-icon-btn__badge[hidden] {
    display: none;
}

.trade-topbar-profile-btn__avatar,
.trade-topbar-profile-head__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: rgba(0, 223, 154, 0.12);
    border: 1px solid rgba(0, 223, 154, 0.22);
    color: #6ee7b7;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.trade-topbar-profile-btn__avatar--emoji,
.trade-topbar-profile-head__avatar--emoji {
    font-weight: 400;
    line-height: 1;
    user-select: none;
}

.trade-topbar-profile-btn__avatar--emoji {
    font-size: 1rem;
}

.trade-topbar-profile-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.trade-topbar-profile-head__avatar--emoji {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.45rem;
    background: rgba(0, 223, 154, 0.1);
    border-color: rgba(0, 223, 154, 0.25);
}

.trade-topbar-profile-head__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.trade-topbar-profile-head__body strong {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trade-topbar-profile-head__body span {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trade-topbar-dropdown {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    width: min(22rem, calc(100vw - 1.5rem));
    border-radius: 0.85rem;
    background: var(--app-surface, #ffffff);
    border: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    z-index: 130;
    overflow: hidden;
}

.trade-topbar-dropdown.hidden {
    display: none;
}

.trade-topbar-dropdown__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.trade-topbar-notify-list {
    max-height: 22rem;
    overflow: auto;
}

.trade-topbar-notify-empty {
    padding: 2rem 1rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted, #94a3b8);
}

.trade-topbar-notify-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.06));
    transition: background 0.15s ease;
}

.trade-topbar-notify-item:hover {
    background: rgba(148, 163, 184, 0.06);
}

.trade-topbar-notify-item--unread {
    background: rgba(59, 130, 246, 0.07);
}

.trade-topbar-notify-item__content {
    flex: 1 1 auto;
    min-width: 0;
}

.trade-topbar-notify-item__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.trade-topbar-notify-item__title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary, #f3f4f6);
}

.trade-topbar-notify-item__amount {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: #22c55e;
    font-variant-numeric: tabular-nums;
}

.trade-topbar-notify-item__body {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted, #94a3b8);
}

.trade-topbar-notify-item__time {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.6875rem;
    color: var(--text-muted, #64748b);
}

.trade-topbar-notify-item__icon {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-muted, #94a3b8);
}

.trade-topbar-notify-item__icon--deposit {
    background: rgba(34, 197, 94, 0.14);
    color: #4ade80;
}

.trade-topbar-notify-item__icon--withdrawal {
    background: rgba(59, 130, 246, 0.14);
    color: #60a5fa;
}

.trade-topbar-notify-item__icon--trade {
    background: rgba(168, 85, 247, 0.14);
    color: #c084fc;
}

.trade-topbar-notify-item__icon--auto,
.trade-topbar-notify-item__icon--welcome {
    background: rgba(234, 179, 8, 0.14);
    color: #facc15;
}

.trade-topbar-notify-item__dot {
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    margin-top: 0.35rem;
    border-radius: 999px;
    background: #3b82f6;
}

.trade-topbar-notify-item__dot[hidden] {
    display: none;
}

/* ------------------------------------------------------------------ */
/* App toast notifications (deposit, withdraw, trade feedback)       */
/* ------------------------------------------------------------------ */
.app-toast-stack {
    position: fixed;
    top: calc(3.6rem + env(safe-area-inset-top, 0px));
    right: calc(0.75rem + env(safe-area-inset-right, 0px));
    z-index: 250;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: min(22rem, calc(100vw - 1.5rem - env(safe-area-inset-right, 0px)));
    pointer-events: none;
}

.app-toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem 0.7rem 0.7rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(17, 24, 39, 0.94);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(1.1rem);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.app-toast--leaving {
    opacity: 0;
    transform: translateX(1.1rem);
}

.app-toast__icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.app-toast__body {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 0.25rem;
}

.app-toast__label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.app-toast__message {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #e5e7eb;
}

.app-toast__close {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.app-toast__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
}

.app-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    transform-origin: left center;
    animation-name: appToastProgress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.app-toast__progress--paused {
    animation-play-state: paused;
}

@keyframes appToastProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.app-toast--success {
    border-color: rgba(34, 197, 94, 0.28);
}
.app-toast--success .app-toast__icon {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}
.app-toast--success .app-toast__label { color: #4ade80; }
.app-toast--success .app-toast__progress { background: #22c55e; }

.app-toast--error {
    border-color: rgba(239, 68, 68, 0.28);
}
.app-toast--error .app-toast__icon {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
}
.app-toast--error .app-toast__label { color: #f87171; }
.app-toast--error .app-toast__progress { background: #ef4444; }

.app-toast--warning {
    border-color: rgba(234, 179, 8, 0.28);
}
.app-toast--warning .app-toast__icon {
    background: rgba(234, 179, 8, 0.16);
    color: #facc15;
}
.app-toast--warning .app-toast__label { color: #facc15; }
.app-toast--warning .app-toast__progress { background: #eab308; }

.app-toast--info {
    border-color: rgba(59, 130, 246, 0.28);
}
.app-toast--info .app-toast__icon {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
}
.app-toast--info .app-toast__label { color: #60a5fa; }
.app-toast--info .app-toast__progress { background: #3b82f6; }

.light-theme .app-toast {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.light-theme .app-toast__message {
    color: #1f2937;
}

.light-theme .app-toast__close {
    color: #64748b;
}

.light-theme .app-toast__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #111827;
}

@media (max-width: 1023px) {
    .app-toast-stack {
        top: calc(3.2rem + env(safe-area-inset-top, 0px));
        right: calc(0.5rem + env(safe-area-inset-right, 0px));
        width: min(20rem, calc(100vw - 1rem - env(safe-area-inset-right, 0px)));
    }
}

.trade-topbar-dropdown__foot {
    display: block;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.trade-topbar-profile-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 0;
    background: transparent;
    font-size: 0.8125rem;
    font-family: inherit;
    color: var(--text-primary, #111827);
    text-decoration: none;
    text-align: left;
    cursor: pointer;
}

.trade-topbar-profile-link--active {
    background: rgba(0, 223, 154, 0.08);
    color: var(--primary, #00df9a);
}

.trade-topbar-profile-link--active i {
    color: var(--primary, #00df9a);
}

.trade-topbar-profile-link:hover,
.trade-topbar-profile-link:focus-visible {
    background: rgba(255, 255, 255, 0.04);
}

.trade-topbar-profile-nav {
    display: none;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
}

.trade-topbar-profile-actions {
    display: flex;
    flex-direction: column;
}

.trade-topbar-profile-link--deposit {
    color: var(--primary, #00df9a);
    font-weight: 600;
}

.trade-topbar-profile-link--deposit i {
    color: var(--primary, #00df9a);
}

.trade-topbar-profile-link--logout {
    border-top: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
    color: #dc2626;
}

.trade-topbar-profile-link--logout:hover,
.trade-topbar-profile-link--logout:focus-visible {
    background: rgba(220, 38, 38, 0.06);
}

.trade-topbar-profile-accounts {
    display: none;
}

.trade-topbar-profile-accounts__label {
    margin: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
}

.trade-topbar-profile-accounts__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.trade-topbar-profile-account-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
    min-height: 4.75rem;
    padding: 0.65rem 0.7rem;
    border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary, #f3f4f6);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.trade-topbar-profile-account-card__top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.trade-topbar-profile-account-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
}

.trade-topbar-profile-account-card__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
}

.trade-topbar-profile-account-card__balance {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.trade-topbar-profile-account-card__status {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary, #00df9a);
}

.trade-topbar-profile-account-card__status[hidden] {
    display: none;
}

.trade-topbar-profile-account-card--demo.trade-topbar-account-option--active {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.trade-topbar-profile-account-card--demo.trade-topbar-account-option--active .trade-topbar-profile-account-card__name {
    color: #fca5a5;
}

.trade-topbar-profile-account-card--real.trade-topbar-account-option--active {
    border-color: rgba(34, 197, 94, 0.55);
    background: rgba(34, 197, 94, 0.1);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.trade-topbar-profile-account-card--real.trade-topbar-account-option--active .trade-topbar-profile-account-card__name {
    color: #86efac;
}

.trade-topbar-profile-account-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.55rem;
    padding: 0.55rem 0.65rem;
    border: 1px dashed var(--border-color, rgba(255, 255, 255, 0.14));
    border-radius: 0.55rem;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.trade-topbar-profile-account-reset:hover,
.trade-topbar-profile-account-reset:focus-visible {
    color: var(--text-primary, #f3f4f6);
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.trade-topbar-profile-account-reset[hidden] {
    display: none;
}

@media (max-width: 1023px) {
    .app-shell--topnav .app-topbar-menu,
    .app-shell--topnav .trade-topbar-icon-btn,
    .app-shell--topnav .trade-topbar-profile-btn {
        display: inline-flex;
    }

    .app-shell--topnav #mobile-menu-btn {
        display: none;
    }

    /* Pin header dropdowns (notifications + profile) to the viewport's
       top-right so the card never spills past the left edge on mobile. */
    .trade-topbar-dropdown {
        position: fixed;
        top: calc(3.4rem + env(safe-area-inset-top, 0px));
        right: calc(0.8rem + env(safe-area-inset-right, 0px));
        left: auto;
        width: min(15rem, calc(100vw - 1.6rem - env(safe-area-inset-right, 0px)));
        z-index: 200;
    }

    .trade-topbar-dropdown--profile {
        width: min(15rem, calc(100vw - 1.6rem - env(safe-area-inset-right, 0px)));
    }

    .trade-topbar-profile-accounts {
        display: block;
        padding: 0.75rem 0.85rem 0.85rem;
        border-bottom: 1px solid var(--border-color, rgba(15, 23, 42, 0.08));
    }

    .app-shell--topnav .trade-topbar-account {
        display: inline-flex;
    }

    .app-shell--topnav #topbarDepositBtn {
        display: inline-flex;
    }
}

.binary-segment-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    padding: 0.25rem;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.binary-segment-card--contracts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
    padding: 0.2rem;
}

/* Contract pills sit above the chart on mobile, but inside the trade panel
   ("the bot") on desktop. */
.binary-contract-bar {
    padding: 0.55rem 0.65rem 0.4rem;
}

@media (min-width: 1024px) {
    .binary-contract-bar {
        display: none;
    }
}

@media (max-width: 1023px) {
    .binary-trade-panel .binary-segment-card--contracts {
        display: none;
    }

    /* Contracts live above the chart on mobile, so collapse the panel's
       contract/barrier section unless the digit picker is showing. */
    .binary-trade-panel__section:has(.binary-segment-card--contracts):has(#binaryBarrierWrap.hidden) {
        padding: 0;
    }
}

.binary-contract-bar .binary-segment-card--contracts {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.binary-contract-bar .binary-segment-card--contracts::-webkit-scrollbar {
    display: none;
}

.binary-contract-bar .binary-contract-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    padding: 0.45rem 1.05rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 0.5rem;
    border: 1px solid rgba(96, 165, 250, 0.4);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted, #9ca3af);
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.binary-contract-bar .binary-contract-tab--active {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.16);
    border-color: #60a5fa;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.5);
}

/* Contract pills moved out of the panel: collapse the leftover section
   so it only takes space when the barrier digit picker is visible */
.binary-trade-panel__section--barrier-only {
    padding: 0;
}

.binary-trade-panel__section--barrier-only #binaryBarrierWrap:not(.hidden) {
    margin-top: 0.5rem;
}

.binary-barrier-digits {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 0.25rem;
}

.binary-barrier-digit {
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted, #9ca3af);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0;
    cursor: pointer;
}

.binary-barrier-digit--active {
    border-color: #60a5fa;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.14);
}

.binary-field__input-wrap--multiplier {
    display: flex;
    align-items: center;
}

.binary-field__input-prefix {
    padding-left: 0.55rem;
    color: var(--text-muted, #9ca3af);
    font-weight: 700;
}

.binary-field__input--prefixed {
    padding-left: 0.25rem;
}

.binary-segment-card .binary-contract-tab {
    padding: 0.3rem 0.2rem;
    font-size: 0.625rem;
    line-height: 1.2;
    border-radius: 0.4rem;
}

/* Contract type pills (Even/Odd, Over/Under, etc.) use the same small
   radius as the quick-option chips */
.binary-segment-card--contracts .binary-contract-tab {
    border-radius: 0.5rem;
}

.binary-trade-btns {
    gap: 0.4rem;
}

.binary-trade-btn {
    min-height: 3.1rem;
    padding: 0.5rem 0.35rem;
    border-radius: 0.5rem;
    gap: 0.08rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.binary-trade-btn__label {
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.binary-trade-btn__amount {
    font-size: 0.6875rem;
    font-weight: 600;
}

.binary-trade-btn__pct {
    font-size: 0.5625rem;
    opacity: 0.8;
}

@media (min-width: 1024px) {
    .binary-trade-btns {
        min-height: 0;
    }
}

.binary-contract-tab--auto-active {
    background: rgba(249, 115, 22, 0.18);
    border-color: rgba(249, 115, 22, 0.45);
    color: #fdba74;
}

.binary-stake-presets {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.3rem;
}

.binary-stake-preset {
    padding: 0.32rem 0.15rem;
    font-size: 0.66rem;
    text-align: center;
}

/* Session P/L card (replaces the payout line) */
.binary-pl-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.binary-pl-card__stats {
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-secondary, #cbd5e1);
}

.binary-pl-card__amount {
    font-family: ui-monospace, monospace;
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
}

.binary-pl-card__amount--up {
    color: #4ade80;
}

.binary-pl-card__amount--down {
    color: #f87171;
}

.binary-trade-btn--stop {
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%) !important;
    box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.55);
}

.binary-trade-btn--auto-backdrop {
    opacity: 0.35;
    filter: blur(0.5px);
    pointer-events: none;
}

.binary-trade-btn--selected {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.55);
}

.binary-positions__headline {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.binary-positions__instrument-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.06);
}

.binary-positions__amount-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.binary-positions__balance {
    font-size: 0.625rem;
    color: var(--text-muted, #9ca3af);
    font-family: ui-monospace, monospace;
}

.binary-positions__direction {
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
    margin-top: 0.15rem;
}

.binary-closed-card {
    padding: 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: rgba(255, 255, 255, 0.02);
}

.binary-closed-card__head {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-bottom: 0.55rem;
}

.binary-closed-card__title-block {
    flex: 1;
    min-width: 0;
}

.binary-closed-card__title {
    display: block;
    font-size: 0.8125rem;
}

.binary-closed-card__subtitle {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
}

.binary-closed-card__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.binary-closed-card__stat-label {
    display: block;
    font-size: 0.625rem;
    color: var(--text-muted, #9ca3af);
}

.binary-closed-card__stat-value {
    font-size: 0.75rem;
    font-family: ui-monospace, monospace;
}

.line-chart-panel__btn--ai {
    color: #93c5fd;
}

/* —— Deposit modal —— */
.app-dialog--deposit {
    max-width: 28rem;
}

.app-dialog--deposit > .deposit-step {
    display: none;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.app-dialog--deposit > .deposit-step.deposit-step--active {
    display: flex;
}

.app-dialog--deposit > .deposit-step[hidden] {
    display: none !important;
}

.app-dialog--deposit > form.deposit-step.deposit-step--active {
    display: flex;
}

.app-dialog__header--with-subtitle {
    align-items: flex-start;
}

.app-dialog__header-text {
    flex: 1;
    min-width: 0;
}

.app-dialog__header-text--with-icon {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.app-dialog__subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted, #9ca3af);
    line-height: 1.4;
}

.app-dialog__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin-right: -0.25rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.15s ease, background 0.15s ease;
}

.app-dialog__back:hover {
    color: var(--text-primary, #fff);
    background: var(--app-row-hover, rgba(255, 255, 255, 0.06));
}

.app-dialog__back.hidden {
    display: none;
}

.deposit-method-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.deposit-method-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 0.75rem;
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.03));
    color: var(--text-primary, #fff);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.deposit-method-card:hover {
    border-color: rgba(0, 223, 154, 0.35);
    background: var(--app-link-hover-bg, rgba(0, 223, 154, 0.08));
}

.deposit-method-card:active {
    transform: scale(0.99);
}

.deposit-method-card__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.deposit-method-card__icon--mpesa {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.deposit-method-card__icon--usdt {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.deposit-method-card__icon--card {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.deposit-method-card__usdt-mark {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
}

.deposit-method-card__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.deposit-method-card__text strong {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.deposit-method-card__text small {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.deposit-method-card__arrow {
    flex-shrink: 0;
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
    opacity: 0.7;
}

/* Phone number privacy mask (deposit / withdrawal) */
.phone-field,
.bot-field__control.phone-field {
    width: 100%;
}

.phone-field__wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    display: block;
    isolation: isolate;
}

.phone-field__mask {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: 0.55rem 2.35rem 0.55rem 0.75rem;
    pointer-events: none;
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.04em;
    color: var(--text-primary, #f3f4f6);
    z-index: 1;
    overflow: hidden;
    border-radius: inherit;
}

.phone-field__toggle {
    position: absolute;
    right: 0.5rem;
    top: 0;
    bottom: 0;
    height: 1.75rem;
    margin: auto 0;
    z-index: 4;
    width: 1.75rem;
    flex-shrink: 0;
    border: 0;
    border-radius: 0.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    transform: none;
}

.phone-field__toggle--visible {
    opacity: 1;
    pointer-events: auto;
}

.phone-field__toggle:hover {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-primary, #f3f4f6);
}

.phone-field__toggle:active {
    transform: none;
}

.phone-field__toggle i {
    width: 1rem;
    text-align: center;
    font-size: 0.8rem;
    line-height: 1;
    pointer-events: none;
}

/* Input sits on top; display layer stays fixed underneath. */
.phone-field__input {
    position: relative;
    z-index: 2;
    width: 100%;
    padding-right: 2.35rem !important;
    background: transparent !important;
    font-weight: 500;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    border-radius: inherit;
}

.phone-field__wrap .phone-field__input {
    display: block;
    box-sizing: border-box;
}

.phone-field--ready .phone-field__input {
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    caret-color: var(--text-primary, #f3f4f6);
}

.phone-mask__value {
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    filter: blur(6px);
    opacity: 0.95;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.phone-field--revealed .phone-mask__value {
    filter: blur(0);
    opacity: 1;
}

.light-theme .phone-field__mask {
    color: var(--text-primary, #111827);
}

.light-theme .phone-field__toggle {
    color: #64748b;
}

.light-theme .phone-field__toggle:hover {
    background: rgba(15, 23, 42, 0.06);
    color: #111827;
}

.light-theme .phone-field--ready .phone-field__input {
    caret-color: #111827;
}

.bot-field__control.phone-field {
    display: flex;
    align-items: stretch;
}

.bot-field__control.phone-field .phone-field__wrap {
    display: block;
    align-self: stretch;
}

.bot-field__control.phone-field .phone-field__mask {
    padding: 0.6rem 2.35rem 0.6rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.bot-field__control--with-prefix .phone-field__mask {
    padding: 0.6rem 2.35rem 0.6rem 0.75rem;
}

.bot-field__control.phone-field .phone-field__input {
    width: 100%;
    height: 100%;
    min-height: 2.75rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.bot-field__control.phone-field:not(.bot-field__control--with-prefix) .phone-field__mask {
    padding: 0.6rem 2.35rem 0.6rem 2.25rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
}

.bot-field__control.phone-field:not(.bot-field__control--with-prefix) .phone-field__input {
    border-radius: 0.5rem;
}

.phone-field > .phone-field__wrap .phone-field__input.app-input {
    min-height: 2.65rem;
    border-radius: 0.5rem;
}

.phone-field > .phone-field__wrap .phone-field__mask {
    border-radius: 0.5rem;
}

.app-input.phone-field__input {
    padding-right: 2.35rem;
}

.deposit-usdt-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.deposit-usdt-panel__hero {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.deposit-usdt-panel__icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #fbbf24;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.deposit-usdt-panel__hero-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.deposit-usdt-panel__network {
    display: inline-flex;
    align-self: flex-start;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.22);
    color: #fbbf24;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.deposit-usdt-panel__lead {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-primary, #f3f4f6);
}

.deposit-usdt-address {
    margin: 0;
}

.deposit-usdt-generating {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.03));
}

.deposit-usdt-generating__spinner {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    border: 2px solid rgba(245, 158, 11, 0.2);
    border-top-color: #fbbf24;
    animation: depositUsdtSpin 0.75s linear infinite;
}

@keyframes depositUsdtSpin {
    to { transform: rotate(360deg); }
}

.deposit-usdt-generating__text {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
}

.deposit-usdt-address-reveal {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: depositUsdtFadeIn 0.25s ease-out;
}

@keyframes depositUsdtFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.deposit-usdt-address-reveal__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.deposit-usdt-generating[hidden],
.deposit-usdt-generating.hidden {
    display: none !important;
}

.deposit-usdt-address-reveal[hidden],
.deposit-usdt-address-reveal.hidden {
    display: none !important;
}

.deposit-usdt-address-reveal__box {
    position: relative;
    padding: 0.9rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
    overflow-x: auto;
}

.deposit-usdt-address-reveal__code {
    display: inline;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.55;
    color: var(--text-primary, #f3f4f6);
    word-break: break-all;
}

.deposit-usdt-address-reveal__cursor {
    display: inline-block;
    width: 0.45rem;
    height: 1em;
    margin-left: 0.05rem;
    vertical-align: text-bottom;
    background: #fbbf24;
    animation: depositUsdtCursor 0.85s step-end infinite;
}

.deposit-usdt-address-reveal__cursor.hidden {
    display: none;
}

@keyframes depositUsdtCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.deposit-usdt-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 0.65rem;
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.deposit-usdt-copy-btn:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.16);
    border-color: rgba(245, 158, 11, 0.4);
}

.deposit-usdt-copy-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.deposit-usdt-unavailable {
    margin: 0 0 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
    font-size: 0.8125rem;
}

.deposit-card-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.deposit-card-form__hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.deposit-card-form__hint i {
    font-size: 1.25rem;
    color: var(--text-muted, #9ca3af);
}

.deposit-card-processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.65rem;
    padding: 1.25rem 0.75rem;
}

.deposit-card-processing.hidden {
    display: none;
}

.deposit-card-processing__pulse {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    border: 3px solid rgba(59, 130, 246, 0.18);
    border-top-color: var(--info-color, #3b82f6);
    animation: depositCardSpin 0.9s linear infinite;
}

@keyframes depositCardSpin {
    to { transform: rotate(360deg); }
}

.deposit-card-processing__title {
    margin: 0.15rem 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
}

.deposit-card-processing__text {
    margin: 0;
    max-width: 22rem;
    font-size: 0.8125rem;
    line-height: 1.55;
    color: var(--text-secondary, #d1d5db);
}

.deposit-card-processing__ref {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    font-family: ui-monospace, monospace;
}

.deposit-card-processing__note {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.light-theme .deposit-method-card__icon--mpesa {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
}

.light-theme .deposit-method-card__icon--usdt {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.light-theme .deposit-method-card__icon--card {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.light-theme .deposit-usdt-unavailable {
    color: #dc2626;
}

.light-theme .deposit-usdt-panel__icon,
.light-theme .deposit-usdt-panel__network {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
    border-color: rgba(217, 119, 6, 0.22);
}

.light-theme .deposit-usdt-address-reveal__box {
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.07) 0%, rgba(217, 119, 6, 0.02) 100%);
    border-color: rgba(217, 119, 6, 0.2);
}

.light-theme .deposit-usdt-copy-btn {
    color: #d97706;
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.22);
}

/* —— Entry Scanner modal (theme-aware app-dialog) —— */
.app-dialog--scanner {
    max-width: 26rem;
}

.entry-scanner-head__icon {
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.14);
    color: var(--bot-accent-text, #60a5fa);
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.entry-scanner-head__title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.entry-scanner-head__title-row h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    line-height: 1.2;
}

.entry-scanner-head__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.14);
    color: var(--bot-accent-text, #60a5fa);
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.entry-scanner-intro {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-muted, #9ca3af);
}

.entry-scanner-intro strong {
    color: var(--text-secondary, #d1d5db);
    font-weight: 700;
}

.entry-scanner-field {
    margin-bottom: 1rem;
}

.entry-scanner-field__label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
}

.entry-scanner-field__select-wrap {
    position: relative;
}

.entry-scanner-field__select {
    width: 100%;
    appearance: none;
    padding: 0.72rem 2.25rem 0.72rem 0.85rem;
    border: 1px solid var(--border-color-strong, rgba(255, 255, 255, 0.12));
    border-radius: 0.65rem;
    background: var(--app-input-bg, #0f1419);
    color: var(--text-primary, #fff);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.entry-scanner-field__select:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.entry-scanner-field__chevron {
    position: absolute;
    right: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted, #9ca3af);
    font-size: 0.7rem;
}

.entry-scanner-progress {
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.65rem;
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    transition: border-color 0.2s ease, background 0.2s ease;
}

.entry-scanner-progress--active {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

.entry-scanner-progress--done {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
}

.entry-scanner-progress__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.entry-scanner-progress__head span:first-child {
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
}

.entry-scanner-progress__head span:last-child {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.entry-scanner-progress__track {
    height: 0.4rem;
    border-radius: 999px;
    background: var(--border-color, rgba(255, 255, 255, 0.1));
    overflow: hidden;
}

.entry-scanner-progress__bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--info-color, #3b82f6), #2563eb);
    transition: width 0.2s ease;
}

.entry-scanner-progress--done .entry-scanner-progress__bar {
    background: linear-gradient(90deg, var(--success-color, #10b981), #059669);
}

.entry-scanner-dialog--scanning .entry-scanner-progress__bar {
    animation: entryScannerPulse 1.2s ease-in-out infinite;
}

@keyframes entryScannerPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}

.entry-scanner-result {
    margin-bottom: 0.25rem;
    animation: entryScannerIn 0.25s ease-out;
}

.entry-scanner-result.hidden {
    display: none;
}

@keyframes entryScannerIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.entry-scanner-result__hero {
    padding: 0.9rem;
    border-radius: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.22);
    margin-bottom: 0.65rem;
}

.entry-scanner-result__hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}

.entry-scanner-result__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bot-accent-text, #60a5fa);
}

.entry-scanner-result__quality {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--bot-profit-win, #4ade80);
    background: rgba(34, 197, 94, 0.14);
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
}

.entry-scanner-result__market {
    margin: 0 0 0.55rem;
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text-primary, #fff);
}

.entry-scanner-result__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.entry-scanner-result__chip {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
}

.entry-scanner-result__chip--accent {
    border-color: rgba(59, 130, 246, 0.28);
    color: var(--bot-accent-text, #60a5fa);
}

.entry-scanner-result__chip--pick {
    border-color: rgba(34, 197, 94, 0.28);
    color: var(--bot-profit-win, #4ade80);
}

.entry-scanner-result__line {
    margin: 0;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    background: var(--app-input-bg, rgba(0, 0, 0, 0.2));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    font-size: 0.75rem;
    line-height: 1.55;
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
}

.entry-scanner-foot {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.entry-scanner-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.82rem 1rem;
    border-radius: 0.7rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.entry-scanner-btn--primary {
    border: none;
    background: var(--info-color, #3b82f6);
    color: #fff;
}

.entry-scanner-btn--primary:hover:not(:disabled) {
    filter: brightness(1.08);
}

.entry-scanner-btn--primary:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.entry-scanner-btn--ghost {
    border: 1px solid var(--border-color-strong, rgba(255, 255, 255, 0.14));
    background: transparent;
    color: var(--bot-accent-text, #60a5fa);
}

.entry-scanner-btn--ghost:hover {
    background: rgba(59, 130, 246, 0.08);
}

.entry-scanner-btn--apply {
    border: none;
    background: var(--success-color, #10b981);
    color: #fff;
    font-size: 0.8125rem;
    padding: 0.7rem 0.85rem;
}

.entry-scanner-btn--apply:hover {
    filter: brightness(1.08);
}

.entry-scanner-dialog--has-result .entry-scanner-btn--primary {
    background: transparent;
    color: var(--bot-accent-text, #60a5fa);
    border: 1px solid rgba(59, 130, 246, 0.28);
}

.light-theme .entry-scanner-head__icon {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.14);
}

.light-theme .entry-scanner-head__badge {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.light-theme .entry-scanner-result__hero {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.18);
}

.light-theme .entry-scanner-result__line {
    background: var(--app-surface-hover, #f8fafc);
}

/* —— Support chat modal —— */
.app-dialog--support {
    max-width: 26rem;
    width: min(26rem, calc(100vw - 2rem));
    height: min(32rem, calc(100dvh - 2rem));
    max-height: min(90dvh, calc(100dvh - 2rem));
}

.support-chat__head-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 223, 154, 0.12);
    color: var(--primary, #00df9a);
    font-size: 1rem;
    box-shadow: inset 0 0 0 1px rgba(0, 223, 154, 0.18);
}

.support-chat__head-icon--avatar {
    border-radius: 999px;
    padding: 0;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    border: 2px solid rgba(0, 223, 154, 0.35);
}

.support-chat__head-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.support-chat__title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.app-dialog--support .support-chat__content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 1.25rem 0;
    overflow: hidden;
}

.support-chat__footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: var(--app-surface, #111827);
}

.support-chat__status-line {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.support-chat__status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    flex-shrink: 0;
}

button.trade-topbar-nav__link,
button.sidebar-link[data-support-open] {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    background: transparent;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

button.sidebar-link[data-support-open] {
    display: flex;
    width: 100%;
    color: inherit;
}

.support-chat__topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    flex-shrink: 0;
}

.support-chat__topic {
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary, #d1d5db);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.support-chat__topic:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
    color: #93c5fd;
}

.support-chat__messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.15rem 0.1rem 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.support-chat__message {
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}

.support-chat__message--user {
    flex-direction: row-reverse;
}

.support-chat__avatar {
    flex-shrink: 0;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 800;
    background: rgba(37, 99, 235, 0.18);
    color: #93c5fd;
}

.support-chat__avatar--agent {
    width: 2rem;
    height: 2rem;
    padding: 0;
    overflow: hidden;
    background: transparent;
    color: inherit;
    font-size: inherit;
    border: 2px solid rgba(0, 223, 154, 0.35);
}

.support-chat__avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 999px;
}

.support-chat__message--user .support-chat__avatar {
    background: rgba(0, 223, 154, 0.14);
    color: var(--primary, #00df9a);
}

.support-chat__bubble {
    max-width: calc(100% - 2.2rem);
    padding: 0.55rem 0.7rem;
    border-radius: 0.65rem;
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.support-chat__message--user .support-chat__bubble {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.22);
}

.support-chat__bubble strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
}

.support-chat__bubble p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--text-primary, #f3f4f6);
}

.support-chat__bubble--typing {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    min-height: 1.25rem;
}

.support-chat__typing-dot {
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 999px;
    background: #93c5fd;
    animation: support-chat-typing 1.1s infinite ease-in-out;
}

.support-chat__typing-dot:nth-child(2) {
    animation-delay: 0.15s;
}

.support-chat__typing-dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes support-chat-typing {
    0%, 80%, 100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

.support-chat__action {
    display: inline-flex;
    align-items: center;
    margin-top: 0.55rem;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 0.45rem;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.support-chat__action:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
}

.support-chat__suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.support-chat__suggestions[hidden] {
    display: none !important;
}

.support-chat__suggestion {
    padding: 0.32rem 0.55rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.support-chat__suggestion:hover {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
    color: #93c5fd;
}

.support-chat__attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.support-chat__attachments[hidden] {
    display: none !important;
}

.support-chat__attachment-chip {
    position: relative;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
}

.support-chat__attachment-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.support-chat__attachment-remove {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    width: 1.2rem;
    height: 1.2rem;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.55rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.support-chat__message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.support-chat__message-image {
    max-width: 100%;
    width: auto;
    max-height: 10rem;
    border-radius: 0.45rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    display: block;
}

.support-chat__compose {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.support-chat__attach {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--border-color-strong, rgba(255, 255, 255, 0.12));
    border-radius: 0.55rem;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.support-chat__attach:hover:not(:disabled) {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
    color: #93c5fd;
}

.support-chat__attach:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.support-chat__input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.75rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border-color-strong, rgba(255, 255, 255, 0.12));
    background: var(--app-input-bg, #0f1419);
    color: var(--text-primary, #fff);
    font-size: 0.8125rem;
}

.support-chat__input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.45);
}

.support-chat__send {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.55rem;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.support-chat__send:hover:not(:disabled) {
    background: #1d4ed8;
}

.support-chat__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.light-theme .support-chat__bubble {
    background: var(--app-surface-hover, #f8fafc);
}

.light-theme .support-chat__message--user .support-chat__bubble {
    background: rgba(37, 99, 235, 0.08);
}

.light-theme .support-chat__head-icon {
    background: rgba(0, 223, 154, 0.1);
    color: #059669;
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.16);
}

.light-theme .support-chat__attach {
    background: var(--app-input-bg, #fff);
}

.light-theme .support-chat__input {
    background: var(--app-input-bg, #fff);
    color: var(--text-primary, #0f172a);
}

.light-theme .support-chat__footer {
    background: var(--app-surface, #fff);
    border-top-color: var(--border-color, rgba(15, 23, 42, 0.08));
}

@media (max-width: 639px) {
    .app-dialog--support {
        width: calc(100vw - 1.5rem);
        height: min(100dvh - 1.5rem, 32rem);
        max-height: calc(100dvh - 1.5rem);
    }

    .app-dialog--support .support-chat__content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .support-chat__footer {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    }
}

.market-picker__toolbar {
    margin-bottom: 1rem;
}

.trade-chart-picker-wrap {
    align-items: stretch;
}

.trade-chart-picker {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

.trade-chart-picker__trigger {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--markets-search-border, var(--border-color, rgba(255, 255, 255, 0.12)));
    border-radius: 0.65rem;
    background: var(--markets-search-bg, var(--app-input-bg, #0f1419));
    color: var(--text-primary, #f3f4f6);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.trade-chart-picker__icon {
    flex-shrink: 0;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.55rem;
    background-color: rgba(16, 185, 129, 0.16);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Crect x='4' y='13' width='3.4' height='7' rx='1'/%3E%3Crect x='10.3' y='6' width='3.4' height='14' rx='1'/%3E%3Crect x='16.6' y='10' width='3.4' height='10' rx='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 1.15rem;
}

.trade-chart-picker__quote {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.trade-chart-picker__price {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
}

.trade-chart-picker__change {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
}

.trade-chart-picker__change--up {
    color: #10b981;
}

.trade-chart-picker__change--down {
    color: #ef4444;
}

.trade-chart-picker__trigger:hover,
.trade-chart-picker__trigger[aria-expanded="true"] {
    border-color: #3b82f6;
    background: var(--markets-row-hover-bg, rgba(59, 130, 246, 0.06));
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.trade-chart-picker__trigger-main {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.trade-chart-picker__name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--markets-search-text, var(--text-primary, #f3f4f6));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trade-chart-picker__symbol {
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
}

.trade-chart-picker__caret {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    transition: transform 0.15s ease;
}

.trade-chart-picker__trigger[aria-expanded="true"] .trade-chart-picker__caret {
    transform: rotate(180deg);
}

.trade-chart-picker__panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    left: 0;
    right: 0;
    z-index: 40;
    border-radius: 0.75rem;
    border: 1px solid var(--markets-panel-border, var(--border-color, rgba(255, 255, 255, 0.12)));
    background: var(--app-surface, #111827);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-width: 0;
}

.trade-chart-picker__panel--open {
    position: fixed;
    right: auto;
    z-index: 1200;
}

@media (min-width: 640px) {
    .trade-chart-picker__panel {
        min-width: 0;
        max-width: 15rem;
    }
}

.trade-chart-picker__panel .market-picker {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: transparent;
}

.trade-chart-picker__panel .market-picker__toolbar,
.trade-chart-picker__panel .markets-page__toolbar {
    margin-bottom: 0;
    padding: 0.5rem 0.55rem;
    border-bottom: 1px solid var(--markets-toolbar-border);
    background: transparent;
    flex-shrink: 0;
    gap: 0.5rem;
}

/* Drop the redundant "Instruments" caption to save space */
.trade-chart-picker__panel .markets-page__panel-label {
    display: none;
}

.trade-chart-picker__panel .markets-page__toolbar-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

@media (min-width: 480px) {
    .trade-chart-picker__panel .markets-page__toolbar-head {
        flex-direction: row;
        align-items: center;
        gap: 0.75rem;
    }

    .trade-chart-picker__panel .markets-page__panel-label {
        flex-shrink: 0;
    }

    .trade-chart-picker__panel .markets-page__search-wrap {
        flex: 1 1 auto;
    }
}

.trade-chart-picker__panel .market-picker__list,
.trade-chart-picker__panel .markets-page__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(24rem, 56vh);
    overflow: auto;
    padding: 0.35rem;
    scrollbar-gutter: stable;
}

.trade-chart-picker__panel .markets-page__row {
    padding: 0.45rem 0.6rem;
    border-radius: 0.5rem;
}

/* Simple list look (per reference): no search, no filters, no prices —
   just instrument names with a teal dot on the active one. */
.trade-chart-picker__panel .markets-page__toolbar,
.trade-chart-picker__panel .market-picker__toolbar,
.trade-chart-picker__panel .markets-page__row-price {
    display: none;
}

.trade-chart-picker__panel .markets-page__row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-color: transparent;
}

.trade-chart-picker__panel .markets-page__row::before {
    content: "";
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    border-radius: 0.5rem;
    background-color: rgba(148, 163, 184, 0.12);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Crect x='4' y='13' width='3.4' height='7' rx='1'/%3E%3Crect x='10.3' y='6' width='3.4' height='14' rx='1'/%3E%3Crect x='16.6' y='10' width='3.4' height='10' rx='1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.95rem;
}

.trade-chart-picker__panel .markets-page__row--active::before {
    background-color: rgba(16, 185, 129, 0.16);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'%3E%3Crect x='4' y='13' width='3.4' height='7' rx='1'/%3E%3Crect x='10.3' y='6' width='3.4' height='14' rx='1'/%3E%3Crect x='16.6' y='10' width='3.4' height='10' rx='1'/%3E%3C/svg%3E");
}

.trade-chart-picker__panel .markets-page__row-main {
    order: 1;
    flex: 1 1 auto;
}

.trade-chart-picker__panel .markets-page__row-indicator {
    order: 2;
    display: none;
}

.trade-chart-picker__panel .markets-page__row--active {
    box-shadow: none;
}

.trade-chart-picker__panel .markets-page__row--active .markets-page__row-indicator {
    display: block;
}

.trade-chart-picker__panel .markets-page__row--active .markets-page__row-name {
    color: #10b981;
    font-weight: 700;
}

/* Flatter, tighter rows in the trade market picker */
.trade-chart-picker__panel .markets-page__row-name {
    font-size: 0.8rem;
}

.trade-chart-picker__panel .markets-page__group-title {
    margin: 0.3rem 0.2rem 0.15rem;
    font-size: 0.62rem;
}

.light-theme .trade-chart-picker__panel .markets-page__row {
    border-color: #e2e8f0;
}

.light-theme .trade-chart-picker__panel .markets-page__row:hover {
    transform: none;
}

.trade-chart-picker__native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* —— Markets page —— */
.markets-page,
.line-chart-panel--markets-style,
.trade-chart-picker,
.trade-chart-picker__panel,
.trade-chart-picker__panel .market-picker {
    --markets-panel-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%), #111827;
    --markets-panel-border: rgba(255, 255, 255, 0.1);
    --markets-panel-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    --markets-toolbar-bg: rgba(0, 0, 0, 0.12);
    --markets-toolbar-border: rgba(255, 255, 255, 0.08);
    --markets-search-bg: rgba(0, 0, 0, 0.22);
    --markets-search-border: rgba(255, 255, 255, 0.1);
    --markets-search-text: #f8fafc;
    --markets-search-placeholder: #94a3b8;
    --markets-filter-track-bg: rgba(0, 0, 0, 0.18);
    --markets-filter-track-border: rgba(255, 255, 255, 0.08);
    --markets-filter-text: #9ca3af;
    --markets-filter-hover-bg: rgba(255, 255, 255, 0.04);
    --markets-filter-hover-text: #f3f4f6;
    --markets-filter-active-bg: rgba(59, 130, 246, 0.2);
    --markets-filter-active-border: rgba(59, 130, 246, 0.4);
    --markets-filter-active-text: #dbeafe;
    --markets-row-bg: rgba(255, 255, 255, 0.025);
    --markets-row-hover-bg: rgba(59, 130, 246, 0.08);
    --markets-row-hover-border: rgba(59, 130, 246, 0.28);
    --markets-row-active-bg: linear-gradient(90deg, rgba(0, 223, 154, 0.12) 0%, rgba(0, 223, 154, 0.04) 100%);
    --markets-row-active-border: rgba(0, 223, 154, 0.4);
    --markets-row-active-accent: #00df9a;
    --markets-row-indicator: rgba(255, 255, 255, 0.14);
    --markets-row-price-bg: rgba(255, 255, 255, 0.05);
    --markets-row-price-text: #e5e7eb;
    --markets-row-price-active-text: #6ee7b7;
    --markets-row-price-active-bg: rgba(0, 223, 154, 0.12);
    --markets-chart-bg: linear-gradient(180deg, rgba(15, 20, 25, 0.9) 0%, #0f1419 100%);
    --markets-chart-border: rgba(255, 255, 255, 0.08);
    --markets-label-icon: #60a5fa;
}

.light-theme .markets-page,
.light-theme .line-chart-panel--markets-style,
.light-theme .trade-chart-picker,
.light-theme .trade-chart-picker__panel,
.light-theme .trade-chart-picker__panel .market-picker {
    --markets-panel-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --markets-panel-border: #e2e8f0;
    --markets-panel-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --markets-toolbar-bg: #f1f5f9;
    --markets-toolbar-border: #e2e8f0;
    --markets-search-bg: #ffffff;
    --markets-search-border: #cbd5e1;
    --markets-search-text: #0f172a;
    --markets-search-placeholder: #94a3b8;
    --markets-filter-track-bg: #eef2f7;
    --markets-filter-track-border: #e2e8f0;
    --markets-filter-text: #64748b;
    --markets-filter-hover-bg: #ffffff;
    --markets-filter-hover-text: #0f172a;
    --markets-filter-active-bg: #ffffff;
    --markets-filter-active-border: #93c5fd;
    --markets-filter-active-text: #1d4ed8;
    --markets-row-bg: #ffffff;
    --markets-row-hover-bg: #eff6ff;
    --markets-row-hover-border: #93c5fd;
    --markets-row-active-bg: linear-gradient(90deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%);
    --markets-row-active-border: #34d399;
    --markets-row-active-accent: #059669;
    --markets-row-indicator: #cbd5e1;
    --markets-row-price-bg: #f1f5f9;
    --markets-row-price-text: #0f172a;
    --markets-row-price-active-text: #047857;
    --markets-row-price-active-bg: rgba(16, 185, 129, 0.14);
    --markets-chart-bg: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    --markets-chart-border: #e2e8f0;
    --markets-label-icon: #2563eb;
}

.markets-page {
    max-width: 72rem;
}

.markets-page__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.markets-page__title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.35rem, 2.5vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary, #f3f4f6);
}

.markets-page__subtitle {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-muted, #9ca3af);
    max-width: 32rem;
}

.markets-page__trade-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
}

.markets-page__toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 2;
}

.markets-page__toolbar-head {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.markets-page__panel-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
}

.markets-page__panel-label i {
    color: var(--markets-label-icon);
    font-size: 0.75rem;
}

.markets-page__search-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.markets-page__search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #9ca3af);
    font-size: 0.8125rem;
    pointer-events: none;
}

.markets-page__search {
    width: 100%;
    padding: 0.62rem 0.85rem 0.62rem 2.25rem;
    border-radius: 0.65rem;
    border: 1px solid var(--markets-search-border);
    background: var(--markets-search-bg);
    color: var(--markets-search-text);
    font-size: 0.8125rem;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.markets-page__search::placeholder {
    color: var(--markets-search-placeholder);
}

.markets-page__search:focus {
    outline: none;
    border-color: #3b82f6;
    background: var(--markets-search-bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.markets-page__filters {
    width: 100%;
}

.markets-page__filter-track {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.28rem;
    border-radius: 0.75rem;
    border: 1px solid var(--markets-filter-track-border);
    background: var(--markets-filter-track-bg);
}

.markets-page__filter {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.45rem 0.65rem;
    border-radius: 0.55rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--markets-filter-text);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.markets-page__filter:hover {
    color: var(--markets-filter-hover-text);
    background: var(--markets-filter-hover-bg);
}

.markets-page__filter--active {
    background: var(--markets-filter-active-bg);
    border-color: var(--markets-filter-active-border);
    color: var(--markets-filter-active-text);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.markets-page__group.market-picker__item--hidden,
.markets-page__row.market-picker__item--hidden,
.markets-page__group[hidden],
.markets-page__row[hidden] {
    display: none !important;
}

.markets-page__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
}

@media (min-width: 1024px) {
    .markets-page__layout {
        grid-template-columns: minmax(0, 1.1fr) minmax(20rem, 0.9fr);
        gap: 1.25rem;
        min-height: min(72vh, 40rem);
    }
}

.markets-page__list-panel,
.markets-page__preview {
    border-radius: 1rem;
    border: 1px solid var(--markets-panel-border);
    background: var(--markets-panel-bg);
    box-shadow: var(--markets-panel-shadow);
    overflow: hidden;
}

.markets-page__list-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.markets-page__list-panel .markets-page__toolbar,
.markets-page__list-panel .market-picker__toolbar {
    margin-bottom: 0;
    padding: 1rem 1rem 0.9rem;
    border-bottom: 1px solid var(--markets-toolbar-border);
    background: var(--markets-toolbar-bg);
    flex-shrink: 0;
    gap: 0.8rem;
}

.markets-page__list-panel .markets-page__toolbar-head {
    flex-direction: row;
    align-items: center;
    gap: 0.85rem;
}

.markets-page__list-panel .markets-page__panel-label {
    flex-shrink: 0;
}

.markets-page__list-panel .markets-page__search-wrap {
    flex: 1 1 auto;
}

@media (max-width: 639px) {
    .markets-page__list-panel .markets-page__toolbar-head {
        flex-direction: column;
        align-items: stretch;
    }
}

.markets-page__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(70vh, 36rem);
    overflow: auto;
    padding: 0.75rem;
    scrollbar-gutter: stable;
}

@media (min-width: 1024px) {
    .markets-page__list-scroll {
        max-height: none;
    }
}

.markets-page__group {
    margin-bottom: 1rem;
}

.markets-page__group:last-child {
    margin-bottom: 0;
}

.markets-page__group-title {
    margin: 0 0 0.5rem;
    padding: 0 0.15rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
}

.markets-page__rows {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.markets-page__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 0.7rem;
    background: var(--markets-row-bg);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.markets-page__row-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--markets-row-indicator);
    flex-shrink: 0;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.markets-page__row:hover {
    border-color: var(--markets-row-hover-border);
    background: var(--markets-row-hover-bg);
    transform: translateY(-1px);
}

.markets-page__row--active {
    border-color: var(--markets-row-active-border);
    background: var(--markets-row-active-bg);
    box-shadow: inset 3px 0 0 var(--markets-row-active-accent);
}

.markets-page__row--active .markets-page__row-indicator {
    background: var(--markets-row-active-accent);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.markets-page__row-main {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.markets-page__row-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary, #f3f4f6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.markets-page__row-meta {
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
}

.markets-page__row-price {
    font-size: 0.8125rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--markets-row-price-text);
    white-space: nowrap;
    padding: 0.2rem 0.45rem;
    border-radius: 0.4rem;
    background: var(--markets-row-price-bg);
}

.markets-page__row--active .markets-page__row-price {
    color: var(--markets-row-price-active-text);
    background: var(--markets-row-price-active-bg);
}

.markets-page__row-digit {
    min-width: 1.1rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #93c5fd;
}

.markets-page__preview {
    display: flex;
    flex-direction: column;
    padding: 1.1rem;
    gap: 1rem;
}

.markets-page__preview-head {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.markets-page__preview-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
}

.markets-page__preview-title {
    margin: 0;
    font-size: clamp(1rem, 2vw, 1.15rem);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary, #f3f4f6);
}

.markets-page__preview-symbol {
    margin: 0.2rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.markets-page__preview-price-wrap {
    text-align: right;
}

.markets-page__preview-price {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #f3f4f6);
    line-height: 1.2;
}

.markets-page__preview-digit {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
}

.markets-page__preview-digit strong {
    color: #93c5fd;
}

.markets-page__chart-wrap {
    flex: 1 1 auto;
    min-height: 14rem;
    border-radius: 0.4rem;
    border: 1px solid var(--markets-chart-border);
    background: var(--markets-chart-bg);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.markets-page__chart {
    width: 100%;
    height: 100%;
    min-height: 14rem;
}

@media (min-width: 1024px) {
    .markets-page__chart {
        min-height: 18rem;
    }
}

.markets-page__ohlc {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.markets-page__ohlc div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.45rem;
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.markets-page__ohlc span {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
}

.markets-page__ohlc strong {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #f3f4f6);
}

.markets-page__preview-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
    margin-top: auto;
    padding-top: 0.25rem;
}

.markets-page__trade-btn {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

.light-theme .markets-page__trade-btn {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

.markets-page__trade-btn,
.markets-page__scanner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-decoration: none;
    min-height: 2.5rem;
}

.light-theme .markets-page__trade-link {
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

.light-theme .markets-page__row {
    border-color: #e2e8f0;
}

.light-theme .markets-page__row:hover {
    transform: none;
}

.light-theme .markets-page__chart-wrap {
    box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.04);
}

/* Trade page chart — same preview layout as Markets */
.line-chart-panel--markets-style {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0.85rem 1rem 1rem;
    background: transparent;
    border: none;
}

.line-chart-panel--markets-style .line-chart-panel__toolbar {
    flex-shrink: 0;
    margin-bottom: 0;
    overflow: visible;
    position: relative;
    z-index: 25;
}

.line-chart-panel--markets-style .trade-chart-picker-wrap {
    gap: 0.5rem;
}

.line-chart-panel--markets-style .line-chart-panel__buttons {
    flex-shrink: 0;
}

/* Zoom / refresh controls float as a vertical rail on the left (Y-axis) edge */
.line-chart-panel--markets-style .line-chart-panel__buttons--rail {
    position: absolute;
    left: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 0.25rem;
    z-index: 4;
}

.line-chart-panel--markets-style .line-chart-panel__buttons--rail .line-chart-panel__btn {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.7rem;
    border-radius: 0.4rem;
    background: var(--markets-chart-bg, rgba(17, 24, 39, 0.7));
    backdrop-filter: blur(4px);
}

.line-chart-panel--markets-style .line-chart-panel__buttons--rail .line-chart-panel__btn.is-active {
    border-color: #3b82f6;
    color: #3b82f6;
}

.line-chart-panel--markets-style .line-chart-panel__btn {
    border: 1px solid var(--markets-search-border, var(--border-color, rgba(255, 255, 255, 0.12)));
    background: var(--markets-search-bg, rgba(255, 255, 255, 0.04));
    color: var(--text-muted, #9ca3af);
    border-radius: 0.55rem;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.line-chart-panel--markets-style .line-chart-panel__btn:hover {
    border-color: #3b82f6;
    background: var(--markets-row-hover-bg, rgba(59, 130, 246, 0.08));
    color: var(--text-primary, #f3f4f6);
}

.line-chart-panel--markets-style .line-chart-panel__markets-preview {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
    min-height: 0;
}

.line-chart-panel--markets-style .markets-page__chart-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
}

.line-chart-panel--markets-style .markets-page__chart {
    height: 100%;
    min-height: 14rem;
}

.line-chart-panel--markets-style .line-chart-panel__digit-footer {
    flex-shrink: 0;
}

.binary-trade-desk__col--chart .line-chart-panel--markets-style {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
        "panel-preview"
        "panel-digits";
    gap: 0;
    height: 100%;
    min-height: 0;
    padding: 0.75rem 0.85rem 0.85rem;
    position: relative;
}

/* Market picker floats on top of the chart (top-left) so the chart card
   extends to full height behind it. */
.binary-trade-desk__col--chart .line-chart-panel--markets-style .line-chart-panel__toolbar {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    right: auto;
    width: auto;
    max-width: min(72%, 17rem);
    padding: 0;
    z-index: 25;
}

.binary-trade-desk__col--chart .line-chart-panel--markets-style .line-chart-panel__controls--full {
    width: auto;
}

.binary-trade-desk__col--chart .line-chart-panel--markets-style .trade-chart-picker__trigger {
    background: var(--app-surface, rgba(17, 24, 39, 0.85));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 0.5rem;
}

.binary-trade-desk__col--chart .line-chart-panel--markets-style .trade-chart-picker__icon {
    border-radius: 0.5rem;
}

.binary-trade-desk__col--chart .line-chart-panel--markets-style .line-chart-panel__markets-preview {
    grid-area: panel-preview;
    min-height: 0;
    overflow: hidden;
}

.binary-trade-desk__col--chart .line-chart-panel--markets-style .line-chart-panel__digit-footer {
    grid-area: panel-digits;
}

.binary-trade-desk__col--chart .line-chart-panel--markets-style .markets-page__chart {
    min-height: 0;
    max-height: none;
}

@media (max-width: 1023px) {
    .binary-trade-desk__col--chart .line-chart-panel--desk,
    .binary-trade-desk__col--chart .line-chart-panel--markets-style {
        height: 100%;
        min-height: min(58vh, calc(100dvh - 20rem));
    }

    .binary-trade-desk__col--chart .line-chart-panel--markets-style .markets-page__chart-wrap {
        flex: 1;
        min-height: 12rem;
    }

    .binary-trade-desk__col--chart .line-chart-panel--markets-style .markets-page__chart {
        min-height: 12rem;
        height: 100%;
    }
}

/* —— Transaction history page —— */
.history-page__toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
}

.history-page__search-wrap {
    position: relative;
}

.history-page__search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted, #9ca3af);
    font-size: 0.8125rem;
    pointer-events: none;
}

.history-page__search {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.1rem;
    border-radius: 0.55rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: var(--app-input-bg, #0f1419);
    color: var(--text-primary, #f3f4f6);
    font-size: 0.8125rem;
}

.history-page__search:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.45);
}

.history-page__filters,
.history-page__account-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.history-page__account-filters {
    padding-top: 0.15rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.history-page__account-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
    margin-right: 0.25rem;
}

.history-page__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    background: transparent;
    color: var(--text-muted, #9ca3af);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.history-page__pill:hover {
    color: var(--text-primary, #f3f4f6);
    border-color: rgba(59, 130, 246, 0.35);
}

.history-page__pill--active {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.45);
    color: #93c5fd;
}

.history-page__pill-count {
    font-size: 0.625rem;
    font-weight: 700;
    opacity: 0.85;
}

.history-page__list-card {
    padding: 0;
    overflow: hidden;
}

.history-page__list {
    display: flex;
    flex-direction: column;
}

.history-page__list[hidden] {
    display: none !important;
}

.history-page__item {
    display: flex;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    transition: background 0.15s ease;
}

.history-page__item:last-child {
    border-bottom: none;
}

.history-page__item:hover {
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.03));
}

.history-page__item[hidden],
.history-page__item.history-page__item--hidden {
    display: none !important;
}

.history-page__item-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.history-page__item-icon--win,
.history-page__item-icon--deposit {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.history-page__item-icon--loss,
.history-page__item-icon--withdrawal {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.history-page__item-icon--open {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.history-page__item-body {
    flex: 1;
    min-width: 0;
}

.history-page__item-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.history-page__item-main {
    min-width: 0;
}

.history-page__item-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-page__item-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.history-page__item-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.history-page__item-amount {
    font-size: 0.875rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.history-page__item-amount--positive {
    color: #4ade80;
}

.history-page__item-amount--negative {
    color: #f87171;
}

.history-page__item-amount--muted {
    color: var(--text-muted, #9ca3af);
}

.history-page__item-meta {
    margin: 0.35rem 0 0;
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
    font-variant-numeric: tabular-nums;
}

.history-page__item-time {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
}

.history-page__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1.25rem;
    text-align: center;
}

.history-page__empty[hidden] {
    display: none !important;
}

.history-page__empty i {
    font-size: 2rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.25rem;
}

.history-page__empty h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
}

.history-page__empty p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-muted, #9ca3af);
    max-width: 22rem;
}

.history-page__empty--filter {
    padding: 2rem 1rem;
}

.light-theme .history-page__item:hover {
    background: var(--app-surface-hover, #f8fafc);
}

.light-theme .history-page__search {
    background: var(--app-input-bg, #fff);
}

/* —— Auto session TP / SL result modal —— */
.auto-session-result {
    max-width: 22rem;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1.25rem 1.25rem;
    gap: 0;
}

.auto-session-result__icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 0.85rem;
}

.auto-session-result__icon--tp {
    background: rgba(34, 197, 94, 0.14);
    color: #22c55e;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.auto-session-result__icon--sl {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.18);
}

.auto-session-result__title {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
}

.auto-session-result__title--tp {
    color: #22c55e;
}

.auto-session-result__title--sl {
    color: #ef4444;
}

.auto-session-result__amount {
    margin: 0 0 1rem;
    font-size: 1.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.auto-session-result__amount--tp {
    color: #22c55e;
}

.auto-session-result__amount--sl {
    color: #ef4444;
}

.auto-session-result__stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 1.1rem;
    border-radius: 0.65rem;
    background: var(--app-surface-hover, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    overflow: hidden;
}

.auto-session-result__stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    font-size: 0.8125rem;
}

.auto-session-result__stat + .auto-session-result__stat {
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.auto-session-result__stat span {
    color: var(--text-muted, #9ca3af);
}

.auto-session-result__stat strong {
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #f3f4f6);
}

.auto-session-result__wl--positive {
    color: #22c55e;
}

.auto-session-result__wl--negative {
    color: #ef4444;
}

.auto-session-result__btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.55rem;
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.auto-session-result__btn:hover {
    filter: brightness(1.05);
}

.auto-session-result__btn:active {
    transform: translateY(1px);
}

#autoSessionResultModal.auto-session-result-modal--sl .auto-session-result__btn {
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
}

.light-theme .auto-session-result__stats {
    background: #f8fafc;
}

.light-theme .auto-session-result__title--tp,
.light-theme .auto-session-result__amount--tp {
    color: #16a34a;
}

.light-theme .auto-session-result__title--sl,
.light-theme .auto-session-result__amount--sl {
    color: #dc2626;
}

/* Settings — profile */
.settings-page {
    max-width: 52rem;
}

.settings-page__header {
    margin-bottom: 1.25rem;
}

.settings-profile-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas:
        "avatar body"
        "meta meta";
    gap: 1rem 1.25rem;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(0, 223, 154, 0.08) 0%, rgba(59, 130, 246, 0.06) 100%);
    border: 1px solid rgba(0, 223, 154, 0.18);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.settings-profile-card__avatar {
    grid-area: avatar;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 999px;
    font-size: 2.35rem;
    line-height: 1;
    background: rgba(0, 223, 154, 0.12);
    border: 2px solid rgba(0, 223, 154, 0.28);
    box-shadow: 0 8px 20px rgba(0, 223, 154, 0.12);
    user-select: none;
}

.settings-profile-card__body {
    grid-area: body;
    align-self: center;
    min-width: 0;
}

.settings-profile-card__label {
    margin: 0 0 0.2rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary, #00df9a);
}

.settings-profile-card__name {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
    line-height: 1.25;
}

.settings-profile-card__email {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    color: var(--text-muted, #9ca3af);
    word-break: break-word;
}

.settings-profile-card__meta {
    grid-area: meta;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-profile-card__meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.settings-profile-card__meta-item dt {
    margin: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
}

.settings-profile-card__meta-item dd {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #f3f4f6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-page__panels {
    display: grid;
    gap: 1.25rem;
}

.settings-panel .app-card-title {
    margin-bottom: 1.1rem;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.settings-form__hint {
    margin: 0.4rem 0 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.settings-form__actions {
    padding-top: 0.35rem;
}

.settings-input--readonly {
    opacity: 0.75;
    cursor: not-allowed;
}

.settings-phone-field {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.settings-phone-field__prefix {
    display: inline-flex;
    align-items: center;
    padding: 0 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.settings-phone-field .app-input {
    flex: 1;
    min-width: 0;
}

@media (max-width: 640px) {
    .settings-profile-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "avatar"
            "body"
            "meta";
        text-align: center;
    }

    .settings-profile-card__avatar {
        margin: 0 auto;
    }

    .settings-profile-card__meta {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .settings-form__grid {
        grid-template-columns: 1fr;
    }
}

.light-theme .settings-profile-card {
    background: linear-gradient(135deg, rgba(0, 223, 154, 0.06) 0%, rgba(59, 130, 246, 0.04) 100%);
    border-color: rgba(0, 223, 154, 0.2);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.light-theme .settings-profile-card__name {
    color: #111827;
}

.light-theme .settings-profile-card__meta {
    border-top-color: rgba(15, 23, 42, 0.08);
}

.light-theme .settings-profile-card__meta-item dd {
    color: #111827;
}

/* —— Marketing landing (index) —— */
.marketing-page {
    background: var(--app-bg, #060806);
}

.marketing-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(6, 8, 6, 0.85);
    backdrop-filter: blur(12px);
}

.marketing-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
}

.marketing-header__logo {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.marketing-header__nav {
    display: flex;
    align-items: center;
    gap: 0.35rem 1rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.marketing-header__link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted, #9ca3af);
    text-decoration: none;
    transition: color 0.15s ease;
}

.marketing-header__link:hover {
    color: var(--text-primary, #f3f4f6);
}

.marketing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.marketing-btn--sm {
    padding: 0.45rem 1rem;
    font-size: 0.8125rem;
}

.marketing-btn--lg {
    padding: 0.8rem 1.35rem;
    font-size: 0.9375rem;
}

.marketing-btn--primary {
    background: var(--primary, #00df9a);
    color: #04120c;
    box-shadow: 0 8px 24px rgba(0, 223, 154, 0.22);
}

.marketing-btn--primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.marketing-btn--ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary, #f3f4f6);
}

.marketing-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.marketing-main {
    overflow-x: hidden;
}

.marketing-hero {
    position: relative;
    padding: 3.5rem 1.25rem 2.5rem;
}

.marketing-hero__glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(0, 223, 154, 0.18), transparent 60%),
        radial-gradient(ellipse 40% 30% at 80% 20%, rgba(59, 130, 246, 0.08), transparent 50%);
    pointer-events: none;
}

.marketing-hero__content {
    position: relative;
    max-width: 44rem;
    margin: 0 auto;
    text-align: center;
}

.marketing-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary, #00df9a);
    background: rgba(0, 223, 154, 0.1);
    border: 1px solid rgba(0, 223, 154, 0.22);
}

.marketing-hero__title {
    margin: 1.1rem 0 0.85rem;
    font-size: clamp(2.2rem, 6vw, 3.75rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.marketing-hero__lead {
    margin: 0 auto;
    max-width: 36rem;
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    line-height: 1.65;
    color: var(--text-muted, #9ca3af);
}

.marketing-hero__type {
    margin-top: 1.25rem;
    font-size: 1.05rem;
    color: var(--text-muted, #9ca3af);
}

.marketing-hero__type strong {
    display: inline-block;
    min-width: 7.5rem;
    margin-left: 0.35rem;
    color: var(--primary, #00df9a);
    font-weight: 800;
}

.marketing-hero__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.75rem;
}

.marketing-hero__trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem 1.25rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
    color: var(--text-muted, #9ca3af);
}

.marketing-hero__trust i {
    color: var(--primary, #00df9a);
    margin-right: 0.3rem;
}

.marketing-stats {
    padding: 0 1.25rem 2rem;
}

.marketing-stats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 56rem;
    margin: 0 auto;
}

.marketing-stat {
    padding: 1.1rem 1rem;
    border-radius: 0.85rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.marketing-stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary, #f3f4f6);
}

.marketing-stat span {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.marketing-section {
    padding: 3rem 1.25rem;
    max-width: 72rem;
    margin: 0 auto;
}

.marketing-section--muted {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
}

.marketing-section__head {
    max-width: 40rem;
    margin: 0 auto 2rem;
    text-align: center;
}

.marketing-section__eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--primary, #00df9a);
}

.marketing-section__head h2 {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary, #f3f4f6);
}

.marketing-section__head p:last-child {
    margin: 0.75rem 0 0;
    color: var(--text-muted, #9ca3af);
    line-height: 1.6;
}

.marketing-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.marketing-feature {
    padding: 1.35rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.marketing-feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.65rem;
    margin-bottom: 0.85rem;
    background: rgba(0, 223, 154, 0.12);
    color: var(--primary, #00df9a);
    font-size: 1rem;
}

.marketing-feature h3 {
    margin: 0 0 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
}

.marketing-feature p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted, #9ca3af);
}

.marketing-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1rem;
    max-width: 44rem;
    margin-inline: auto;
}

.marketing-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.marketing-step__num {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: #04120c;
    background: var(--primary, #00df9a);
}

.marketing-step h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
}

.marketing-step p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-muted, #9ca3af);
}

.marketing-cta {
    padding: 2rem 1.25rem 3.5rem;
    max-width: 72rem;
    margin: 0 auto;
}

.marketing-cta__card {
    padding: 2rem 1.5rem;
    border-radius: 1.15rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(0, 223, 154, 0.12) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(0, 223, 154, 0.22);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.marketing-cta__card h2 {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    color: var(--text-primary, #f3f4f6);
}

.marketing-cta__card p {
    margin: 0.65rem auto 0;
    max-width: 32rem;
    color: var(--text-muted, #9ca3af);
    line-height: 1.6;
}

.marketing-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.35rem;
}

.marketing-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.25);
}

.marketing-footer__inner {
    display: grid;
    gap: 2rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 1.5rem;
}

.marketing-footer__logo {
    display: inline-block;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.marketing-footer__tagline {
    margin: 0.85rem 0 1rem;
    max-width: 22rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--text-muted, #9ca3af);
}

.marketing-footer__email {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8125rem;
    color: var(--primary, #00df9a);
    text-decoration: none;
}

.marketing-footer__email:hover {
    text-decoration: underline;
}

.marketing-footer__cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
}

.marketing-footer__col h6 {
    margin: 0 0 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #9ca3af);
}

.marketing-footer__col ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.marketing-footer__col li + li {
    margin-top: 0.55rem;
}

.marketing-footer__col a {
    font-size: 0.875rem;
    color: var(--text-primary, #e5e7eb);
    text-decoration: none;
    transition: color 0.15s ease;
}

.marketing-footer__col a:hover {
    color: var(--primary, #00df9a);
}

.marketing-footer__bottom {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.marketing-footer__bottom p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.marketing-footer__risk {
    margin-top: 0.5rem !important;
    max-width: 40rem;
    margin-inline: auto !important;
    line-height: 1.5;
    opacity: 0.85;
}

@media (min-width: 640px) {
    .marketing-stats__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .marketing-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .marketing-footer__inner {
        grid-template-columns: 1.1fr 1.4fr;
        align-items: start;
    }

    .marketing-footer__cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .marketing-hero {
        padding: 4.5rem 1.25rem 3rem;
    }

    .marketing-features {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.light-theme .marketing-header {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.light-theme .marketing-page {
    background: #f8fafc;
}

.light-theme .marketing-stat,
.light-theme .marketing-feature,
.light-theme .marketing-step {
    background: #fff;
    border-color: rgba(15, 23, 42, 0.08);
}

.light-theme .marketing-section--muted {
    background: #f1f5f9;
    border-color: rgba(15, 23, 42, 0.08);
}

.light-theme .marketing-footer {
    background: #fff;
    border-top-color: rgba(15, 23, 42, 0.08);
}

.light-theme .marketing-footer__bottom {
    border-top-color: rgba(15, 23, 42, 0.08);
}

.light-theme .marketing-cta__card {
    background: linear-gradient(135deg, rgba(0, 223, 154, 0.08) 0%, rgba(59, 130, 246, 0.05) 100%);
}

/* Bottom quick-action bar (mobile only) */
.app-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 110;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: var(--app-surface, rgba(17, 24, 39, 0.96));
    backdrop-filter: blur(12px);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.22);
}

.app-bottom-nav__inner {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0.15rem;
    max-width: 56rem;
    margin: 0 auto;
    padding: 0.35rem 0.5rem 0.45rem;
}

/* Positions bottom-sheet (mobile): reuses the desktop positions sidebar */
.positions-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.6);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    z-index: 125;
}

.positions-sheet-backdrop[hidden] {
    display: none;
}

.binary-positions-sidebar__close {
    display: none;
    flex: 0 0 auto;
    width: 1.9rem;
    height: 1.9rem;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0.55rem;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-secondary, #cbd5e1);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 1023px) {
    .app-bottom-nav {
        display: block;
    }

    .app-shell--bottom-nav .app-main {
        padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0));
    }

    /* Attach the trade screen straight under the header and edge-to-edge */
    .app-main--trade {
        padding-top: 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Slide the positions sidebar up as a full-screen panel */
    body.positions-sheet-open .binary-trade-desk__col--positions {
        display: flex !important;
        position: fixed;
        inset: 0;
        max-height: none;
        z-index: 130;
        background: var(--bg-secondary, #0f1623);
        border: none;
        border-radius: 0;
        box-shadow: none;
        overflow: hidden;
        animation: positionsSheetUp 0.22s ease;
        padding-top: env(safe-area-inset-top, 0);
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0));
    }

    body.positions-sheet-open .binary-positions-sidebar {
        min-height: 0;
        height: 100%;
        max-height: 100%;
    }

    body.positions-sheet-open {
        overflow: hidden;
    }

    .binary-positions-sidebar__close {
        display: inline-flex;
    }

    .binary-positions-sidebar__account {
        margin-left: auto;
    }
}

@keyframes positionsSheetUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.app-bottom-nav__item {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.35rem 0.25rem;
    border: 0;
    border-radius: 0.55rem;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    font-size: 0.625rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.app-bottom-nav__item i {
    font-size: 1rem;
}

.app-bottom-nav__item:hover,
.app-bottom-nav__item:focus-visible,
.app-bottom-nav__item--active {
    color: var(--text-primary, #f3f4f6);
    background: rgba(255, 255, 255, 0.05);
}

.app-bottom-nav__item--active {
    color: var(--primary, #00df9a);
}

.app-bottom-nav__item--active i {
    color: var(--primary, #00df9a);
}

.app-bottom-nav__item--deposit {
    color: var(--primary, #00df9a);
}

.app-bottom-nav__item--deposit i {
    color: var(--primary, #00df9a);
}

.app-bottom-nav__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    line-height: 1;
}

.light-theme .app-bottom-nav {
    background: rgba(255, 255, 255, 0.96);
    border-top-color: rgba(15, 23, 42, 0.08);
}

.light-theme .trade-topbar-profile-account-card {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.1);
}

.light-theme .trade-topbar-profile-account-card--demo.trade-topbar-account-option--active {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.45);
}

.light-theme .trade-topbar-profile-account-card--real.trade-topbar-account-option--active {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.45);
}

/* Full-page support chat */
.support-chat-page-wrap {
    max-width: 52rem;
    margin: 0 auto;
    padding: 0.75rem 1rem 1.25rem;
    min-height: calc(100dvh - 7rem);
    display: flex;
    flex-direction: column;
}

.support-chat-page {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.support-chat-page__card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 1rem;
    background: var(--bg-secondary, #141414);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.support-chat-page__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: var(--bg-primary, #0f1419);
}

.support-chat-page__header-main {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.support-chat-page__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.support-chat-page__status {
    margin: 0.2rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-secondary, #9ca3af);
}

.support-chat-page__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.support-chat-page__body .support-chat__content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.support-chat-page__messages {
    flex: 1;
    min-height: 12rem;
    max-height: none;
    overflow-y: auto;
}

.support-chat-page__footer {
    flex-shrink: 0;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: var(--bg-primary, #0f1419);
}

@media (min-width: 1024px) {
    .support-chat-page-wrap {
        padding-top: 1rem;
        min-height: calc(100vh - 6rem);
    }

    .support-chat-page__messages {
        min-height: 20rem;
    }
}

/* ============================================================
   Binary trade desk — phone & tablet layout (<= 1023px)
   A clean, modern mobile trading screen: hero chart, rounded
   pill controls, a signature stake box, chip presets and bold
   Buy/Sell buttons. Uses the existing blue/cyan trade accents.
   ============================================================ */
@media (max-width: 1023px) {
    /* ---- One-screen layout: lock the trade view to the viewport ---- */
    .app-shell--topnav .app-body:has(.app-main--trade) {
        height: 100dvh;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .app-body:has(.app-main--trade) .app-topbar {
        position: static;
        flex: 0 0 auto;
    }

    .app-main--trade {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .app-shell--bottom-nav .app-main--trade {
        padding-bottom: calc(3.1rem + env(safe-area-inset-bottom, 0));
    }

    .app-main--trade > .binary-trade-page.page-container {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .binary-trade-page.page-container {
        padding: 0;
        max-width: 100%;
    }

    /* Flat, borderless desk fills the available height as a clean stack. */
    .binary-trade-desk {
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        gap: 0.3rem;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden;
    }

    .binary-trade-desk__col {
        border: none;
    }

    /* ---- Hero chart card (full-bleed, fills leftover height) ---- */
    .binary-trade-desk__col--chart {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        border-radius: 0 0 0.5rem 0.5rem;
        background: var(--bg-secondary, #0f1623);
        border: none;
        border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.07));
        overflow: hidden;
    }

    .binary-trade-desk__col--chart .line-chart-panel--desk,
    .binary-trade-desk__col--chart .line-chart-panel--markets-style {
        height: auto;
        min-height: 0;
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        padding: 0.4rem 0.45rem 0.3rem;
    }

    .binary-trade-desk__col--chart .line-chart-panel__markets-preview {
        flex: 1 1 auto;
        min-height: 0;
    }

    .binary-trade-desk__col--chart .line-chart-panel--markets-style .markets-page__chart-wrap,
    .binary-trade-desk__col--chart .line-chart-panel--markets-style .markets-page__chart,
    .binary-trade-desk__col--chart #tradingChart {
        min-height: 5rem;
        height: 100%;
    }

    .binary-trade-desk__col--chart .line-chart-panel--markets-style .line-chart-panel__toolbar {
        padding: 0 0 0.4rem;
        border-bottom: none;
    }

    /* Market picker as a rounded "symbol" pill */
    .binary-trade-desk .trade-chart-picker__trigger {
        padding: 0.45rem 0.8rem;
        font-size: 0.85rem;
        font-weight: 700;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    }

    .binary-trade-desk .line-chart-panel__btn {
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
        border-radius: 0.6rem;
    }

    /* Compact 0-9 live-digit strip on mobile: one tight row above Auto/Manual */
    .binary-trade-desk .line-chart-panel__digit-footer {
        flex-shrink: 0;
        margin: 0;
        padding: 0.3rem 0.4rem 0.35rem;
        min-height: 0;
        border-radius: 0;
    }

    .binary-trade-desk .line-chart-panel__digit-footer .digit-stats__row {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 0.15rem;
        min-height: 0;
    }

    .binary-trade-desk .line-chart-panel__digit-footer .digit-stat {
        gap: 0.08rem;
        padding: 0;
    }

    .binary-trade-desk .line-chart-panel__digit-footer .digit-stat__tick-pointer {
        border-left-width: 4px;
        border-right-width: 4px;
        border-bottom-width: 5px;
        margin-bottom: 0.08rem;
    }

    .binary-trade-desk .line-chart-panel__digit-footer .digit-stat__ring {
        width: 1.45rem;
        height: 1.45rem;
        padding: 1.5px;
    }

    .binary-trade-desk .line-chart-panel__digit-footer .digit-stat__bubble {
        font-size: 0.6rem;
    }

    .binary-trade-desk .line-chart-panel__digit-footer .digit-stat__pct {
        font-size: 0.5rem;
    }

    /* ---- Trade controls card ---- */
    .binary-trade-desk__col--trade {
        flex: 0 0 auto;
        border-radius: 0.5rem 0.5rem 0 0;
        background: var(--bg-secondary, #0f1623);
        border: none;
        border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.07));
        overflow: hidden;
    }

    .binary-trade-panel {
        padding: 0.3rem 0.55rem 0.35rem;
        gap: 0;
        overflow: visible;
    }

    .binary-trade-panel__body {
        overflow: visible;
    }

    .binary-trade-panel__section {
        padding: 0.18rem 0;
        border-bottom: none;
    }

    .binary-field__label {
        font-size: 0.64rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: var(--text-muted, #9ca3af);
        margin-bottom: 0.2rem;
    }

    /* Hide the "Mode" caption — the toggle speaks for itself */
    .binary-trade-panel__section--mode .binary-field__label {
        display: none;
    }

    /* ---- Mode toggle: big segmented pills (Auto / Manual) ---- */
    .binary-trade-panel__section--mode .binary-segment-card {
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem;
        padding: 0;
        background: transparent;
        border: none;
    }

    .binary-trade-panel__section--mode .binary-contract-tab {
        padding: 0.4rem 0.5rem;
        font-size: 0.75rem;
        font-weight: 700;
        border-radius: 0.5rem;
        border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
        background: rgba(255, 255, 255, 0.03);
    }

    .binary-trade-panel__section--mode .binary-contract-tab--active {
        color: #bfdbfe;
        background: linear-gradient(180deg, rgba(59, 130, 246, 0.28), rgba(59, 130, 246, 0.14));
        border-color: rgba(96, 165, 250, 0.85);
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.5), 0 6px 16px rgba(37, 99, 235, 0.22);
    }

    /* ---- Contract type pills: swipeable outlined chips ---- */
    .binary-segment-card--contracts {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.45rem;
        padding: 0;
        background: transparent;
        border: none;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .binary-segment-card--contracts::-webkit-scrollbar {
        display: none;
    }

    .binary-segment-card--contracts .binary-contract-tab {
        flex: 0 0 auto;
        padding: 0.4rem 0.95rem;
        font-size: 0.75rem;
        font-weight: 600;
        border-radius: 0.5rem;
        border: 1px solid rgba(96, 165, 250, 0.4);
        background: rgba(255, 255, 255, 0.02);
        scroll-snap-align: start;
    }

    .binary-segment-card--contracts .binary-contract-tab--active {
        color: #bfdbfe;
        background: rgba(59, 130, 246, 0.16);
        border-color: #60a5fa;
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.5);
    }

    /* Barrier digits: all 10 visible, comfy tap targets */
    .binary-barrier-digits {
        gap: 0.25rem;
    }

    .binary-barrier-digit {
        padding: 0.4rem 0;
        font-size: 0.8rem;
        border-radius: 0.5rem;
    }

    /* Risk controls (TP / SL / multiplier) */
    .binary-field--inline .binary-field__input {
        padding: 0.32rem 0.5rem;
        font-size: 0.8rem;
        border-radius: 0.55rem;
    }

    .binary-session-pl {
        border-radius: 0.6rem;
        padding: 0.35rem 0.6rem;
        margin-top: 0.35rem;
    }

    /* ---- Stake control: the signature glowing box ---- */
    .binary-trade-panel__section--stake .binary-stake-header {
        margin-bottom: 0.2rem;
        justify-content: flex-end;
    }

    /* The box already shows "STAKE" inside, so drop the caption */
    .binary-stake-header .binary-field__label {
        display: none;
    }

    .binary-stake-control {
        gap: 0.45rem;
        align-items: stretch;
    }

    .binary-stake-control__btn {
        flex: 0 0 2.1rem;
        font-size: 1.15rem;
        font-weight: 500;
        border-radius: 0.6rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
    }

    .binary-stake-control__btn:active:not(:disabled) {
        background: rgba(96, 165, 250, 0.18);
        border-color: rgba(96, 165, 250, 0.6);
    }

    .binary-stake-control__input-wrap {
        position: relative;
        justify-content: center;
        padding: 0.15rem 0.85rem;
        border-radius: 0.6rem;
        border: 1.5px solid rgba(96, 165, 250, 0.6);
        background: rgba(59, 130, 246, 0.06);
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.18), inset 0 0 14px rgba(59, 130, 246, 0.08);
    }

    .binary-stake-control__input-wrap::before {
        content: "STAKE";
        position: absolute;
        left: 0.95rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.58rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        color: var(--text-muted, #9ca3af);
        pointer-events: none;
    }

    .binary-stake-control__currency {
        color: #60a5fa;
        font-size: 1rem;
        font-weight: 800;
        margin-right: 0.3rem;
    }

    .binary-stake-control__input {
        flex: 0 1 auto;
        width: auto;
        max-width: 7rem;
        text-align: center;
        font-size: 1.05rem;
        font-weight: 800;
        padding: 0.15rem 0;
    }

    .binary-pl-card {
        margin-top: 0.3rem;
        padding: 0.32rem 0.6rem;
        border-radius: 0.55rem;
    }

    .binary-pl-card__stats {
        font-size: 0.72rem;
    }

    .binary-pl-card__amount {
        font-size: 0.9rem;
    }

    /* Quick-amount presets: one compact line, no scroll */
    .binary-stake-presets {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0.25rem;
        margin-top: 0.3rem;
    }

    .binary-stake-preset {
        min-width: 0;
        padding: 0.28rem 0.1rem;
        font-size: 0.66rem;
        text-align: center;
        border-radius: 0.5rem;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    }

    .binary-stake-preset--active {
        color: #bfdbfe;
        background: rgba(59, 130, 246, 0.16);
        border-color: #60a5fa;
        box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.45);
    }

    /* ---- Action buttons: big, bold, rounded ---- */
    .binary-trade-panel__section--actions {
        position: static;
        padding: 0.3rem 0 0.1rem;
        margin-top: 0.05rem;
        background: transparent;
        border-top: none;
    }

    .binary-trade-btns {
        gap: 0.45rem;
    }

    .binary-trade-btn {
        min-height: 1.95rem;
        gap: 0;
        border-radius: 0.6rem;
        padding: 0.2rem 0.4rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .binary-trade-btn__label {
        font-size: 0.78rem;
        font-weight: 800;
        letter-spacing: 0.02em;
        line-height: 1.1;
    }

    .binary-trade-btn__amount {
        font-size: 0.58rem;
        opacity: 0.9;
        line-height: 1.1;
    }

    .binary-trade-btn__pct {
        font-size: 0.52rem;
        opacity: 0.75;
        line-height: 1.1;
    }
}

/* ============================================================
   Desktop: lock the trade desk to the viewport, edge-to-edge.
   No page padding, no scroll, no shifting of the main card.
   ============================================================ */
@media (min-width: 1024px) {
    .app-shell--topnav .app-body:has(.app-main--trade) {
        height: 100dvh;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .app-body:has(.app-main--trade) .app-topbar {
        position: static;
        flex: 0 0 auto;
    }

    .app-shell--topnav .app-main--trade {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0;
        overflow: hidden;
    }

    .app-main--trade > .binary-trade-page.page-container {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .binary-trade-page.page-container {
        padding: 0;
        max-width: 100%;
    }

    .binary-trade-desk {
        flex: 1 1 auto;
        height: 100%;
        min-height: 0;
        border: none;
        border-radius: 0;
        overflow: hidden;
    }

    /* Fill the column: spread the control sections evenly and pin the
       Buy/Sell buttons to the bottom, so there's no dead space after
       the quick-amount inputs. */
    .binary-trade-desk__col--trade .binary-trade-panel__body {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 0.5rem;
        overflow: hidden;
    }

    .binary-trade-desk__col--trade .binary-trade-panel__section {
        padding: 0.95rem 0;
    }

    /* The Auto/Manual toggle is self-explanatory — drop the "Mode" caption */
    .binary-trade-desk__col--trade .binary-trade-panel__section--mode .binary-field__label {
        display: none;
    }

    .binary-trade-desk__col--trade .binary-trade-panel__section--barrier-only:has(#binaryBarrierWrap.hidden) {
        display: none;
    }

    /* Slightly larger Auto / Manual tabs on desktop */
    .binary-trade-desk__col--trade .binary-trade-panel__section--mode .binary-segment-card {
        gap: 0.6rem;
    }

    .binary-trade-desk__col--trade .binary-trade-panel__section--mode .binary-contract-tab {
        padding: 0.7rem 0.6rem;
        font-size: 0.85rem;
        border-radius: 0.5rem;
    }
}

/* Mobile: drop the "Trading account" switcher card from the profile menu.
   Account switching stays available via the topbar balance pill. */
@media (max-width: 1023px) {
    .trade-topbar-dropdown--profile .trade-topbar-profile-accounts {
        display: none;
    }
}

/* Extra-small phones */
@media (max-width: 380px) {
    /* Keep Take profit / Stop loss / Multiplier on a single line */
    .binary-risk-controls__grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.3rem;
    }

    .binary-risk-controls__grid--3 .binary-field:last-child {
        grid-column: auto;
    }

    .binary-stake-control__btn {
        flex-basis: 2.2rem;
        font-size: 1.1rem;
    }

    .binary-stake-control__input {
        font-size: 1.05rem;
        max-width: 5.5rem;
    }

    .binary-trade-btn {
        min-height: 2rem;
    }

    .binary-trade-btn__label {
        font-size: 0.74rem;
    }

    .binary-segment-card--contracts .binary-contract-tab {
        padding: 0.5rem 0.9rem;
        font-size: 0.74rem;
    }

    .binary-trade-panel__section--mode .binary-contract-tab {
        font-size: 0.74rem;
        padding: 0.4rem 0.4rem;
    }

    .binary-barrier-digit {
        font-size: 0.78rem;
        padding: 0.5rem 0;
    }
}

/* Landscape phones: keep the chart flexible so controls still fit */
@media (max-width: 900px) and (orientation: landscape) {
    .binary-trade-desk__col--chart .line-chart-panel--markets-style .markets-page__chart-wrap,
    .binary-trade-desk__col--chart .line-chart-panel--markets-style .markets-page__chart,
    .binary-trade-desk__col--chart #tradingChart {
        min-height: 4rem;
        height: 100%;
    }
}

/* ============================================================
   Light theme: keep trade controls readable.
   The dark-theme defaults use pale text on pale fills for the
   selected states, which is unreadable on a white background.
   ============================================================ */
.light-theme .binary-contract-tab {
    color: var(--text-secondary, #334155);
}

.light-theme .binary-contract-tab--active,
.light-theme .binary-trade-panel__section--mode .binary-contract-tab--active,
.light-theme .binary-segment-card--contracts .binary-contract-tab--active,
.light-theme .binary-stake-preset--active {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.light-theme .binary-stake-preset {
    color: var(--text-secondary, #334155);
}

.light-theme .binary-stake-control__currency {
    color: #2563eb;
}

.light-theme .binary-stake-control__input-wrap {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18), inset 0 0 14px rgba(37, 99, 235, 0.05);
}

