:root {
    /* Dark Trading Palette — Futures Pro */
    --ft-bg: #0b0e11;
    --ft-bg-secondary: #181a20;
    --ft-bg-tertiary: #1e2329;
    --ft-border: #2b3139;
    --ft-text-primary: #eaecef;
    --ft-text-secondary: #848e9c;
    --ft-green: #0ecb81;
    --ft-red: #f6465d;
    --ft-accent: #6366f1;
    --ft-accent-light: #818cf8;
    --ft-accent-glow: rgba(var(--primary-rgb), 0.15);
    --text-on-primary: #ffffff;
    --ft-hover: rgba(255, 255, 255, 0.04);

    /* Layout Constants */
    --header-height: 48px;
    --ticker-height: 56px;
}

body.futures-theme {
    background-color: var(--ft-bg);
    color: var(--ft-text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    overflow: hidden;
}

.futures-layout {
    display: grid;
    grid-template-areas:
        "header header header"
        "ticker ticker ticker"
        "book chart form"
        "book tabs form";
    grid-template-columns: 300px 1fr 310px;
    grid-template-rows: var(--header-height) var(--ticker-height) 1fr 280px;
    height: 100vh;
}

/* ─── Header ─── */
.dashboard-header {
    grid-area: header;
    padding: 0 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ft-bg-secondary);
    border-bottom: 1px solid var(--ft-border);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.25rem;
    color: var(--ft-accent);
}

.header-left h1 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ft-text-primary);
    letter-spacing: -0.01em;
    margin: 0;
}

.header-left h1 span {
    color: var(--ft-accent);
}

/* Header Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
}

.header-nav .nav-link {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ft-text-secondary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
}

.header-nav .nav-link:hover {
    color: var(--ft-text-primary);
    background-color: var(--ft-hover);
}

.header-nav .nav-link.active {
    color: var(--ft-accent);
    background-color: rgba(var(--primary-rgb), 0.15);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ─── Ticker Bar (Premium — matches Spot) ─── */
.futures-ticker-bar {
    grid-area: ticker;
    background: #181a20;
    border-bottom: 1px solid var(--ft-border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.futures-ticker-bar::-webkit-scrollbar {
    display: none;
}

.ticker-item.main-ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    border-right: 1px solid var(--ft-border);
    padding-right: 20px;
    flex-shrink: 0;
}

.ticker-pair {
    font-size: 18px;
    font-weight: 700;
    color: var(--ft-text-primary);
    letter-spacing: -0.02em;
}

.ticker-price {
    font-size: 18px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: var(--ft-green);
    transition: color 0.3s ease;
    letter-spacing: -0.01em;
}

.ticker-price.up {
    color: var(--ft-green);
}

.ticker-price.down {
    color: var(--ft-red);
}

.ticker-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex-shrink: 0;
}

