body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 15px;
    padding-top: 100px;
    /* Space for fixed controls */
    box-sizing: border-box;
    background-color: #f4f7f6;
    color: #333;
}

.controls-container {
    position: fixed;
    top: 10px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.98);
    padding: 10px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.switch-container {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.switch-container label {
    margin-right: 10px;
    font-size: 0.9em;
    color: #555;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .3s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked+.slider {
    background-color: #28a745;
}

input:focus+.slider {
    box-shadow: 0 0 1px #28a745;
}

input:checked+.slider:before {
    transform: translateX(22px);
}

#manual-refresh-btn {
    padding: 8px 14px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background-color 0.2s ease-in-out;
}

#manual-refresh-btn:hover {
    background-color: #0056b3;
}

#manual-refresh-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.status-info {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.status-info .entry {
    margin-bottom: 5px;
    font-size: 0.95em;
}

.status-info .key {
    font-weight: bold;
    color: #007bff;
}

.status-info .value {
    margin-left: 8px;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 20px 0;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9em;
    vertical-align: top;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    white-space: normal;
}

td {
    white-space: pre-wrap;
    word-break: break-word;
    color: #212529;
}

tr:last-child th,
tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: #f1f3f5;
}

#EnergyFlowSvgObject {
    margin: 20px auto;
    display: block;
    max-width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    background-color: #fff;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.07);
}

@media only screen and (min-width: 769px) {
    body {
        padding: 25px;
        padding-top: 100px;
    }

    #EnergyFlowSvgObject {
        max-width: 600px;
    }

    .table-container {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .status-info {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    .entry,
    th,
    td {
        font-size: 0.95em;
    }

    .switch-container label,
    #manual-refresh-btn {
        font-size: 0.9em;
    }
}
