        * {
            box-sizing: border-box;
        }

        body {
            font-family: Verdana, Geneva, Tahoma, sans-serif;
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            background-color: #ffffff;
            font-size: 0.8em;
            color: #333;
        }

        .page-loader {
            position: fixed;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            background: rgba(255, 255, 255, 0.9);
            z-index: 999;
        }

        .page-loader.is-hidden {
            display: none;
        }

        .loader-spinner {
            width: 26px;
            height: 26px;
            border: 3px solid #d1d5db;
            border-top-color: #4b5563;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        .loader-text {
            font-size: 12px;
            color: #4b5563;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        /* Battery */
        .battery {
            display: flex;
            align-items: center;
            margin-left: 35px;
            margin-right: 0px;
            flex: 1;
            justify-content: flex-start;
        }

        .battery-body {
            width: 70px;
            height: 38px;
            border: 2px solid #cfd6cc;
            border-radius: 6px;
            padding: 3px;
            background: #f8faf7;
            box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.08);
            position: relative;
            overflow: hidden;
        }

        .battery-cap {
            width: 6px;
            height: 18px;
            margin-left: 2px;
            background: #cfd6cc;
            border-radius: 2px;
        }

        /* Text */
        .battery-info {
            display: flex;
            flex-direction: column;
            line-height: 1.2;
            flex: 1;
            align-items: center;
            text-align: center;
            margin-left: 15px;
        }

        .battery-level {
            height: 100%;
            border-radius: 4px;
            background: linear-gradient(180deg,
                    #a8e063 0%,
                    #7ac943 100%);
            box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.6);
        }

        .battery-percent {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            font-weight: 600;
            color: #1f2933;
            text-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
            pointer-events: none;
        }

        .battery-widget {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            column-gap: 12px;
            margin: 0 auto;
           /* padding: 12px 18px; */
            background: #ffffff;
            border-radius: 12px;
            /* box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08); */
            width: fit-content;
            justify-content: space-between;
        }

        .card {
            border: 1px solid rgba(0, 0, 0, .08);
            border-radius: 10px;
            padding: 6px 6px 7px;
            background: #fafafa;
            min-width: 0;
            /* important for tight grids */
        }

        /* 3 cards in one row */
        .cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
        }

        .container {
            background: #ffffff;
            /* padding: 8px 10px 12px; */
            max-width: 360px;
            width: 100%;
            text-align: left;
        }

        .dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--accent);
        }

        .energy {
            font-size: 24px;
            font-weight: 600;
            color: var(--capacity-color, #6aa84f);
        }

        .energy span {
            font-size: 16px;
            font-weight: 500;
            margin-left: 2px;
        }

        .gaugeCanvasWrap {
            position: relative;
            /* width: 150px; */
            height: 100px;
        }

        .gaugeWrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }

        .grid-status-icon {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            margin-left: 20px;
            font-size: 6pt;
        }

        .grid-status-icon.off-grid {
            color: #f59e0b;
            margin-right: 30px;
        }

        .grid-status-icon.on-grid {
            color: #56b14b;
            margin-right: 35px;
        }

        .inv-header {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 6px;
        }

        .inv360 {
            width: 350px;
            font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
            background: #fff;
            border: 1px solid rgba(0, 0, 0, .08);
            border-radius: 14px;
            padding: 8px;
            box-shadow: 0 10px 26px rgba(0, 0, 0, .10);
            font-size: 11px;
            color: #111827;
            margin: 5px;
        }

        .inv360.off-grid {
            --accent: #f59e0b;
        }

        .inv360.on-grid {
            --accent: #56b14b;
        }

        .lastGridSince {
            text-align: left;
        }

        .lastGridSince.is-offgrid {
            color: #e71831;
        }

        .lastUpdated {
            text-align: right;
            cursor: pointer;
            user-select: none;
        }

        A.lastUpdatedLink:hover {
            text-align: right;
            cursor: pointer;
            user-select: none;
            text-decoration: underline;
        }

         A.lastUpdatedLink {
            color: inherit;
            text-decoration: none;
        }
        
        A.lastUpdatedLink:visited {
            color: inherit;
            text-decoration: none;
        }

        .rows {
            display: grid;
            gap: 3px;
        }

        .rows div {
            display: flex;
            justify-content: space-between;
            font-size: 9px;
            line-height: 1.1;
        }

        .rows span:first-child {
            color: #6b7280;
        }

        .rows span:last-child {
            font-weight: 600;
            letter-spacing: .2px;
        }

        .runtime {
            font-size: 11px;
            color: #6b7280;
            white-space: nowrap;
        }

        .runtime-note {
            flex-basis: 100%;
            text-align: center;
        }

        .statusFooter {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0;
            font-size: 0.9em;
            line-height: normal;
            margin-top: 6px;
            color: #555;
            gap: 8px;
        }
