.speed-page {
    --ink: #111827;
    --muted: #667085;
    --line: rgba(220, 233, 214, 0.9);
    --green: #7ed957;
    --green-dark: #3f9d2e;
    --cyan: #06b6d4;
    --panel: rgba(255, 255, 255, 0.9);
    height: calc(100vh - var(--speed-nav-height, 92px));
    height: calc(100dvh - var(--speed-nav-height, 92px));
    min-height: calc(100vh - var(--speed-nav-height, 92px));
    min-height: calc(100dvh - var(--speed-nav-height, 92px));
    padding: clamp(10px, 1.6vh, 18px) 18px;
    background:
        radial-gradient(circle at 10% 20%, rgba(126, 217, 87, 0.18), transparent 32%),
        radial-gradient(circle at 88% 18%, rgba(22, 32, 24, 0.08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f7faf6 100%);
    color: var(--ink);
    overflow: hidden;
}

body:has(.speed-page) .footer {
    display: none;
}

body:has(.speed-page) .navbar {
    position: sticky;
    top: 0;
}

body:has(.speed-page) .navbar .container {
    padding-top: 0.58rem;
    padding-bottom: 0.58rem;
}

body:has(.speed-page) .logo svg {
    height: 38px;
}

.speed-fit {
    transform: scale(var(--fit-scale, 1));
    transform-origin: top center;
    transition: transform 0.16s ease;
    will-change: transform;
}

.speed-stage {
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: clamp(14px, 2.2vh, 24px);
    align-items: stretch;
    min-height: calc(100vh - var(--speed-nav-height, 92px) - clamp(20px, 3.2vh, 36px));
    min-height: calc(100dvh - var(--speed-nav-height, 92px) - clamp(20px, 3.2vh, 36px));
}

.speed-lab,
.speed-side,
.speed-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 20px 56px rgba(22, 32, 24, 0.09);
    backdrop-filter: blur(18px);
    border-radius: 20px;
}

.speed-lab {
    min-height: 0;
    padding: clamp(16px, 3vw, 34px);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.speed-lab::before {
    content: "";
    position: absolute;
    inset: clamp(12px, 2.4vh, 28px);
    border: 1px solid rgba(17, 24, 40, 0.06);
    border-radius: 16px;
    pointer-events: none;
}

.speed-topbar,
.speed-core,
.speed-actions,
.speed-side > * {
    position: relative;
    z-index: 1;
}

.speed-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: clamp(8px, 2vh, 22px);
}

.speed-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    color: #162018;
}

.speed-back-link {
    display: inline-block;
    margin-bottom: 0.38rem;
    color: var(--green-dark);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.speed-back-link:hover {
    color: #162018;
}

.speed-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 7px rgba(126, 217, 87, 0.16);
}

.speed-mode {
    padding: 7px 11px;
    border-radius: 999px;
    background: #ecfdf3;
    color: #027a48;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 1px rgba(2, 122, 72, 0.08);
}

.speed-core {
    display: grid;
    place-items: center;
    text-align: center;
    padding: clamp(4px, 1vh, 10px) 0 clamp(10px, 2vh, 22px);
    min-height: 0;
}

.speed-title {
    margin: 0 0 clamp(4px, 1vh, 10px);
    color: #162018;
    font-size: clamp(1.9rem, min(4.4vw, 8vh), 4.2rem);
    line-height: 0.98;
    letter-spacing: 0;
}

.speed-subtitle {
    margin: 0 auto clamp(8px, 1.6vh, 16px);
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 520px;
}

.speed-trust-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: clamp(12px, 2.4vh, 24px);
}

.speed-trust-row span {
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 50px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.orbital-meter {
    width: min(410px, 72vw, 46vh);
    min-width: 180px;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle, #fff 0 43%, transparent 44%), conic-gradient(from -140deg, var(--green) calc(var(--meter, 0) * 1%), #edf4ea 0);
    box-shadow: inset 0 0 0 1px rgba(17, 24, 40, 0.06), 0 28px 74px rgba(63, 157, 46, 0.2);
    position: relative;
}

.orbital-meter::before,
.orbital-meter::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(17, 24, 39, 0.08);
}

.orbital-meter::before {
    inset: 10%;
}

.orbital-meter::after {
    inset: 23%;
    border-style: dashed;
}

.meter-readout {
    position: relative;
    z-index: 2;
    width: 58%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--line);
    box-shadow: 0 16px 45px rgba(17, 24, 39, 0.08);
}

.meter-number {
    font-size: clamp(2.35rem, min(7vw, 10vh), 5.1rem);
    line-height: 0.9;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.meter-unit {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.speed-phase {
    margin-top: clamp(8px, 1.8vh, 18px);
    min-height: 28px;
    color: var(--muted);
    font-weight: 750;
}

.speed-actions {
    display: flex;
    justify-content: center;
    gap: clamp(8px, 1.5vh, 12px);
    flex-wrap: wrap;
}

.speed-btn {
    min-height: clamp(42px, 6.2vh, 52px);
    border: 0;
    border-radius: 50px;
    padding: 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 850;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.speed-btn.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--green), var(--green-dark));
    box-shadow: 0 18px 34px rgba(63, 157, 46, 0.26);
}

