/* ===== SIDEBARS / DRAWERS / MODALS ===== */

/* Every drawer takes the FULL visible viewport height unconditionally.
   `dvh` (dynamic viewport height) follows the actual visible area as the iOS URL
   bar shows/hides, so the sidebar always reaches the true bottom of the viewport.
   `100vh` is the fallback for older browsers. */
.drawer, .trade-drawer, .traders-drawer, .profile-drawer {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
}

/* All scrollable panels inside a sidebar must CONTAIN their overscroll.
   Without this, swiping past the bottom of the list "bleeds" through into
   the locked page underneath (iOS rubber-band scroll chaining). */
.drawer-body, .trade-drawer-body, .traders-drawer-body, .profile-drawer-body, .history-drawer-body {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

/* ---- Shared drawer overlay ---- */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
    opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 100;
    height: 100vh;
    height: 100dvh;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-close {
    width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, 0.08);
    color: #fff; border: none; cursor: pointer; font-size: 16px;
}

/* ---- Drawer header actions (trash dropdown next to close button) ---- */
.drawer-actions { position: relative; display: flex; align-items: center; gap: 6px; }
.drawer-trash {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255, 56, 101, 0.08); color: var(--red);
    border: 1px solid rgba(255, 56, 101, 0.2);
    cursor: pointer; font-size: 14px; transition: all 0.15s;
}
.drawer-trash:hover { background: rgba(255, 56, 101, 0.18); transform: translateY(-1px); }
.drawer-trash:active { transform: scale(0.92); }
.drawer-trash-menu {
    position: absolute; top: 40px; right: 0;
    min-width: 270px;
    background: rgba(12, 12, 18, 0.98);
    border: 1px solid var(--gray2);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    z-index: 110;
    display: flex; flex-direction: column; gap: 2px;
}
.drawer-trash-menu.hidden { display: none; }
.drawer-trash-item {
    display: flex; align-items: center; gap: 10px;
    background: transparent; border: none; color: #fff;
    padding: 10px 12px; border-radius: 8px;
    text-align: left; cursor: pointer; transition: background 0.15s;
    width: 100%;
}
.drawer-trash-item:hover { background: rgba(255, 255, 255, 0.06); }
.drawer-trash-item.danger:hover { background: rgba(255, 56, 101, 0.12); }
.drawer-trash-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
.drawer-trash-label {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 13px; font-weight: 700;
}
.drawer-trash-label small {
    font-size: 10px; font-weight: 500; color: var(--gray); letter-spacing: 0.3px;
}

