/* Status page semantics mapped to the shared Hiper API palette. */
:root {
    --status-bg: var(--hiper-palette-bg);
    --status-card: var(--hiper-palette-card);
    --status-text: var(--hiper-palette-text);
    --status-muted: var(--hiper-palette-muted);
    --status-accent: var(--hiper-palette-accent);
    --status-accent-soft: var(--hiper-palette-accent-soft);
    --status-border: var(--hiper-palette-border);
    --status-ok: var(--hiper-palette-success);
    --status-warn: var(--hiper-palette-warning);
    --status-bad: var(--hiper-palette-danger);
    --status-unknown: hsl(215, 20%, 40%);
}

.status-public-page h1,
.status-public-page h2,
.status-public-page h3,
.status-public-page h4,
.status-public-page h5,
.status-public-page h6 {
    color: var(--status-text);
}

.status-public-page {
    font-family: 'Sora', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(800px 400px at 50% -5%, rgba(var(--tblr-primary-rgb), .10), transparent 60%), var(--status-bg);
    min-height: 100vh;
    color: var(--status-text);
}

.status-public-page .public-main {
    width: 100%;
    max-width: none;
    padding: 0;
}

.status-nav {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 31px 22px 27px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.status-brand {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--status-text);
}
.status-brand:hover {
    text-decoration: none;
}

.status-brand-mark {
    display: block;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    object-fit: contain;
}

.status-brand-name {
    font-size: 15px;
    font-weight: 700;
}

.status-brand-pill {
    padding: 3px 8px;
    border: 1px solid var(--status-border);
    border-radius: 20px;
    color: var(--status-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.status-nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 22px;
}

.status-nav-links a {
    color: var(--status-muted);
    font-size: 12.5px;
    text-decoration: none;
    white-space: nowrap;
}

.status-nav-links .status-app-link {
    color: var(--status-accent);
    font-weight: 600;
}

.status-page {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 0 22px 48px;
    box-sizing: border-box;
    color: var(--status-text);
}

.status-page * {
    box-sizing: border-box;
}

.status-page .reveal {
    opacity: 0;
    transform: translateY(14px);
    animation: status-fade-up .55s ease forwards;
}

.status-page .reveal:nth-child(2) { animation-delay: .06s; }
.status-page .reveal:nth-child(3) { animation-delay: .12s; }
.status-page .reveal:nth-child(4) { animation-delay: .18s; }
.status-page .reveal:nth-child(5) { animation-delay: .24s; }

@keyframes status-fade-up {
    to { opacity: 1; transform: none; }
}

@keyframes status-pulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 181, 68, .5); }
    70% { box-shadow: 0 0 0 9px rgba(245, 181, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 181, 68, 0); }
}

.status-alert {
    min-height: 98px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    padding: 19px 20px;
    border: 1px solid rgba(245, 181, 68, .4);
    border-radius: 16px;
    background: rgba(245, 181, 68, .08);
}

.status-alert.is-ok {
    border-color: rgba(61, 220, 151, .30);
    background: rgba(61, 220, 151, .06);
}

.status-alert.is-bad {
    border-color: rgba(240, 112, 106, .45);
    background: rgba(240, 112, 106, .08);
}

.status-alert-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--status-warn);
    animation: status-pulse 1.8s infinite;
}

.is-ok .status-alert-dot { background: var(--status-ok); animation-name: none; }
.is-bad .status-alert-dot { background: var(--status-bad); animation-name: status-pulse; }

.status-alert-content {
    min-width: 0;
    flex: 1;
}

.status-alert-content strong {
    display: block;
    margin-bottom: 4px;
    color: var(--status-warn);
    font-size: 16px;
    font-weight: 700;
}

.is-ok .status-alert-content strong { color: var(--status-ok); }
.is-bad .status-alert-content strong { color: var(--status-bad); }

.status-alert-content span {
    display: block;
    color: var(--status-muted);
    font-size: 12px;
    line-height: 1.55;
}

.status-alert-dismiss {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--status-warn);
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.is-ok .status-alert-dismiss { color: var(--status-ok); }
.is-bad .status-alert-dismiss { color: var(--status-bad); }

.status-panel {
    margin-bottom: 18px;
    padding: 18px 20px 15px;
    border: 1px solid var(--status-border);
    border-radius: 14px;
    background: var(--status-card);
}

.status-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.status-panel-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.status-panel-head > span {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--status-muted);
    font-size: 10.5px;
}

.status-components {
    overflow: hidden;
}

.status-component {
    padding: 14px 0;
    border-top: 1px solid var(--status-border);
}

.status-component-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 9px;
}

.status-component-copy {
    min-width: 180px;
    flex: 1 1 180px;
}

.status-component-copy strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.status-component-copy span {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--status-muted);
    font-size: 10px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid rgba(61, 220, 151, .4);
    border-radius: 20px;
    background: rgba(61, 220, 151, .12);
    color: var(--status-ok);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
}

.status-pill.is-warn {
    border-color: rgba(245, 181, 68, .4);
    background: rgba(245, 181, 68, .12);
    color: var(--status-warn);
}

.status-pill.is-bad {
    border-color: rgba(240, 112, 106, .4);
    background: rgba(240, 112, 106, .12);
    color: var(--status-bad);
}

.status-pill-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-pill.is-warn .status-pill-dot { animation: status-pulse 1.8s infinite; }

