.home-dashboard {
    --home-ink: #10271f;
    --home-muted: #40574d;
    --home-green: #087f45;
    --home-green-bright: #17a864;
    --home-line: rgba(18, 57, 42, 0.13);
    --home-paper: #ffffff;
    min-height: calc(100vh - 78px);
    padding: clamp(1.8rem, 2.5vw, 2.7rem) var(--vw-header-gutter) 7rem;
    background: #f3f6f4;
    border-radius: 0 0 21px 21px;
    color: var(--home-ink);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
}

/* One grid for header and page: nav items and page content share left/right
   edges at every viewport width (the cap recentres both once it binds). */
.vw-app-shell:has(.home-dashboard) {
    --home-grid-width: 1380px;
}

.vw-app-shell:has(.home-dashboard) .vw-page-content {
    padding-left: 0;
    padding-right: 0;
}

.vw-app-shell:has(.home-dashboard) .vw-main-header {
    padding-left: max(
        var(--vw-header-gutter),
        calc((100% - var(--home-grid-width)) / 2)
    );
    padding-right: max(
        var(--vw-header-gutter),
        calc((100% - var(--home-grid-width)) / 2)
    );
}

.home-dashboard *,
.home-dashboard *::before,
.home-dashboard *::after {
    box-sizing: border-box;
}

.home-dashboard h1,
.home-dashboard h2,
.home-dashboard h3,
.home-dashboard p {
    margin-top: 0;
}

.home-hero,
.home-signal-row,
.home-quick-access {
    width: min(100%, var(--home-grid-width, 1380px));
    margin-inline: auto;
}

.home-hero {
    padding-bottom: clamp(1.75rem, 2.4vw, 2.4rem);
}

.home-hero h1 {
    margin-bottom: 0;
    font-size: clamp(2.75rem, 4vw, 4rem);
    font-weight: 630;
    letter-spacing: -0.048em;
    line-height: 0.96;
}

.home-signal-row {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.7fr);
    gap: 1.2rem;
    margin-bottom: clamp(2.6rem, 4.2vw, 4rem);
}

.home-health {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 20px;
    background: var(--home-paper);
    box-shadow: 0 12px 32px rgba(14, 51, 37, 0.06);
}

.home-health__header {
    padding: 1.65rem 1.8rem 0;
}

