:root {
    --state-running: #27ae60;
    --state-idle: #bdc3c7;
    --state-offline: #e74c3c;
}

body {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
}

/* State banner */
.state-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    margin: 0 -1rem 1rem;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

.state-banner small {
    font-weight: normal;
    font-size: 0.85rem;
    opacity: 0.9;
}

.state-banner.running {
    background: var(--state-running);
}

.state-banner.idle {
    background: #95a5a6;
}

.state-banner.offline {
    background: #4a4a4a;
}


/* Summary cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-cards .card {
    text-align: center;
    padding: 0.75rem;
    background: var(--pico-card-background-color, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.summary-cards .card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.summary-cards .card .value {
    font-size: 1.4rem;
    font-weight: bold;
    margin-top: 0.25rem;
}

/* Chart container */
#chart {
    margin: 0;
    padding: 0;
}


/* Sheet progress bar */
.sheet-bar {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--pico-card-background-color, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.sheet-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
}

.sheet-info span:first-child {
    font-weight: bold;
    font-size: 1rem;
}

.sheet-info span:last-child {
    font-size: 0.85rem;
    opacity: 0.7;
}

.progress-track {
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 6px;
    background: #3498db;
    transition: width 0.5s ease;
}

.sheet-times {
    display: flex;
    justify-content: space-between;
    margin-top: 0.3rem;
    font-size: 0.8rem;
    opacity: 0.6;
}

#sheet-pace {
    opacity: 1;
    font-weight: bold;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .summary-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .last-sheet {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* PWA standalone */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
    }
}
