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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #f8fafc;
}

.subtitle {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

#status-bar {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-connected {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.status-disconnected {
    background: rgba(251, 146, 60, 0.15);
    color: #fb923c;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid #334155;
}

.metric-card h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #38bdf8;
    line-height: 1.2;
}

.metric-unit {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.125rem;
}

#chart-container {
    background: #1e293b;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 1px solid #334155;
}

#chart-container canvas {
    width: 100% !important;
    height: 300px !important;
}

.ad-block {
    background: #1e293b;
    border-radius: 0.5rem;
    border: 1px solid #334155;
    padding: 0.75rem 1rem;
    text-align: center;
    margin-top: 1rem;
}

.ad-label {
    display: block;
    font-size: 0.625rem;
    color: #64748b;
    text-align: left;
    margin-bottom: 0.25rem;
}

footer {
    text-align: center;
    padding: 1.5rem 0 0;
    color: #475569;
    font-size: 0.75rem;
}

@media (max-width: 600px) {
    #app {
        padding: 1rem 0.5rem;
    }

    main {
        flex-direction: column;
    }

    #metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .metric-card {
        padding: 0.75rem;
    }

    .metric-value {
        font-size: 1.25rem;
    }

    #chart-container canvas {
        height: 200px !important;
    }

    header h1 {
        font-size: 1.5rem;
    }
}