.stat-label {
    color: var(--ft-text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    color: var(--ft-text-primary);
}

.stat-value.muted {
    color: var(--ft-text-secondary);
}

.funding-countdown {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ─── Order Book (Left) ─── */
.futures-book {
    grid-area: book;
    background: var(--ft-bg-secondary);
    border-right: 1px solid var(--ft-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.book-tabs {
    display: flex;
    height: 36px;
    border-bottom: 1px solid var(--ft-border);
}

.book-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--ft-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.book-tab.active {
    color: #fff;
    font-weight: 600;
    border-bottom-color: var(--ft-accent);
}

.book-tab:hover:not(.active) {
    color: var(--ft-text-primary);
}

.book-tab-content {
    flex: 1;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.book-tab-content.active {
    display: flex;
}

.order-book-header,
.trades-header-row {
    padding: 8px 12px;
    font-size: 11px;
    color: var(--ft-text-secondary);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 1px solid var(--ft-border);
}

.text-right {
    text-align: right;
}

.order-book-spread {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-top: 1px solid var(--ft-border);
    border-bottom: 1px solid var(--ft-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.spread-price {
    font-size: 15px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
}

.spread-pct {
    font-size: 11px;
    color: var(--ft-text-secondary);
    font-weight: 500;
}

.trades-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

/* ─── Chart (Center) ─── */
.futures-chart {
    grid-area: chart;
    background: var(--ft-bg-secondary);
    border-bottom: 1px solid var(--ft-border);
    display: flex;
    flex-direction: column;
}

.chart-toolbar {
    padding: 8px 12px;
    display: flex;
    gap: 12px;
    height: 40px;
    align-items: center;
    background: var(--ft-bg-secondary);
    border-bottom: 1px solid var(--ft-border);
}

.chart-spacer {
    flex: 1;
}

.chart-canvas {
    height: calc(100% - 40px);
}

/* ─── Tabs (Positions/Orders) ─── */
.futures-tabs {
    grid-area: tabs;
    background: var(--ft-bg-secondary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.futures-tabs .order-tabs {
    height: 40px;
    display: flex;
    border-bottom: 1px solid var(--ft-border);
    align-items: stretch;
}

.futures-tabs .order-tab {
    padding: 0 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--ft-text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.futures-tabs .order-tab.active {
    color: var(--ft-accent);
    border-bottom-color: var(--ft-accent);
    font-weight: 600;
}

.futures-tabs .order-tab:hover:not(.active) {
    color: var(--ft-text-primary);
}

.tab-spacer {
    flex: 1;
}

.tab-actions {
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.btn-cancel-all {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(246, 70, 93, 0.1);
    color: var(--ft-red);
    border: 1px solid var(--ft-red);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-cancel-all:hover {
    background: rgba(246, 70, 93, 0.2);
}

.tab-content-container {
    height: calc(100% - 40px);
    overflow-y: auto;
}

.positions-table,
.orders-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
}

.positions-table thead,
.orders-table thead {
    position: sticky;
    top: 0;
    background: var(--ft-bg-secondary);
    text-align: left;
    color: var(--ft-text-secondary);
}

.positions-table th,
.orders-table th {
    padding: 8px 10px;
    font-weight: 500;
}

.positions-table td,
.orders-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--ft-border);
}

.no-positions td,
.no-orders td {
    padding: 40px !important;
    text-align: center;
    color: var(--ft-text-secondary);
}

/* ─── Market Selector (Right Column Top) ─── */
.market-selector {
    display: flex;
    flex-direction: column;
    height: 230px;
    border-bottom: 1px solid var(--ft-border);
    background-color: var(--ft-bg-secondary);
}

.market-selector-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--ft-border);
}

.market-list-tabs {
    display: flex;
    margin-bottom: 10px;
}

.market-list-tabs .list-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--ft-text-secondary);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.market-list-tabs .list-tab:hover {
    color: var(--ft-text-primary);
}

.market-list-tabs .list-tab.active {
    color: var(--ft-accent);
    border-bottom-color: var(--ft-accent);
    font-weight: 600;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--ft-bg-tertiary);
    border-radius: 4px;
    padding: 6px 10px;
}

.search-box i {
    color: var(--ft-text-secondary);
    font-size: 12px;
    margin-right: 8px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--ft-text-primary);
    font-size: 12px;
    width: 100%;
    outline: none;
}

.market-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--ft-border) transparent;
}

.market-list::-webkit-scrollbar {
    width: 4px;
}

.market-list::-webkit-scrollbar-track {
    background: transparent;
}

.market-list::-webkit-scrollbar-thumb {
    background-color: var(--ft-border);
    border-radius: 4px;
}

/* Market Items */
.market-item {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.market-item:hover,
.market-item.active {
    background-color: var(--ft-bg-tertiary);
}

.market-item .favorite-btn {
    background: none;
    border: none;
    color: var(--ft-text-secondary);
    font-size: 12px;
    margin-right: 8px;
    cursor: pointer;
    padding: 0;
}

.market-item .favorite-btn i.fas {
    color: var(--ft-accent);
}

.market-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 50%;
    background-color: var(--ft-bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.market-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.market-icon-fallback {
    font-size: 10px;
    font-weight: 700;
    color: var(--ft-text-secondary);
}

.market-name {
    flex: 1;
    font-size: 12px;
    font-weight: 600;
    color: var(--ft-text-primary);
}

.market-changeB {
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: right;
    min-width: 54px;
}

.market-changeB.positive {
    background: rgba(14, 203, 129, 0.1);
    color: var(--ft-green);
}

.market-changeB.negative {
    background: rgba(246, 70, 93, 0.1);
    color: var(--ft-red);
}

/* ─── Order Form (Right — Premium, matches Spot) ─── */
.futures-form {
    grid-area: form;
    background: var(--ft-bg-secondary);
    border-left: 1px solid var(--ft-border);
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.futures-form .trading-forms-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: var(--ft-bg-secondary);
}

/* Form Tabs */
.futures-form .form-tabs {
    display: flex;
    padding: 0;
    border-bottom: 1px solid var(--ft-border);
}

.futures-form .form-tab {
    flex: 1;
    padding: 11px 0;
    border: none;
    background: transparent;
    color: var(--ft-text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.futures-form .form-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: transparent;
    border-radius: 2px 2px 0 0;
    transition: all 0.2s ease;
}

.futures-form .form-tab[data-form-tab="buy"]:hover {
    color: var(--ft-green);
    background: rgba(14, 203, 129, 0.04);
}

.futures-form .form-tab[data-form-tab="sell"]:hover {
    color: var(--ft-red);
    background: rgba(246, 70, 93, 0.04);
}

.futures-form .form-tab[data-form-tab="buy"].active {
    color: var(--ft-green);
    background: rgba(14, 203, 129, 0.06);
}

.futures-form .form-tab[data-form-tab="buy"].active::after {
    background: var(--ft-green);
    left: 10%;
    right: 10%;
}

.futures-form .form-tab[data-form-tab="sell"].active {
    color: var(--ft-red);
    background: rgba(246, 70, 93, 0.06);
}

.futures-form .form-tab[data-form-tab="sell"].active::after {
    background: var(--ft-red);
    left: 10%;
    right: 10%;
}

/* Form Container */
.futures-form .trading-form-container {
    display: none;
    flex-direction: column;
    background-color: var(--ft-bg-secondary);
    padding: 12px 14px 14px;
    overflow-y: auto;
}

.futures-form .trading-form-container.active {
    display: flex;
}

.futures-form .form-body {
    display: flex;
    flex-direction: column;
    overflow: visible;
    gap: 8px;
}

.futures-form .balance-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--ft-text-secondary);
    margin-bottom: 0;
    padding: 8px 10px;
    background-color: var(--ft-bg-tertiary);
    border-radius: 4px;
}

.futures-form .balance-display .value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--ft-text-primary);
}

.futures-form .balance-display .currency {
    font-weight: 600;
    color: var(--ft-text-secondary);
    margin-left: 4px;
}

.futures-form .input-field {
    background-color: var(--ft-bg-tertiary);
    border-radius: 4px;
    padding: 9px 10px;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.futures-form .input-field:hover {
    border-color: var(--ft-border);
}

.futures-form .input-field:focus-within {
    border-color: var(--ft-accent);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
}

.futures-form .field-label {
    font-size: 11px;
    color: var(--ft-text-secondary);
    width: 48px;
    flex-shrink: 0;
    font-weight: 500;
}

.futures-form .input-field input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--ft-text-primary);
    text-align: right;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    outline: none;
    width: 0;
    min-width: 0;
}

