:root {
    --client-bg: #070714;
    --client-surface: #12122a;
    --client-surface-2: #1a1a3d;
    --client-card: #1e1e45;
    --client-primary: #7c4dff;
    --client-primary-dark: #5b2fd4;
    --client-accent: #9d6fff;
    --client-text: #f4f4ff;
    --client-muted: #9ca3c7;
    --client-border: rgba(124, 77, 255, 0.2);
    --client-success: #22c55e;
    --client-danger: #ef4444;
    --client-buy: #34d399;
    --client-sell: #f87171;
    --client-whatsapp: #25d366;
    --nav-h: 72px;
    --header-h: 56px;
    --font: 'Source Sans 3', system-ui, sans-serif;
    --radius: 14px;
    --radius-lg: 20px;
}

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

body.client-app {
    font-family: var(--font);
    background: var(--client-bg);
    color: var(--client-text);
    min-height: 100vh;
    padding-bottom: calc(var(--nav-h) + 16px);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--client-accent); text-decoration: none; }

/* Header */
.client-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: var(--header-h);
    padding-right: var(--content-padding-x);
    background: rgba(7, 7, 20, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--client-border);
    overflow: visible;
}

.client-header-inner {
    flex: 1;
    min-width: 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
    overflow: visible;
}

.client-header-profile {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: var(--header-h);
    overflow: visible;
    z-index: 110;
}

.client-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--client-text);
    letter-spacing: -0.03em;
}

.client-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--client-primary), #3b82f6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 900;
}

.client-profile-menu {
    position: relative;
    flex-shrink: 0;
}

.client-profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.2rem 0;
    font-family: inherit;
}

.client-profile-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    line-height: 1.25;
    flex-shrink: 0;
}

.client-profile-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--client-text);
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-profile-role {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--client-muted);
}

.client-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--client-border);
    background: var(--client-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--client-muted);
    transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.client-profile-trigger:hover .client-avatar,
.client-profile-menu:has(.client-profile-dropdown:not([hidden])) .client-avatar {
    border-color: var(--client-primary);
    box-shadow: 0 0 12px rgba(124, 77, 255, 0.35);
    color: var(--client-text);
}

.client-profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: auto;
    min-width: 11.5rem;
    padding: 0.5rem 0;
    background: linear-gradient(180deg, #1e1e45 0%, #161632 100%);
    border: 1px solid var(--client-border);
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 24px rgba(124, 77, 255, 0.12);
    z-index: 200;
}

.client-profile-dropdown[hidden] {
    display: none;
}

.client-profile-dropdown-item {
    display: block;
    width: 100%;
    padding: 0.7rem 1.15rem;
    text-align: left;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    color: #c4c8e8;
    text-decoration: none;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.client-profile-dropdown-item:hover {
    background: rgba(124, 77, 255, 0.12);
    color: var(--client-text);
}

.client-profile-dropdown-form {
    margin: 0;
    border-top: 1px solid rgba(124, 77, 255, 0.12);
}

.client-profile-dropdown-logout {
    color: #b8bccf;
}

.form-error {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--client-danger);
}

.client-main {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

/* Markets — use full standard content width (1200px) */
.client-main--markets {
    width: 100%;
    max-width: var(--content-max-width);
}

.markets-page {
    width: 100%;
    min-width: 0;
}

.markets-page .client-page-title,
.markets-page .client-page-sub {
    text-align: left;
}

.markets-page .market-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    width: 100%;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--client-border);
    padding-bottom: 0.5rem;
}

.markets-page .market-tab {
    text-align: center;
    justify-self: stretch;
}

.markets-page .market-table-wrap {
    width: 100%;
    max-width: none;
    padding: 0;
    overflow: hidden;
}

.markets-page .market-table-full {
    width: 100%;
    min-width: 100%;
    table-layout: fixed;
}

.markets-page .market-table-full col.col-name { width: 16%; }
.markets-page .market-table-full col.col-symbol { width: 10%; }
.markets-page .market-table-full col.col-price { width: 16%; }
.markets-page .market-table-full col.col-change { width: 12%; }
.markets-page .market-table-full col.col-holdings { width: 12%; }
.markets-page .market-table-full col.col-pl { width: 8%; }
.markets-page .market-table-full col.col-actions { width: 26%; }

