body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f7;
    color: #1d1d1f;
}

header {
    background: white;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}

.status-offline {
    color: #d70015;
}

.status-online {
    color: #007aff;
}

main {
    max-width: 600px;     /* maximale Breite */
    margin: 0 auto;       /* zentriert */
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}


.card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

button {
    width: 100%;
    max-width: 220px;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: #007aff;
    color: white;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin: 0 auto;
    display: block;
}

#stayawake-on {
    background: #34c759; /* iOS Grün */
}

#stayawake-off {
    background: #ff3b30; /* iOS Rot */
}



button:active {
    background: #0060d1;
    transform: scale(0.98);
}

button.disabled {
    background: #b0b0b5;
    cursor: not-allowed;
}

#stayawake-off {
    background: #ff3b30;
}

#stayawake-off:active {
    background: #d92a20;
}

#schedule-output {
    background: #f2f2f7;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
}

input {
    width: 20%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 16px;
}

#weekday-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center; /* sorgt dafür, dass Checkbox + Label auf gleicher Höhe sitzen */
}

#weekday-container input[type="checkbox"] {
    transform: translateY(4px); /* minimal nach unten schieben */
}


#weekday-container label {
    background: #f2f2f7;
    padding: 5px 5px;
    border-radius: 12px;
    font-size: 16px;
    width: 60px;            /* feste Breite */
    height: 40px;           /* feste Höhe */
    display: flex;          /* für perfekte Zentrierung */
    align-items: center;    /* vertikal zentriert */
    justify-content: center;/* horizontal zentriert */
    cursor: pointer;
    font-weight: 500;
    text-align: center;
}




.time-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 16px;
    color: #333;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.time-item:hover {
    background: #f7f7f7;
    border-color: #ccc;
}

.remove-time {
    background: none;
    border: none;
    color: #d9534f;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.remove-time:hover {
    color: #b52b27;
}


#esp-status {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: bold;
    text-align: center;
}

.status-online {
    background: #34c759;
    color: white;
}

.status-offline {
    background: #ff3b30;
    color: white;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 600;
}

.card .value {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

#battery-chart,
#distance-chart {
    margin-top: 10px;
}

#esp-status {
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    font-size: 16px;
}

.status-online {
    background: #34c759; /* iOS Grün */
    color: white;
}

.status-offline {
    background: #ff3b30; /* iOS Rot */
    color: white;
}


#mqtt-status,
#esp-status {
    padding: 10px 16px;
    border-radius: 12px;
    font-weight: 600;
    text-align: center;
    font-size: 15px;
    width: fit-content;
    max-width: 240px;
    margin: 0 auto; /* zentriert */
}

.status-online {
    background: #34c759; /* iOS Grün */
    color: white;
}

.status-offline {
    background: #ff3b30; /* iOS Rot */
    color: white;
}


#status-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.dual-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.dual-buttons button {
    flex: 1;
    max-width: 160px;
}

.schedule-buttons {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 10px;
}

#time-container {
    max-width: 300px;   /* oder 280px, je nach Geschmack */
    margin: 0;
    padding: 0;
}

#schedule-layout {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* sorgt für perfekte linke Ausrichtung */
    gap: 12px;
}

#chart-range {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

#chart-range button {
    background: none;
    border: none;
    padding: 8px 0;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    position: relative;
}

#chart-range button.active {
    color: #007aff;
    font-weight: 600;
}

#chart-range button.active::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 3px;
    background: #007aff;
    border-radius: 2px;
}

.chart-card {
    background: #ffffff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.chart-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}