/* ---- Settings drawer (right side) ---- */
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 90vw);
    background: #0d0d14; border-left: 1px solid var(--gray2);
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 101; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header {
    padding: 18px 20px; border-bottom: 1px solid var(--gray2);
    display: flex; justify-content: space-between; align-items: center;
}
.drawer-title { font-size: 18px; font-weight: 900; letter-spacing: -0.3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.drawer-footer {
    padding: 16px 20px; border-top: 1px solid var(--gray2);
    display: flex; gap: 10px;
}
.drawer-footer button { flex: 1; padding: 12px; border-radius: 12px; border: none; font-weight: 800; letter-spacing: 1px; font-size: 12px; cursor: pointer; }
.save-btn { background: var(--green); color: #000; }
.save-btn:disabled { opacity: 0.5; }
.history-btn { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ===== Settings drawer — top tab bar (Wallets / App / Règles) ===== */
.settings-tabs {
    display: flex; gap: 6px; padding: 12px 20px;
    border-bottom: 1px solid var(--gray2);
    background: rgba(0,0,0,0.15);
}
.settings-tab {
    flex: 1; padding: 10px 8px; border-radius: 11px; border: 1px solid var(--gray2);
    background: rgba(255,255,255,0.03); color: var(--gray);
    font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
    cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.settings-tab:hover { color: #fff; }
.settings-tab.active {
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    color: #000; border-color: transparent;
    box-shadow: 0 4px 14px rgba(0,212,255,0.25);
}
.settings-tab-icon { font-size: 14px; }

/* ===== Wallets tab ===== */
.wallets-mode-toggle {
    display: flex; gap: 4px; padding: 4px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--gray2); border-radius: 14px;
    margin-bottom: 14px;
}
.wallets-mode-btn {
    flex: 1; padding: 11px; border-radius: 11px; border: none;
    background: transparent; color: var(--gray);
    font-size: 12px; font-weight: 900; letter-spacing: 1.5px;
    cursor: pointer; transition: all 0.2s;
}
.wallets-mode-btn:hover { color: #fff; }
.wallets-mode-btn.active.paper {
    background: rgba(255,209,102,0.18); color: var(--gold);
    box-shadow: inset 0 0 0 1px rgba(255,209,102,0.4);
}
.wallets-mode-btn.active.live {
    background: rgba(255,56,101,0.18); color: var(--red);
    box-shadow: inset 0 0 0 1px rgba(255,56,101,0.4);
}
.wallets-mode-warn {
    margin-bottom: 14px; padding: 10px 12px;
    background: rgba(255,209,102,0.08); border: 1px solid rgba(255,209,102,0.25);
    border-radius: 10px; font-size: 11px; line-height: 1.4; color: var(--gold);
}

/* ===== Wallet card v2 — modern multi-zone layout ===== */
.wallet-card-item {
    padding: 14px; border-radius: 16px; margin-bottom: 12px; position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.045), rgba(255,255,255,0.005));
    border: 1px solid var(--gray2);
    transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.wallet-card-item:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.wallet-card-item.active {
    border-color: rgba(0,255,157,0.4);
    background: linear-gradient(135deg, rgba(0,255,157,0.06), rgba(255,255,255,0.005));
    box-shadow: 0 0 30px rgba(0,255,157,0.07);
}
.wallet-card-item.paused {
    background: linear-gradient(135deg, rgba(255,209,102,0.04), rgba(255,255,255,0.005));
    border-color: rgba(255,209,102,0.25);
}
.wallet-card-item.paused .wcv-head { opacity: 0.75; }

/* Top accent stripe matching the network's brand */
.wallet-card-item::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #00FFA3, #DC1FFF, transparent);
    opacity: 0.5;
}

/* HEAD: avatar + name/sub + status pills */
.wcv-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.wcv-avatar {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 30% 30%, rgba(0,255,163,0.18), rgba(220,31,255,0.18));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 14px rgba(220,31,255,0.18), inset 0 1px 0 rgba(255,255,255,0.06);
}
.wcv-meta { flex: 1; min-width: 0; }
.wcv-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.wcv-name {
    font-size: 15px; font-weight: 800; letter-spacing: -0.2px;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wcv-pill {
    font-size: 9px; padding: 2px 7px; border-radius: 6px;
    font-weight: 800; letter-spacing: 1px;
}
.wcv-pill.active   { background: rgba(0,255,157,0.18); color: var(--green); border: 1px solid rgba(0,255,157,0.3); }
.wcv-pill.paused   { background: rgba(255,209,102,0.18); color: var(--gold);  border: 1px solid rgba(255,209,102,0.3); }
.wcv-pill.override { background: rgba(179,102,255,0.18); color: var(--violet); border: 1px solid rgba(179,102,255,0.3); }
.wcv-pill.live     { background: rgba(255,56,101,0.18); color: var(--red);   border: 1px solid rgba(255,56,101,0.3); }
.wcv-pill.paper    { background: rgba(0,212,255,0.18); color: var(--cyan);  border: 1px solid rgba(0,212,255,0.3); }

.wcv-sub {
    font-family: ui-monospace, Menlo, monospace; font-size: 10px;
    color: var(--gray); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* STATS row — 3 small cells per wallet (trades, WR, PnL or balance) */
.wcv-stats {
    display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
    margin-bottom: 12px;
}
.wcv-stat {
    padding: 8px 10px; border-radius: 10px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--gray2);
}
.wcv-stat-label { font-size: 8px; color: var(--gray); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.wcv-stat-value { font-size: 13px; font-weight: 900; margin-top: 3px; letter-spacing: -0.3px; }
.wcv-stat-value.pos { color: var(--green); }
.wcv-stat-value.neg { color: var(--red); }
.wcv-stat-value.cyan { color: var(--cyan); }
.wcv-stat-value.gold { color: var(--gold); }

/* ACTIONS row */
.wcv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.wcv-actions button {
    flex: 1; min-width: 0; padding: 8px 10px; border-radius: 9px;
    font-size: 10px; font-weight: 800; letter-spacing: 1px;
    cursor: pointer; transition: transform 0.1s, background 0.15s;
    border: 1px solid var(--gray2); background: rgba(255,255,255,0.03); color: var(--gray);
    white-space: nowrap;
}
.wcv-actions button:active { transform: scale(0.96); }
.wcv-actions .activate { color: var(--cyan); border-color: rgba(0,212,255,0.3); }
.wcv-actions .activate:hover { background: rgba(0,212,255,0.08); }
.wcv-actions .pause { color: var(--gold); border-color: rgba(255,209,102,0.3); }
.wcv-actions .pause:hover { background: rgba(255,209,102,0.08); }
.wcv-actions .rules { color: var(--violet); border-color: rgba(179,102,255,0.3); }
.wcv-actions .rules:hover { background: rgba(179,102,255,0.08); }
.wcv-actions .reveal { color: var(--gold); border-color: rgba(255,209,102,0.3); }
.wcv-actions .del { flex: 0 0 auto; min-width: 40px; color: var(--red); border-color: rgba(255,56,101,0.3); }
.wcv-actions .del:hover { background: rgba(255,56,101,0.08); }

/* Per-wallet rules editor (in-drawer view shown when user clicks ⚙ RÈGLES on a card) */
.wallet-rules-header { margin-bottom: 16px; }
.wallet-rules-back {
    background: rgba(255,255,255,0.04); color: var(--cyan);
    border: 1px solid var(--gray2); border-radius: 8px;
    padding: 6px 12px; font-size: 11px; font-weight: 700; cursor: pointer;
    margin-bottom: 10px;
}
.wallet-rules-title { font-size: 16px; font-weight: 900; letter-spacing: -0.3px; margin-bottom: 6px; }
.wallet-rules-sub { font-size: 11px; color: var(--gray); line-height: 1.5; }

.pw-right { display: flex; align-items: center; gap: 6px; }
.pw-default-row {
    display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
    padding: 4px 8px; border-radius: 8px;
    background: rgba(255,255,255,0.03);
    font-size: 10px;
}
.pw-default-label { color: var(--gray); }
.pw-default-value { font-weight: 800; color: rgba(255,255,255,0.7); font-variant-numeric: tabular-nums; }
.pw-reset {
    margin-left: auto;
    padding: 3px 8px; border-radius: 6px;
    background: rgba(255,209,102,0.12); color: var(--gold);
    border: 1px solid rgba(255,209,102,0.3);
    font-size: 9px; font-weight: 800; letter-spacing: 1px;
    cursor: pointer; transition: background 0.15s;
}
.pw-reset:hover { background: rgba(255,209,102,0.2); }

.wallet-add-btn {
    width: 100%; padding: 14px; margin-top: 4px;
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(179,102,255,0.06));
    color: var(--cyan); border: 1px dashed rgba(0,212,255,0.4); border-radius: 14px;
    font-size: 12px; font-weight: 800; letter-spacing: 1.5px;
    cursor: pointer; transition: background 0.2s;
}
.wallet-add-btn:hover { background: linear-gradient(135deg, rgba(0,212,255,0.18), rgba(179,102,255,0.12)); }

.wallet-form {
    margin-top: 10px; padding: 14px; border-radius: 14px;
    background: rgba(0,212,255,0.04); border: 1px solid rgba(0,212,255,0.2);
}
.wallet-form-row { margin-bottom: 10px; }
.wallet-form-label { font-size: 10px; color: var(--gray); font-weight: 800; letter-spacing: 1px; margin-bottom: 6px; }
.wallet-form input, .wallet-form textarea {
    width: 100%; padding: 10px 12px;
    background: rgba(255,255,255,0.05); border: 1px solid var(--gray2);
    border-radius: 10px; color: #fff; font-family: inherit; font-size: 13px;
}
.wallet-form input:focus, .wallet-form textarea:focus { outline: 1px solid var(--cyan); border-color: var(--cyan); }
.wallet-form textarea { font-family: ui-monospace, Menlo, monospace; font-size: 11px; resize: vertical; min-height: 70px; }
.wallet-form-actions { display: flex; gap: 8px; }
.wallet-form-actions button {
    flex: 1; padding: 9px; border-radius: 10px; border: none;
    font-size: 11px; font-weight: 800; letter-spacing: 1px; cursor: pointer;
}
.wallet-form-actions .submit { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #000; }
.wallet-form-actions .cancel { background: rgba(255,255,255,0.06); color: var(--gray); }
.wallet-form-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.wallet-form-tab {
    flex: 1; padding: 7px; border-radius: 8px; border: 1px solid var(--gray2);
    background: rgba(255,255,255,0.03); color: var(--gray);
    font-size: 10px; font-weight: 700; cursor: pointer;
}
.wallet-form-tab.active { background: rgba(0,212,255,0.15); color: var(--cyan); border-color: var(--cyan); }

/* ===== App tab — API keys ===== */
.app-config-section { margin-bottom: 18px; }
.app-config-label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.app-config-label { font-size: 11px; color: var(--gray); font-weight: 800; letter-spacing: 1.5px; flex: 1; }
.app-config-status {
    font-size: 9px; padding: 2px 7px; border-radius: 5px;
    font-weight: 800; letter-spacing: 1px;
}
.app-config-status.set { background: rgba(0,255,157,0.12); color: var(--green); border: 1px solid rgba(0,255,157,0.25); }
.app-config-status.unset { background: rgba(255,209,102,0.12); color: var(--gold); border: 1px solid rgba(255,209,102,0.25); }

.app-config-input-row { display: flex; gap: 8px; align-items: stretch; }
.app-config-input {
    flex: 1; padding: 11px 14px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--gray2); border-radius: 10px;
    color: #fff; font-family: ui-monospace, Menlo, monospace; font-size: 12px;
    transition: border-color 0.15s, background 0.15s;
}
.app-config-input:focus {
    outline: none; border-color: var(--cyan);
    background: rgba(0,212,255,0.04);
}
.app-config-test-btn {
    padding: 0 14px; flex-shrink: 0;
    background: rgba(179,102,255,0.12); color: var(--violet);
    border: 1px solid rgba(179,102,255,0.3); border-radius: 10px;
    font-family: inherit; font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
    cursor: pointer; transition: background 0.15s;
}
.app-config-test-btn:hover:not(:disabled) { background: rgba(179,102,255,0.22); }
.app-config-test-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.app-config-test-result {
    margin-top: 6px; padding: 7px 11px; border-radius: 8px;
    font-size: 11px; line-height: 1.4; display: none;
}
.app-config-test-result.ok      { display: block; background: rgba(0,255,157,0.08); color: var(--green); border: 1px solid rgba(0,255,157,0.25); }
.app-config-test-result.err     { display: block; background: rgba(255,56,101,0.08); color: var(--red); border: 1px solid rgba(255,56,101,0.25); }
.app-config-test-result.loading { display: block; background: rgba(255,255,255,0.04); color: var(--gray); }
.app-config-help { font-size: 10px; color: var(--gray); margin-top: 6px; line-height: 1.4; }
.app-config-restart-note {
    margin-top: 14px; padding: 12px;
    background: rgba(255,209,102,0.08); border: 1px solid rgba(255,209,102,0.25);
    border-radius: 10px; font-size: 11px; color: var(--gold); line-height: 1.5;
}

/* ===== Settings drawer — group cards + sliders + dirty indicator ===== */
.settings-group-card {
    margin-bottom: 18px; padding: 18px 16px;
    border-radius: 18px; position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    border: 1px solid var(--gray2);
}
.settings-group-card::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--cyan); opacity: 0.7;
}
.settings-group-card.exit::before    { background: var(--green); box-shadow: 0 0 14px rgba(0,255,157,0.4); }
.settings-group-card.selection::before { background: var(--cyan);  box-shadow: 0 0 14px rgba(0,212,255,0.4); }
.settings-group-card.entry::before    { background: var(--gold);  box-shadow: 0 0 14px rgba(255,209,102,0.4); }
.settings-group-card.eject::before    { background: var(--red);   box-shadow: 0 0 14px rgba(255,56,101,0.4); }

.settings-group-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 11px; font-weight: 900; letter-spacing: 2px;
    margin-bottom: 16px; padding-bottom: 10px;
    border-bottom: 1px solid var(--gray2);
}
.settings-group-icon { font-size: 16px; }
.settings-group-card.exit .settings-group-title    { color: var(--green); }
.settings-group-card.selection .settings-group-title { color: var(--cyan); }
.settings-group-card.entry .settings-group-title    { color: var(--gold); }
.settings-group-card.eject .settings-group-title    { color: var(--red); }

