:root {
    --primary: #00df9a;
    --primary-dark: #00b377;
    --dark: #000300;
    --gray-800: #1a1a1a;
    --gray-700: #2a2a2a;
    --nav-height: 4rem;
}

@media (min-width: 768px) {
    :root {
        --nav-height: 5rem;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--app-bg, var(--dark));
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text-primary, white);
}

.bg-dark {
    background-color: var(--dark) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.bg-gradient {
    background: linear-gradient(to right, rgba(0, 223, 154, 0.2), rgba(0, 0, 0, 0));
}

.text-gradient {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hover-gradient {
    transition: all 0.3s ease;
}

.hover-gradient:hover {
    background: linear-gradient(to right, var(--primary), var(--primary-dark)) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 223, 154, 0.3);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Mobile menu animation */
#mobile-menu {
    transition: left 0.5s ease-in-out;
}

#mobile-menu.open {
    left: 0 !important;
}

/* Form styles */
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 223, 154, 0.2);
}

/* Button animations */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Layout */
.site-header {
    backdrop-filter: blur(8px);
    background-color: var(--app-topbar-bg, rgba(0, 3, 0, 0.95));
}

/* App sidebar layout (logged-in pages) */
.app-shell {
    min-height: 100vh;
    background: var(--app-bg, var(--dark));
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    height: 100dvh;
    background: var(--app-sidebar-bg, #060806);
    border-right: 1px solid var(--app-sidebar-border, rgba(0, 223, 154, 0.18));
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: transform 0.3s ease;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 1.15rem;
    font-weight: 700;
    text-decoration: none;
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
}

.sidebar-close:hover {
    color: var(--text-primary, #fff);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    margin-bottom: 0.15rem;
    border-radius: 0.5rem;
    color: var(--text-muted, #9ca3af);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    cursor: pointer;
}

.sidebar-link:hover {
    color: var(--text-primary, #fff);
    background: var(--app-link-hover-bg, rgba(0, 223, 154, 0.08));
}

.sidebar-link-active {
    color: var(--primary) !important;
    background: var(--app-link-active-bg, rgba(0, 223, 154, 0.14)) !important;
    font-weight: 600;
}

.sidebar-icon {
    width: 1.25rem;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 0.75rem 0.5rem 1rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    flex-shrink: 0;
}

.sidebar-logout {
    color: #f87171 !important;
}

.sidebar-logout:hover {
    background: rgba(248, 113, 113, 0.1) !important;
    color: #fca5a5 !important;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: var(--app-overlay, rgba(0, 0, 0, 0.55));
    z-index: 45;
}

.app-body {
    min-height: 100vh;
    min-height: 100dvh;
}

.app-topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--app-topbar-bg, rgba(0, 3, 0, 0.98));
    border-bottom: 1px solid var(--border-color, #1f2937);
    position: sticky;
    top: 0;
    z-index: 40;
}

.app-topbar-menu {
    background: none;
    border: none;
    color: var(--text-primary, #fff);
    font-size: 1.25rem;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
}

.app-topbar-logo {
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    flex: 1;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.app-topbar-icon {
    background: none;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 1.1rem;
    padding: 0.35rem;
    cursor: pointer;
}

.app-topbar-logout {
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.app-main {
    padding: 1rem;
}

@media (min-width: 640px) {
    .app-main {
        padding: 1.25rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .app-shell--topnav .app-sidebar,
    .app-shell--topnav .sidebar-backdrop {
        display: none !important;
    }

    .app-shell--topnav .app-body {
        margin-left: 0;
    }

    .app-shell--topnav .app-topbar--trade {
        display: flex;
    }

    .app-shell--topnav .app-main:not(.app-main--trade) {
        padding: 1.5rem 2rem;
    }

    .app-shell--topnav .app-main--trade {
        padding: 0;
        max-width: 100%;
    }
}

@media (max-width: 1023px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }
}

/* Top navigation layout (all logged-in pages) */
.app-shell--topnav .app-topbar--trade {
    display: flex;
}

.app-topbar--trade {
    gap: 1rem;
    padding: 0.65rem 1rem;
    flex-wrap: wrap;
}

.app-topbar--trade .app-topbar-logo {
    flex: 0 0 auto;
    font-size: 1.05rem;
}

.trade-topbar-nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
    padding: 0 0.5rem;
}

.trade-topbar-nav__link {
    color: var(--text-muted, #9ca3af);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.45rem 0.75rem;
    border-radius: 0.45rem;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}

.trade-topbar-nav__link:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.05);
}

.trade-topbar-nav__link--active {
    color: var(--primary, #00df9a);
    background: rgba(0, 223, 154, 0.1);
}

.trade-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    flex-wrap: wrap;
}

.trade-topbar-balance {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.trade-topbar-balance strong {
    font-family: ui-monospace, monospace;
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
}

.trade-topbar-balance__badge {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1;
}

.trade-topbar-balance__badge--demo {
    background: #ef4444;
    color: #fff;
}

.trade-topbar-balance__badge--real {
    background: #22c55e;
    color: #052e16;
}

.trade-topbar-btn {
    border: none;
    border-radius: 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.trade-topbar-btn--primary {
    background: #3b82f6;
    color: #fff;
}

.trade-topbar-btn--primary:hover {
    background: #2563eb;
}

.trade-topbar-btn--ghost {
    background: transparent;
    color: var(--text-muted, #9ca3af);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
}

.trade-topbar-btn--ghost:hover {
    color: var(--text-primary, #fff);
    background: rgba(255, 255, 255, 0.05);
}

.trade-topbar-icon {
    display: none;
}

.trade-topbar-logout {
    display: none;
}

@media (min-width: 1024px) {
    .trade-topbar-nav {
        display: flex;
    }

    .trade-topbar-icon,
    .trade-topbar-logout {
        display: inline-flex;
    }

    .app-shell--topnav .trade-topbar-btn--ghost:not(.trade-topbar-logout) {
        display: inline-flex;
    }
}

@media (max-width: 1023px) {
    .app-shell--topnav .trade-topbar-nav,
    .app-shell--topnav .trade-topbar-btn,
    .app-shell--topnav .trade-topbar-balance {
        display: none;
    }

    .app-shell--topnav .app-topbar--trade .app-topbar-logo {
        flex: 1;
    }
}

.page-container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
}

@media (min-width: 640px) {
    .page-container {
        padding: 1.25rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .page-container {
        padding: 1.5rem 2rem;
    }
}

body.auth-page {
    --nav-height: 0;
}

body.auth-page .auth-shell {
    min-height: 100svh;
    min-height: 100dvh;
}

.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0 3rem;
    min-height: 100svh;
    min-height: 100dvh;
}

.auth-shell {
    min-height: calc(100svh - var(--nav-height));
    min-height: calc(100dvh - var(--nav-height));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(ellipse at top, rgba(0, 223, 154, 0.08) 0%, transparent 55%),
        var(--app-bg, var(--dark));
}

@media (min-width: 768px) {
    .auth-shell {
        justify-content: center;
        padding: 2rem 1.5rem;
    }
}

.auth-mobile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
    width: 100%;
    max-width: 56rem;
    margin-bottom: 1rem;
}

.auth-mobile-brand__logo {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-mobile-brand__tagline {
    color: #9ca3af;
    font-size: 0.875rem;
}

@media (min-width: 1024px) {
    .auth-mobile-brand {
        display: none;
    }
}

.auth-layout {
    width: 100%;
    max-width: 56rem;
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 0.875rem;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(0, 223, 154, 0.15));
    box-shadow: var(--app-shadow, 0 25px 50px -12px rgba(0, 0, 0, 0.55));
}

.auth-layout--register {
    max-width: 60rem;
}

@media (min-width: 1024px) {
    .auth-layout {
        grid-template-columns: 1fr 1.1fr;
        min-height: 32rem;
    }

    .auth-layout--register {
        min-height: 36rem;
    }
}

.auth-brand {
    display: none;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    background: linear-gradient(145deg, rgba(0, 223, 154, 0.18) 0%, var(--app-bg, rgba(0, 3, 0, 0.95)) 55%);
    border-right: 1px solid var(--border-color, rgba(0, 223, 154, 0.12));
}

@media (min-width: 1024px) {
    .auth-brand {
        display: flex;
    }
}

.auth-brand-logo {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.auth-brand h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.auth-brand p {
    color: var(--text-muted, #9ca3af);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.auth-brand-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-brand-list li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-secondary, #d1d5db);
    font-size: 0.95rem;
}

.auth-brand-list i {
    color: var(--primary);
    width: 1rem;
    text-align: center;
}

.auth-panel {
    background: var(--app-surface, #111827);
    padding: 1.5rem 1.25rem;
}

@media (min-width: 640px) {
    .auth-panel {
        padding: 2rem 2.25rem;
    }
}

@media (max-width: 639px) {
    .auth-input {
        font-size: 16px;
    }
}

.auth-panel-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

@media (max-width: 639px) {
    .auth-panel-header {
        margin-bottom: 1.25rem;
    }

    .auth-panel-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
        margin-bottom: 0.65rem;
    }

    .auth-panel-header h1 {
        font-size: 1.35rem;
    }
}

@media (min-width: 1024px) {
    .auth-panel-header {
        text-align: left;
    }
}

.auth-panel-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 223, 154, 0.12);
    color: var(--primary);
    font-size: 1.25rem;
}

@media (min-width: 1024px) {
    .auth-panel-icon {
        margin-left: 0;
        margin-right: 0;
    }
}

.auth-panel-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.auth-panel-header p {
    color: var(--text-muted, #9ca3af);
    font-size: 0.9rem;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.35);
    color: #f87171;
}

.auth-field {
    margin-bottom: 1.1rem;
}

.auth-field label {
    display: block;
    color: var(--text-secondary, #d1d5db);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.auth-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color-strong, #374151);
    background: var(--app-input-bg, #0f1419);
    color: var(--text-primary, #f3f4f6);
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input::placeholder {
    color: var(--text-muted, #6b7280);
}

.auth-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 223, 154, 0.15);
}

.auth-phone-group {
    display: flex;
}

.auth-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    border: 1px solid var(--border-color-strong, #374151);
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    background: var(--bg-tertiary, #1a222d);
    color: var(--text-muted, #9ca3af);
    font-size: 0.9rem;
    white-space: nowrap;
}

.auth-phone-group .auth-input {
    border-radius: 0 0.5rem 0.5rem 0;
}

.auth-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 480px) {
    .auth-row-2 {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .auth-row-2 .auth-field {
        margin-bottom: 1.1rem;
    }
}

.auth-remember-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 0.65rem;
}

.auth-remember-row label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted, #9ca3af);
    font-size: 0.875rem;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 500;
}

.auth-remember-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-remember-row a {
    color: var(--primary);
    font-size: 0.875rem;
    text-decoration: none;
}

.auth-remember-row a:hover {
    color: #fff;
}

.auth-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--primary);
    color: #000;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.auth-submit:hover {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 223, 154, 0.35);
}

.auth-footer-text {
    text-align: center;
    margin-top: 1.25rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

.auth-footer-text a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer-text a:hover {
    color: #fff;
}

.password-toggle-wrap .auth-input {
    padding-right: 2.75rem;
}

.nav-tabs-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.nav-tabs-scroll nav {
    display: flex;
    min-width: max-content;
    gap: 1.5rem;
}

.nav-tabs-scroll .tab-btn {
    white-space: nowrap;
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .nav-tabs-scroll .tab-btn {
        font-size: 1rem;
    }
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.error-page-icon {
    font-size: 4rem;
}

.error-page-code {
    font-size: 4rem;
    line-height: 1;
}

@media (min-width: 640px) {
    .error-page-icon {
        font-size: 6rem;
    }

    .error-page-code {
        font-size: 6rem;
    }
}

@media (min-width: 768px) {
    .error-page-icon {
        font-size: 8rem;
    }

    .error-page-code {
        font-size: 8rem;
    }
}

/* Chart container */
#tradingChart,
.line-chart-panel__canvas {
    background: var(--gray-800);
    border-radius: 8px;
    min-height: 360px;
    width: 100%;
    position: relative;
}

.line-chart-panel__canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 360px;
}

.line-chart-panel__overlay {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 4;
    pointer-events: none;
}

.line-chart-panel__overlay-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.35rem;
    background: rgba(15, 20, 30, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.line-chart-panel__overlay-value {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: #fff;
    letter-spacing: 0.02em;
}

.line-chart-panel__overlay-change {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: ui-monospace, monospace;
}

.line-chart-panel__overlay-change--up {
    color: #4ade80;
}

.line-chart-panel__overlay-change--down {
    color: #f87171;
}

.light-theme .line-chart-panel__overlay-price {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.08);
}

.light-theme .line-chart-panel__overlay-value {
    color: #111827;
}

.binary-trade-main {
    min-width: 0;
    width: 100%;
}

.binary-trade-main .line-chart-panel {
    width: 100%;
}

.line-chart-panel {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 0.875rem;
    padding: 1rem;
}

.line-chart-panel__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.line-chart-panel__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.line-chart-panel__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.line-chart-panel__controls--full {
    width: 100%;
    justify-content: space-between;
}

.line-chart-panel__select {
    background: var(--app-input-bg, #374151);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color-strong, #4b5563);
    border-radius: 0.5rem;
    padding: 0.45rem 0.65rem;
    font-size: 0.8125rem;
    min-width: 8rem;
}

.line-chart-panel__buttons {
    display: flex;
    gap: 0.35rem;
}

.line-chart-panel__btn {
    background: var(--app-input-bg, #374151);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color-strong, #4b5563);
    border-radius: 0.45rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    cursor: pointer;
}

.line-chart-panel__btn:hover {
    background: var(--app-row-hover, #4b5563);
}

.line-chart-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.35rem 0.15rem;
}

.line-chart-panel__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
}

.line-chart-panel__badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.35);
    border-radius: 999px;
    padding: 0.15rem 0.45rem;
}

.line-chart-panel__price {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    color: var(--text-primary, #fff);
    letter-spacing: 0.02em;
}

@media (min-width: 640px) {
    .line-chart-panel__price {
        font-size: 1.6rem;
    }
}

.digit-stats {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.digit-stats__title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.5rem;
}

.digit-stats__row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.35rem;
}

@media (min-width: 640px) {
    .digit-stats__row {
        grid-template-columns: repeat(10, minmax(0, 1fr));
    }
}

.digit-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: transparent;
    border: none;
    padding: 0 0 0.15rem;
    cursor: pointer;
    color: inherit;
    font: inherit;
    position: relative;
}

.digit-stat__tick-pointer {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 7px solid #f97316;
    opacity: 0;
    margin-bottom: 0.2rem;
    filter: drop-shadow(0 1px 3px rgba(249, 115, 22, 0.45));
    transition: opacity 0.35s ease, transform 0.35s ease;
    transform: translateY(-3px);
}

.digit-stat--last-tick .digit-stat__tick-pointer {
    opacity: 1;
    transform: translateY(0);
}

.digit-stat__ring {
    --digit-accent: #38bdf8;
    --digit-track: #3a4558;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(
        from 225deg,
        var(--digit-accent) 0deg 115deg,
        var(--digit-track) 115deg 360deg
    );
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.digit-stat__ring--selected {
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.45);
    transform: scale(1.06);
}

.digit-stat:focus-visible .digit-stat__ring {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.digit-stat__bubble {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #151b28;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    transition: transform 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, font-size 0.25s ease;
}

.digit-stat__pct {
    font-size: 0.625rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    transition: color 0.25s ease;
}

.digit-stat--pct-high {
    --digit-accent: #3b82f6;
}

.digit-stat--pct-high .digit-stat__bubble {
    color: #60a5fa;
}

.digit-stat--pct-high .digit-stat__pct {
    color: #60a5fa;
    font-weight: 700;
}

.digit-stat--pct-low {
    --digit-accent: #ef4444;
}

.digit-stat--pct-low .digit-stat__bubble {
    color: #f87171;
}

.digit-stat--pct-low .digit-stat__pct {
    color: #f87171;
    font-weight: 700;
}

.light-theme .digit-stat--pct-high .digit-stat__bubble {
    color: #2563eb;
}

.light-theme .digit-stat--pct-high .digit-stat__pct {
    color: #2563eb;
}

.light-theme .digit-stat--pct-low .digit-stat__bubble {
    color: #dc2626;
}

.light-theme .digit-stat--pct-low .digit-stat__pct {
    color: #dc2626;
}

.light-theme .digit-stat__ring {
    --digit-track: #cbd5e1;
}

.light-theme .digit-stat__bubble {
    background: #f8fafc;
    color: #0f172a;
}

.light-theme .digit-stat__pct {
    color: #64748b;
}

.digit-stat--win-a .digit-stat__ring {
    --digit-track: rgba(34, 197, 94, 0.45);
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.35);
}

.digit-stat--win-b .digit-stat__ring {
    --digit-track: rgba(239, 68, 68, 0.45);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
}

.digit-stat--result-win .digit-stat__bubble {
    font-size: 1rem;
    font-weight: 900;
    color: #22c55e;
   box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.55), 0 0 12px rgba(34, 197, 94, 0.35);
    transform: scale(1.12);
}

.digit-stat--result-win .digit-stat__pct {
    color: #4ade80;
    font-weight: 800;
    font-size: 0.7rem;
}

.digit-stat--result-loss .digit-stat__bubble {
    font-size: 1rem;
    font-weight: 900;
    color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.55), 0 0 12px rgba(248, 113, 113, 0.35);
    transform: scale(1.12);
}

.digit-stat--result-loss .digit-stat__pct {
    color: #fca5a5;
    font-weight: 800;
    font-size: 0.7rem;
}

.binary-sound-toggle[aria-pressed="false"] {
    opacity: 0.55;
}

.binary-sound-toggle[aria-pressed="false"] i {
    color: var(--text-muted, #94a3b8);
}

.binary-trade-flash {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.binary-trade-flash:not([hidden]) {
    opacity: 1;
}

.binary-trade-flash__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 1.25rem 2rem;
    border-radius: 0.75rem;
    background: rgba(15, 20, 30, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    animation: binaryTradeFlashIn 0.35s ease-out;
}

.binary-trade-flash--win .binary-trade-flash__card {
    border-color: rgba(34, 197, 94, 0.35);
    box-shadow: 0 8px 32px rgba(34, 197, 94, 0.25);
}

.binary-trade-flash--loss .binary-trade-flash__card {
    border-color: rgba(248, 113, 113, 0.35);
    box-shadow: 0 8px 32px rgba(248, 113, 113, 0.25);
}

.binary-trade-flash__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.binary-trade-flash--win .binary-trade-flash__label {
    color: #4ade80;
}

.binary-trade-flash--loss .binary-trade-flash__label {
    color: #f87171;
}

.binary-trade-flash__amount {
    font-size: 1.75rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.binary-trade-flash--win .binary-trade-flash__amount {
    color: #22c55e;
}

.binary-trade-flash--loss .binary-trade-flash__amount {
    color: #ef4444;
}

@keyframes binaryTradeFlashIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.light-theme .binary-trade-flash__card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 0, 0, 0.08);
}

.light-theme .digit-stat--result-win .digit-stat__bubble {
    color: #15803d;
}

.light-theme .digit-stat--result-loss .digit-stat__bubble {
    color: #dc2626;
}

/* Modal styles */
.modal {
    backdrop-filter: blur(4px);
}

/* Table styles */
table {
    border-collapse: collapse;
}

th, td {
    border-bottom: 1px solid #374151;
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* Status badges */
.status-pending {
    background-color: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.status-completed {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-failed {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.password-toggle-wrap {
    position: relative;
}

.password-toggle-wrap input {
    padding-right: 2.75rem;
    width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.25rem;
}

.password-toggle-btn:hover {
    color: var(--text-primary, #ffffff);
}

.password-toggle-btn .hidden {
    display: none;
}

/* App page layout — compact cards & typography */
.app-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.app-page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.app-page-header p {
    font-size: 0.875rem;
    color: var(--text-muted, #9ca3af);
}

.app-card {
    background: var(--app-surface, #111827);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    border-radius: 0.625rem;
    padding: 1rem 1.125rem;
    box-shadow: var(--app-shadow, none);
}

@media (min-width: 640px) {
    .app-card {
        padding: 1.125rem 1.25rem;
    }
}

.app-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-card-title i {
    color: var(--primary);
    font-size: 0.9rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .stat-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.stat-grid--3 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .stat-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.stat-card {
    background: var(--app-surface, #111827);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    border-radius: 0.625rem;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: var(--app-shadow, none);
}

.stat-card__label {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.15rem;
}

.stat-card__value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.stat-card__icon--green {
    background: rgba(0, 223, 154, 0.12);
    color: var(--primary);
}

.stat-card__icon--blue {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.stat-card__icon--yellow {
    background: rgba(234, 179, 8, 0.12);
    color: #facc15;
}

.stat-card__icon--purple {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
}

.stat-card__icon--red {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
}

.app-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color-strong, #374151);
    background: var(--app-input-bg, #0f1419);
    color: var(--text-primary, #f3f4f6);
}

.app-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 223, 154, 0.15);
}

.app-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
    margin-bottom: 0.35rem;
}

.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.app-btn-primary {
    background: var(--primary);
    color: #000;
}

.app-btn-primary:hover {
    filter: brightness(1.05);
}

.app-btn-ghost {
    background: var(--app-ghost-btn-bg, #1f2937);
    color: var(--text-secondary, #e5e7eb);
}

.app-btn-ghost:hover {
    background: var(--app-ghost-btn-hover, #374151);
}

.app-btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
}

.app-alert {
    padding: 0.65rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.app-alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.app-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.app-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.app-table {
    width: 100%;
    font-size: 0.8125rem;
    border-collapse: collapse;
}

.app-table th {
    text-align: left;
    color: var(--text-muted, #9ca3af);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    white-space: nowrap;
}

.app-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.04));
    color: var(--text-secondary, #e5e7eb);
}

.app-table tbody tr:hover {
    background: var(--app-row-hover, rgba(255, 255, 255, 0.02));
}

.app-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
}

.app-badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.app-badge-warning {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.app-badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.app-badge-muted {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--app-modal-backdrop, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.app-modal-backdrop.hidden {
    display: none;
}

.app-modal {
    background: var(--app-surface, #111827);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 0.75rem;
    padding: 1.25rem;
    width: 100%;
    max-width: 24rem;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--app-shadow, none);
}

.app-modal h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.app-modal-balance {
    background: rgba(0, 223, 154, 0.08);
    border: 1px solid rgba(0, 223, 154, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.app-modal-balance p:first-child {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.app-modal-balance p:last-child {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

/* Responsive dialog (trade + deposit modals) */
body.app-dialog-open {
    overflow: hidden;
}

.app-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--app-modal-backdrop, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) 0.75rem max(0.75rem, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.app-dialog-overlay.hidden {
    display: none !important;
}

@media (min-width: 640px) {
    .app-dialog-overlay {
        align-items: center;
        padding: 1rem;
    }
}

.app-dialog {
    position: relative;
    width: 100%;
    max-width: 28rem;
    max-height: min(92dvh, calc(100dvh - 1.5rem));
    margin: auto 0;
    display: flex;
    flex-direction: column;
    background: var(--app-surface, #111827);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 0.875rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .app-dialog {
        margin: auto;
        max-height: min(90dvh, calc(100dvh - 2rem));
    }
}

.app-dialog--trade {
    max-width: 26rem;
}

.app-dialog__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.app-dialog__header h2,
.app-dialog__header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #fff);
    line-height: 1.3;
}

.app-dialog__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease, background 0.2s ease;
}

.app-dialog__close:hover {
    color: var(--text-primary, #fff);
    background: var(--app-row-hover, rgba(255, 255, 255, 0.06));
}

.app-dialog__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    -webkit-overflow-scrolling: touch;
}

.app-dialog__body--flush {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.app-dialog__footer {
    flex-shrink: 0;
    padding: 0.875rem 1.25rem 1rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: var(--app-surface, #111827);
}

.app-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.app-dialog__actions .app-btn,
.app-dialog__actions button[type="submit"],
.app-dialog__actions button[type="button"] {
    flex: 1 1 auto;
    min-width: 7rem;
}

.app-dialog-balance {
    background: rgba(0, 223, 154, 0.08);
    border: 1px solid rgba(0, 223, 154, 0.2);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.app-dialog-balance p:first-child {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    margin: 0 0 0.25rem;
}

.app-dialog-balance p:last-child {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

.app-dialog .bot-status__body {
    max-height: 8rem;
}

.app-dialog > form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.deposit-channel-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.deposit-channel-list__loading {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.deposit-channel-option {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.deposit-channel-option:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.04);
}

.deposit-channel-option input {
    margin-top: 0.2rem;
    accent-color: var(--primary);
}

.deposit-channel-option__body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.deposit-channel-option__body strong {
    font-size: 0.9rem;
}

.deposit-channel-option__body small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.deposit-hint {
    margin: 0.35rem 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.deposit-bank-details,
.deposit-channel-details {
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0.5rem;
    background: rgba(var(--primary-rgb), 0.06);
    font-size: 0.85rem;
}

.deposit-bank-details p,
.deposit-channel-details p {
    margin: 0 0 0.35rem;
}

.deposit-stk-waiting {
    text-align: center;
    padding: 1.25rem 0.5rem;
}

.deposit-stk-waiting__pulse {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: var(--primary);
    animation: deposit-stk-pulse 1.4s ease-in-out infinite;
}

@keyframes deposit-stk-pulse {
    0%, 100% { transform: scale(0.85); opacity: 0.6; }
    50% { transform: scale(1); opacity: 1; }
}

.deposit-stk-waiting p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.deposit-stk-waiting p strong {
    color: var(--text);
    font-size: 1rem;
}

.app-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: stretch;
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.875rem;
    }

    .dashboard-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Keep dashboard cards visually the same height on desktop */
.dashboard-grid > .app-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dashboard-grid > .app-card > .space-y-2,
.dashboard-grid > .app-card > .space-y-3,
.dashboard-grid > .app-card > .text-center {
    flex: 1 1 auto;
}

.dashboard-grid > .app-card > button,
.dashboard-grid > .app-card > a {
    margin-top: auto;
}

.dashboard-metrics-bar h2 {
    margin-bottom: 0;
}

.dashboard-metrics-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .dashboard-metrics-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1rem;
    }

    .dashboard-metrics-row--detailed {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dashboard-metrics-row--detailed {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-metric-item {
        padding: 0.65rem 0.875rem;
        border-radius: 0.5rem;
        background: var(--app-row-hover, rgba(255, 255, 255, 0.02));
        border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    }
}

.dashboard-metric-item--split {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .dashboard-metric-item--split {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }
}

@media (min-width: 1024px) {
    .dashboard-metric-item--split {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }
}

.app-card h2 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.app-card .metric-lg {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
}

.app-card .metric-md {
    font-size: 1rem;
    font-weight: 600;
}

/* Trading Bot panel */
.trading-bot-panel {
    position: relative;
    background: var(--app-surface, #111827);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 0.875rem;
    padding: 1.25rem;
    box-shadow: var(--app-shadow, none);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .trading-bot-panel {
        padding: 1.5rem;
    }
}

.trading-bot-panel__accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #00b377, var(--primary));
    background-size: 200% 100%;
    animation: bot-accent-shift 4s ease infinite;
}

@keyframes bot-accent-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.trading-bot-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.125rem;
}

.trading-bot-panel__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.trading-bot-panel__icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 223, 154, 0.12);
    color: var(--primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.trading-bot-panel__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary, #fff);
    margin: 0;
}

.trading-bot-panel__subtitle {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    margin: 0.15rem 0 0;
}

.trading-bot-panel__live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: rgba(0, 223, 154, 0.1);
    border: 1px solid rgba(0, 223, 154, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.trading-bot-panel__live-dot {
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--primary);
    animation: bot-pulse 2s ease infinite;
}

@keyframes bot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.bot-account-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    padding: 0.25rem;
    background: var(--app-input-bg, #0f1419);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 0.625rem;
    margin-bottom: 1rem;
}

.bot-account-switch__btn {
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.bot-account-switch__btn:hover {
    color: var(--text-primary, #fff);
    background: var(--app-row-hover, rgba(255, 255, 255, 0.04));
}

.bot-account-switch__btn.bot-tab--active {
    background: var(--primary);
    color: #000;
    box-shadow: 0 2px 8px rgba(0, 223, 154, 0.25);
}

.trading-bot-panel__balance {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    margin-bottom: 1rem;
    border-radius: 0.625rem;
    background: linear-gradient(135deg, rgba(0, 223, 154, 0.08) 0%, rgba(0, 223, 154, 0.02) 100%);
    border: 1px solid rgba(0, 223, 154, 0.18);
}

.trading-bot-panel__balance-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 223, 154, 0.15);
    color: var(--primary);
    flex-shrink: 0;
}

.trading-bot-panel__balance-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.15rem;
}

.trading-bot-panel__balance-value {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary, #fff);
}

.bot-side-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.bot-side-switch__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--app-ghost-btn-bg, #1f2937);
    color: var(--text-secondary, #d1d5db);
    cursor: pointer;
    transition: all 0.2s ease;
}

.bot-side-switch__btn:hover {
    border-color: var(--border-color-strong, rgba(255, 255, 255, 0.15));
}

.bot-side-switch__btn.bot-side--buy-active {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.45);
    color: #4ade80;
}

.bot-side-switch__btn.bot-side--sell-active {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.45);
    color: #f87171;
}

.bot-field {
    margin-bottom: 0.875rem;
}

.bot-field__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.35rem;
}

.bot-field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.bot-field__icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted, #6b7280);
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 1;
}

.bot-field__input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color-strong, #374151);
    background: var(--app-input-bg, #0f1419);
    color: var(--text-primary, #f3f4f6);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bot-field__input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 223, 154, 0.15);
}

.bot-field__hint {
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
    margin: 0.35rem 0 0;
}

.bot-field__control--with-prefix .bot-field__prefix {
    flex-shrink: 0;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color-strong, #374151);
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    background: var(--app-input-bg, #0f1419);
    color: var(--text-muted, #9ca3af);
}

.bot-field__control--with-prefix .bot-field__input {
    border-radius: 0 0.5rem 0.5rem 0;
    padding-left: 0.75rem;
}

.trading-bot-panel__price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.875rem;
    border-radius: 0.5rem;
    background: var(--app-row-hover, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.trading-bot-panel__price-label {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.trading-bot-panel__price-value {
    font-size: 0.875rem;
    font-weight: 600;
    font-family: ui-monospace, monospace;
    color: var(--text-primary, #fff);
}

.trading-bot-panel__price-sep {
    color: var(--text-muted, #6b7280);
    margin: 0 0.15rem;
}

/* Compact dashboard trading bot panel */
.trading-bot-panel--compact {
    padding: 0.75rem;
}

@media (min-width: 1024px) {
    .trading-bot-panel--compact {
        padding: 0.875rem;
    }
}

.trading-bot-panel--compact .trading-bot-panel__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.trading-bot-panel--compact .trading-bot-panel__header {
    margin-bottom: 0.5rem;
}

.trading-bot-panel--compact .trading-bot-panel__icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.85rem;
    border-radius: 0.45rem;
}

.trading-bot-panel--compact .trading-bot-panel__title-wrap {
    gap: 0.5rem;
}

.trading-bot-panel--compact .trading-bot-panel__title {
    font-size: 0.9rem;
}

.trading-bot-panel--compact .trading-bot-panel__live {
    font-size: 0.625rem;
    padding: 0.15rem 0.4rem;
}

.trading-bot-panel__bar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.bot-account-switch--compact {
    margin-bottom: 0;
    padding: 0.15rem;
    gap: 0.2rem;
}

.bot-account-switch--compact .bot-account-switch__btn {
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
}

.trading-bot-panel__balance-inline {
    text-align: right;
    min-width: 0;
}

.trading-bot-panel__balance-inline .trading-bot-panel__balance-label {
    display: block;
    font-size: 0.6rem;
    margin-bottom: 0;
    line-height: 1.2;
}

.trading-bot-panel__balance-inline .trading-bot-panel__balance-value {
    font-size: 0.95rem;
    line-height: 1.1;
}

.bot-side-switch--compact {
    margin-bottom: 0.5rem;
    gap: 0.35rem;
}

.bot-side-switch--compact .bot-side-switch__btn {
    padding: 0.4rem 0.5rem;
    font-size: 0.75rem;
}

.trading-bot-panel__market {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
    align-items: end;
    margin-bottom: 0.5rem;
}

.trading-bot-panel--compact .bot-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
}

.trading-bot-panel--compact .bot-config-grid > * {
    min-width: 0;
}

.trading-bot-panel--compact .trading-bot-panel__market > * {
    min-width: 0;
}

.bot-field__control--display {
    width: 100%;
}

.bot-field__display {
    width: 100%;
    padding: 0.4rem 0.5rem 0.4rem 1.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: ui-monospace, monospace;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color-strong, #374151);
    background: var(--app-row-hover, rgba(255, 255, 255, 0.03));
    color: var(--text-primary, #f3f4f6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    min-height: calc(0.4rem + 0.4rem + 1.25em);
    box-sizing: border-box;
}

.bot-field--compact {
    margin-bottom: 0;
}

.bot-field--compact .bot-field__label {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
}

.bot-field--compact .bot-field__input {
    padding: 0.4rem 0.5rem 0.4rem 1.85rem;
    font-size: 0.75rem;
}

.bot-field--compact .bot-field__icon {
    left: 0.55rem;
    font-size: 0.7rem;
}

.trading-bot-panel__price--inline {
    margin-bottom: 0;
    padding: 0.4rem 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    min-height: 100%;
}

.trading-bot-panel__price--inline .trading-bot-panel__price-label {
    font-size: 0.65rem;
    line-height: 1.2;
}

.trading-bot-panel__price--inline .trading-bot-panel__price-value {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.bot-config-grid--compact {
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

/* Dashboard bot fields stay 2-per-row on all screen sizes */
@media (max-width: 639px) {
    .trading-bot-panel--compact .trading-bot-panel__market,
    .trading-bot-panel--compact .bot-config-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trading-bot-panel--compact .bot-field--compact .bot-field__label {
        font-size: 0.6rem;
    }

    .trading-bot-panel--compact .bot-field--compact .bot-field__input,
    .trading-bot-panel--compact .bot-field__display {
        font-size: 0.7rem;
        padding: 0.35rem 0.4rem 0.35rem 1.65rem;
    }

    .trading-bot-panel--compact .bot-field--compact .bot-field__icon {
        left: 0.45rem;
        font-size: 0.65rem;
    }
}

.bot-status--compact {
    margin-bottom: 0.5rem;
    border-style: solid;
}

.bot-status--compact .bot-status__body {
    padding: 0.4rem 0.5rem;
    max-height: 7rem;
    font-size: 0.75rem;
}

.bot-status--compact .bot-status__body--live {
    max-height: 11rem;
}

.bot-status__idle--compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    text-align: left;
}

.bot-status__idle--compact i {
    font-size: 0.85rem;
    margin: 0;
    display: inline;
    flex-shrink: 0;
}

.bot-status__idle--compact span {
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--text-muted, #9ca3af);
}

.bot-cta--compact {
    padding: 0.55rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
}

.trading-bot-metrics--compact {
    margin-top: 0.5rem;
    padding: 0.65rem 0.75rem !important;
}

.trading-bot-metrics__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.trading-bot-metrics__head h3 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.trading-bot-metrics__tag {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
}

.trading-bot-metrics__tag--demo {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.trading-bot-metrics__tag--live {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.trading-bot-metrics__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
}

.trading-bot-metrics__item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.35rem 0.45rem;
    border-radius: 0.4rem;
    background: var(--app-row-hover, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.trading-bot-metrics__item span {
    font-size: 0.6rem;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.trading-bot-metrics__item strong {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    line-height: 1.2;
}


.bot-status {
    margin-bottom: 1rem;
    border-radius: 0.625rem;
    border: 1px dashed var(--border-color-strong, rgba(255, 255, 255, 0.12));
    background: var(--bot-status-bg, rgba(0, 0, 0, 0.15));
    overflow: hidden;
}

.bot-status__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.bot-status__body {
    padding: 0.75rem;
    max-height: 10rem;
    overflow-y: auto;
    font-size: 0.8125rem;
}

.bot-status__idle {
    text-align: center;
    padding: 0.5rem 0.25rem;
    color: var(--text-muted, #9ca3af);
}

.bot-status__idle i {
    font-size: 1.5rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.5rem;
    display: block;
}

.bot-status__idle p {
    font-weight: 600;
    color: var(--text-secondary, #d1d5db);
    margin: 0 0 0.25rem;
}

.bot-status__idle span {
    font-size: 0.75rem;
    line-height: 1.4;
}

.bot-status__body--live {
    max-height: 16rem;
}

.bot-session-live {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.bot-session-live__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.bot-session-live__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--bot-accent-text, #60a5fa);
}

.bot-session-live__bot {
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
}

.bot-session-live__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.bot-session-live__summary div {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.bot-session-live__summary span {
    color: var(--text-muted, #9ca3af);
}

.bot-session-live__summary strong {
    color: var(--text-secondary, #e5e7eb);
    font-weight: 600;
}

.bot-run-log__label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.375rem;
}

.bot-run-log__list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 6.5rem;
    overflow-y: auto;
}

.bot-run-log__item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    background: var(--bot-run-item-bg, rgba(55, 65, 81, 0.35));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    font-size: 0.75rem;
}

.bot-run-log__run {
    color: var(--text-secondary, #d1d5db);
    font-weight: 600;
}

.bot-run-log__stake {
    color: var(--text-muted, #9ca3af);
    text-align: center;
}

.bot-run-log__profit {
    text-align: right;
    font-weight: 600;
}

.bot-run-log__profit--win {
    color: var(--bot-profit-win, #4ade80);
}

.bot-run-log__profit--loss {
    color: var(--bot-profit-loss, #f87171);
}

.bot-run-log__empty {
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.bot-status__spinner--sm {
    width: 0.875rem;
    height: 0.875rem;
    border: 2px solid transparent;
    border-bottom-color: var(--bot-accent-text, #60a5fa);
    border-radius: 50%;
    animation: bot-status-spin 0.8s linear infinite;
}

.bot-session-end {
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
}

.bot-session-end--win {
    background: var(--bot-session-end-win-bg);
    border: 1px solid var(--bot-session-end-win-border);
}

.bot-session-end--loss {
    background: var(--bot-session-end-loss-bg);
    border: 1px solid var(--bot-session-end-loss-border);
}

.bot-session-end__title {
    font-size: 0.875rem;
    font-weight: 700;
    margin: 0;
}

.bot-session-end__title--win {
    color: var(--bot-profit-win, #4ade80);
}

.bot-session-end__title--loss {
    color: var(--bot-profit-loss, #f87171);
}

.bot-session-end__detail {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    margin: 0.25rem 0 0;
}

.bot-status__running {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0.5rem;
    text-align: center;
}

.bot-status__running p {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--bot-accent-text, #60a5fa);
}

.bot-status__running span {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.bot-status__running .bot-status__spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid transparent;
    border-bottom-color: var(--bot-accent-text, #60a5fa);
    border-radius: 50%;
    animation: bot-status-spin 0.8s linear infinite;
}

@keyframes bot-status-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Bot marketplace grid — pairs on larger screens only */
.bots-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

@media (min-width: 640px) {
    .bots-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.25rem;
    }
}

.bots-grid .bot-card,
.bots-grid .my-bot-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

.bots-grid .bot-card .p-6,
.bots-grid .my-bot-card .p-6 {
    padding: 0.875rem;
}

@media (min-width: 640px) {
    .bots-grid .bot-card .p-6,
    .bots-grid .my-bot-card .p-6 {
        padding: 1.5rem;
    }
}

.bots-grid .bot-card h3,
.bots-grid .my-bot-card h3 {
    font-size: 0.95rem;
    line-height: 1.25;
}

@media (min-width: 640px) {
    .bots-grid .bot-card h3,
    .bots-grid .my-bot-card h3 {
        font-size: 1.25rem;
    }
}

.bots-grid .bot-card .text-2xl,
.bots-grid .my-bot-card .text-2xl {
    font-size: 1.125rem;
}

.bots-grid .bot-card .text-xl,
.bots-grid .my-bot-card .text-xl {
    font-size: 1rem;
}

.bots-grid .bot-card .text-lg,
.bots-grid .my-bot-card .text-lg {
    font-size: 0.875rem;
}

.bots-grid .bot-card .px-6,
.bots-grid .bot-card .py-2,
.bots-grid .bot-card button {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.bots-grid .bot-card button {
    font-size: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .bots-grid .bot-card button {
        font-size: 0.875rem;
        padding: 0.5rem 1.5rem;
    }
}

.bots-grid .bot-card > .p-6:last-of-type,
.bots-grid .my-bot-card .p-6 {
    flex: 1 1 auto;
}

.bots-grid .bot-card > :last-child {
    margin-top: auto;
}

.my-bot-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .my-bot-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

.bot-cta {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 700;
    color: #000;
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.bot-cta:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(234, 179, 8, 0.35);
}

.bot-cta:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.bot-cta--stop {
    color: #fff;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.28);
}

.bot-cta--stop:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.bot-config-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.bot-config-grid .bot-field {
    margin-bottom: 0;
}

.bot-field--full {
    grid-column: 1 / -1;
}

/* Other pages: bot config stacks on small screens; dashboard stays 2-col */
@media (max-width: 639px) {
    .bot-config-grid {
        grid-template-columns: 1fr;
    }

    .trading-bot-panel--compact .bot-config-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.trading-bot-panel__footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0.875rem 0 0;
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
}

.trading-bot-metrics {
    margin-top: 0.5rem;
}

.light-theme .trading-bot-panel__live {
    color: #00b377;
}

.light-theme .bot-side-switch__btn.bot-side--buy-active {
    background: rgba(5, 150, 105, 0.1);
    border-color: rgba(5, 150, 105, 0.35);
    color: #059669;
}

.light-theme .bot-side-switch__btn.bot-side--sell-active {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
}

.light-theme .bot-field__input:focus {
    box-shadow: 0 0 0 2px rgba(0, 179, 119, 0.18);
}

.light-theme .bot-run-log__list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

.light-theme .bot-status__body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

/* Dashboard crypto wallets */
.crypto-wallets-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.crypto-wallets-card__head h2 {
    margin: 0;
}

.crypto-wallets-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.crypto-wallet-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.55rem 0.6rem;
    border-radius: 0.5rem;
    background: var(--app-row-hover, rgba(255, 255, 255, 0.02));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.crypto-wallet-item__head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.crypto-wallet-item__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.crypto-wallet-item__coin {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.crypto-wallet-item__address {
    font-family: ui-monospace, monospace;
    font-size: 0.7rem;
    color: var(--text-secondary, #d1d5db);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crypto-wallet-item__empty {
    margin: 0;
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
}

.crypto-wallet-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.crypto-wallet-item__actions .app-btn,
.crypto-wallet-item > .app-btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    font-size: 0.7rem;
    padding: 0.3rem 0.45rem;
}

/* Binary options trading */
.binary-trade-page.page-container {
    max-width: 100%;
    padding: 0.5rem;
}

@media (min-width: 1024px) {
    .binary-trade-page.page-container {
        padding: 0.75rem 1rem 1rem;
    }
}

.binary-trade-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.binary-trade-alert--success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.binary-trade-alert--error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.binary-trade-page {
    max-width: 100%;
}

.binary-trade-desk {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    min-height: calc(100vh - 7rem);
    background: var(--bg-secondary, #141414);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

@media (min-width: 1024px) {
    .binary-trade-desk {
        grid-template-columns: 240px minmax(0, 1fr) 300px;
        align-items: stretch;
        height: calc(100vh - 6rem);
        min-height: 520px;
    }
}

@media (min-width: 1280px) {
    .binary-trade-desk {
        grid-template-columns: 280px minmax(0, 1fr) 320px;
    }
}

.binary-trade-desk__col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

@media (min-width: 1024px) {
    .binary-trade-desk__col {
        border-bottom: none;
        border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    }

    .binary-trade-desk__col:last-child {
        border-right: none;
    }
}

.binary-trade-desk__col--chart {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.binary-trade-desk .line-chart-panel--desk,
.binary-trade-desk .binary-trade-panel,
.binary-trade-desk .binary-positions-sidebar {
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 1;
}

.binary-trade-desk .binary-positions-sidebar {
    max-height: none;
}

.binary-trade-desk__col--positions {
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1023px) {
    .binary-trade-desk__col--positions {
        max-height: 42vh;
        min-height: 260px;
    }

    .binary-trade-desk .binary-positions-sidebar {
        height: 100%;
        max-height: 100%;
    }
}

@media (min-width: 1024px) {
    .binary-trade-desk__col--positions {
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
    }

    .binary-trade-desk .binary-positions-sidebar {
        max-height: none;
        height: 100%;
        min-height: 0;
    }

    .binary-trade-desk__col--trade {
        min-height: 0;
        overflow: hidden;
    }

    .binary-trade-desk__col--trade .binary-trade-panel {
        height: 100%;
        max-height: none;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
        padding-bottom: 0;
    }

    .binary-trade-panel__body {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
    }

    .binary-trade-panel__section--actions {
        flex-shrink: 0;
        margin-top: auto;
        padding: 0.75rem 0 0.85rem;
        background: rgba(0, 0, 0, 0.18);
        border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
        position: relative;
        z-index: 2;
    }

    .binary-trade-panel__section--stake {
        padding-bottom: 0.55rem;
    }

    .binary-trade-btns {
        min-height: 4.75rem;
    }
}

.binary-trade-desk__col--chart .line-chart-panel--desk {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "panel-toolbar"
        "panel-chart"
        "panel-digits";
    flex: 1;
    margin-bottom: 0;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.binary-trade-desk__col--chart .line-chart-panel__toolbar {
    grid-area: panel-toolbar;
}

.binary-trade-desk__col--chart .line-chart-panel__head {
    display: none;
}

.binary-trade-desk__col--chart .line-chart-panel__body {
    grid-area: panel-chart;
    flex: unset;
    min-height: 0;
    overflow: hidden;
}

.binary-trade-desk__col--chart .line-chart-panel__canvas-wrap {
    flex: 1;
    min-height: 0;
    height: 100%;
    max-height: 100%;
}

.binary-trade-desk__col--chart .line-chart-panel__canvas,
.binary-trade-desk__col--chart #tradingChart {
    min-height: 0;
    height: 100%;
}

.binary-trade-desk__col--chart .line-chart-panel__digit-footer {
    grid-area: panel-digits;
}

.binary-trade-desk .line-chart-panel--desk {
    padding: 0.75rem 0.75rem 0;
}

.binary-trade-desk .line-chart-panel__toolbar {
    margin-bottom: 0;
    padding: 0 0 0.65rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.binary-trade-desk .line-chart-panel__digit-footer {
    flex-shrink: 0;
    margin: 0;
    padding: 0.65rem 0.75rem 0.75rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    background: rgba(0, 0, 0, 0.22);
    border-radius: 0 0 0.65rem 0.65rem;
    overflow: visible;
    z-index: 3;
    min-height: 4.25rem;
}

.binary-trade-desk .line-chart-panel__digit-footer .digit-stats__row {
    gap: 0.3rem;
    min-height: 3.75rem;
}

.line-chart-panel__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.binary-trade-desk .binary-positions-sidebar__head {
    padding: 0.85rem 0.75rem 0.65rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.binary-trade-desk .binary-positions-tabs {
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
}

.binary-positions-sidebar {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 320px;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.binary-positions-sidebar__head,
.binary-positions-tabs,
.binary-positions__list-head,
.binary-positions-footer {
    flex-shrink: 0;
}

.binary-positions__list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem 0.25rem;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.05));
}

.binary-positions__list-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.binary-positions__list-count {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-secondary, #cbd5e1);
    font-variant-numeric: tabular-nums;
}

.binary-positions__viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.binary-positions__viewport::before,
.binary-positions__viewport::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1.25rem;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.binary-positions__viewport::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(20, 20, 20, 0.92), transparent);
}

.binary-positions__viewport::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(20, 20, 20, 0.92), transparent);
}

.binary-positions__viewport--scroll-top::before {
    opacity: 1;
}

.binary-positions__viewport--scroll-bottom::after {
    opacity: 1;
}

.light-theme .binary-positions__viewport::before {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.95), transparent);
}

.light-theme .binary-positions__viewport::after {
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95), transparent);
}

.binary-positions__list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.65rem 0.75rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.55) transparent;
}

.binary-positions__list:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline-offset: -2px;
}

.binary-positions__list::-webkit-scrollbar {
    width: 6px;
}

.binary-positions__list::-webkit-scrollbar-track {
    background: transparent;
}

.binary-positions__list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.45);
    border-radius: 999px;
}

.binary-positions__list::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.7);
}

.binary-positions-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    padding: 0.65rem 0.75rem 0.5rem;
}

.binary-positions-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted, #9ca3af);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    cursor: pointer;
    border-radius: 0.35rem;
}

.binary-positions-tab--active {
    color: var(--text-primary, #fff);
    background: var(--app-row-hover, rgba(255, 255, 255, 0.06));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.light-theme .binary-positions-tab--active {
    color: #0f172a;
    background: rgba(59, 130, 246, 0.12);
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.35);
}

.light-theme .binary-positions-tab {
    color: #64748b;
}

.binary-positions__list--inactive {
    display: none !important;
}

.binary-positions__loading {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    text-align: center;
    padding: 1.5rem 0.75rem;
}

.binary-positions-footer {
    margin-top: auto;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    background: rgba(0, 0, 0, 0.15);
}

.binary-positions-footer__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.35rem;
}

.binary-positions-footer__row strong {
    font-size: 0.8125rem;
    color: var(--text-primary, #fff);
    font-family: ui-monospace, monospace;
}

.binary-positions-footer__meta {
    font-size: 0.6875rem;
    color: var(--text-muted, #6b7280);
    margin-top: 0.25rem;
}

.binary-positions__empty {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    text-align: center;
    padding: 1.5rem 0.5rem;
    line-height: 1.4;
}

.binary-positions-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.75rem 0.35rem;
}

.binary-positions-sidebar__label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.binary-positions-sidebar__account {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.45rem;
    border-radius: 0.35rem;
}

.binary-positions-sidebar__account--demo {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.binary-positions-sidebar__account--real {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.binary-positions__item {
    display: flex;
    gap: 0.65rem;
    padding: 0.65rem 0.6rem;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    transition: border-color 0.15s ease;
}

.binary-positions__item--won {
    border-color: rgba(34, 197, 94, 0.22);
    background: rgba(34, 197, 94, 0.05);
}

.binary-positions__item--lost {
    border-color: rgba(249, 115, 22, 0.22);
    background: rgba(249, 115, 22, 0.05);
}

.binary-positions__item--open {
    border-color: rgba(59, 130, 246, 0.22);
    background: rgba(59, 130, 246, 0.05);
}

.binary-positions__title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.binary-positions__status {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #9ca3af);
}

.binary-positions__instrument {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    line-height: 1.25;
}

.binary-positions__amount {
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.binary-positions__amount--win {
    color: #4ade80;
}

.binary-positions__amount--loss,
.binary-positions__amount--stake {
    color: #fb923c;
}

.binary-positions__tag {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.35rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-muted, #9ca3af);
}

.binary-positions__tag--direction {
    color: var(--text-primary, #e5e7eb);
}

.binary-positions__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.35rem;
}

.binary-positions__countdown {
    margin-left: 0.35rem;
    color: #60a5fa;
    font-weight: 600;
}

.binary-trade-desk .binary-positions__item {
    background: rgba(255, 255, 255, 0.015);
    border-color: rgba(255, 255, 255, 0.05);
}

.binary-positions__empty strong {
    color: var(--text-primary, #fff);
}

.digit-stats {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.binary-positions__icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.7rem;
}

.binary-positions__icon--win {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.binary-positions__icon--loss {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
}

.binary-positions__icon--open {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.binary-positions__body {
    min-width: 0;
    flex: 1;
}

.binary-positions__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.binary-positions__time {
    font-size: 0.625rem;
    color: #6b7280;
    margin-top: 0.2rem;
}

.binary-trade-panel {
    padding: 0.85rem 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 0;
}

.binary-trade-panel--compact {
    padding: 0.75rem;
}

@media (max-width: 1023px) {
    .binary-trade-panel {
        display: flex;
        flex-direction: column;
    }

    .binary-trade-panel__section--actions {
        position: sticky;
        bottom: 0;
        z-index: 2;
        background: rgba(0, 0, 0, 0.2);
        border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
        padding-bottom: 0.85rem;
    }
}

.binary-trade-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.binary-trade-panel__section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06));
    position: relative;
}

.binary-trade-panel__section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.binary-trade-panel__section--account {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.65rem;
}

.binary-trade-panel__section--risk {
    padding-bottom: 0.65rem;
}

.binary-trade-panel__section--stake .binary-field__label {
    margin-bottom: 0.4rem;
}

.binary-trade-panel__section--actions {
    padding-top: 0.65rem;
}

.binary-contract-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.binary-contract-hint {
    margin: 0.35rem 0 0;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--text-muted, #9ca3af);
}

.binary-field--duration {
    margin-top: 0.65rem;
}

.binary-duration-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
}

.binary-duration-preset {
    background: var(--app-input-bg, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    color: var(--text-muted, #9ca3af);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.45rem 0.25rem;
    border-radius: 0.45rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    line-height: 1.2;
}

.binary-duration-preset:hover {
    border-color: rgba(59, 130, 246, 0.45);
    color: var(--text-primary, #e5e7eb);
}

.binary-duration-preset--active {
    border-color: rgba(59, 130, 246, 0.75);
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.binary-contract-tab {
    background: var(--app-input-bg, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    color: var(--text-muted, #9ca3af);
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.45rem 0.35rem;
    border-radius: 0.45rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
    line-height: 1.25;
}

.binary-contract-tab:hover {
    color: var(--text-primary, #fff);
    border-color: rgba(96, 165, 250, 0.35);
}

.binary-contract-tab--active {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(96, 165, 250, 0.55);
    color: #93c5fd;
}

.binary-contract-tabs__select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.binary-stake-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.45rem;
}

.binary-stake-header .binary-field__label {
    margin-bottom: 0;
}

.binary-stake-header__max {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    font-family: ui-monospace, monospace;
}

.binary-stake-control {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

.binary-stake-control__btn {
    flex: 0 0 2.5rem;
    background: var(--app-input-bg, #374151);
    border: 1px solid var(--border-color-strong, #4b5563);
    color: var(--text-primary, #fff);
    border-radius: 0.55rem;
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    user-select: none;
}

.binary-stake-control__btn:hover:not(:disabled) {
    background: #4b5563;
    border-color: #6b7280;
}

.binary-stake-control__btn:active:not(:disabled) {
    transform: scale(0.96);
}

.binary-stake-control__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.binary-stake-control__input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--app-input-bg, #374151);
    border: 1px solid var(--border-color-strong, #4b5563);
    border-radius: 0.55rem;
    padding: 0 0.75rem;
    min-width: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.binary-stake-control__input-wrap:focus-within {
    border-color: rgba(96, 165, 250, 0.65);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.binary-stake-control__input-wrap--recovery {
    border-color: rgba(249, 115, 22, 0.45);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.15);
}

.binary-stake-control__currency {
    color: var(--text-muted, #9ca3af);
    font-size: 0.875rem;
    font-weight: 700;
    margin-right: 0.3rem;
}

.binary-stake-control__input {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary, #fff);
    font-size: 1.0625rem;
    font-weight: 700;
    padding: 0.6rem 0;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.02em;
}

.binary-stake-control__input:focus {
    outline: none;
}

.binary-stake-control__input--at-max {
    color: #93c5fd;
}

.binary-stake-control__input--locked {
    color: #fdba74;
    cursor: not-allowed;
}

.binary-stake-quick {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.binary-stake-quick__btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    color: var(--text-secondary, #d1d5db);
    border-radius: 0.45rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.binary-stake-quick__btn:hover:not(:disabled) {
    border-color: rgba(96, 165, 250, 0.45);
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.08);
}

.binary-stake-quick__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.binary-stake-meta {
    margin: 0.45rem 0 0;
    font-size: 0.6875rem;
    color: var(--text-muted, #9ca3af);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.binary-stake-meta strong {
    font-family: ui-monospace, monospace;
    font-size: 0.8125rem;
    color: #4ade80;
    font-weight: 700;
}

.binary-trade-panel__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.binary-mode-switch {
    display: flex;
    gap: 0.25rem;
    background: var(--app-input-bg, #374151);
    border-radius: 0.5rem;
    padding: 0.2rem;
}

.binary-mode-btn {
    border: none;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.55rem;
    border-radius: 0.35rem;
    cursor: pointer;
}

.binary-mode-btn--active {
    background: var(--bg-secondary, #1f2937);
    color: var(--text-primary, #fff);
}

.binary-mode-btn--auto-active {
    background: rgba(249, 115, 22, 0.2);
    color: #fdba74;
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.35);
}

.binary-trade-panel--auto-running .binary-trade-panel__head {
    border-bottom-color: rgba(249, 115, 22, 0.35);
}

.binary-trade-panel--recovering .binary-trade-panel__section--stake {
    background: rgba(249, 115, 22, 0.06);
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    border-radius: 0.45rem;
}

.binary-trade-panel__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.binary-trade-panel__balance {
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
}

.binary-trade-panel__balance strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary, #fff);
}

.binary-field {
    margin-bottom: 0.65rem;
}

.binary-field__label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #9ca3af);
    margin-bottom: 0.25rem;
}

.binary-field__input {
    width: 100%;
    background: var(--app-input-bg, #374151);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color-strong, #4b5563);
    border-radius: 0.5rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.8125rem;
}

.binary-stake-presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.binary-stake-preset {
    background: var(--app-input-bg, #374151);
    border: 1px solid var(--border-color-strong, #4b5563);
    color: var(--text-secondary, #d1d5db);
    border-radius: 0.45rem;
    padding: 0.38rem 0.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    font-family: ui-monospace, monospace;
    cursor: pointer;
    pointer-events: auto;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.binary-stake-preset:hover:not(:disabled) {
    border-color: rgba(96, 165, 250, 0.4);
    color: #e5e7eb;
}

.binary-stake-preset:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.binary-stake-preset--active {
    border-color: #60a5fa;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.12);
}

.binary-trade-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.binary-trade-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    border: none;
    border-radius: 0.65rem;
    padding: 0.85rem 0.5rem;
    cursor: pointer;
    min-height: 5rem;
    transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.binary-trade-btn:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.binary-trade-btn--green {
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.binary-trade-btn--red {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.binary-trade-btn__label {
    font-size: 0.95rem;
    font-weight: 700;
}

.binary-trade-btn__amount {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.95;
}

.binary-trade-btn__pct {
    font-size: 0.65rem;
    opacity: 0.85;
}

.binary-instruments-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .binary-instruments-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .binary-instruments-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.binary-instrument-card {
    display: block;
    padding: 1rem;
    border-radius: 0.75rem;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.binary-instrument-card:hover {
    border-color: #60a5fa;
    transform: translateY(-2px);
}

.binary-instrument-card h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.binary-instrument-card p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
}

.binary-risk-controls,
.binary-auto-controls {
    margin-bottom: 0.65rem;
}

.binary-risk-controls__grid,
.binary-auto-controls__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.binary-risk-controls__grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 380px) {
    .binary-risk-controls__grid--3 {
        grid-template-columns: 1fr 1fr;
    }

    .binary-risk-controls__grid--3 .binary-field:last-child {
        grid-column: 1 / -1;
    }
}

.binary-auto-runs-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.45rem;
    padding: 0.4rem 0.55rem;
    border-radius: 0.45rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
}

.binary-auto-runs-status strong {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: #93c5fd;
}

.binary-field__input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.binary-session-pl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
}

.binary-session-pl strong {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--text-primary, #fff);
}

.binary-trade-btn--disabled,
.binary-trade-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
}

.binary-field--inline {
    margin-bottom: 0;
}


.binary-auto-controls__hint {
    display: none;
}

.binary-auto-stop-wrap {
    margin-bottom: 0.75rem;
}

.binary-auto-stop-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 0.65rem;
    background: #1f2937;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.binary-auto-stop-btn:hover {
    background: #374151;
}

.binary-auto-stop-btn__icon {
    width: 0.85rem;
    height: 0.85rem;
    background: #f97316;
    border-radius: 0.15rem;
    flex-shrink: 0;
}

.binary-auto-session {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.55rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.7rem;
    color: var(--text-muted, #9ca3af);
}

.binary-auto-session strong {
    font-family: ui-monospace, monospace;
    font-size: 0.8rem;
    color: var(--text-primary, #fff);
}

.light-theme .binary-trade-desk {
    background: var(--app-surface, #fff);
    border-color: var(--border-color, rgba(0, 0, 0, 0.08));
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.light-theme .binary-trade-desk .line-chart-panel__digit-footer {
    background: rgba(15, 23, 42, 0.06);
    border-top-color: rgba(0, 0, 0, 0.08);
}

.light-theme .binary-trade-panel__section--actions {
    background: rgba(0, 0, 0, 0.03);
}

.light-theme .binary-trade-panel {
    background: transparent;
}


.app-dialog--sm {
    max-width: 24rem;
}