.status-component-metrics {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    justify-content: flex-end;
    gap: 7px;
    color: var(--status-text);
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.status-component-metrics strong {
    color: var(--status-text);
    font-size: 12px;
    font-weight: 700;
}

.status-component-metrics-separator {
    color: var(--status-muted);
    font-weight: 400;
}

.status-component-metrics > span:last-child {
    color: var(--status-muted);
    font-weight: 600;
}

.status-history-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-history-edge {
    flex: 0 0 auto;
    color: var(--status-muted);
    font-size: 9px;
    letter-spacing: .05em;
}

.status-history {
    min-width: 0;
    display: flex;
    flex: 1;
    align-items: center;
    overflow: hidden;
    justify-content: space-between;
    gap: 2px;
}

.status-bar {
    flex: 1;
    height: 20px;
    border-radius: 2px;
    background: var(--status-ok);
    opacity: .48;
    transition: transform .15s ease, opacity .15s ease;
}

.status-bar.is-ok { background: var(--status-ok); opacity: .7; }
.status-bar.is-warn { background: var(--status-warn); opacity: .7 }
.status-bar.is-bad { background: var(--status-bad); opacity: .7; }
.status-bar.is-unknown { background: var(--status-unknown); opacity: .7; }

.status-bar:hover {
    opacity: 1;
}

.status-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--status-border);
    color: var(--status-muted);
    font-size: 9.5px;
}

.status-legend > span:not(.status-legend-note) {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-swatch {
    width: 9px;
    height: 9px;
    display: inline-block;
    border-radius: 2px;
}

.legend-swatch.is-ok { background: var(--status-ok); opacity: .55; }
.legend-swatch.is-warn { background: var(--status-warn); }
.legend-swatch.is-bad { background: var(--status-bad); }
.legend-swatch.is-unknown { background: var(--status-unknown); }
.status-legend-note { margin-left: auto; }

.status-history-link {
    margin-left: auto;
    color: var(--status-accent);
    font-size: 11px !important;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.status-timeline {
    position: relative;
    margin-top: 15px;
    padding-left: 25px;
}

.status-timeline::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 8px;
    width: 2px;
    background: var(--status-border);
}

.status-incident-item {
    position: relative;
    margin-bottom: 20px;
}

.status-incident-item:last-child {
    margin-bottom: 0;
}

.status-timeline-dot {
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--status-card);
    border-radius: 50%;
}

.status-timeline-dot.is-ok { background: var(--status-ok); }
.status-timeline-dot.is-warn { background: var(--status-warn); animation: status-pulse 1.8s infinite; }

.status-incident-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.status-incident-topline strong {
    font-size: 13px;
    font-weight: 600;
}

.status-incident-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border: 1px solid rgba(61, 220, 151, .4);
    border-radius: 20px;
    background: rgba(61, 220, 151, .12);
    color: var(--status-ok);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .06em;
}

.status-incident-tag.is-warn {
    border-color: rgba(245, 181, 68, .4);
    background: rgba(245, 181, 68, .12);
    color: var(--status-warn);
}

.status-incident-date {
    display: block;
    margin-top: 4px;
    color: var(--status-muted);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.status-incident-item p {
    margin: 8px 0 0;
    color: var(--status-muted);
    font-size: 11px;
    line-height: 1.6;
}

.status-maintenance {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding: 15px 19px;
    border: 1px solid var(--status-accent);
    border-radius: 16px;
    background: var(--status-accent-soft);
}

.status-maintenance-icon {
    width: 36px;
    height: 36px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: rgba(var(--tblr-primary-rgb), .20);
    color: var(--status-accent);
    font-size: 18px;
}

.status-maintenance strong,
.status-maintenance span {
    display: block;
}

.status-maintenance strong {
    font-size: 13px;
    font-weight: 600;
}

.status-maintenance span {
    margin-top: 4px;
    color: var(--status-muted);
    font-size: 10.5px;
    line-height: 1.45;
}

.status-empty {
    padding: 20px 6px 8px;
    color: var(--status-muted);
    font-size: 11px;
}

.status-empty-large {
    padding: 28px 6px 8px;
}

.status-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    color: var(--status-muted);
    font-size: 10px;
    text-align: center;
}

.status-footer-host {
    font-variant-numeric: tabular-nums;
}

.status-footer a {
    color: var(--status-accent);
    text-decoration: none;
}

@media (max-width: 720px) {
    .status-nav {
        padding-top: 20px;
        padding-bottom: 21px;
    }

    .status-nav-links {
        gap: 12px;
    }

    .status-nav-links a:first-child {
        display: none;
    }

    .status-component-metrics {
        flex: 0 0 100%;
        justify-content: flex-start;
    }

    .status-legend-note {
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 500px) {
    .status-nav,
    .status-page {
        padding-left: 15px;
        padding-right: 15px;
    }

    .status-brand-pill {
        display: none;
    }

    .status-brand-name {
        font-size: 14px;
    }

    .status-alert {
        align-items: flex-start;
        min-height: 0;
        padding: 17px;
    }

    .status-alert-dismiss {
        margin-top: -4px;
    }

    .status-panel {
        padding-left: 15px;
        padding-right: 15px;
    }

    .status-history {
        gap: 1.5px;
    }

    .status-bar {
        width: 3px;
        flex-basis: 3px;
        height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .status-page .reveal,
    .status-alert-dot,
    .status-timeline-dot.is-warn,
    .status-pill.is-warn .status-pill-dot {
        animation: none !important;
        transform: none;
        opacity: 1;
    }
}
