/* ==========================================
   TOOLINHAND INTERNET SPEED TEST PRO
   Native Blue-Purple Gradient Theme
   Version 4.0
   ========================================== */

.tihst {
    --ts-primary: var(--blue, #2563eb);
    --ts-secondary: var(--purple, #7c3aed);
    --ts-ink: #17203a;
    --ts-muted: #64748b;
    --ts-border: #e2e8f0;
    --ts-bg: #f8fafc;
    --ts-white: #ffffff;
    --ts-gradient: linear-gradient(
        135deg,
        var(--ts-primary),
        var(--ts-secondary)
    );

    box-sizing: border-box;
    width: 100%;
    max-width: 1140px;
    margin: 28px auto;
    background: var(--ts-white);
    color: var(--ts-ink);
    border: 1px solid var(--ts-border);
    border-radius: 24px;
    overflow: hidden;
    font: inherit;
    font-size: 15px;
    line-height: 1.6;
    box-shadow: 0 12px 40px rgba(23, 32, 58, .06);
}

.tihst *,
.tihst *::before,
.tihst *::after {
    box-sizing: border-box;
}

.tihst [hidden] {
    display: none !important;
}

.tihst button {
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tihst button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.tihst button:focus-visible {
    outline: 3px solid var(--ts-primary);
    outline-offset: 4px;
}


/* ==========================================
   PROFESSIONAL PAGE TITLE
   Scoped to this tool page
   ========================================== */

main:has(.tihst) h1 {
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    color: #2563eb;
}

@supports (background-clip: text) {
    main:has(.tihst) h1 {
        background: linear-gradient(
            135deg,
            var(--blue, #2563eb),
            var(--purple, #7c3aed)
        );
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
    }
}


/* ==========================================
   HEADER
   ========================================== */

.tihst .ts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 26px 30px;

    background: linear-gradient(
        115deg,
        #eff6ff,
        #ffffff 50%,
        #f5f3ff
    );

    border-bottom: 1px solid var(--ts-border);
}

.tihst .ts-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--ts-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
}

.tihst .ts-heading h2 {
    margin: 0;
    padding: 0;
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    line-height: 1.3;
    color: var(--ts-ink);
    letter-spacing: -.6px;
}

.tihst .ts-heading p {
    margin: 6px 0 0;
    color: var(--ts-muted);
    font-size: 14px;
}

.tihst .ts-status,
.tihst .ts-server-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 40px;
    border: 1px solid #dbeafe;
    background: #ffffff;
    color: var(--ts-primary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tihst .ts-status::before,
.tihst .ts-server-badge::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.tihst [data-state="success"] {
    color: #047857;
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.tihst [data-state="error"] {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fef2f2;
}


/* ==========================================
   MAIN DASHBOARD
   ========================================== */

.tihst .ts-dashboard {
    display: grid;
    grid-template-columns:
        minmax(0, 1.1fr)
        minmax(0, 1fr);
    gap: 22px;
    padding: 26px;
}

.tihst .ts-meter-panel {
    min-width: 0;
    padding: 28px 22px;
    border: 1px solid var(--ts-border);
    border-radius: 18px;
    text-align: center;

    background: radial-gradient(
        ellipse at center,
        #f5f3ff,
        #ffffff 75%
    );
}

.tihst .ts-meter-label {
    margin-bottom: 20px;
    color: var(--ts-ink);
    font-size: 18px;
    font-weight: 700;
}


/* ==========================================
   ANIMATED SPEEDOMETER
   ========================================== */

.tihst .ts-gauge {
    --ts-angle: 0deg;
    position: relative;
    width: min(280px, 100%);
    margin: 0 auto 24px;
}

.tihst .ts-gauge-ring {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    padding: 13px;
    border-radius: 50%;

    background: conic-gradient(
        from 225deg,
        var(--ts-primary) 0deg,
        var(--ts-secondary) var(--ts-angle),
        #e0e7ff var(--ts-angle),
        #e0e7ff 270deg,
        transparent 270deg,
        transparent 360deg
    );
}

.tihst .ts-gauge-inner {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 20px;
    border-radius: 50%;

    background: radial-gradient(
        circle at center,
        #ffffff 45%,
        #f5f3ff 100%
    );

    box-shadow:
        inset 0 0 0 1px #e2e8f0,
        0 0 0 7px rgba(255,255,255,.85);
}

.tihst .ts-go {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 65%;
    aspect-ratio: 1;
    min-width: 0;
    padding: 8px;

    background: #ffffff;
    color: var(--ts-primary);
    border: 3px solid transparent;
    border-radius: 50%;

    background:
        linear-gradient(#ffffff, #ffffff)
            padding-box,
        var(--ts-gradient)
            border-box;

    box-shadow: 0 8px 30px rgba(37,99,235,.12);

    transition:
        transform .2s ease,
        box-shadow .2s ease;
}

.tihst .ts-go strong {
    font-size: clamp(25px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.15;

    background: var(--ts-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tihst .ts-go small {
    margin-top: 8px;
    color: var(--ts-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.tihst .ts-go:hover {
    transform: scale(1.04);
    box-shadow: 0 12px 36px rgba(124,58,237,.18);
}

.tihst .ts-go:active {
    transform: scale(.97);
}

.tihst .ts-reading {
    width: 100%;
    min-width: 0;
    padding: 6px;
    text-align: center;
}

.tihst .ts-reading strong {
    display: block;
    color: var(--ts-ink);
    font-size: clamp(30px, 5vw, 52px);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1.5px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.tihst .ts-reading span {
    display: block;
    margin-top: 8px;
    color: var(--ts-secondary);
    font-size: 17px;
    font-weight: 700;
}

.tihst .ts-scale {
    display: flex;
    justify-content: space-between;
    padding: 0 12px;
    margin-top: -8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ts-muted);
}


/* ==========================================
   PROGRESS BAR
   ========================================== */

.tihst .ts-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 20px 0 8px;
    color: var(--ts-muted);
    font-size: 12px;
}

.tihst .ts-progress-info strong {
    color: var(--ts-primary);
    font-weight: 700;
}

.tihst progress {
    display: block;
    width: 100%;
    height: 9px;
    margin: 0;
    border: 0;
    border-radius: 20px;
    background: #e2e8f0;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    accent-color: var(--ts-primary);
}

.tihst progress::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 20px;
}

.tihst progress::-webkit-progress-value {
    background: var(--ts-gradient);
    border-radius: 20px;
    transition: width .25s ease;
}

.tihst progress::-moz-progress-bar {
    background: var(--ts-gradient);
    border-radius: 20px;
}

.tihst .ts-message {
    min-height: 44px;
    margin: 16px 0 8px;
    color: var(--ts-muted);
    font-size: 13px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.tihst .ts-stop {
    min-height: 42px;
    padding: 10px 24px;
    margin-top: 6px;
    border: 0;
    border-radius: 10px;
    background: var(--ts-gradient);
    color: #ffffff;
    font-weight: 700;
}


/* ==========================================
   RESULT CARDS
   ========================================== */

.tihst .ts-results {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.tihst .ts-card {
    --ts-accent: #2563eb;
    --ts-tint: #eff6ff;

    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 9px;
    min-width: 0;
    min-height: 170px;
    padding: 20px;
    overflow: hidden;

    background: linear-gradient(
        145deg,
        #ffffff,
        #f8fafc
    );

    border: 1px solid var(--ts-border);
    border-radius: 16px;

    box-shadow: 0 3px 12px rgba(23,32,58,.035);

    transition:
        transform .2s ease,
        border-color .2s ease;
}

.tihst .ts-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ts-accent);
}

.tihst .ts-card:hover {
    transform: translateY(-3px);
    border-color: #c7d2fe;
}

.tihst .ts-download {
    --ts-accent: #2563eb;
    --ts-tint: #eff6ff;
}

.tihst .ts-upload {
    --ts-accent: #7c3aed;
    --ts-tint: #f5f3ff;
}

.tihst .ts-ping {
    --ts-accent: #047857;
    --ts-tint: #ecfdf5;
}

.tihst .ts-jitter {
    --ts-accent: #b45309;
    --ts-tint: #fffbeb;
}

.tihst .ts-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ts-tint);
    color: var(--ts-accent);
    font-size: 25px;
    font-weight: 700;
    line-height: 1;
}

.tihst .ts-card-label {
    color: var(--ts-ink);
    font-size: 13px;
    font-weight: 700;
}

.tihst .ts-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
}

.tihst .ts-value strong {
    min-width: 0;
    color: var(--ts-accent);
    font-size: clamp(25px, 4vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.tihst .ts-value small {
    color: var(--ts-muted);
    font-size: 12px;
}

.tihst .ts-card p {
    margin: 0;
    color: var(--ts-muted);
    font-size: 12px;
}


/* ==========================================
   SERVER INFORMATION
   ========================================== */

.tihst .ts-server-panel {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
    margin: 0 26px 20px;
    background: linear-gradient(
        120deg,
        #eff6ff,
        #f5f3ff
    );
    border: 1px solid #e0e7ff;
    border-radius: 14px;
}

.tihst .ts-server-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: var(--ts-gradient);
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    border-radius: 12px;
}

.tihst .ts-server-info {
    flex: 1;
    min-width: 150px;
}

.tihst .ts-server-info strong {
    display: block;
    color: var(--ts-ink);
    font-size: 14px;
    font-weight: 700;
}

.tihst .ts-server-info span {
    display: block;
    margin-top: 4px;
    color: var(--ts-muted);
    font-size: 12px;
}


/* ==========================================
   ACTION BUTTONS
   ========================================== */

.tihst .ts-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 20px 24px;
}

.tihst .ts-secondary-button {
    min-height: 42px;
    padding: 10px 22px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--ts-primary);
    font-size: 13px;
    font-weight: 700;

    transition:
        color .2s ease,
        background .2s ease;
}

.tihst .ts-secondary-button:not(:disabled):hover {
    background: var(--ts-gradient);
    border-color: transparent;
    color: #ffffff;
}


/* ==========================================
   FOOTER
   ========================================== */

.tihst .ts-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 18px;
    border-top: 1px solid var(--ts-border);
    color: #047857;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
}

.tihst .ts-notice {
    margin: 0;
    padding: 14px 24px;
    color: var(--ts-muted);
    background: #ffffff;
    font-size: 11px;
    text-align: center;
    line-height: 1.7;
}


/* ==========================================
   TABLET
   ========================================== */

@media (max-width: 900px) {
    .tihst .ts-dashboard {
        gap: 14px;
        padding: 18px;
    }

    .tihst .ts-card {
        padding: 15px;
        min-height: 155px;
    }

    .tihst .ts-meter-panel {
        padding: 24px 18px;
    }

    .tihst .ts-server-panel {
        margin-left: 18px;
        margin-right: 18px;
    }
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 700px) {
    .tihst {
        border-radius: 16px;
        margin: 18px auto;
    }

    .tihst .ts-header {
        padding: 18px;
    }

    .tihst .ts-heading h2 {
        font-size: 22px;
    }

    .tihst .ts-eyebrow {
        font-size: 10px;
        letter-spacing: 1.4px;
    }

    .tihst .ts-dashboard {
        grid-template-columns: minmax(0, 1fr);
        padding: 14px;
        gap: 14px;
    }

    .tihst .ts-meter-panel {
        padding: 24px 18px;
    }

    .tihst .ts-gauge {
        width: min(245px, 90%);
    }

    .tihst .ts-go strong {
        font-size: 32px;
    }

    .tihst .ts-results {
        gap: 10px;
    }

    .tihst .ts-card {
        min-height: 155px;
        padding: 14px;
        border-radius: 12px;
    }

    .tihst .ts-card-label {
        font-size: 12px;
    }

    .tihst .ts-value strong {
        font-size: 28px;
    }

    .tihst .ts-icon {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }

    .tihst .ts-server-panel {
        margin: 0 14px 18px;
        padding: 14px;
    }

    .tihst .ts-server-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .tihst .ts-server-badge {
        font-size: 10px;
        padding: 6px 10px;
    }

    .tihst .ts-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 18px;
    }
}

@media (max-width: 360px) {
    .tihst .ts-card {
        padding: 10px;
    }

    .tihst .ts-value strong {
        font-size: 23px;
    }

    .tihst .ts-go small {
        font-size: 8px;
    }

    .tihst .ts-server-info {
        min-width: 120px;
    }
}

@media (hover: none) {
    .tihst .ts-card:hover,
    .tihst .ts-go:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tihst *,
    .tihst *::before,
    .tihst *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* END OF TOOLINHAND SPEED TEST PRO CSS */