.settings-item {
    padding: 12px 0;
    border-bottom: 1px dashed rgba(255,255,255,0.04);
    transition: opacity 0.2s, background 0.2s, padding 0.2s, margin 0.2s, border-radius 0.2s;
}
.settings-item:last-child { border-bottom: none; padding-bottom: 0; }
.settings-item:first-child { padding-top: 0; }
.settings-item.dirty {
    background: rgba(0,212,255,0.05);
    border-radius: 10px;
    margin: 0 -10px;
    padding-left: 12px; padding-right: 12px;
    border-bottom-color: transparent;
}
.settings-item.disabled {
    opacity: 0.35; pointer-events: none;
}
.settings-item-row {
    display: flex; justify-content: space-between; align-items: center;
    gap: 10px; margin-bottom: 6px;
}
.settings-item-label {
    font-size: 13px; font-weight: 800; letter-spacing: -0.2px;
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 6px;
}
.settings-item-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--cyan); flex-shrink: 0;
    box-shadow: 0 0 8px var(--cyan);
    opacity: 0; transition: opacity 0.2s;
}
.settings-item.dirty .settings-item-dot { opacity: 1; }
.settings-item-current {
    font-size: 14px; font-weight: 900; letter-spacing: -0.3px;
    color: var(--cyan);
    font-variant-numeric: tabular-nums;
    background: rgba(0,212,255,0.1);
    padding: 3px 10px; border-radius: 8px;
    border: 1px solid rgba(0,212,255,0.2);
    white-space: nowrap;
}
.settings-item-desc {
    font-size: 11px; color: var(--gray);
    line-height: 1.55; margin-bottom: 10px;
}
.settings-item.bool .settings-item-desc { margin-bottom: 0; }

