:root {
    color-scheme: dark;

    --background: #0d1015;
    --surface: #171b22;
    --surface-light: #202630;
    --border: #2a313c;

    --text: #f5f7fa;
    --muted: #aeb7c4;

    --primary: #1976d2;
    --primary-hover: #2388ee;

    --good: #43d17d;
    --warning: #ffc857;
    --danger: #ff5f6d;

    --radius: 20px;
    --shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
}

html {
    background: var(--background);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(25, 118, 210, 0.13), transparent 35rem),
        var(--background);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(13, 16, 21, 0.92);
    backdrop-filter: blur(18px);
}

.header-inner {
    width: min(100% - 28px, 900px);
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.brand-icon {
    font-size: 28px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 16px;
}

.brand small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 12px;
}

.navigation {
    display: flex;
    gap: 5px;
}

.navigation a {
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.navigation a.active {
    background: var(--surface-light);
    color: var(--text);
}

.page-container {
    width: min(100% - 28px, 760px);
    margin: 0 auto;
    padding: 24px 0 48px;
}

.refresh-section {
    margin-bottom: 22px;
}

.refresh-button {
    width: 100%;
    min-height: 68px;
    padding: 16px 22px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #0d5eb2);
    box-shadow: 0 12px 28px rgba(25, 118, 210, 0.3);
    color: white;
    cursor: pointer;
    font: inherit;
    font-size: clamp(18px, 5vw, 23px);
    font-weight: 900;
}

.refresh-button span {
    display: inline-block;
    margin-right: 8px;
    font-size: 28px;
    vertical-align: -2px;
}

.refresh-button:hover,
.refresh-button:focus-visible {
    background: linear-gradient(135deg, var(--primary-hover), #176fc5);
}

.refresh-button:active {
    transform: translateY(1px);
}

.refresh-description {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.card {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(23, 27, 34, 0.96);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 21px 21px 17px;
    border-bottom: 1px solid var(--border);
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.eyebrow {
    margin: 0 0 4px;
    color: #76b9ff;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2 {
    margin: 0;
    line-height: 1.15;
}

h1 {
    font-size: clamp(25px, 7vw, 34px);
}

h2 {
    font-size: clamp(22px, 6vw, 29px);
}

.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.status-item {
    min-height: 150px;
    padding: 22px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-bottom: 1px solid var(--border);
}

.status-item:nth-child(odd) {
    border-right: 1px solid var(--border);
}

.status-item-wide {
    grid-column: 1 / -1;
    min-height: auto;
    border-right: 0 !important;
    border-bottom: 0;
}

.status-icon {
    font-size: 28px;
}

.status-label,
.status-detail {
    display: block;
}

.status-label {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.status-value {
    display: block;
    font-size: clamp(25px, 8vw, 38px);
    line-height: 1.1;
}

.status-detail {
    margin-top: 7px;
    color: var(--muted);
    font-size: 14px;
}

.status-good {
    color: var(--good);
}

.status-warning {
    color: var(--warning);
}

.status-danger {
    color: var(--danger);
}

.status-neutral {
    color: var(--text);
}

.latest-message-body,
.message-detail-body {
    padding: 24px 21px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: clamp(23px, 7vw, 36px);
    font-weight: 850;
    line-height: 1.35;
}

.message-time-unavailable {
    margin: 0;
    padding: 0 21px 20px;
    color: var(--muted);
    font-size: 13px;
}

.text-link,
.back-link {
    color: #76b9ff;
    font-weight: 800;
    text-decoration: none;
}

.back-link {
    display: inline-block;
    margin-bottom: 16px;
}

.message-list {
    display: flex;
    flex-direction: column;
}

.message-row {
    min-height: 84px;
    padding: 17px 19px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
}

.message-row:last-child {
    border-bottom: 0;
}

.message-row:hover,
.message-row:focus-visible {
    background: var(--surface-light);
}

.message-row-content {
    min-width: 0;
}

.message-row-content strong {
    display: -webkit-box;
    overflow: hidden;
    font-size: 17px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.message-row-content > span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.message-arrow {
    color: var(--muted);
    font-size: 32px;
}

.message-meta {
    margin-top: 7px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    color: var(--muted);
    font-size: 12px;
}

.page-heading {
    margin-bottom: 19px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 22px;
}

.page-heading p:not(.eyebrow) {
    max-width: 580px;
    margin: 9px 0 0;
    color: var(--muted);
}

.small-refresh-button,
.primary-link-button {
    display: inline-flex;
    min-height: 46px;
    padding: 11px 16px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.detail-list {
    margin: 0;
    padding: 0 21px 22px;
}

.detail-list > div {
    padding: 14px 0;
    display: grid;
    grid-template-columns: minmax(110px, 0.45fr) 1fr;
    gap: 15px;
    border-top: 1px solid var(--border);
}

.detail-list dt {
    color: var(--muted);
    font-weight: 750;
}

.detail-list dd {
    margin: 0;
    font-weight: 750;
    overflow-wrap: anywhere;
}

.alert {
    margin-bottom: 18px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 15px;
}

.alert-danger {
    border: 1px solid rgba(255, 95, 109, 0.35);
    background: rgba(255, 95, 109, 0.12);
    color: #ffd6da;
}

.empty-state {
    padding: 32px 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
}

.empty-state strong {
    font-size: 20px;
}

.empty-state span {
    color: var(--muted);
}

.empty-state .primary-link-button {
    margin-top: 12px;
}

.site-footer {
    padding: 0 18px 30px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

@media (max-width: 620px) {
    .header-inner {
        min-height: auto;
        padding: 13px 0 11px;
        flex-direction: column;
        align-items: stretch;
    }

    .brand {
        justify-content: center;
    }

    .navigation {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .navigation a {
        text-align: center;
    }

    .page-container {
        padding-top: 18px;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .status-item,
    .status-item:nth-child(odd) {
        min-height: auto;
        border-right: 0;
    }

    .status-item-wide {
        grid-column: auto;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .small-refresh-button {
        width: 100%;
    }

    .detail-list > div {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}