.home-health__eyebrow {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
    color: var(--home-green);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-health__pulse {
    width: 0.55rem;
    height: 0.55rem;
    border: 2px solid rgba(23, 168, 100, 0.26);
    border-radius: 50%;
    background: var(--home-green-bright);
    box-shadow: 0 0 0 5px rgba(23, 168, 100, 0.09);
}

.home-health__header h2 {
    margin-bottom: 0.35rem;
    font-size: clamp(1.35rem, 1.8vw, 1.8rem);
    font-weight: 650;
    letter-spacing: -0.035em;
}

.home-health__header p {
    margin-bottom: 0;
    color: var(--home-muted);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.55;
}

.home-health__metric {
    min-height: 142px;
    padding: 1.1rem 1.8rem 1.35rem;
}

.home-health__value {
    color: var(--home-green);
    font-size: clamp(3rem, 5vw, 4.35rem);
    font-weight: 700;
    letter-spacing: -0.065em;
    line-height: 0.98;
}

.home-health__timestamp,
.home-health__stale {
    display: block;
    margin-top: 0.55rem;
    color: var(--home-muted);
    font-size: 0.72rem;
    font-weight: 600;
}

.home-health__stale {
    color: #95680a;
}

.home-health__chart {
    height: 68px;
    margin-top: 0.65rem;
}

.home-health__error,
.home-health__empty {
    padding: 2rem 0;
    color: #98514e;
    font-size: 0.88rem;
}

.home-health__empty {
    color: var(--home-muted);
}

.home-health .grid-health-skeleton {
    min-height: 142px;
}

.home-context {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2rem;
    overflow: hidden;
    border-radius: 20px;
    background:
        linear-gradient(
            180deg,
            rgba(5, 26, 18, 0.34) 0%,
            rgba(5, 26, 18, 0.12) 38%,
            rgba(5, 26, 18, 0.9) 100%
        ),
        url("/assets/figures/voltwise_bess.webp") center 54% / cover no-repeat;
    box-shadow: 0 12px 32px rgba(14, 51, 37, 0.1);
    color: #ffffff;
    text-decoration: none;
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.home-context:hover {
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 16px 38px rgba(14, 51, 37, 0.15);
    transform: translateY(-2px);
}

.home-context:focus-visible,
.home-quick-card:focus-visible {
    outline: 3px solid rgba(23, 168, 100, 0.45);
    outline-offset: 3px;
}

.home-context > span {
    align-self: flex-start;
    margin-bottom: auto;
    padding: 0.34rem 0.58rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(8, 37, 27, 0.58);
    color: #9ce6bd;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.home-context__body strong {
    display: block;
    max-width: 340px;
    margin: 3rem 0 0.8rem;
    font-size: clamp(1.4rem, 1.8vw, 1.85rem);
    font-weight: 650;
    letter-spacing: -0.035em;
    line-height: 1.08;
}

.home-context__action,
.home-quick-card__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 720;
    letter-spacing: 0.01em;
    line-height: 1;
}

.home-context__action {
    color: rgba(255, 255, 255, 0.76);
}

.home-quick-access > h2 {
    margin-bottom: 1.5rem;
    font-size: clamp(1.75rem, 2.2vw, 2.25rem);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.home-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.home-quick-card {
    --card-accent: #087f45;
    --card-tint: rgba(8, 127, 69, 0.08);
    position: relative;
    min-width: 0;
    min-height: 210px;
    padding: 1.45rem;
    overflow: hidden;
    border: 1px solid var(--home-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 24px rgba(14, 51, 37, 0.045);
    color: var(--home-ink);
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.home-quick-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: var(--card-accent);
    content: "";
}

.home-quick-card:hover {
    color: var(--home-ink);
    text-decoration: none;
    box-shadow: 0 14px 32px rgba(14, 51, 37, 0.08);
    transform: translateY(-2px);
}

.home-quick-card__meta {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.55rem;
    color: var(--card-accent);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.home-quick-card__meta span {
    padding: 0.24rem 0.52rem;
    border-radius: 999px;
    background: var(--card-tint);
}

.home-quick-card h3 {
    margin-bottom: 0.55rem;
    font-size: 1.27rem;
    font-weight: 650;
    letter-spacing: -0.035em;
}

.home-quick-card > p {
    min-height: 3.1rem;
    margin-bottom: 1.3rem;
    color: var(--home-muted);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.55;
}

.home-quick-card__action {
    position: absolute;
    right: 1.45rem;
    bottom: 1.45rem;
    color: var(--home-green);
}

@media (max-width: 1199.98px) {
    .home-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .home-signal-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-context {
        min-height: 250px;
    }
}

@media (max-width: 767.98px) {
    .home-dashboard {
        padding-top: 2rem;
    }

    .home-quick-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 575.98px) {
    .home-dashboard {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .home-hero h1 {
        font-size: 2.65rem;
        line-height: 0.98;
    }

    .home-health__header {
        padding: 1.35rem 1.35rem 0;
    }

    .home-health__metric {
        padding: 1rem 1.35rem 1.2rem;
    }

    .home-quick-card {
        min-height: 205px;
    }
}

@media (min-width: 1600px) and (min-height: 850px) {
    .vw-app-shell:has(.home-dashboard) {
        --home-grid-width: 1540px;
    }

    .home-dashboard {
        padding-top: clamp(2.8rem, 4.5vh, 4.4rem);
        padding-bottom: clamp(5rem, 8vh, 7.5rem);
    }

    .home-hero {
        padding-bottom: clamp(2.5rem, 3.4vh, 3.4rem);
    }

    .home-signal-row {
        grid-template-columns: minmax(0, 1.62fr) minmax(330px, 0.72fr);
        gap: 1.5rem;
        margin-bottom: clamp(3.8rem, 6vh, 5.8rem);
    }

    .home-health__header {
        padding: 1.9rem 2.1rem 0;
    }

    .home-health__metric {
        min-height: 164px;
        padding: 1.25rem 2.1rem 1.55rem;
    }

    .home-context {
        padding: 2.25rem;
    }

    .home-quick-grid {
        gap: 1.1rem;
    }

    .home-quick-card {
        min-height: 238px;
        padding: 1.7rem;
    }

    .home-quick-card__action {
        right: 1.7rem;
        bottom: 1.7rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-context,
    .home-quick-card {
        transition: none;
    }
}
