:root {
    --bg-color: #0b0e14;
    --panel-bg: rgba(15, 20, 28, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --neon-green: #00e676;
    --neon-red: #ff3366;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --cyber-blue: #00d4ff;
    --cyber-purple: #b026ff;
    --accent: #00e676;
    --border: rgba(255, 255, 255, 0.08);
    --amber: #ffab40;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 212, 255, 0.07), transparent 30%),
        radial-gradient(circle at 90% 80%, rgba(0, 230, 118, 0.06), transparent 35%),
        radial-gradient(circle at 50% 50%, rgba(176, 38, 255, 0.03), transparent 40%);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem;
    gap: 1.25rem;
}

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    position: relative;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: rgba(15, 20, 28, 0.4);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.logo {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.neon-text {
    color: var(--neon-green);
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.5);
}

.pnl-header {
    font-size: 1.35rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0,0,0,0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}

.neon-green {
    color: var(--neon-green);
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}
.neon-red {
    color: var(--neon-red);
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.4);
}

/* ── Mode Badge (Paper / Live) ──────────────────────────────────── */
.mode-badge-header {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 6px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}
.mode-badge-header.paper {
    background: rgba(255, 171, 64, 0.2);
    color: #ffab40;
    border: 1px solid rgba(255, 171, 64, 0.4);
    text-shadow: 0 0 8px rgba(255, 171, 64, 0.3);
}
.mode-badge-header.live {
    background: rgba(255, 51, 102, 0.2);
    color: #ff3366;
    border: 1px solid rgba(255, 51, 102, 0.5);
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
    animation: livePulse 2s infinite;
}
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 51, 102, 0.2); }
    50% { box-shadow: 0 0 16px rgba(255, 51, 102, 0.5); }
}

/* ── Balance Bar ────────────────────────────────────────────────── */
.balance-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    margin-right: 8px;
}
.balance-bar .bal-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.balance-bar .bal-label {
    color: var(--text-muted);
    font-size: 0.75rem;
}
.balance-bar .bal-value {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    font-variant-numeric: tabular-nums;
}
.balance-bar .bal-value.sim {
    color: var(--amber);
}
.balance-bar .bal-value.real {
    color: var(--neon-green);
}

/* Main Layout */
.main-content {
    display: flex;
    flex: 1;
    gap: 1.25rem;
    min-height: 0;
    overflow: hidden;
}

/* Panels common */
aside {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}
aside h2, footer h2 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
aside h2::before, footer h2::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--cyber-blue);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--cyber-blue);
}

/* Left Panel - Pairs */
.pair-list {
    list-style: none;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.pair-list li {
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    background: rgba(255,255,255,0.02);
}
.pair-list li:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
}
.pair-list li.active {
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 0 20px rgba(0, 212, 255, 0.05);
}

.pair-name {
    font-weight: 600;
    font-size: 1.05rem;
}
.pair-vol {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.pair-price {
    text-align: right;
    font-weight: 600;
}
.pair-price span {
    font-size: 0.75rem;
    display: block;
    margin-top: 4px;
    font-weight: 700;
}

.price-up { color: var(--neon-green); }
.price-down { color: var(--neon-red); }

/* Center Panel - Chart */
.chart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    position: relative;
    min-height: 300px;
    overflow: hidden;
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.badge {
    background: rgba(0, 212, 255, 0.1);
    color: var(--cyber-blue);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(0, 212, 255, 0.3);
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.badge.paper {
    background: rgba(255, 171, 64, 0.15);
    color: #ffab40;
    border-color: rgba(255, 171, 64, 0.3);
}
.badge.live {
    background: rgba(255, 51, 102, 0.15);
    color: #ff3366;
    border-color: rgba(255, 51, 102, 0.4);
}
.current-price {
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: color 0.3s, text-shadow 0.3s;
}
#tvchart {
    flex: 1;
    width: 100%;
    min-height: 250px;
    position: relative;
}
.chart-tooltip {
    position: absolute;
    display: none;
    padding: 10px;
    box-sizing: border-box;
    font-size: 12px;
    color: #fff;
    background-color: rgba(15, 20, 28, 0.85);
    text-align: left;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    line-height: 1.5;
}
.chart-tooltip .symbol {
    color: var(--cyber-blue);
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 13px;
}

/* Right Panel - Settings */
.control-group {
    margin-bottom: 0.85rem;
}
.control-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    font-weight: 500;
}
.control-group span {
    color: var(--cyber-blue);
    font-weight: 600;
    background: rgba(0,0,0,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Custom Range Input */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    height: 20px;
}
input[type=range]:focus {
    outline: none;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--cyber-blue);
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.6);
    border: 2px solid #fff;
    transition: transform 0.1s;
}
input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}
/* Firefox range */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    border: none;
}
input[type=range]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--cyber-blue);
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.6);
    border: 2px solid #fff;
}