/* ---- Modern range slider with gradient-filled track ---- */
.settings-slider {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 8px;
    background: transparent;
    outline: none; cursor: pointer;
    margin: 0; padding: 0;
}
.settings-slider::-webkit-slider-runnable-track {
    width: 100%; height: 6px; border-radius: 3px;
    background: linear-gradient(to right,
        var(--cyan) 0%, var(--violet) var(--fill, 50%),
        rgba(255,255,255,0.08) var(--fill, 50%), rgba(255,255,255,0.08) 100%);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}
.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 22px; height: 22px; margin-top: -8px;
    background: #fff;
    border: 2px solid var(--cyan);
    border-radius: 50%; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,212,255,0.5);
    transition: transform 0.15s, box-shadow 0.15s;
}
.settings-slider:hover::-webkit-slider-thumb,
.settings-slider:active::-webkit-slider-thumb {
    transform: scale(1.18);
    box-shadow: 0 4px 20px rgba(0,212,255,0.7);
}
.settings-slider::-moz-range-track {
    width: 100%; height: 6px; border-radius: 3px;
    background: linear-gradient(to right,
        var(--cyan) 0%, var(--violet) var(--fill, 50%),
        rgba(255,255,255,0.08) var(--fill, 50%), rgba(255,255,255,0.08) 100%);
}
.settings-slider::-moz-range-thumb {
    width: 22px; height: 22px;
    background: #fff;
    border: 2px solid var(--cyan);
    border-radius: 50%; cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,212,255,0.5);
}

/* ---- Number input (used when no slider config exists) ---- */
.settings-number-input {
    width: 100%; padding: 10px 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--gray2);
    border-radius: 10px; color: #fff;
    font-family: inherit; font-size: 14px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s, background 0.2s;
}
.settings-number-input:focus {
    outline: none; border-color: var(--cyan);
    background: rgba(0,212,255,0.04);
}

/* ---- Tags input (chip-style) ---- */
.settings-tags-wrap {
    display: flex; flex-wrap: wrap; gap: 5px;
    padding: 8px 10px; min-height: 40px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--gray2); border-radius: 10px;
    transition: border-color 0.2s;
}
.settings-tags-wrap:focus-within { border-color: var(--cyan); }
.settings-tag-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 6px;
    background: rgba(255,56,101,0.12); color: var(--red);
    border: 1px solid rgba(255,56,101,0.25);
    font-size: 10px; font-weight: 800; letter-spacing: 0.5px;
    text-transform: uppercase;
}
.settings-tag-chip-x {
    cursor: pointer; opacity: 0.7;
    line-height: 1; font-size: 13px;
}
.settings-tag-chip-x:hover { opacity: 1; }
.settings-tag-input {
    flex: 1; min-width: 80px;
    background: transparent; border: none; outline: none;
    color: #fff; font-family: inherit; font-size: 12px; font-weight: 600;
}

/* ---- Footer save button with pending-count + pulse ---- */
.save-btn.has-changes {
    animation: savePulse 1.5s ease infinite;
}
@keyframes savePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,157,0.5); }
    50% { box-shadow: 0 0 0 10px rgba(0,255,157,0); }
}
.save-btn-count {
    display: inline-block; margin-left: 8px;
    background: rgba(0,0,0,0.2); color: #000;
    padding: 1px 7px; border-radius: 8px;
    font-size: 11px; font-weight: 900;
}