.speed-btn.secondary {
    color: var(--green-dark);
    background: #fff;
    border: 1px solid var(--line);
}

.speed-btn:hover {
    transform: translateY(-2px);
}

.speed-btn:disabled {
    opacity: 0.68;
    cursor: wait;
    transform: none;
}

.speed-side {
    padding: clamp(12px, 2vh, 20px);
    display: grid;
    gap: clamp(8px, 1.5vh, 14px);
    grid-template-rows: auto auto minmax(72px, 1fr) auto;
    min-height: 0;
}

.score-panel {
    background:
        radial-gradient(circle at 86% 12%, rgba(126, 217, 87, 0.2), transparent 28%),
        linear-gradient(135deg, #101828 0%, #162018 100%);
    color: #fff;
    border-radius: 16px;
    padding: clamp(14px, 2.2vh, 20px);
    min-height: clamp(112px, 19vh, 168px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.score-helper {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
    line-height: 1.45;
}

.score-label {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.score-grade {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
}

.score-grade strong {
    font-size: clamp(2.6rem, 8vh, 4rem);
    line-height: 0.88;
}

.score-grade span {
    text-align: right;
    font-weight: 850;
    color: var(--green);
}

.speed-card {
    padding: clamp(11px, 1.8vh, 16px);
    box-shadow: none;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 16px;
}

.speed-card-title {
    margin-bottom: 8px;
    color: #162018;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: clamp(6px, 1.05vh, 10px) 0;
    border-top: 1px solid var(--line);
}

.metric-row:first-child {
    border-top: 0;
    padding-top: 0;
}

.metric-name {
    color: var(--muted);
    font-weight: 780;
}

.metric-value {
    color: var(--ink);
    font-weight: 900;
    font-size: clamp(1rem, 2vh, 1.2rem);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.metric-value small {
    color: var(--muted);
    font-size: 0.75rem;
    margin-left: 3px;
    font-weight: 800;
}

.sample-bars {
    height: clamp(58px, 12vh, 96px);
    display: flex;
    align-items: end;
    gap: 5px;
    padding-top: 12px;
}

.sample-bars span {
    flex: 1;
    min-width: 7px;
    height: 18%;
    background: linear-gradient(180deg, var(--cyan), var(--green));
    border-radius: 4px 4px 0 0;
    transition: height 0.25s ease;
}

.quick-labels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: clamp(8px, 1.8vh, 18px);
}

.quick-labels span {
    min-height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 850;
    text-align: center;
}

.quick-labels span.ready {
    color: #027a48;
    background: #ecfdf3;
    border-color: #abefc6;
}

.quick-labels span.warn {
    color: #b54708;
    background: #fffaeb;
    border-color: #fedf89;
}

@media (max-width: 980px) {
    .speed-stage {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .speed-lab {
        min-height: auto;
    }

    .speed-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: auto auto;
    }

    .quick-labels {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .speed-page {
        padding: 82px 12px 24px;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .speed-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .orbital-meter {
        width: min(300px, 82vw, 38vh);
    }

    .quick-labels,
    .speed-side {
        grid-template-columns: 1fr;
    }

    .speed-btn {
        width: 100%;
    }
}

@media (max-height: 720px) and (min-width: 981px) {
    .speed-subtitle {
        display: none;
    }

    .sample-bars {
        height: clamp(48px, 10vh, 78px);
    }

    .quick-labels span {
        min-height: 34px;
    }
}

@media (max-height: 580px) and (min-width: 981px) {
    .speed-stage {
        grid-template-columns: minmax(0, 1fr) 310px;
    }

    .speed-title {
        font-size: clamp(1.65rem, 7vh, 3rem);
    }

    .orbital-meter {
        width: min(310px, 42vh);
    }
}

.tool-seo-section {
    padding: 72px 0;
    background: #f7faf6;
    color: #162018;
}

.tool-seo-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 28px;
    align-items: stretch;
}

.tool-seo-grid article,
.tool-seo-grid aside,
.tool-faq {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(22, 32, 24, 0.07);
    padding: 24px;
}

.tool-seo-kicker {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--green-dark);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.tool-seo-section h2,
.tool-seo-section h3 {
    color: #162018;
    margin-bottom: 12px;
}

.tool-seo-section p,
.tool-seo-section li {
    color: #5d6a5f;
    line-height: 1.75;
}

.tool-seo-section ul {
    padding-left: 20px;
}

.tool-faq {
    margin-top: 24px;
}

.tool-faq details {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}

.tool-faq details:first-of-type {
    border-top: 0;
}

.tool-faq summary {
    cursor: pointer;
    color: #162018;
    font-weight: 850;
}

@media (max-width: 760px) {
    .tool-seo-grid {
        grid-template-columns: 1fr;
    }
}
