:root {
    font-family: Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    color: #e8edf5;
    background: #090d14
}

* {
    box-sizing: border-box
}

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden
}

body {
    margin: 0;
    background: radial-gradient(circle at 50% -30%,#17233b 0,#090d14 43rem);
    min-height: 100dvh
}

.shell {
    width: 100%;
    max-width: none;
    margin: auto;
    padding: 0 clamp(1rem,2vw,2rem)
}

.topbar {
    height: 64px;
    border-bottom: 1px solid #263244;
    display: flex;
    align-items: center;
    justify-content: space-between
}

.brand {
    min-width: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .13em;
    display: flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap
}

.brand-mark {
    color: #47d7a1;
    font-size: 1.4rem
}

.brand small {
    font-size: .58rem;
    color: #77859a;
    letter-spacing: .12em;
    border-left: 1px solid #3a4657;
    padding-left: .6rem
}

.live, .refresh {
    font-size: .72rem;
    letter-spacing: .1em;
    color: #aeb9c9;
    display: flex;
    align-items: center;
    gap: .5rem;
    white-space: nowrap
}

    .live time {
        color: #e7eef8;
        margin-left: .5rem;
        font-variant-numeric: tabular-nums
    }

.pulse, .status i {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: #39d69b;
    border-radius: 50%;
    box-shadow: 0 0 12px #39d69b
}

.dashboard-heading {
    padding: 1.2rem 0 .9rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem
}

.eyebrow {
    font-size: .65rem;
    letter-spacing: .13em;
    color: #6c7b91;
    margin: 0 0 .2rem;
    font-weight: 700
}

h1, h2, p {
    margin-top: 0
}

h1 {
    margin-bottom: .2rem;
    font-size: 1.55rem;
    letter-spacing: -.04em
}

.muted {
    color: #8e9aad;
    margin: 0;
    font-size: .9rem
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: .75rem;
    margin-bottom: .8rem
}

.summary, .aggregator-card {
    min-width: 0;
    background: linear-gradient(145deg,#121925,#0e141e);
    border: 1px solid #263346;
    border-radius: 10px;
    box-shadow: 0 12px 30px #0002
}

.summary {
    padding: .75rem 1rem
}

    .summary span, .metric span {
        font-size: .64rem;
        text-transform: uppercase;
        color: #8391a6;
        letter-spacing: .07em;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

    .summary strong {
        font-size: 1.25rem;
        margin-top: .25rem;
        display: block;
        font-variant-numeric: tabular-nums;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

    .summary small {
        font-size: .75rem;
        color: #7e8ba0;
        margin-left: .2rem
    }

.widget-list {
    display: grid;
    gap: .8rem;
    min-width: 0
}

.aggregator-card {
    overflow: hidden
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1.15rem;
    border-bottom: 1px solid #263346
}

    .card-head > div {
        min-width: 0
    }

h2 {
    font-size: 1.05rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.status {
    font-size: .65rem;
    letter-spacing: .1em;
    font-weight: 700;
    display: flex;
    gap: .45rem;
    align-items: center;
    color: #58d9a8;
    white-space: nowrap
}

    .status.offline {
        color: #ff6c7b
    }

        .status.offline i {
            background: #ff6c7b;
            box-shadow: none
        }

.metrics {
    display: grid;
    grid-template-columns: repeat(6,minmax(0,1fr));
    padding: .7rem 1.15rem;
    gap: .75rem
}

.metric {
    min-width: 0;
    border-right: 1px solid #263346;
    padding-right: .6rem
}

    .metric:last-child {
        border: 0
    }

    .metric strong {
        display: block;
        font-size: clamp(.85rem,1.5vw,2rem);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: .3rem;
        font-variant-numeric: tabular-nums
    }

    .metric.accent strong {
        color: #56d9ed
    }

    .metric.warn strong {
        color: #ffc369
    }
    .metric.success strong {
        color: #47d7a1
    }
    .metric.danger strong {
        color: #ff6c7b
    }

.health-row {
    border-top: 1px solid #263346;
    padding: .55rem 1.15rem;
    display: flex;
    gap: .9rem;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0
}

.health-label {
    font-size: .61rem;
    letter-spacing: .1em;
    color: #65748a
}

.health {
    font-size: .7rem;
    color: #c7d1df;
    display: flex;
    align-items: center;
    gap: .35rem;
    min-width: 0
}

    .health b {
        height: 7px;
        width: 7px;
        flex: 0 0 7px;
        border-radius: 50%;
        background: #38d39a
    }

    .health.bad b {
        background: #ff6877
    }

    .health small {
        font-size: .63rem;
        color: #728096;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap
    }

.dashboard-footer {
    padding: .65rem 0;
    color: #66758a;
    font-size: .7rem
}

.loading {
    padding: 4rem;
    color: #90a0b5;
    text-align: center
}

@media(min-width:651px) and (min-height:650px) {
    .viewport-shell {
        height: 100dvh;
        overflow: hidden
    }

        .viewport-shell main {
            height: calc(100dvh - 64px);
            display: flex;
            flex-direction: column
        }

    .dashboard-heading, .summary-grid, .dashboard-footer {
        flex: 0 0 auto
    }

    .widget-list {
        flex: 1 1 auto;
        min-height: 0;
        grid-template-rows: repeat(2,minmax(0,1fr))
    }

    .aggregator-card {
        display: flex;
        flex-direction: column
    }

    .health-row {
        margin-top: auto
    }
}

@media(max-width:1050px) {
    .metrics {
        grid-template-columns: repeat(3,minmax(0,1fr))
    }

    .metric:nth-child(3) {
        border-right: 0
    }

    .metric:nth-child(-n+3) {
        padding-bottom: .7rem;
        border-bottom: 1px solid #263346
    }
}

@media(max-width:650px) {
    .shell {
        padding: 0 1rem
    }

    .topbar {
        height: 64px
    }

    .brand small, .live time {
        display: none
    }

    .dashboard-heading {
        padding: 1.35rem 0 1rem
    }

    .refresh {
        display: none
    }

    .summary-grid {
        grid-template-columns: repeat(2,minmax(0,1fr))
    }

    .summary strong {
        font-size: 1.1rem
    }

    .card-head, .metrics, .health-row {
        padding-left: 1rem;
        padding-right: 1rem
    }

    .metrics {
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: .8rem
    }

    .metric {
        border-bottom: 1px solid #263346 !important;
        padding-bottom: .8rem
    }

        .metric:nth-last-child(-n+2) {
            border-bottom: 0 !important;
            padding-bottom: 0
        }

        .metric:nth-child(even) {
            border-right: 0
        }

        .metric strong {
            font-size: .95rem
        }

    .health-row {
        gap: .65rem
    }

    .health-label {
        width: 100%
    }
}

@media(max-width:380px) {
    .brand {
        font-size: .86rem
    }

    .summary {
        padding: .65rem
    }

        .summary span {
            font-size: .58rem
        }

    .card-head {
        padding: .7rem .8rem
    }

    .metrics, .health-row {
        padding-left: .8rem;
        padding-right: .8rem
    }
}
