/* PS Speed Test – uses the theme's CSS variables */
.psst, .psst-report {
    --psst-good: #0a7d43;
    --psst-average: #b45309;
    --psst-poor: #c0262d;
    --psst-na: #8a8f98;
    max-width: 900px;
    margin: 0 auto;
}

.psst-form, .psst-lead, .psst-progress {
    background: var(--gray-light, #f8f9fa);
    border: 1px solid var(--gray, #e9ecef);
    border-radius: var(--radius, 12px);
    padding: 24px;
}

.psst-label, .psst-lead label { display: block; font-weight: 600; margin-bottom: 6px; }
.psst-input-row { display: flex; gap: 10px; }
.psst input[type="url"], .psst input[type="text"], .psst input[type="email"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    font: inherit;
    padding: 12px 14px;
    border: 1px solid #c9ced6;
    border-radius: var(--radius-sm, 8px);
    background: #fff;
}
.psst input:focus { outline: 2px solid var(--primary, #0077c2); outline-offset: 1px; }
.psst .btn { white-space: nowrap; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.psst .btn:disabled { opacity: .7; cursor: wait; }
.psst-hint, .psst-small { font-size: 14px; color: var(--text-light, #666); margin-top: 10px; }
.psst-msg { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm, 8px); background: #fdecec; color: var(--psst-poor); }
.psst-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Progress */
.psst-progress { margin-top: 20px; }
.psst-progress-title { font-weight: 600; }
.psst-timer { color: var(--text-light, #666); font-variant-numeric: tabular-nums; margin-left: 6px; }
.psst-steps { margin-top: 12px; }
.psst-steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.psst-step-status { margin-left: auto; font-size: 14px; color: var(--text-light, #666); }
.psst-step-icon { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary, #0077c2); flex: none; }
.is-running .psst-step-icon { border-right-color: transparent; animation: psst-spin .8s linear infinite; }
.is-done .psst-step-icon { background: var(--psst-good); border-color: var(--psst-good); }
.is-failed .psst-step-icon { background: var(--psst-poor); border-color: var(--psst-poor); }
@keyframes psst-spin { to { transform: rotate(360deg); } }

/* Handover from progress to results */
.psst-progress, .psst-results { transition: opacity .25s ease, transform .25s ease; }
.psst-progress.is-leaving { opacity: 0; transform: translateY(-6px); }
.psst-results.is-entering { opacity: 0; transform: translateY(10px); }
@media (prefers-reduced-motion: reduce) { .psst-progress, .psst-results { transition: none; } }
@media (prefers-reduced-motion: reduce) { .is-running .psst-step-icon { animation: none; } }

/* Results */
.psst-results { margin-top: 32px; scroll-margin-top: calc(var(--header-height, 80px) + 16px); }
.psst-results h2, .psst-report h2 { font-size: 26px; margin: 36px 0 12px; }
.psst-results h3, .psst-report h3 { font-size: 19px; margin: 28px 0 10px; }
.psst-head h2 { margin-top: 0; }
.psst-ps { margin: 12px 0; padding: 10px 14px; border-left: 4px solid var(--primary, #0077c2); background: var(--gray-light, #f8f9fa); }
.psst-ps.is-muted { border-color: var(--psst-na); }
.psst code, .psst-report code { font-size: .92em; background: var(--gray, #e9ecef); padding: 1px 6px; border-radius: 4px; word-break: break-all; }

.psst-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.psst-page { border: 1px solid var(--gray, #e9ecef); border-radius: var(--radius, 12px); padding: 16px; text-align: center; min-width: 0; }
.psst-page h3 { margin: 0 0 8px !important; font-size: 16px !important; }
.psst-gauges { display: flex; justify-content: center; align-items: center; gap: 12px; }
.psst-url { font-size: 13px; color: var(--text-light, #666); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 6px; }

.psst-gauge { position: relative; width: 104px; height: 104px; color: var(--psst-na); }
.psst-gauge.is-small { width: 76px; height: 76px; }
.psst-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.psst-gauge circle { fill: none; stroke-width: 8; }
.psst-gauge-bg { stroke: var(--gray, #e9ecef); }
.psst-gauge-fg { stroke: currentColor; stroke-linecap: round; }
.psst-gauge-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 700; padding-bottom: 14px; }
.psst-gauge.is-small .psst-gauge-num { font-size: 21px; padding-bottom: 12px; }
.psst-gauge-label { position: absolute; left: 0; right: 0; bottom: 26%; font-size: 12px; color: var(--text-light, #666); }
.psst-gauge.is-small .psst-gauge-label { bottom: 22%; font-size: 10px; }
.psst-gauge.is-good { color: var(--psst-good); }
.psst-gauge.is-average { color: var(--psst-average); }
.psst-gauge.is-poor { color: var(--psst-poor); }

.psst-vitals li { display: grid; grid-template-columns: 14px 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray, #e9ecef); }
.psst-vital-name { font-weight: 600; }
.psst-vital-text { grid-column: 2 / 4; font-size: 14px; color: var(--text-light, #666); }
.psst-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--psst-na); }
.is-good > .psst-dot { background: var(--psst-good); }
.is-average > .psst-dot { background: var(--psst-average); border-radius: 2px; }
.is-poor > .psst-dot { background: var(--psst-poor); border-radius: 0; }
.psst-vitals .is-good strong, td.is-good { color: var(--psst-good); }
.psst-vitals .is-average strong, td.is-average { color: var(--psst-average); }
.psst-vitals .is-poor strong, td.is-poor { color: var(--psst-poor); }

.psst-scroll { overflow-x: auto; }
.psst-table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 8px; }
.psst-table th, .psst-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--gray, #e9ecef); vertical-align: top; }
.psst-table thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--text-light, #666); }
.psst-table td { font-weight: 600; }
.psst-kv th { width: 45%; font-weight: 500; }
.psst-check { font-weight: 700; }
.psst-check.is-good { color: var(--psst-good); }
.psst-check.is-average { color: var(--psst-average); }
.psst-check.is-poor { color: var(--psst-poor); }
.psst-check.is-na { color: var(--psst-na); }

/* Lead form */
.psst-lead { margin-top: 32px; background: #eef6fc; border-color: #cfe4f4; }
.psst-lead h3 { margin-top: 0; }
.psst-lead-list { margin: 0 0 16px; }
.psst-lead-list li { position: relative; padding-left: 22px; margin: 6px 0; }
.psst-lead-list li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--primary, #0077c2); }
.psst-lead-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.psst-consent { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 14px; margin: 4px 0 16px; }
.psst-consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.psst-consent a, .psst-small a { color: var(--primary, #0077c2); text-decoration: underline; }

/* Full report */
.psst-fixes { counter-reset: none; padding-left: 22px; list-style: decimal; }
.psst-fixes li { padding: 14px 16px; margin: 0 0 12px; border: 1px solid var(--gray, #e9ecef); border-left-width: 4px; border-radius: var(--radius-sm, 8px); }
.psst-fixes li.is-p1 { border-left-color: var(--psst-poor); }
.psst-fixes li.is-p2 { border-left-color: var(--psst-average); }
.psst-fixes li.is-p3 { border-left-color: var(--psst-na); }
.psst-fixes p { margin: 6px 0 0; font-size: 15px; }
.psst-code { white-space: pre-wrap; word-break: break-all; font-size: 13px; background: var(--gray-light, #f8f9fa); border: 1px solid var(--gray, #e9ecef); padding: 12px; border-radius: var(--radius-sm, 8px); }
.psst-shot { border: 1px solid var(--gray, #e9ecef); border-radius: var(--radius-sm, 8px); max-width: 206px; }
.psst-dl dt { font-weight: 700; margin-top: 12px; }
.psst-dl dd { margin: 2px 0 0; color: var(--text-light, #666); }
.psst-cta { margin: 40px 0 24px; padding: 24px; border-radius: var(--radius, 12px); background: #eef6fc; }
.psst-cta h2 { margin-top: 0 !important; }
.psst-cta .btn { margin: 6px 8px 0 0; }

/* Article on the tool page (theme template) */
.psst-article { max-width: 800px; margin: 0 auto; font-size: 17px; line-height: 1.75; }
.psst-article h2 { font-size: 26px; margin: 40px 0 14px; }
.psst-article h2:first-child { margin-top: 0; }
.psst-article p, .psst-article ul { margin-bottom: 16px; }
.psst-article ul { list-style: disc; padding-left: 22px; }
.psst-article li { margin-bottom: 8px; }
.psst-article a { color: var(--primary, #0077c2); text-decoration: underline; }
.psst-article code { font-size: .88em; background: var(--gray, #e9ecef); padding: 1px 6px; border-radius: 4px; }

@media (max-width: 600px) {
    .psst-form, .psst-lead, .psst-progress { padding: 16px; }
    .psst-input-row { flex-direction: column; }
    .psst-lead-fields { grid-template-columns: 1fr; }
    .psst-table { font-size: 14px; }
    .psst-kv th { width: 50%; }
}
