:root {
    --status-bg: #ffffff;
    --status-border: #e4e4e7;
    --status-text: #18181b;
    --status-muted: #71717a;
    --status-light: #a1a1aa;

    --status-success: #22c55e;
    --status-error: #ef4444;
    --status-warning: #eab308;
    --status-neutral: #f4f4f5;

    --status-radius: 0px;

    --status-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #ffffff;
    color: var(--status-text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

/* Updated selector to include the new section card */
#status-dashboard,
#incidents-section,
#how-it-works-section {
    width: min(100% - 24px, 850px);

    margin: 20px auto;

    padding: 24px;

    border: 1px solid var(--status-border);

    border-radius: var(--status-radius);

    background: var(--status-bg);

    box-shadow: var(--status-shadow);
}

.status-header {
    display: flex;
    align-items: center;

    gap: 12px;

    margin-bottom: 20px;

    min-width: 0;
}

#status-dot {
    flex: 0 0 12px;

    width: 12px;
    height: 12px;

    border-radius: 50%;

    background: var(--status-light);

    display: inline-block;

    transition:
        background-color 0.3s ease,
        box-shadow 0.3s ease;
}

.status-content {
    min-width: 0;
}

#status-text {
    font-size: 16px;
    line-height: 1.4;
    font-weight: 700;

    color: var(--status-text);

    overflow-wrap: anywhere;
}

#status-subtext {
    margin-top: 2px;

    color: var(--status-muted);

    font-size: 13px;
    line-height: 1.4;

    overflow-wrap: anywhere;
}
#status-note {
    margin: 2px 0px 12px;

    color: var(--status-muted);

    font-size: 13px;
    line-height: 1.4;
}
.timeline-labels {
    display: grid;

    grid-template-columns:
        1fr auto 1fr;

    align-items: center;

    gap: 8px;

    margin-bottom: 6px;

    color: var(--status-light);

    font-size: 11px;
    line-height: 1.3;

    font-weight: 500;
}

.timeline-labels span {
    min-width: 0;
}

#label-start {
    text-align: left;
}

#timeline-efficiency {
    text-align: center;
}

#label-end {
    text-align: right;
}

#history-timeline-bar {
    display: flex;

    align-items: center;

    gap: 4px;

    width: 100%;
    min-width: 0;

    height: 28px;
}

.history-bar {
    flex: 1 1 0;

    min-width: 0;

    height: 100%;

    border-radius: 0;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.history-bar:hover {
    transform: scaleY(1.15);
}

.history-bar--operational {
    background: var(--status-success);
}

.history-bar--outage {
    background: var(--status-error);
}

.history-bar--untracked {
    background: var(--status-neutral);
}

.history-bar--paused {
    background: var(--status-warning);
}

.history-bar--degraded {
    background: #f97316;
}

/* Shared Heading Styles for Incidents and How it Works */
#incidents-section h2,
#how-it-works-section h2 {
    margin: 0 0 16px;

    font-size: 18px;
    font-weight: 700;
}

#incidents-list {
    display: flex;

    flex-direction: column;

    gap: 12px;
}

.incident {
    padding: 12px;

    background: #fafafa;

    border-radius: 0;
}

.incident--detected {
    border-left:
        4px solid
        var(--status-error);
}

.incident--resolved {
    border-left:
        4px solid
        var(--status-success);
}

.incident--degraded {
    border-left: 4px solid #f97316;
}

.incident--degraded-resolved {
    border-left: 4px solid var(--status-success);
}

.incident-title {
    font-weight: 600;
    font-size: 14px;
}

.incident-date,
.incident-duration {
    color: var(--status-muted);
    font-size: 13px;
}

.incident-date {
    margin-top: 4px;
}

.incident-duration {
    margin-top: 2px;
}

.no-incidents {
    margin: 0;

    color: var(--status-muted);

    font-size: 14px;
}

.view-history-button {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
max-width: 170px;
margin: 22px auto 0;
padding: 8px 12px;

color: #18181b;
background: #ffffff;

border: 0px solid #e4e4e7;
border-radius: 0px;

text-decoration: none;
font-size: 13px;
font-weight: 600;

box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03);

transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;

}

.view-history-button:hover {
border-color: #d4d4d8;

}

.view-history-button:active {
transform: translateY(0);
}

.view-history-button:focus-visible {
outline: 2px solid #18181b;
outline-offset: 3px;
}

.view-history-arrow {
display: inline-flex;
align-items: center;
justify-content: center;

font-size: 16px;
line-height: 1;

transition: transform 0.2s ease;

}

