/**
 * Internet speed test page. Its card, explainer, FAQ, CTA and table styles are
 * also the shared section styles of every free tool page (see tools.css).
 */
.st-hero__eyebrow {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 222, 0, 0.14);
  color: var(--yellow);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
}

.st-tool-section { padding-top: var(--space-10); }

.st-card {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-8);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.st-card [hidden] { display: none !important; }

.st-card__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

/* Gauge */
.st-gauge {
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 240 / 200;
}

.st-gauge__svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.st-gauge__track,
.st-gauge__fill {
  fill: none;
  stroke-width: 16;
  stroke-linecap: round;
}

.st-gauge__track { stroke: var(--gray-200); }

.st-gauge__fill {
  stroke: var(--yellow);
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  opacity: 0;
  transition: stroke-dashoffset 0.25s var(--ease-out);
}

.st-card.is-running .st-gauge__fill { stroke: var(--brand-red); }

.st-gauge__readout {
  position: absolute;
  inset: 34% 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.st-gauge__value {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw, 3.5rem);
  font-weight: var(--fw-black);
  color: var(--brand-black);
  font-variant-numeric: tabular-nums;
}

.st-gauge__unit {
  margin-top: 4px;
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
}

.st-gauge__phase {
  min-height: 1.4em;
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--red-text);
  font-weight: var(--fw-bold);
}

.st-start {
  min-width: 220px;
  padding: 14px 32px;
  font-size: var(--text-lg);
  font-weight: var(--fw-extrabold);
  border-radius: var(--radius-full);
}

.st-start:disabled {
  opacity: 0.6;
  cursor: progress;
}

.st-status {
  margin: 0;
  min-height: 1.7em;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* Metrics */
.st-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-8);
}

.st-metric {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--gray-100);
  border: 2px solid transparent;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.st-metric.is-active {
  border-color: var(--yellow);
  background: #fffbe0;
}

.st-metric__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: var(--fw-medium);
}

.st-metric__value b {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-black);
  color: var(--brand-black);
  font-variant-numeric: tabular-nums;
}

.st-metric__value small {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Connection info */
.st-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2) var(--space-6);
  margin: var(--space-6) 0 0;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius);
  border: 1px dashed var(--gray-200);
}

.st-info__row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
}

.st-info dt { color: var(--text-muted); }

.st-info dd {
  margin: 0;
  font-weight: var(--fw-bold);
  text-align: end;
  overflow-wrap: anywhere;
}

/* Verdict */
.st-verdict { margin-top: var(--space-6); }

.st-verdict__title,
.st-history__title {
  font-size: var(--text-lg);
  margin: 0 0 var(--space-3);
}

.st-verdict__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.st-verdict__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--gray-100);
  font-size: var(--text-sm);
}

.st-verdict__badge {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
}

.st-verdict__item.is-ok .st-verdict__badge { background: rgba(16, 185, 129, 0.15); color: #047857; }
.st-verdict__item.is-no .st-verdict__badge { background: rgba(227, 25, 31, 0.1); color: var(--red-text); }

.st-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* History */
.st-history { margin-top: var(--space-8); }

.st-history__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}

.st-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--red-text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
  text-decoration: underline;
}

.st-history__note,
.st-note {
  margin: var(--space-3) 0 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.st-note { margin-top: var(--space-6); }

/* Tables */
.st-table-wrap { overflow-x: auto; }

.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.st-table th,
.st-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--gray-200);
  text-align: start;
}

.st-table thead th {
  background: var(--brand-black);
  color: var(--white);
  font-weight: var(--fw-bold);
}

.st-table td { font-variant-numeric: tabular-nums; }

.st-table--needs {
  max-width: 820px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.st-table--needs tbody th { font-weight: var(--fw-medium); }

/* Explainer */
.st-explain-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}

.st-explain {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--yellow);
}

.st-explain h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.st-explain p {
  margin: 0;
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

/* Tips */
.st-tips {
  max-width: 820px;
  margin: var(--space-12) auto 0;
}

.st-tips__title { font-size: var(--text-xl); }

.st-tips__list {
  margin: var(--space-3) 0 0;
  padding-inline-start: 1.4em;
  line-height: var(--leading-relaxed);
}

/* FAQ */
.st-faq {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: var(--space-3);
}

.st-faq__item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5);
}

.st-faq__item summary {
  cursor: pointer;
  font-weight: var(--fw-bold);
}

.st-faq__item p {
  margin: var(--space-3) 0 0;
  color: var(--text-muted);
  line-height: var(--leading-normal);
}

/* CTA */
.st-cta {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-8);
  text-align: center;
  border-radius: var(--radius-xl);
  background: var(--brand-black);
  color: var(--white);
}

.st-cta h2 {
  margin: 0 0 var(--space-3);
  color: var(--white);
}

.st-cta p {
  margin: 0 auto var(--space-6);
  max-width: 560px;
  opacity: 0.85;
}

.st-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

.st-cta .btn--outline {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 860px) {
  .st-explain-grid { grid-template-columns: repeat(2, 1fr); }
  .st-verdict__list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .st-card { padding: var(--space-5); border-radius: var(--radius-lg); }
  .st-metrics { grid-template-columns: repeat(2, 1fr); }
  .st-info { grid-template-columns: 1fr; }
  .st-explain-grid,
  .st-verdict__list { grid-template-columns: 1fr; }
  .st-cta { padding: var(--space-8) var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
  .st-gauge__fill,
  .st-metric { transition: none; }
}