.futures-form .input-field input::placeholder {
    color: var(--ft-text-secondary);
}

/* Hide number input spinners */
.futures-form .input-field input[type="number"]::-webkit-outer-spin-button,
.futures-form .input-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.futures-form .input-field input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.futures-form .field-suffix {
    font-size: 11px;
    color: var(--ft-text-secondary);
    margin-left: 6px;
    width: 40px;
    text-align: right;
    font-weight: 600;
    flex-shrink: 0;
}

.futures-form .leverage-selector {
    margin-bottom: 8px;
    padding-top: 4px;
}

.futures-form .leverage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.futures-form .leverage-label {
    font-size: 12px;
    color: var(--ft-text-secondary);
    font-weight: 500;
}

.futures-form .leverage-value-box {
    display: flex;
    align-items: center;
    background: var(--ft-bg-tertiary);
    border: 1px solid var(--ft-border);
    border-radius: 4px;
    padding: 2px 8px;
    transition: all 0.2s;
}

.futures-form .leverage-value-box:focus-within {
    border-color: var(--ft-accent);
}

.futures-form .leverage-input {
    width: 30px;
    background: transparent;
    border: none;
    color: var(--ft-text-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    text-align: right;
    outline: none;
    padding: 0;
}

.futures-form .leverage-input::-webkit-outer-spin-button,
.futures-form .leverage-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.futures-form .leverage-suffix {
    color: var(--ft-text-primary);
    font-size: 13px;
    font-weight: 600;
    margin-left: 2px;
}

.futures-form .range-slider-container {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    margin: 0 4px;
}

.futures-form .slider-track-bg {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--ft-bg-tertiary);
    border-radius: 2px;
    z-index: 1;
}

.futures-form .slider-track-fill {
    position: absolute;
    left: 0;
    height: 4px;
    background: var(--ft-accent);
    border-radius: 2px;
    z-index: 2;
    pointer-events: none;
}

.futures-form .styled-slider {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    position: relative;
    z-index: 3;
    outline: none;
    margin: 0;
}

.futures-form .styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #fff;
    border: 3px solid var(--ft-accent);
    border-radius: 50%;
    cursor: grab;
    transition: transform 0.1s, box-shadow 0.1s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.futures-form .styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

.futures-form .styled-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
}

.futures-form .leverage-markers {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding: 0 4px;
}

.futures-form .leverage-markers span {
    font-size: 10px;
    color: var(--ft-text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.futures-form .leverage-markers span:hover {
    color: var(--ft-text-primary);
}

.futures-form .leverage-markers span::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--ft-border);
    border-radius: 50%;
    z-index: 0;
}

.futures-form .total-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 0;
    padding: 8px 10px;
    background-color: var(--ft-bg-tertiary);
    border-radius: 4px;
    font-weight: 500;
}

.futures-form .total-display .value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: var(--ft-text-primary);
}

