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

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: #161b22;
    border-bottom: 1px solid #30363d;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

header h1 { font-size: 1rem; font-weight: 600; color: #f0f6fc; }

#status-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: #21262d;
    color: #8b949e;
}

#status-badge.connected { background: #0f3d1e; color: #3fb950; }
#status-badge.disconnected { background: #3d1f00; color: #f85149; }

.layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

aside {
    width: 200px;
    background: #161b22;
    border-right: 1px solid #30363d;
    overflow-y: auto;
    padding: 8px 0;
    flex-shrink: 0;
}

.market-group { padding: 8px 12px 4px; }
.market-group h3 { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: #8b949e; }

.market-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background 0.1s;
}

.market-item:hover { background: #21262d; }
.market-item.active { background: #1f2d1f; color: #3fb950; }

.market-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #30363d;
    flex-shrink: 0;
}

.market-item.active .market-dot { background: #3fb950; }

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 16px;
    gap: 12px;
}

.market-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.market-header h2 { font-size: 1.1rem; color: #f0f6fc; }

#last-price {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #58a6ff;
}

#last-time { font-size: 0.75rem; color: #8b949e; }

.chart-container {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    flex: 1;
    min-height: 0;
    position: relative;
}

.chart-container canvas { width: 100% !important; height: 100% !important; }

.table-container {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    overflow: auto;
    max-height: 200px;
}

table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
thead th {
    position: sticky; top: 0;
    background: #1c2128;
    padding: 6px 12px;
    text-align: left;
    font-weight: 500;
    color: #8b949e;
    border-bottom: 1px solid #30363d;
}
tbody td { padding: 5px 12px; border-bottom: 1px solid #21262d; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #21262d; }

.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #8b949e;
    font-size: 0.85rem;
}