/* Strategy panel inputs */
#strategy-params input[type="text"],
#strategy-params input[type="number"],
#strategy-params select,
#tab-strategy input[type="text"],
#tab-strategy input[type="number"],
#tab-strategy select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.85rem;
    margin-top: 4px;
    transition: border-color 0.2s;
}
#strategy-params input:focus,
#strategy-params select:focus,
#tab-strategy input:focus,
#tab-strategy select:focus {
    border-color: var(--cyber-blue);
    outline: none;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
}


/* ══════════════════════════════════════════════════════════════════
   CYBER BUTTON — High visibility, bright, glowing
   ══════════════════════════════════════════════════════════════════ */
.cyber-button {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.25) 0%, rgba(0, 230, 118, 0.10) 100%);
    color: #2cff8e;
    border: 1.5px solid rgba(0, 230, 118, 0.6);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s ease;
    margin-top: auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.2), inset 0 0 12px rgba(0, 230, 118, 0.05);
    text-shadow: 0 0 8px rgba(0, 230, 118, 0.4);
}
.cyber-button::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    transform: scale(0.5);
}
.cyber-button:hover::after {
    opacity: 1;
    transform: scale(1);
}
.cyber-button:hover {
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.35) 0%, rgba(0, 230, 118, 0.15) 100%);
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.45), inset 0 0 15px rgba(0, 230, 118, 0.08);
    transform: translateY(-2px);
    color: #5cffae;
}
.cyber-button:active {
    transform: translateY(0);
    box-shadow: 0 0 12px rgba(0, 230, 118, 0.3);
}
.cyber-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}
.cyber-button.active {
    color: #ff6690;
    border-color: rgba(255, 51, 102, 0.6);
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.25) 0%, rgba(255, 51, 102, 0.10) 100%);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.25);
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
}
.cyber-button.active:hover {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.35) 0%, rgba(255, 51, 102, 0.15) 100%);
    box-shadow: 0 0 30px rgba(255, 51, 102, 0.45);
}

/* Danger variant for live trading */
.cyber-button.danger {
    color: #ff6690;
    border-color: rgba(255, 51, 102, 0.6);
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.25) 0%, rgba(255, 51, 102, 0.10) 100%);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.2);
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.4);
}

/* Amber variant for caution */
.cyber-button.amber {
    color: #ffcc70;
    border-color: rgba(255, 171, 64, 0.6);
    background: linear-gradient(135deg, rgba(255, 171, 64, 0.25) 0%, rgba(255, 171, 64, 0.10) 100%);
    box-shadow: 0 0 20px rgba(255, 171, 64, 0.2);
    text-shadow: 0 0 8px rgba(255, 171, 64, 0.4);
}

.bot-status {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    text-align: center;
    color: var(--text-muted);
    padding: 0.75rem;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.03);
}
.bot-status span {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Bottom Panel - Trades */
.bottom-panel {
    height: 280px;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
}
.table-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.trades-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    text-align: left;
    font-size: 0.9rem;
}
.trades-table th {
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.65rem 0.75rem;
    position: sticky;
    top: 0;
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    z-index: 10;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.trades-table td {
    padding: 0.65rem 0.75rem;
    background: rgba(255,255,255,0.02);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}
.trades-table tbody tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
.trades-table tbody tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
.trades-table tbody tr:hover td {
    background: rgba(255,255,255,0.05);
}

/* Trade row mode badges */
.trade-mode-badge {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.trade-mode-badge.paper {
    background: rgba(255, 171, 64, 0.15);
    color: #ffab40;
    border: 1px solid rgba(255, 171, 64, 0.3);
}
.trade-mode-badge.live {
    background: rgba(255, 51, 102, 0.15);
    color: #ff3366;
    border: 1px solid rgba(255, 51, 102, 0.3);
}
.trade-status-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}
.trade-status-badge.open {
    background: rgba(0, 212, 255, 0.15);
    color: var(--cyber-blue);
    border: 1px solid rgba(0, 212, 255, 0.3);
}
.trade-status-badge.closed {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.1);
}

@keyframes rowInsert {
    0% { opacity: 0; transform: translateX(-20px); background-color: rgba(0, 212, 255, 0.2); }
    100% { opacity: 1; transform: translateX(0); background-color: rgba(255,255,255,0.02); }
}

.trades-table tbody tr.new-row td {
    animation: rowInsert 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.type-buy { color: var(--neon-green); font-weight: 700; }
.type-sell { color: var(--neon-red); font-weight: 700; }

/* Tabs */
.tabs-header {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 6px;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}
.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}
.tab-btn.active {
    color: var(--cyber-blue);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}
.tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
}
.tab-content.active {
    display: flex;
}

/* ── Bottom panel header with controls ──────────────────────────── */
.bottom-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.bottom-header h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}
.trades-filter {
    display: flex;
    gap: 6px;
    align-items: center;
}
.trades-filter select {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: inherit;
}
.trades-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.2);
    padding: 3px 8px;
    border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2); 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15); 
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255,255,255,0.3); 
}

