:root {
    --bg: #f5f7f8;
    --panel: #ffffff;
    --text: #1d252c;
    --muted: #64717d;
    --line: #dce3e8;
    --green: #178a58;
    --green-soft: #e7f6ee;
    --amber: #b7791f;
    --amber-soft: #fff3d7;
    --red: #b42318;
    --red-soft: #fde8e6;
    --gray-soft: #edf1f4;
    --blue: #2764c5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
    min-height: 100vh;
}

.hero {
    background: #18232c;
    color: #fff;
    padding: 32px 20px;
}

.hero-inner,
.content {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: end;
}

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 28px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #18232c;
    font-weight: 800;
}

.brand strong {
    display: block;
    font-size: 18px;
}

.brand span,
.hero-copy p {
    color: #b9c6d0;
}

.hero-copy h1 {
    margin: 0 0 10px;
    font-size: clamp(32px, 5vw, 56px);
    line-height: 1;
    letter-spacing: 0;
}

.hero-copy p {
    margin: 0;
    max-width: 680px;
    font-size: 17px;
}

.status-summary {
    min-width: 260px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
}

.status-summary span {
    display: block;
    color: #b9c6d0;
    font-size: 13px;
}

.status-summary strong {
    display: block;
    margin: 8px 0;
    font-size: 26px;
}

.content {
    padding: 24px 20px 48px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.stat span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 24px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 24px 0 12px;
}

.section-head h2 {
    margin: 0;
    font-size: 20px;
}

.icon-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
}

.icon-button:disabled {
    opacity: .55;
    cursor: wait;
}

.services {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.service-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 5px solid var(--green);
    border-radius: 8px;
    padding: 16px;
}

.service-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}

.service-card h3 {
    margin: 0;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.service-card p,
.service-foot {
    color: var(--muted);
    font-size: 13px;
}

.service-card p {
    margin: 4px 0 0;
}

.status-pill {
    white-space: nowrap;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    background: var(--green-soft);
    color: var(--green);
}

.service-logo {
    width: 88px;
    height: 88px;
    margin: 20px 0 14px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: var(--gray-soft);
    border: 1px solid var(--line);
    overflow: hidden;
}

.service-logo img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.service-logo span {
    display: none;
    font-size: 34px;
    font-weight: 800;
    color: var(--blue);
}

.service-logo.logo-fallback span,
.service-logo:not(:has(img)) span {
    display: block;
}

.service-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.service-degraded,
.service-unstable,
.service-stale {
    border-left-color: var(--amber);
}

.service-degraded .status-pill,
.service-unstable .status-pill,
.service-stale .status-pill {
    background: var(--amber-soft);
    color: var(--amber);
}

.service-outage,
.service-down {
    border-left-color: var(--red);
}

.service-outage .status-pill,
.service-down .status-pill {
    background: var(--red-soft);
    color: var(--red);
}

.nodes {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.node-row {
    display: grid;
    grid-template-columns: 18px 1.4fr 1fr 1fr 90px;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.node-row:first-child {
    border-top: 0;
}

.node-row strong {
    color: var(--text);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted);
}

.dot-operational {
    background: var(--green);
}

.dot-degraded,
.dot-unstable,
.dot-stale {
    background: var(--amber);
}

.dot-outage,
.dot-down {
    background: var(--red);
}

.error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid var(--red);
    border-radius: 8px;
    color: var(--red);
    background: var(--red-soft);
}

.empty {
    margin: 0;
    padding: 18px;
    color: var(--muted);
}

.overall-operational .status-summary strong {
    color: #7ee3aa;
}

.overall-degraded .status-summary strong,
.overall-stale .status-summary strong,
.overall-unstable .status-summary strong {
    color: #ffd37a;
}

.overall-outage .status-summary strong,
.overall-down .status-summary strong {
    color: #ff9a92;
}

@media (max-width: 760px) {
    .hero-inner {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .status-summary {
        min-width: 0;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .node-row {
        grid-template-columns: 14px 1fr;
    }

    .node-row span:nth-child(n+3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats,
    .services {
        grid-template-columns: 1fr;
    }

    .service-head,
    .service-foot {
        flex-direction: column;
        align-items: flex-start;
    }
}
