.speedtest-page {
    --st-bg: #0b0c10;
    --st-panel: #12141a;
    --st-text: #f5f7fb;
    --st-muted: #8b93a7;
    --st-download: #2bd4c7;
    --st-upload: #a855f7;
    --st-ping: #f5f7fb;
    --st-arc: #2a2f3a;
    --st-glow: rgba(168, 85, 247, 0.55);
    min-height: calc(100vh - 140px);
    margin: -1rem calc(50% - 50vw) 0;
    width: 100vw;
    max-width: 100vw;
    padding: 2rem 1rem 3rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(168, 85, 247, 0.12), transparent 55%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(43, 212, 199, 0.08), transparent 50%),
        var(--st-bg);
    color: var(--st-text);
    border-radius: 0;
    box-sizing: border-box;
}

.speedtest-shell {
    max-width: 720px;
    margin: 0 auto;
}

.speedtest-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.12em;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--st-text);
    text-transform: uppercase;
}

.speedtest-brand svg {
    width: 28px;
    height: 28px;
    color: var(--st-download);
}

.speedtest-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
    margin-bottom: 1.25rem;
}

.speedtest-metric {
    text-align: center;
}

.speedtest-metric__label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--st-muted);
    margin-bottom: 0.35rem;
}

.speedtest-metric__label .dot-dl {
    color: var(--st-download);
}

.speedtest-metric__label .dot-ul {
    color: var(--st-upload);
}

.speedtest-metric__value {
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.speedtest-latency {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.speedtest-latency__item {
    text-align: center;
    min-width: 64px;
}

.speedtest-latency__label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--st-muted);
    margin-bottom: 0.2rem;
}

.speedtest-latency__value {
    font-size: 1.35rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.speedtest-latency__value.is-dl {
    color: var(--st-download);
}

.speedtest-latency__value.is-ul {
    color: var(--st-upload);
}

.speedtest-quality {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem 0 1.5rem;
    flex-wrap: wrap;
}

.speedtest-quality__item {
    width: 56px;
    text-align: center;
}

.speedtest-quality__icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 0.35rem;
    border-radius: 10px;
    border: 1px solid #2a3140;
    background: #161a22;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--st-muted);
    font-size: 1.1rem;
}

.speedtest-quality__dots {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.speedtest-quality__dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2a3140;
}

.speedtest-quality__dots span.on {
    background: var(--st-download);
}

.speedtest-gauge-wrap {
    position: relative;
    width: min(100%, 420px);
    margin: 0 auto 1.5rem;
}

.speedtest-gauge {
    width: 100%;
    height: auto;
    display: block;
}

.speedtest-gauge__live {
    position: absolute;
    left: 50%;
    bottom: 12%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
}

.speedtest-gauge__live-value {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.speedtest-gauge__live-unit {
    font-size: 0.85rem;
    color: var(--st-muted);
    margin-top: 0.15rem;
}

.speedtest-gauge__live-phase {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--st-upload);
}

.speedtest-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.speedtest-btn {
    appearance: none;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 2.4rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, #7c3aed, #2bd4c7);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 0 28px var(--st-glow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.speedtest-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 36px rgba(43, 212, 199, 0.45);
}

.speedtest-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.speedtest-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    background: rgba(18, 20, 26, 0.9);
    border: 1px solid #232836;
}

.speedtest-meta__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.speedtest-meta__label {
    color: var(--st-muted);
}

.speedtest-meta__value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
    word-break: break-all;
}

.speedtest-meta__value.is-ip {
    color: var(--st-download);
    font-size: 1.05rem;
}

.speedtest-status {
    text-align: center;
    margin-top: 1rem;
    min-height: 1.25rem;
    color: var(--st-muted);
    font-size: 0.9rem;
}

.speedtest-status.is-error {
    color: #ff6b7a;
}

@media (max-width: 576px) {
    .speedtest-page {
        padding: 1.25rem 0.75rem 2rem;
    }

    .speedtest-metrics {
        gap: 1rem;
    }

    .speedtest-latency {
        gap: 1rem;
    }
}