.futures-form .btn-execute {
    width: 100%;
    padding: 11px;
    border-radius: 4px;
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.futures-form .btn-execute.buy {
    background: linear-gradient(180deg, #0ecb81 0%, #0b9e65 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 203, 129, 0.2);
}

.futures-form .btn-execute.sell {
    background: linear-gradient(180deg, #f6465d 0%, #c9364a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(246, 70, 93, 0.2);
}

.futures-form .btn-execute:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.futures-form .btn-execute.buy:hover {
    box-shadow: 0 4px 16px rgba(14, 203, 129, 0.35);
}

.futures-form .btn-execute.sell:hover {
    box-shadow: 0 4px 16px rgba(246, 70, 93, 0.35);
}

.futures-form .btn-execute:active {
    transform: translateY(0) scale(0.98);
    filter: brightness(0.95);
    transition-duration: 0.05s;
}

/* ─── Utilities ─── */
.text-up {
    color: var(--ft-green);
}

.text-down {
    color: var(--ft-red);
}

.bg-up {
    background-color: var(--ft-green);
}

.bg-down {
    background-color: var(--ft-red);
}

.desktop-only {
    /* Visible by default, hidden on mobile via media query below */
    display: flex;
}

/* ─── Interval Buttons (Chart) ─── */
.futures-chart .interval-btn {
    padding: 4px 8px;
    font-size: 12px;
    background: transparent;
    border: none;
    color: var(--ft-text-secondary);
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.futures-chart .interval-btn:hover {
    background: var(--ft-bg-tertiary);
    color: var(--ft-text-primary);
}

.futures-chart .interval-btn.active {
    background: var(--ft-accent);
    color: #fff;
    font-weight: 600;
}

.futures-chart .chart-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: transparent;
    border: 1px solid var(--ft-border);
    color: var(--ft-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
}

.futures-chart .chart-action-btn:hover {
    background: var(--ft-bg-tertiary);
    color: var(--ft-text-primary);
}

/* ─── TP/SL Section ─── */
.tpsl-section {
    margin: 2px 0 4px;
}

.tpsl-header {
    display: flex;
    align-items: center;
}

.tpsl-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.tpsl-checkbox {
    width: 14px;
    height: 14px;
    accent-color: var(--ft-accent);
    cursor: pointer;
}

.tpsl-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ft-text-secondary);
    letter-spacing: 0.03em;
}

.tpsl-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 6px;
}

.tpsl-input {
    padding: 7px 10px !important;
}

/* ─── Order Confirmation Modal ─── */
.modalO {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modalO.show {
    opacity: 1;
}

.modalO-content {
    background: var(--ft-bg-tertiary);
    border: 1px solid var(--ft-border);
    border-radius: 12px;
    width: 380px;
    max-width: 92%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(16px) scale(0.97);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modalO.show .modalO-content {
    transform: translateY(0) scale(1);
}

.modalO-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ft-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modalO-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--ft-text-primary);
    margin: 0;
}

.modalO-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--ft-text-secondary);
    padding: 4px;
    transition: color 0.15s;
    line-height: 1;
}

.modalO-close:hover {
    color: var(--ft-red);
}

.modalO-body {
    padding: 16px 20px 20px;
}

.order-confirm-details {
    margin-bottom: 20px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.confirm-row:last-child {
    border-bottom: none;
}

.confirm-label {
    color: var(--ft-text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.confirm-value {
    font-weight: 600;
    font-size: 13px;
    color: var(--ft-text-primary);
    font-family: 'Roboto Mono', monospace;
}

.confirm-currency {
    font-size: 11px;
    color: var(--ft-text-secondary);
    font-weight: 500;
    margin-left: 4px;
}

.modalO-actions {
    display: flex;
    gap: 10px;
}

.modalO-actions .btn {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.modalO-actions .btn-outline {
    background: transparent;
    border: 1px solid var(--ft-border);
    color: var(--ft-text-primary);
}

.modalO-actions .btn-outline:hover {
    background: var(--ft-hover);
    border-color: var(--ft-text-secondary);
}

.modalO-actions .btn-primary {
    background: var(--ft-accent);
    border: none;
    color: #000;
    font-weight: 700;
}

.modalO-actions .btn-primary:hover {
    filter: brightness(1.1);
}

.modalO-actions .btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.modalO-actions .btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: #000;
    border-radius: 50%;
    animation: modal-spinner 0.8s linear infinite;
}

@keyframes modal-spinner {
    to { transform: rotate(360deg); }
}

.error-message {
    background: rgba(246, 70, 93, 0.1);
    border: 1px solid rgba(246, 70, 93, 0.3);
    color: var(--ft-red);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
}

/* ─── Mobile Nav ─── */
.mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-nav {
        display: flex;
    }
}