.home-energy-shell,
.home-climate-shell {
    display: grid;
    gap: 14px;
}

.home-climate-shell {
    margin-top: 18px;
}

.home-section-header h4 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.home-section-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.home-energy-grid {
    display: grid;
    grid-template-columns: minmax(280px, 1.1fr) minmax(280px, 0.9fr);
    gap: 14px;
}

.home-energy-card {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 14px;
    min-height: 270px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at top left, rgba(34, 197, 94, 0.14), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.home-energy-card::after {
    content: "";
    position: absolute;
    right: -48px;
    bottom: -64px;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
}

.home-energy-title {
    position: relative;
    z-index: 1;
    font-weight: 800;
    color: var(--text-main);
}

.home-battery-body {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    align-content: center;
}

.home-battery-visual {
    position: relative;
    display: flex;
    align-items: center;
    width: min(100%, 340px);
    height: 112px;
    border: 5px solid #0f172a;
    border-radius: 22px;
    background: #e5e7eb;
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.7);
}

.home-battery-terminal {
    position: absolute;
    right: -22px;
    width: 18px;
    height: 46px;
    border-radius: 0 10px 10px 0;
    background: #0f172a;
}

.home-battery-fill {
    position: absolute;
    inset: 0 auto 0 0;
    min-width: 8px;
    border-radius: 16px;
    background: linear-gradient(90deg, #ef4444 0%, #f59e0b 42%, #22c55e 100%);
    transition: width 0.35s ease;
}

.home-battery-soc {
    position: relative;
    z-index: 1;
    width: 100%;
    text-align: center;
    font-size: 2.2rem;
    color: #0f172a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.home-energy-flow {
    position: relative;
    z-index: 1;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 700;
}

.battery-direction-charging .home-energy-flow {
    background: #dcfce7;
    color: #166534;
}

.battery-direction-discharging .home-energy-flow {
    background: #fee2e2;
    color: #991b1b;
}

.home-energy-metrics {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.home-energy-metric {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.72);
}

.home-energy-metric span {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.home-energy-metric strong {
    color: var(--text-main);
}

.home-energy-flags {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.home-energy-flag {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.home-energy-flag.is-on {
    background: #ecfdf5;
    color: #047857;
}

.home-energy-flag.is-off {
    background: #f1f5f9;
    color: #64748b;
}

.home-phase-card {
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 36%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.home-total-power {
    position: relative;
    z-index: 1;
    font-size: 2.6rem;
    font-weight: 900;
    color: #0f172a;
}

.home-phase-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
}

.home-phase-row {
    display: grid;
    gap: 7px;
}

.home-phase-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
}

.home-phase-track {
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.home-phase-fill {
    height: 100%;
    min-width: 6px;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #2563eb);
}

@media (max-width: 900px) {
    .home-energy-grid {
        grid-template-columns: 1fr;
    }

    .home-energy-card {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .home-energy-metrics {
        grid-template-columns: 1fr;
    }

    .home-battery-visual {
        height: 92px;
    }

    .home-battery-soc,
    .home-total-power {
        font-size: 2rem;
    }
}