/* Roadmap Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 230, 118, 0.1);
    color: var(--text-main);
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 230, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* ── Execute Confirmation Modal ─────────────────────────────────── */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.confirm-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 0 40px rgba(0, 230, 118, 0.1);
}
.confirm-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--cyber-blue);
}
.confirm-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.confirm-row .label { color: var(--text-muted); }
.confirm-row .value { color: var(--text-main); font-weight: 600; }
.confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.confirm-actions .cyber-button {
    flex: 1;
    padding: 10px;
    font-size: 0.85rem;
    margin-top: 0;
}

/* Risk indicator */
.risk-meter {
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.08);
    margin-top: 12px;
    overflow: hidden;
}
.risk-meter .fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}
.risk-meter .fill.low { background: var(--neon-green); width: 33%; }
.risk-meter .fill.medium { background: var(--amber); width: 66%; }
.risk-meter .fill.high { background: var(--neon-red); width: 100%; }

/* ══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════════════════════════ */

/* Tablet landscape */
@media (max-width: 1200px) {
    aside { width: 240px; padding: 0.5rem 0.75rem; }
    .app-container { padding: 0.75rem; gap: 0.75rem; }
    .current-price { font-size: 1.35rem; }
    .logo { font-size: 1.3rem; }
}

/* Tablet portrait / small laptop */
@media (max-width: 1024px) {
    .main-content {
        flex-wrap: wrap;
    }
    .left-panel {
        width: 100%;
        max-height: 140px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 0;
    }
    .left-panel h2 { display: none; }
    .pair-list {
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-right: 0;
    }
    .pair-list li {
        min-width: 150px;
        flex-shrink: 0;
        margin-bottom: 0;
        padding: 0.5rem 0.75rem;
    }
    .chart-container {
        flex: 1 1 100%;
        min-height: 250px;
        order: 1;
    }
    .right-panel {
        width: 100%;
        max-height: 280px;
        order: 2;
    }
    .bottom-panel {
        height: 200px;
        order: 3;
    }
}

/* Mobile portrait */
@media (max-width: 768px) {
    body { overflow-y: auto; overflow-x: hidden; }
    .app-container { padding: 0.5rem; gap: 0.5rem; height: auto; min-height: 100vh; }

    .app-header {
        padding: 0.35rem 0.75rem;
        flex-wrap: wrap;
        gap: 4px;
    }
    .logo { font-size: 1.1rem; gap: 0.25rem; }
    .pnl-header { font-size: 0.85rem; padding: 0.3rem 0.5rem; gap: 0.35rem; }
    .balance-bar { font-size: 0.7rem; gap: 8px; }

    .main-content {
        flex-direction: column;
        overflow: visible;
    }

    /* Pairs = horizontal scroll strip */
    .left-panel {
        width: 100%;
        max-height: 110px;
        border-radius: 12px;
        flex-direction: column;
        padding: 0.5rem;
    }
    .left-panel h2 { display: none; }
    .pair-list {
        display: flex;
        flex-direction: row;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .pair-list::-webkit-scrollbar { display: none; }
    .pair-list li {
        min-width: 130px;
        flex-shrink: 0;
        margin-bottom: 0;
        padding: 0.5rem;
        font-size: 0.85rem;
    }
    .pair-name { font-size: 0.9rem; }
    .pair-vol { font-size: 0.65rem; }
    .pair-price { font-size: 0.85rem; }
    .pair-price span { font-size: 0.65rem; }

    /* Chart full width */
    .chart-container {
        width: 100%;
        min-height: 300px;
        border-radius: 12px;
        padding: 0.75rem;
    }
    .chart-header { margin-bottom: 0.5rem; padding-bottom: 0.5rem; }
    .current-price { font-size: 1.4rem; }
    #tvchart { min-height: 220px; }

    /* Right panel full width, scrollable */
    .right-panel {
        width: 100%;
        max-height: none;
        border-radius: 12px;
        padding: 0.75rem;
    }

    /* Bottom panel */
    .bottom-panel {
        height: auto;
        max-height: 250px;
        border-radius: 12px;
        padding: 0.75rem;
    }
    .trades-table { font-size: 0.75rem; }
    .trades-table th { font-size: 0.65rem; padding: 0.4rem 0.5rem; }
    .trades-table td { padding: 0.4rem 0.5rem; font-size: 0.75rem; }

    /* Buttons */
    .cyber-button { padding: 0.5rem 0.75rem; font-size: 0.85rem; }

    /* Tabs */
    .tabs-header { gap: 4px; }
    .tab-btn { font-size: 0.75rem; padding: 3px 6px; }
}

/* Very small screens */
@media (max-width: 400px) {
    .app-header { padding: 0.25rem 0.5rem; }
    .logo { font-size: 0.95rem; }
    .balance-bar { display: none; }
    .mode-badge-header { font-size: 0.6rem; padding: 3px 8px; }
    .pair-list li { min-width: 110px; }
}
