:root {
    font-family: system-ui, sans-serif;
    color: #181b30;
    background: #f5f6fb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at top, #edebfc, transparent 36rem);
}

.dashboard {
    width: min(56rem, calc(100% - 3rem));
    margin-inline: auto;
    padding-block: clamp(2rem, 8vw, 6rem);
}

.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: 1.5rem;
    color: #fff;
    background:
        radial-gradient(circle at 87% 0%, #51409c 0, transparent 48%),
        linear-gradient(120deg, #191c39, #28204f);
    box-shadow: 0 1rem 2.5rem #24204324;
}

h1, h2, p {
    margin: 0;
}

h1 {
    font-size: clamp(1.9rem, 5vw, 3.125rem);
    line-height: 1.1;
    letter-spacing: -0.045em;
}

.interval {
    margin-top: 0.875rem;
    color: #ded8fb;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.summary {
    flex: none;
    min-width: 10rem;
    padding: 1rem 1.25rem;
    border: 1px solid #ffffff38;
    border-radius: 1rem;
    background: #ffffff14;
    color: #e8e1ff;
}

.summary-label {
    font-size: 0.8125rem;
    font-weight: 600;
}

.summary-count {
    margin-top: 0.125rem;
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.summary-count strong {
    font-size: 2rem;
    color: #fff;
}

.panel {
    margin-top: 1.5rem;
    overflow: hidden;
    border: 1px solid #e1e4ef;
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 0.375rem 1.5rem #2520470b;
}

.panel h2 {
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid #eceef6;
    font-size: 1.125rem;
}

.servers {
    margin: 0;
    padding: 0;
    list-style: none;
}

.server {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 1rem 1.5rem;
}

.server + .server {
    border-top: 1px solid #eceef6;
}

.server-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 0;
}

.server-icon {
    display: grid;
    flex: none;
    place-content: center;
    gap: 3px;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: #eeebff;
}

.server-icon:empty::before,
.server-icon:empty::after {
    content: "";
    width: 16px;
    height: 6px;
    border: 1.5px solid #5942a3;
    border-radius: 2px;
    background: radial-gradient(circle at 3px center, #5942a3 1px, transparent 1.5px);
}

.server-flag {
    display: block;
    width: 1.75rem;
    border-radius: 2px;
    outline: 1px solid #181b3026;
}

.server-name {
    font-weight: 650;
    overflow-wrap: anywhere;
}

.status {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 650;
}

.status::before {
    content: "";
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: currentColor;
}

.available { color: #11633c; background: #e3f7eb; }
.unavailable { color: #9d2840; background: #fde8ec; }
.invalid { color: #795100; background: #fff2d6; }
.pending { color: #4c5571; background: #edf0f8; }

.empty {
    padding: 1.5rem;
    color: #555d76;
}

.check-form {
    display: grid;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
}

.check-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.check-fields input,
.check-fields button,
.check-dialog-header button {
    padding: 0.5rem 0.75rem;
    border: 1px solid #b6bace;
    border-radius: 0.5rem;
    font: inherit;
}

.check-fields input { min-width: 0; }
.check-fields button { position: relative; background: #28204f; color: #fff; cursor: pointer; }
.check-fields button[aria-busy="true"] { color: transparent; cursor: wait; }

.check-fields button[aria-busy="true"]::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 1em;
    height: 1em;
    margin: auto;
    border: 2px solid #fff;
    border-inline-end-color: transparent;
    border-radius: 50%;
    animation: check-spin 0.75s linear infinite;
}

@keyframes check-spin { to { transform: rotate(1turn); } }

@media (prefers-reduced-motion: reduce) {
    .check-fields button[aria-busy="true"]::after { animation: none; }
}

.check-form p, .check-cache-note, .check-result-time { color: #555d76; font-size: 0.875rem; }

.check-dialog {
    width: min(34rem, calc(100% - 2rem));
    max-height: calc(100% - 2rem);
    padding: 0;
    border: 1px solid #e1e4ef;
    border-radius: 1.25rem;
    color: inherit;
    background: #fff;
    box-shadow: 0 1rem 2.5rem #181b3040;
}

.check-dialog::backdrop { background: #181b3080; }

.check-dialog-header,
.check-result-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.625rem 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eceef6;
}

.check-dialog-header h2 { font-size: 1.125rem; }
.check-dialog-header button { color: inherit; background: #f5f6fb; cursor: pointer; }
.check-address { font-family: ui-monospace, Consolas, monospace; overflow-wrap: anywhere; }
.check-cache-note, .check-result-time { flex-basis: 100%; }

@media (max-width: 38rem) {
    .dashboard {
        width: calc(100% - 2rem);
    }

    .hero {
        flex-direction: column;
        align-items: stretch;
        gap: 1.25rem;
    }

    .summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding-block: 0.625rem;
    }

    .summary-count {
        margin: 0;
    }
}

@media (max-width: 27rem) {
    .server {
        flex-direction: column;
        align-items: flex-start;
    }

    .server .status {
        margin-inline-start: 3.625rem;
    }
}