@media (max-width: 640px) {
    .markets-page .market-table-wrap {
        overflow-x: auto;
    }

    .markets-page .market-table-full {
        table-layout: auto;
        min-width: 640px;
    }

    .markets-page .market-actions {
        flex-wrap: wrap;
    }
}

/* Bottom nav */
.client-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    background: rgba(18, 18, 42, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--client-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 200;
    padding: 0 0.5rem env(safe-area-inset-bottom);
}

.client-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.75rem;
    color: var(--client-muted);
    font-size: 0.7rem;
    font-weight: 600;
    transition: color 0.2s;
    text-decoration: none;
    min-width: 56px;
}

.client-nav-item svg { width: 22px; height: 22px; opacity: 0.85; }

.client-nav-item.active {
    color: var(--client-primary);
}

.client-nav-item.active svg { opacity: 1; filter: drop-shadow(0 0 6px rgba(124, 77, 255, 0.5)); }

/* Cards */
.client-card {
    background: var(--client-card);
    border: 1px solid var(--client-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.client-card-glow {
    background: linear-gradient(145deg, rgba(124, 77, 255, 0.12), rgba(30, 30, 69, 0.9));
    border: 1px solid rgba(124, 77, 255, 0.35);
}

.client-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.35rem;
    letter-spacing: -0.02em;
}

.client-page-sub {
    text-align: center;
    color: var(--client-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Welcome hero */
.welcome-hero h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--client-primary);
    margin-bottom: 0.5rem;
}

.welcome-hero p {
    color: var(--client-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1rem;
}

.feature-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
}

.feature-mini {
    background: rgba(0, 0, 0, 0.25);
    border-radius: var(--radius);
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--client-muted);
}

.feature-mini strong { display: block; color: var(--client-text); font-size: 0.75rem; margin-bottom: 0.25rem; }

/* Quick actions */
.section-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--client-muted);
    margin: 1.25rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.action-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.1rem 0.5rem;
    background: var(--client-surface-2);
    border: 1px solid var(--client-border);
    border-radius: var(--radius);
    color: var(--client-text);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.action-tile:hover {
    transform: translateY(-2px);
    border-color: var(--client-primary);
    box-shadow: 0 8px 24px rgba(124, 77, 255, 0.2);
    color: var(--client-text);
}

.action-tile-icon {
    font-size: 1.5rem;
    color: var(--client-primary);
}

/* Promo cards */
.promo-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    background: var(--client-surface-2);
    border: 1px solid var(--client-border);
    border-radius: var(--radius);
    margin-bottom: 0.65rem;
}

.promo-card p { font-size: 0.85rem; color: var(--client-muted); flex: 1; }

/* Forms */
.client-form-card {
    max-width: 400px;
    margin: 0 auto;
}

.client-form-card h1 {
    text-align: center;
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--client-muted);
    margin-bottom: 0.4rem;
}

.client-input, .client-select, .client-textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--client-border);
    border-radius: var(--radius);
    color: var(--client-text);
    font-family: inherit;
    font-size: 0.95rem;
}

.client-input:focus, .client-select:focus {
    outline: none;
    border-color: var(--client-primary);
    box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.25);
}

/* Trade — market picker dropdown list */
.trade-market-select {
    color-scheme: dark;
    background-color: var(--client-card);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%239ca3c7'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.trade-market-select option,
.trade-market-select optgroup {
    background-color: #1e1e45;
    color: var(--client-text);
}

.trade-market-select optgroup {
    background-color: #161632;
    color: var(--client-accent);
    font-weight: 700;
}

.trade-market-select option:checked,
.trade-market-select option:hover {
    background-color: #2a2a5a;
    color: var(--client-text);
}

.input-copy-row { display: flex; gap: 0.5rem; align-items: stretch; }

.input-copy-row .client-input { flex: 1; font-size: 0.8rem; min-width: 0; }

.copy-feedback {
    margin: 0.35rem 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--client-buy);
}