/* ---- Trade detail drawer (left side) ---- */
.trade-drawer {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(480px, 95vw);
    background: linear-gradient(180deg, #10101a 0%, #0a0a13 100%);
    border-right: 1px solid var(--gray2);
    transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 101; display: flex; flex-direction: column;
    box-shadow: 4px 0 40px rgba(0, 212, 255, 0.08);
}
.trade-drawer.open { transform: translateX(0); }
.trade-drawer-header {
    padding: 18px 20px 14px; border-bottom: 1px solid var(--gray2);
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.04), transparent);
}
.trade-drawer-title {
    font-size: 20px; font-weight: 900; letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #00d4ff);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.trade-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }

/* ---- Trade detail content blocks ---- */
.td-status-hero {
    padding: 14px 16px; border-radius: 16px; margin-bottom: 14px;
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid var(--gray2);
}
.td-status-hero.profit {
    background:
        radial-gradient(circle at 80% 20%, rgba(0,255,157,0.18), transparent 55%),
        linear-gradient(135deg, rgba(0,255,157,0.06), rgba(255,255,255,0.01));
    border-color: rgba(0,255,157,0.3);
}
.td-status-hero.loss {
    background:
        radial-gradient(circle at 80% 20%, rgba(255,56,101,0.18), transparent 55%),
        linear-gradient(135deg, rgba(255,56,101,0.06), rgba(255,255,255,0.01));
    border-color: rgba(255,56,101,0.3);
}
.td-status-hero.open {
    background:
        radial-gradient(circle at 80% 20%, rgba(0,212,255,0.18), transparent 55%),
        linear-gradient(135deg, rgba(0,212,255,0.06), rgba(255,255,255,0.01));
    border-color: rgba(0,212,255,0.3);
}
.td-hero-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; gap: 10px; }
.td-hero-symbol { font-size: 22px; font-weight: 900; letter-spacing: -0.7px; line-height: 1; }
.td-hero-time { font-size: 10px; color: var(--gray); margin-top: 3px; font-weight: 500; }
.td-hero-pill-box { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.td-hero-pill {
    padding: 4px 9px; border-radius: 8px; font-size: 9px; font-weight: 800;
    letter-spacing: 1.3px; white-space: nowrap;
}
.td-hero-pill.profit { background: rgba(0,255,157,0.18); color: var(--green); border: 1px solid rgba(0,255,157,0.4); }
.td-hero-pill.loss { background: rgba(255,56,101,0.18); color: var(--red); border: 1px solid rgba(255,56,101,0.4); }
.td-hero-pill.open { background: rgba(0,212,255,0.18); color: var(--cyan); border: 1px solid rgba(0,212,255,0.4); animation: pulse 2s ease infinite; }
.td-hero-pct { font-size: 13px; font-weight: 800; letter-spacing: -0.3px; }
.td-hero-pct.pos { color: var(--green); }
.td-hero-pct.neg { color: var(--red); }

.td-hero-pnl {
    font-size: 30px; font-weight: 900; letter-spacing: -1.2px; line-height: 1; margin-top: 2px;
}
.td-hero-pnl.pos { background: linear-gradient(180deg, #fff 0%, var(--green) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 30px rgba(0,255,157,0.35); }
.td-hero-pnl.neg { background: linear-gradient(180deg, #fff 0%, var(--red) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 0 30px rgba(255,56,101,0.35); }
.td-hero-pnl.neu { background: linear-gradient(180deg, #fff 0%, var(--cyan) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.td-hero-eur { font-size: 12px; color: var(--gray); margin-top: 4px; font-weight: 600; }

/* Hero NOUS vs KOL comparison bars */
.td-hero-cmp { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--gray2); }
.td-hero-cmp-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.td-hero-cmp-row:first-child { margin-top: 0; }
.td-hero-cmp-tag { width: 34px; font-size: 9px; font-weight: 800; letter-spacing: 0.8px; flex-shrink: 0; }
.td-hero-cmp-tag.nous { color: var(--cyan); }
.td-hero-cmp-tag.kol { color: var(--violet); }
.td-hero-cmp-track { flex: 1; height: 9px; background: rgba(255,255,255,0.05); border-radius: 5px; overflow: hidden; min-width: 0; }
.td-hero-cmp-fill { height: 100%; border-radius: 5px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.td-hero-cmp-fill.pos { background: linear-gradient(90deg, rgba(0,255,157,0.4), var(--green)); box-shadow: 0 0 6px rgba(0,255,157,0.3); }
.td-hero-cmp-fill.neg { background: linear-gradient(90deg, var(--red), rgba(255,56,101,0.4)); box-shadow: 0 0 6px rgba(255,56,101,0.3); }
.td-hero-cmp-vals { min-width: 78px; text-align: right; }
.td-hero-cmp-pct { font-size: 11px; font-weight: 800; line-height: 1.1; }
.td-hero-cmp-pct.pos { color: var(--green); }
.td-hero-cmp-pct.neg { color: var(--red); }
.td-hero-cmp-sol { font-size: 9px; color: var(--gray); font-weight: 600; margin-top: 1px; }

/* Accumulated-position warning under the comparison bars */
.td-kol-warning {
    margin-top: 10px; padding: 10px 12px; border-radius: 10px;
    background: linear-gradient(135deg, rgba(255,209,102,0.1), rgba(255,209,102,0.02));
    border: 1px solid rgba(255,209,102,0.3);
}
.td-kol-warning-title {
    font-size: 10px; font-weight: 900; color: var(--gold);
    letter-spacing: 1.5px; margin-bottom: 4px;
}
.td-kol-warning-text {
    font-size: 11px; color: #fff; line-height: 1.4; font-weight: 500;
}
.td-kol-warning-detail {
    margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,209,102,0.15);
    font-size: 11px; display: flex; flex-direction: column; gap: 4px;
}
.td-kol-warning-detail .lbl { color: var(--gray); font-weight: 600; }
.td-kol-warning-detail .val { font-weight: 800; }
.td-kol-warning-detail .val.pos { color: var(--green); }
.td-kol-warning-detail .val.neg { color: var(--red); }

.td-section { margin-bottom: 14px; }
.td-section-title {
    font-size: 9px; letter-spacing: 1.8px; font-weight: 800; color: var(--gray);
    margin-bottom: 8px; display: flex; align-items: center; gap: 8px;
}
.td-section-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--gray2), transparent); }

/* Trajet visual */
.td-trajet { display: grid; grid-template-columns: 1fr 30px 1fr; gap: 6px; align-items: stretch; }
.td-trajet-leg {
    padding: 10px 11px; border-radius: 12px; min-width: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid var(--gray2);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; gap: 3px;
}
.td-trajet-leg.entry { border-color: rgba(0,212,255,0.25); }
.td-trajet-leg.entry::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}
.td-trajet-leg.exit-profit { border-color: rgba(0,255,157,0.3); }
.td-trajet-leg.exit-profit::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--green), transparent);
}
.td-trajet-leg.exit-loss { border-color: rgba(255,56,101,0.3); }
.td-trajet-leg.exit-loss::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}
.td-trajet-leg.exit-pending {
    border-style: dashed; background: rgba(255,255,255,0.015);
    display: flex; align-items: center; justify-content: center;
}
.td-trajet-label { font-size: 9px; font-weight: 800; letter-spacing: 1.5px; color: var(--gray); }
.td-trajet-leg.entry .td-trajet-label { color: var(--cyan); }
.td-trajet-leg.exit-profit .td-trajet-label { color: var(--green); }
.td-trajet-leg.exit-loss .td-trajet-label { color: var(--red); }
.td-trajet-amount { font-size: 14px; font-weight: 900; letter-spacing: -0.3px; line-height: 1.1; word-break: break-all; }
.td-trajet-price { font-size: 10px; color: var(--gray); font-family: ui-monospace, Menlo, monospace; margin-top: 2px; word-break: break-all; }
.td-trajet-time { font-size: 9px; color: var(--gray); font-weight: 500; margin-top: 2px; }
.td-trajet-pending-text { font-size: 10px; color: var(--gray); font-weight: 700; letter-spacing: 1px; text-align: center; }
.td-trajet-arrow { display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; }
.td-trajet-arrow.profit { color: var(--green); text-shadow: 0 0 8px rgba(0,255,157,0.6); }
.td-trajet-arrow.loss { color: var(--red); text-shadow: 0 0 8px rgba(255,56,101,0.6); }
.td-trajet-arrow.neu { color: var(--gray); }