.view-history-button:hover .view-history-arrow {
transform: translateX(3px);
}

/* Styles for the new "How it works" description text */
.checker-description p {
    margin: 0 0 12px;

    font-size: 14px;
    line-height: 1.5;
    
    color: var(--status-muted);
}

.checker-description p:last-child {
    margin-bottom: 0;
}

.visually-hidden {
    position: absolute;

    width: 1px;
    height: 1px;

    padding: 0;
    margin: -1px;

    overflow: hidden;

    clip: rect(0, 0, 0, 0);

    white-space: nowrap;

    border: 0;
}

@media (max-width: 480px) {

    /* Updated mobile view container selector */
    #status-dashboard,
    #incidents-section,
    #how-it-works-section {
        width: calc(100% - 24px);

        margin: 12px auto;

        padding: 20px 16px;
    }

    .status-header {
        gap: 10px;

        margin-bottom: 18px;
    }

    #status-text {
        font-size: 15px;
    }

    #status-subtext {
        font-size: 12px;
    }

    .timeline-labels {
        gap: 5px;
        font-size: 10px;
    }

    #history-timeline-bar {
        gap: 3px;
        height: 24px;
    }
}

@media (max-width: 340px) {

    /* Updated tight mobile view container selector */
    #status-dashboard,
    #incidents-section,
    #how-it-works-section {
        width: calc(100% - 16px);

        padding: 16px 12px;
    }

    #history-timeline-bar {
        gap: 2px;
        height: 22px;
    }

    #timeline-efficiency {
        display: none;
    }

    .timeline-labels {
        grid-template-columns:
            1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {

    #status-dot,
    .history-bar {
        transition: none;
    }

    .history-bar:hover {
        transform: none;
    }
}

/* ---------- Shared page header (history page) ---------- */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 20px;
}

.page-header h1 {
    margin: 0;

    font-size: 18px;
    font-weight: 700;
    color: var(--status-text);
}

.page-subtitle {
    margin: 4px 0 0;

    font-size: 13px;
    color: var(--status-muted);
}

/* Reuse the existing "View Incident History" button as a back link */
.view-history-button.back-link {
    width: auto;
    max-width: none;
    margin: 0;
    flex-shrink: 0;
}

.view-history-button.back-link:hover .view-history-arrow {
    transform: translateX(-3px);
}

/* Incident detail text, matching the muted metadata style */
.incident-detail {
    margin-top: 4px;

    font-size: 13px;
    line-height: 1.5;
    color: var(--status-muted);
}

@media (max-width: 480px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .view-history-button.back-link {
        width: 100%;
    }
}
.faq-question {
    margin: 16px 0 16px;
    font-size: 18px;
    font-weight: 700;
}
.faq-answer {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--status-muted);
}

/* ---------- Status dot inline with status text ---------- */

.status-title-row {
    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 0;
}

.status-title-row #status-text {
    flex: 1 1 auto;
    min-width: 0;
}

/* Keeps the subtext and note aligned under the status text */
#status-subtext,
#status-note {
    padding-left: 22px;
}

@media (max-width: 480px) {
    .status-title-row {
        gap: 8px;
    }

    #status-subtext,
    #status-note {
        padding-left: 20px;
    }
}

/* ---------- Timeline tooltip ---------- */

#history-tooltip {
    position: absolute;
    z-index: 1000;

    pointer-events: none;

    padding: 8px 10px;

    background: #18181b;
    color: #fafafa;

    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;

    border-radius: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
}

#history-tooltip[hidden] {
    display: none;
}

.history-tooltip-date {
    font-weight: 600;
    margin-bottom: 2px;
}

#history-timeline-bar > div:focus-visible {
    outline: 2px solid #18181b;
    outline-offset: 2px;
}

/* ---------- Last updated / refresh countdown (upper right) ---------- */

.status-meta {
    margin-left: auto;
    flex-shrink: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;

    text-align: right;
    white-space: nowrap;

    color: var(--status-light);
    font-size: 11px;
    line-height: 1.3;
}

@media (max-width: 480px) {
    .status-meta {
        font-size: 10px;
    }
}

/* ---------- Links ---------- */
/* Append this to the end of status.css */

a {
    color: #18181b;
    text-decoration: underline;
    text-decoration-color: #d4d4d8;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;

    transition:
        color 0.2s ease,
        text-decoration-color 0.2s ease;
}

a:hover {
    color: #52525b;
    text-decoration-color: #71717a;
}

a:focus-visible {
    outline: 2px solid #18181b;
    outline-offset: 2px;
}