/* Buttons */
.client-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem 1.25rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.client-btn-primary {
    background: linear-gradient(135deg, var(--client-primary), var(--client-primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(124, 77, 255, 0.4);
}

.client-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(124, 77, 255, 0.5); }

.client-btn-outline {
    background: transparent;
    border: 1px solid var(--client-border);
    color: var(--client-text);
}

.client-btn-whatsapp {
    background: var(--client-whatsapp);
    color: #fff;
}

.client-btn-telegram {
    background: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
    color: #fff;
}

.support-page {
    text-align: center;
    padding: 2rem 0 1rem;
}

.support-channels {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    max-width: 320px;
    margin: 1.75rem auto 0;
}

.support-channel-btn {
    max-width: 100%;
}

.support-channel-btn__icon {
    font-size: 1.15rem;
    line-height: 1;
}

.support-page-empty {
    margin-top: 1.5rem;
}

.client-btn-sm {
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    width: auto;
}

.client-btn-buy { background: var(--client-buy); color: #0f172a; }
.client-btn-sell { background: var(--client-sell); color: #fff; }

/* Wallet */
.balance-hero {
    text-align: center;
    padding: 1.5rem 0 1.25rem;
}

.balance-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--client-muted);
    margin-bottom: 0.35rem;
}

.balance-amount {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.balance-fiat { color: var(--client-muted); font-size: 0.9rem; margin-top: 0.25rem; }

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.wallet-action-btn {
    padding: 0.85rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--client-border);
    color: var(--client-text);
    background: var(--client-surface-2);
}

.wallet-action-btn.primary {
    background: linear-gradient(135deg, var(--client-primary), var(--client-primary-dark));
    border-color: transparent;
}

/* Markets table */
.market-tabs {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--client-border);
    padding-bottom: 0.5rem;
    width: 100%;
}

.market-tab {
    color: var(--client-muted);
    font-weight: 600;
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid transparent;
    text-decoration: none;
}

.market-tab.active {
    color: var(--client-primary);
    border-bottom-color: var(--client-primary);
}

.market-table-wrap { overflow-x: auto; border-radius: var(--radius); }

.market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.market-table th {
    text-align: left;
    padding: 0.65rem 0.5rem;
    color: var(--client-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.market-table td {
    padding: 0.75rem 0.5rem;
    border-top: 1px solid var(--client-border);
}

.market-table .change-positive {
    background: rgba(34, 197, 94, 0.25);
    color: #4ade80;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.market-table .change-negative {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.market-table-full {
    font-size: 0.78rem;
}

.market-table-full th {
    font-size: 0.68rem;
    padding: 0.75rem 0.4rem;
}

.market-table-full td {
    padding: 0.85rem 0.4rem;
    vertical-align: middle;
}

/* Markets page column alignment (must follow base .market-table rules) */
.markets-page .market-table-full th,
.markets-page .market-table-full td {
    padding: 0.85rem 0.75rem;
}

.markets-page .market-table-full .col-name,
.markets-page .market-table-full .col-symbol {
    text-align: left;
}

.markets-page .market-table-full .col-price,
.markets-page .market-table-full .col-holdings,
.markets-page .market-table-full .col-pl {
    text-align: right;
}

.markets-page .market-table-full .col-change {
    text-align: center;
}

.markets-page .market-table-full .col-actions {
    text-align: right;
}

.markets-page .market-table-full .col-actions .market-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 0.35rem;
}

.market-name { font-weight: 600; white-space: nowrap; }
.market-price { font-weight: 600; white-space: nowrap; }
.market-holdings, .market-pl { color: var(--client-muted); }

.market-actions {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.market-btn {
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.15s;
}

.market-btn:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; }

.market-btn-trade { background: #2563eb; color: #fff; }
.market-btn-buy { background: #22c55e; color: #fff; }
.market-btn-sell { background: #ef4444; color: #fff; }

.trade-btn-link {
    background: #2563eb;
    color: #fff;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Trade page — chart card fills viewport between header and bottom nav */
.client-main--trade {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-h) - var(--nav-h) - 2rem);
}

.client-main--trade #tradeForm {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.client-main--trade .trade-chart-card {
    flex: 1 1 auto;
    min-height: 0;
}

/* Trade — chart card (TradingView fills entire card body) */
.trade-chart-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--header-h) - var(--nav-h) - 17rem);
}

.trade-chart-card__header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--client-border);
    flex-shrink: 0;
}

.trade-chart-card__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    background: var(--client-primary);
    flex-shrink: 0;
}