/* KOL block */
.td-kol-block {
    padding: 12px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(0,212,255,0.04), rgba(179,102,255,0.04));
    border: 1px solid rgba(0,212,255,0.15);
}
.td-kol-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.td-kol-meta { flex: 1; min-width: 0; }
.td-kol-name { font-weight: 800; font-size: 13px; }
.td-kol-addr { font-size: 10px; color: var(--gray); font-family: ui-monospace, Menlo, monospace; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-kol-links { display: flex; gap: 6px; margin-top: 6px; }
.td-kol-link {
    padding: 4px 9px; border-radius: 7px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
    background: rgba(0,212,255,0.1); color: var(--cyan); border: 1px solid rgba(0,212,255,0.2);
    text-decoration: none; transition: transform 0.15s;
}
.td-kol-link:hover { transform: translateY(-1px); }

/* Price comparison bars per leg */
.td-cmp-row { margin-bottom: 10px; }
.td-cmp-row:last-child { margin-bottom: 0; }
.td-cmp-row-label { font-size: 9px; font-weight: 700; color: var(--gray); letter-spacing: 1.3px; margin-bottom: 6px; }
.td-cmp-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 10px; }
.td-cmp-bar:last-child { margin-bottom: 0; }
.td-cmp-bar-tag { width: 32px; font-size: 9px; font-weight: 800; letter-spacing: 0.5px; flex-shrink: 0; }
.td-cmp-bar-tag.us { color: var(--cyan); }
.td-cmp-bar-tag.kol { color: var(--violet); }
.td-cmp-bar-track { flex: 1; height: 10px; background: rgba(255,255,255,0.05); border-radius: 5px; overflow: hidden; position: relative; min-width: 0; }
.td-cmp-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.td-cmp-bar-fill.us { background: linear-gradient(90deg, rgba(0,212,255,0.4), var(--cyan)); box-shadow: 0 0 8px rgba(0,212,255,0.3); }
.td-cmp-bar-fill.kol { background: linear-gradient(90deg, rgba(179,102,255,0.4), var(--violet)); box-shadow: 0 0 8px rgba(179,102,255,0.3); }
.td-cmp-bar-val { width: 82px; text-align: right; font-size: 10px; font-weight: 800; font-family: ui-monospace, Menlo, monospace; flex-shrink: 0; word-break: break-all; }
.td-cmp-verdict {
    margin-top: 10px; padding: 8px 12px; border-radius: 10px; font-size: 11px;
    font-weight: 700; text-align: center; line-height: 1.4;
}
.td-cmp-verdict.good { background: rgba(0,255,157,0.1); color: var(--green); border: 1px solid rgba(0,255,157,0.25); }
.td-cmp-verdict.bad { background: rgba(255,56,101,0.1); color: var(--red); border: 1px solid rgba(255,56,101,0.25); }
.td-cmp-verdict.neutral { background: rgba(255,255,255,0.04); color: var(--gray); border: 1px solid var(--gray2); }

/* Metric pills (2-cols on the trade-detail drawer) */
.td-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.td-metric {
    padding: 9px 11px; border-radius: 12px; min-width: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid var(--gray2);
    display: flex; align-items: center; gap: 8px;
    transition: border-color 0.2s;
}
.td-metric.highlight-cyan { border-color: rgba(0,212,255,0.25); }
.td-metric.highlight-violet { border-color: rgba(179,102,255,0.25); }
.td-metric.highlight-gold { border-color: rgba(255,209,102,0.25); }
.td-metric-icon {
    width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.td-metric.highlight-cyan .td-metric-icon { background: rgba(0,212,255,0.12); }
.td-metric.highlight-violet .td-metric-icon { background: rgba(179,102,255,0.12); }
.td-metric.highlight-gold .td-metric-icon { background: rgba(255,209,102,0.12); }
.td-metric-body { flex: 1; min-width: 0; }
.td-metric-label { font-size: 9px; color: var(--gray); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.td-metric-value { font-size: 12px; font-weight: 800; margin-top: 2px; word-break: break-word; }

/* ===== TRADERS SIDEBAR (replaces the centered modal) ===== */
.traders-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 95vw);
    background: #0d0d14; border-left: 1px solid var(--gray2);
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 101; display: flex; flex-direction: column;
    box-shadow: -4px 0 40px rgba(0, 212, 255, 0.05);
}
.traders-drawer.open { transform: translateX(0); }
.traders-drawer-header {
    padding: 18px 20px 12px; border-bottom: 1px solid var(--gray2);
    display: flex; justify-content: space-between; align-items: center;
}
.traders-drawer-title { font-size: 18px; font-weight: 900; letter-spacing: -0.3px; }
.traders-drawer-meta { font-size: 11px; color: var(--gray); padding: 8px 20px 0; }
.traders-drawer-filters {
    display: flex; gap: 6px; padding: 10px 20px; flex-wrap: wrap;
    border-bottom: 1px solid var(--gray2);
}
.traders-filter {
    padding: 6px 10px; border-radius: 8px; border: 1px solid var(--gray2);
    background: rgba(255, 255, 255, 0.04); color: var(--gray);
    font-size: 10px; font-weight: 700; cursor: pointer;
}
.traders-filter.active { background: rgba(0, 212, 255, 0.15); color: var(--cyan); border-color: var(--cyan); }
.traders-drawer-body { flex: 1; overflow-y: auto; padding: 12px 20px 24px; }

