body {
    margin: 0;
    padding: 24px;
    color: var(--tb-text);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.back-home-btn {
    position: fixed;
    top: 18px;
    left: 20px;
    z-index: 1000;
}

.page-shell {
    display: grid;
    gap: 20px;
    padding-bottom: 40px;
}

.hero {
    padding: 28px;
}

.hero-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.9rem, 3vw, 2.7rem);
}

.hero p {
    margin: 0;
    color: var(--tb-muted);
    max-width: 760px;
    line-height: 1.6;
}

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

.toolbar button {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(135deg, rgba(32, 227, 178, 0.24), rgba(87, 199, 255, 0.22));
    color: #fff;
    padding: 11px 16px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.toolbar button:disabled {
    opacity: 0.75;
    cursor: wait;
}

/* .status-pill and tone variants defined in shared-theme.css */

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.metric-card {
    padding: 18px;
    border-radius: 16px;
    background: rgba(7, 17, 31, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* .metric-label, .metric-value, .positive, .negative defined in shared-theme.css */

.accounts-grid {
    display: grid;
    gap: 18px;
}

.account-card {
    padding: 22px;
}

.account-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.account-head h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
}

.account-head p {
    margin: 0;
    color: var(--tb-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(32, 227, 178, 0.16);
    color: #9ff5db;
    font-size: 0.78rem;
    font-weight: 700;
    border: 1px solid rgba(32, 227, 178, 0.26);
}

.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-demo {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
}

.demo-account {
    border: 1px dashed rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(7, 17, 31, 0.42));
}

.demo-note {
    margin-top: 8px;
    color: #fbbf24;
    font-size: 0.82rem;
    font-weight: 600;
}

.account-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.meta-chip {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.meta-chip span {
    display: block;
    color: var(--tb-muted);
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.meta-chip strong {
    font-size: 0.96rem;
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.table-card {
    padding: 16px;
    border-radius: 16px;
    background: rgba(7, 17, 31, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.table-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.table-card p {
    margin: 0 0 12px;
    color: var(--tb-muted);
    font-size: 0.88rem;
}

.table-wrap {
    overflow-x: hidden;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 0;
    background: rgba(3, 10, 20, 0.42);
}

th, td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    text-align: left;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    color: #cbd5e1;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(15, 23, 42, 0.9);
    position: sticky;
    top: 0;
}

td.muted {
    color: var(--tb-muted);
}

/* .positive, .negative defined in shared-theme.css */

.empty-state {
    padding: 24px;
    text-align: center;
    color: var(--tb-muted);
}

@media (max-width: 980px) {
    .tables-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }

    .hero,
    .account-card {
        padding: 18px;
    }
}

/* Pre-Trade Checklist Gate */
#checklist-gate {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 16px;
}

.gate-card {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 20px;
    padding: 40px 36px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.gate-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.gate-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--tb-text, #e2e8f0);
    margin: 0 0 14px;
}

.gate-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--tb-muted, #94a3b8);
    margin: 0 0 24px;
}

.gate-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin-bottom: 16px;
}

.gate-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.gate-dismiss-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    padding: 10px 20px;
    color: var(--tb-muted, #94a3b8);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.gate-dismiss-btn:hover {
    background: rgba(255,255,255,0.07);
    color: var(--tb-text, #e2e8f0);
}