.trade-chart-card__icon--btc { background: #f7931a; }
.trade-chart-card__icon--eth { background: #627eea; }
.trade-chart-card__icon--sol { background: linear-gradient(135deg, #9945ff, #14f195); }
.trade-chart-card__icon--xrp { background: #23292f; }
.trade-chart-card__icon--uni { background: #ff007a; }
.trade-chart-card__icon--xauusd,
.trade-chart-card__icon--xagusd { background: linear-gradient(135deg, #eab308, #ca8a04); font-size: 1.1rem; }

.trade-chart-card__pair {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.trade-chart-card__body {
    flex: 1 1 auto;
    min-height: calc(100vh - var(--header-h) - var(--nav-h) - 19rem);
    height: calc(100vh - var(--header-h) - var(--nav-h) - 19rem);
    display: flex;
    flex-direction: column;
    position: relative;
}

.tradingview-chart-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
    background: #0d0d1f;
}

.tradingview-chart-wrap .tradingview-widget-container,
.tradingview-chart-wrap #tradingview_chart {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
}

.tradingview-chart-wrap iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    display: block;
}

.metal-trade-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(124, 77, 255, 0.12));
    border: 1px solid rgba(234, 179, 8, 0.35);
    border-radius: var(--radius);
}

.metal-trade-banner span { font-size: 1.5rem; }

.metal-trade-banner strong {
    display: block;
    font-size: 0.95rem;
}

.metal-trade-banner small {
    color: var(--client-muted);
    font-size: 0.78rem;
}

.action-grid-metals {
    grid-template-columns: repeat(3, 1fr);
}

.order-metal-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.45rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(234, 179, 8, 0.2);
    color: #fbbf24;
    border-radius: 4px;
    vertical-align: middle;
}

.order-card-metal {
    border-color: rgba(234, 179, 8, 0.25);
}

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

.period-btn {
    padding: 0.75rem;
    background: var(--client-surface-2);
    border: 1px solid var(--client-border);
    border-radius: var(--radius);
    color: var(--client-text);
    font-size: 0.75rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.period-btn input { display: none; }

.period-btn:has(input:checked) {
    background: linear-gradient(135deg, var(--client-primary), var(--client-primary-dark));
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(124, 77, 255, 0.35);
}

.period-btn strong { display: block; font-size: 0.85rem; margin-bottom: 0.2rem; }

.trade-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Trade confirm modal */
.trade-confirm-modal {
    position: relative;
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem 1.5rem;
    max-width: min(440px, calc(100vw - 2rem));
    width: 100%;
    margin: auto;
    background: linear-gradient(180deg, #1a1a3d 0%, #12122a 100%);
    color: var(--client-text);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
}

.trade-confirm-modal::backdrop {
    background: rgba(4, 4, 12, 0.75);
}

.trade-confirm-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--client-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}

.trade-confirm-close:hover { opacity: 1; }

.trade-confirm-title {
    font-size: 1.35rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.trade-confirm-body {
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.trade-confirm-row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(124, 77, 255, 0.15);
}

.trade-confirm-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trade-confirm-label {
    margin: 0;
    font-weight: 800;
    font-size: 0.95rem;
    text-align: left;
    color: var(--client-text);
}

.trade-confirm-value {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
    color: var(--client-text);
    word-break: break-word;
}

.trade-confirm-btn {
    width: 100%;
    padding: 0.95rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #3d6eb8 0%, #5b9fd4 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    box-shadow: 0 4px 20px rgba(61, 110, 184, 0.45);
}

.trade-confirm-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 6px 28px rgba(91, 159, 212, 0.55);
}

/* Trade countdown overlay (after confirm) */
.trade-countdown-modal {
    border: none;
    padding: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    background: transparent;
}

.trade-countdown-modal[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.trade-countdown-modal::backdrop {
    background: rgba(4, 4, 14, 0.88);
    backdrop-filter: blur(6px);
}

.trade-countdown-card {
    width: min(440px, calc(100vw - 2rem));
    margin: auto;
    padding: 1.25rem 1.5rem 1.75rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #1c1c42 0%, #14142e 100%);
    border: 1px solid rgba(124, 77, 255, 0.35);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    color: var(--client-text);
}

.trade-countdown-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 1.15rem;
}

.trade-countdown-heading {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.trade-countdown-close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--client-text);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    padding: 0;
    margin: -0.15rem -0.25rem 0 0;
}

.trade-countdown-close:hover {
    opacity: 1;
}

.trade-countdown-body {
    text-align: center;
}

.trade-countdown-pair {
    font-size: 1.05rem;
    font-weight: 800;
}

.trade-direction-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fff;
}

.trade-direction-badge--buy {
    background: var(--client-buy);
}

.trade-direction-badge--sell {
    background: var(--client-sell);
}

.trade-countdown-time {
    font-size: 3.25rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1;
    margin: 0 0 1.25rem;
    font-variant-numeric: tabular-nums;
}

.trade-countdown-meta {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--client-text);
}

.trade-countdown-status {
    margin: 0.85rem 0 0;
    font-size: 0.9rem;
    color: var(--client-muted);
    font-weight: 600;
}

.trade-countdown-status--won {
    color: #4ade80;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.trade-countdown-status--lost {
    color: #f87171;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

/* Trade outcome toast (win / loss) */
.trade-outcome-toast {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--nav-h) + 0.65rem);
    z-index: 250;
    width: min(1200px, calc(100% - 2rem));
    padding: 1rem 2.75rem 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1rem;
    line-height: 1.35;
    text-align: center;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.trade-outcome-toast__inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.trade-outcome-toast[hidden] {
    display: none !important;
}

.trade-outcome-toast--won {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.trade-outcome-toast--lost {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.trade-outcome-toast__icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.trade-outcome-toast__icon--dismiss {
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    margin: -0.15rem 0;
    border-radius: 4px;
}

.trade-outcome-toast__icon--dismiss:hover {
    background: rgba(0, 0, 0, 0.12);
}

.trade-outcome-toast__close {
    position: absolute;
    top: 50%;
    right: 0.65rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.9;
    padding: 0.15rem 0.35rem;
}

.trade-outcome-toast__close:hover {
    opacity: 1;
}

/* Orders */
.order-card {
    background: var(--client-surface-2);
    border: 1px solid var(--client-border);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
    width: 100%;
    text-align: inherit;
    font: inherit;
    color: inherit;
}

.order-card--clickable {
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.order-card--clickable:hover {
    border-color: rgba(124, 77, 255, 0.45);
    background: rgba(124, 77, 255, 0.08);
    transform: translateY(-1px);
}

.order-card--clickable:focus-visible {
    outline: 2px solid var(--client-primary);
    outline-offset: 2px;
}

/* Trade receipt modal */
.trade-receipt-modal {
    border: none;
    padding: 0;
    max-width: none;
    width: 100%;
    height: 100%;
    background: transparent;
}

.trade-receipt-modal[open] {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.trade-receipt-modal::backdrop {
    background: rgba(4, 4, 14, 0.88);
    backdrop-filter: blur(4px);
}

.trade-receipt-card {
    width: min(440px, 100%);
    margin: auto;
    padding: 1.25rem 1.35rem 1.5rem;
    border-radius: 16px;
    background: #f8fafc;
    color: #0f172a;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.trade-receipt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.15rem;
}

.trade-receipt-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trade-receipt-icon {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 4px;
    background: linear-gradient(135deg, #7c4dff, #5b2fd4);
    flex-shrink: 0;
}

.trade-receipt-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    color: #0f172a;
}

.trade-receipt-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.trade-receipt-badge {
    padding: 0.2rem 0.65rem;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.trade-receipt-badge--won {
    background: #dcfce7;
    color: #166534;
}

.trade-receipt-badge--lost {
    background: #fee2e2;
    color: #991b1b;
}

.trade-receipt-close {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.trade-receipt-close:hover {
    color: #0f172a;
}

.trade-receipt-section-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748b;
    margin: 0 0 0.5rem;
}

.trade-receipt-rows {
    margin: 0 0 1.15rem;
}

.trade-receipt-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.92rem;
}

.trade-receipt-row:last-child {
    border-bottom: none;
}

.trade-receipt-row dt {
    color: #64748b;
    font-weight: 600;
    margin: 0;
}

.trade-receipt-row dd {
    margin: 0;
    font-weight: 700;
    color: #0f172a;
    text-align: right;
}

.trade-receipt-value--positive {
    color: #16a34a;
}

.trade-receipt-value--negative {
    color: #dc2626;
}

.order-outcome-won { color: var(--client-success); font-weight: 800; font-size: 1.1rem; }
.order-outcome-lost { color: var(--client-danger); font-weight: 800; font-size: 1.1rem; }

.badge-buy {
    background: rgba(52, 211, 153, 0.2);
    color: var(--client-buy);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-sell {
    background: rgba(248, 113, 113, 0.2);
    color: var(--client-sell);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-success { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.alert-error { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--client-muted);
}

.coming-soon-card {
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 360px;
    margin: 2rem auto;
}

.coming-soon-card .icon { font-size: 3rem; margin-bottom: 1rem; color: var(--client-primary); }