/* Single trader entry inside the drawer — REDESIGNED */
.trader-item {
    padding: 12px 14px; border: 1px solid var(--gray2); border-radius: 14px; margin-bottom: 10px;
    cursor: pointer; position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.005));
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.trader-item::before {
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg, transparent, rgba(0,212,255,0.2), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    pointer-events: none; opacity: 0; transition: opacity 0.25s;
}
.trader-item:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,212,255,0.08); }
.trader-item:hover::before { opacity: 1; }
.trader-item.selected { border-color: rgba(0,255,157,0.4); }
.trader-item.selected::before { background: linear-gradient(135deg, transparent, rgba(0,255,157,0.3), transparent 60%); opacity: 1; }
.trader-item.banned { opacity: 0.55; border-color: rgba(255, 56, 101, 0.3); }
.trader-item.whitelisted { border-color: rgba(255,209,102,0.4); }
.trader-item.whitelisted::before { background: linear-gradient(135deg, transparent, rgba(255,209,102,0.3), transparent 60%); opacity: 1; }

.trader-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.trader-ident { flex: 1; min-width: 0; }
.trader-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.trader-name { font-weight: 800; font-size: 14px; }
.trader-addr {
    font-family: ui-monospace, Menlo, monospace; font-size: 10px; color: var(--gray);
    margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.trader-reject { font-size: 10px; color: var(--red); margin-top: 3px; line-height: 1.3; }

/* Compact circular score gauge (32px) */
.trader-score-mini {
    width: 38px; height: 38px; flex-shrink: 0; position: relative;
}
.trader-score-mini svg { width: 38px; height: 38px; }
.trader-score-mini-num {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}

.trader-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.trader-tag {
    font-size: 9px; padding: 2px 6px; border-radius: 4px;
    background: rgba(0, 212, 255, 0.1); color: var(--cyan);
    font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}

/* Metric rows (same pattern as wallet rows) */
.trader-metrics { display: flex; flex-direction: column; gap: 5px; }
.trader-metric { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.trader-metric-icon {
    width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 11px;
    background: rgba(255,255,255,0.04);
}
.trader-metric-icon.cyan { background: rgba(0,212,255,0.12); color: var(--cyan); }
.trader-metric-icon.green { background: rgba(0,255,157,0.12); color: var(--green); }
.trader-metric-icon.red { background: rgba(255,56,101,0.12); color: var(--red); }
.trader-metric-icon.gold { background: rgba(255,209,102,0.12); color: var(--gold); }
.trader-metric-icon.violet { background: rgba(179,102,255,0.12); color: var(--violet); }
.trader-metric-label { font-size: 10px; color: var(--gray); letter-spacing: 0.5px; min-width: 50px; flex-shrink: 0; font-weight: 700; }
.trader-metric-bar { flex: 1; min-width: 0; }
.trader-metric-val { font-size: 11px; font-weight: 800; min-width: 90px; text-align: right; flex-shrink: 0; }

/* Footer with our PnL on this trader */
.trader-footer {
    margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--gray2);
    display: flex; align-items: center; gap: 6px; font-size: 11px;
}
.trader-footer-label { color: var(--gray); font-weight: 700; }
.trader-footer-value { font-weight: 800; }
.trader-footer-sub { color: var(--gray); font-size: 10px; }

/* "Style pill" used in both wallets and traders drawers */
.style-pill {
    display: inline-block; padding: 1px 7px; border-radius: 6px;
    font-size: 9px; font-weight: 800; letter-spacing: 0.8px;
    border: 1px solid;
}
.style-pill.red    { color: var(--red);    background: rgba(255,56,101,0.1);  border-color: rgba(255,56,101,0.3); }
.style-pill.gold   { color: var(--gold);   background: rgba(255,209,102,0.1); border-color: rgba(255,209,102,0.3); }
.style-pill.cyan   { color: var(--cyan);   background: rgba(0,212,255,0.1);   border-color: rgba(0,212,255,0.3); }
.style-pill.violet { color: var(--violet); background: rgba(179,102,255,0.1); border-color: rgba(179,102,255,0.3); }
.style-pill.green  { color: var(--green);  background: rgba(0,255,157,0.1);   border-color: rgba(0,255,157,0.3); }
.style-pill:not(.red):not(.gold):not(.cyan):not(.violet):not(.green) {
    color: var(--gray); border-color: var(--gray2);
}

/* ===== TRADER PROFILE SIDEBAR ===== */
.profile-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 95vw);
    background: linear-gradient(180deg, #10101a 0%, #0a0a13 100%);
    border-left: 1px solid var(--gray2);
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 102; display: flex; flex-direction: column;
    box-shadow: -4px 0 40px rgba(179, 102, 255, 0.08);
}
.profile-drawer.open { transform: translateX(0); }
.profile-drawer-header {
    padding: 18px 20px 14px; border-bottom: 1px solid var(--gray2);
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, rgba(179, 102, 255, 0.05), transparent);
}
.profile-drawer-title {
    font-size: 18px; font-weight: 900; letter-spacing: -0.3px;
    background: linear-gradient(135deg, #fff, var(--violet));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.profile-drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }

.profile-hero {
    padding: 14px 16px; border-radius: 16px; margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(0,212,255,0.06), rgba(179,102,255,0.06));
    border: 1px solid rgba(0,212,255,0.2);
    display: flex; align-items: center; gap: 12px;
}
.profile-hero-info { flex: 1; min-width: 0; }
.profile-hero-name { font-size: 18px; font-weight: 900; letter-spacing: -0.3px; }
.profile-hero-addr { font-size: 10px; color: var(--gray); font-family: ui-monospace, Menlo, monospace; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-hero-status { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }

/* Score gauge — circular SVG with center text */
.profile-score {
    flex-shrink: 0; width: 64px; height: 64px; position: relative;
}
.profile-score-num {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.profile-score-num-big { font-size: 18px; font-weight: 900; }
.profile-score-num-lbl { font-size: 7px; color: var(--gray); letter-spacing: 1px; font-weight: 800; }

/* Metric blocks in profile (2 cols) */
.profile-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.profile-metric {
    padding: 11px 12px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid var(--gray2);
}
.profile-metric-label { font-size: 9px; color: var(--gray); font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.profile-metric-value { font-size: 16px; font-weight: 900; margin-top: 3px; letter-spacing: -0.3px; }
.profile-metric-value.pos { color: var(--green); }
.profile-metric-value.neg { color: var(--red); }
.profile-metric-sub { font-size: 10px; color: var(--gray); margin-top: 3px; font-weight: 600; }
.profile-metric-bar { margin-top: 6px; }

/* Period tabs (1D / 7D / 30D) above metrics */
.profile-period-tabs {
    display: flex; gap: 6px; margin-bottom: 12px;
    padding: 4px; border-radius: 12px;
    background: rgba(255,255,255,0.04); border: 1px solid var(--gray2);
}
.period-tab {
    flex: 1; padding: 8px 12px; border-radius: 9px; border: none;
    background: transparent; color: var(--gray);
    font-size: 11px; font-weight: 800; letter-spacing: 1.2px; cursor: pointer;
    transition: all 0.2s;
}
.period-tab:hover { color: #fff; }
.period-tab.active {
    background: linear-gradient(135deg, var(--cyan), var(--violet));
    color: #000;
    box-shadow: 0 4px 14px rgba(0,212,255,0.25);
}

/* Hold-style callout block — gives meaning to the avg-holding number */
.profile-style-callout {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; border-radius: 12px; margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.005));
    border: 1px solid var(--gray2);
}
.profile-style-callout.red    { background: linear-gradient(135deg, rgba(255,56,101,0.08),  rgba(255,255,255,0.01)); border-color: rgba(255,56,101,0.25); }
.profile-style-callout.gold   { background: linear-gradient(135deg, rgba(255,209,102,0.08), rgba(255,255,255,0.01)); border-color: rgba(255,209,102,0.25); }
.profile-style-callout.cyan   { background: linear-gradient(135deg, rgba(0,212,255,0.08),   rgba(255,255,255,0.01)); border-color: rgba(0,212,255,0.25); }
.profile-style-callout.violet { background: linear-gradient(135deg, rgba(179,102,255,0.08), rgba(255,255,255,0.01)); border-color: rgba(179,102,255,0.25); }
.profile-style-callout.green  { background: linear-gradient(135deg, rgba(0,255,157,0.08),   rgba(255,255,255,0.01)); border-color: rgba(0,255,157,0.25); }
.profile-style-emoji { font-size: 24px; flex-shrink: 0; }
.profile-style-txt { flex: 1; min-width: 0; }
.profile-style-label { font-size: 13px; font-weight: 900; letter-spacing: 0.5px; }
.profile-style-desc { font-size: 11px; color: var(--gray); margin-top: 2px; line-height: 1.3; }

.profile-our-pnl-card {
    padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(255,209,102,0.06), rgba(255,255,255,0.01));
    border: 1px solid rgba(255,209,102,0.2);
}
.profile-our-pnl-label { font-size: 9px; color: var(--gold); letter-spacing: 1.5px; font-weight: 800; }
.profile-our-pnl-value { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; margin-top: 4px; }
.profile-our-pnl-sub { font-size: 11px; color: var(--gray); margin-top: 2px; }

.profile-section { margin-bottom: 14px; }
.profile-section-title { font-size: 9px; letter-spacing: 1.8px; font-weight: 800; color: var(--gray); margin-bottom: 8px; }

.profile-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.profile-action {
    flex: 1; padding: 10px 12px; border-radius: 10px;
    font-size: 11px; font-weight: 800; letter-spacing: 1px; cursor: pointer;
    border: 1px solid var(--gray2); background: rgba(255,255,255,0.04); color: var(--gray);
    transition: transform 0.1s, background 0.15s;
}
.profile-action:active { transform: scale(0.96); }
.profile-action.ban { border-color: rgba(255,56,101,0.3); color: var(--red); background: rgba(255,56,101,0.08); }
.profile-action.wl  { border-color: rgba(0,255,157,0.3); color: var(--green); background: rgba(0,255,157,0.08); }
.profile-action.clear { background: rgba(255,255,255,0.04); color: var(--gray); }

.profile-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.profile-tag {
    font-size: 9px; padding: 3px 7px; border-radius: 5px;
    background: rgba(0,212,255,0.1); color: var(--cyan);
    font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}

.profile-trade-mini {
    padding: 8px 10px; border-radius: 9px; margin-bottom: 5px;
    background: rgba(255,255,255,0.03); border: 1px solid var(--gray2);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px;
}
.profile-trade-mini-pnl { font-weight: 800; }
.profile-trade-mini-meta { font-size: 9px; color: var(--gray); }

/* ===== Config history drawer (slides over the settings drawer) ===== */
.history-drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(440px, 90vw);
    background: linear-gradient(180deg, #10101a 0%, #0a0a13 100%);
    border-left: 1px solid var(--gray2);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 103; /* above settings drawer (101) and overlay (100) */
    display: flex; flex-direction: column;
    box-shadow: -4px 0 40px rgba(255, 209, 102, 0.06);
}
.history-drawer.open { transform: translateX(0); }
.history-drawer-header {
    padding: 18px 20px; border-bottom: 1px solid var(--gray2);
    display: flex; justify-content: space-between; align-items: center;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.04), transparent);
}
.history-drawer-title {
    font-size: 18px; font-weight: 900; letter-spacing: -0.3px;
    background: linear-gradient(135deg, #fff, var(--gold));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.history-drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px 24px; }

.history-item {
    padding: 12px 14px; margin-bottom: 8px;
    border: 1px solid var(--gray2); border-radius: 12px;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.005));
    transition: border-color 0.2s, transform 0.15s;
}
.history-item:hover { border-color: rgba(255,209,102,0.3); transform: translateY(-1px); }
.history-item-ts {
    font-size: 11px; color: var(--gold); font-weight: 800; letter-spacing: 0.5px;
}
.history-item-note {
    font-size: 12px; color: rgba(255,255,255,0.85); margin-top: 4px; line-height: 1.4;
}
.history-item-restore {
    margin-top: 10px; padding: 7px 14px;
    background: rgba(0,212,255,0.12); color: var(--cyan);
    border: 1px solid rgba(0,212,255,0.3); border-radius: 9px;
    font-size: 10px; font-weight: 800; letter-spacing: 1px; cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}
.history-item-restore:hover { background: rgba(0,212,255,0.2); }
.history-item-restore:active { transform: scale(0.96); }
