:root {
  --speedtest-navy: #15344a;
  --speedtest-blue: #4ba7dc;
  --speedtest-blue-dark: #2584bb;
  --speedtest-ink: #243746;
  --speedtest-muted: #627583;
  --speedtest-line: #dce7ed;
  --speedtest-surface: #ffffff;
  --speedtest-wash: #f3f8fb;
  --speedtest-good: #1f8a63;
}

.speedtest-page {
  background: var(--speedtest-wash);
  color: var(--speedtest-ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.speedtest-shell {
  box-sizing: border-box;
  margin: 0 auto;
  max-width: 1180px;
  padding-left: 24px;
  padding-right: 24px;
  width: 100%;
}

.speedtest-hero {
  background:
    radial-gradient(circle at 82% 20%, rgba(91, 181, 229, 0.24), transparent 28%),
    linear-gradient(135deg, #112f43 0%, #1e5674 100%);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.speedtest-hero .speedtest-shell {
  align-items: center;
  display: flex;
  gap: 36px;
  justify-content: space-between;
  min-height: 255px;
  padding-bottom: 48px;
  padding-top: 48px;
}

.speedtest-hero__copy {
  max-width: 700px;
}

.speedtest-kicker,
.speedtest-eyebrow {
  color: var(--speedtest-blue-dark);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.speedtest-kicker {
  color: #8fd2f4;
}

.speedtest-hero h1 {
  color: #fff;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 16px;
}

.speedtest-hero p {
  color: #dcecf5;
  font-size: 18px;
  margin: 0;
  max-width: 650px;
}

.speedtest-hero__actions {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  flex: 0 0 225px;
  gap: 10px;
}

.speedtest-button {
  appearance: none;
  background: var(--speedtest-blue);
  border: 1px solid var(--speedtest-blue);
  border-radius: 7px;
  box-shadow: none;
  color: #102c3f;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  min-height: 44px;
  padding: 10px 17px;
  text-align: center;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.speedtest-button:hover {
  background: #72bee7;
  border-color: #72bee7;
  transform: translateY(-1px);
}

.speedtest-button:focus-visible {
  outline: 3px solid rgba(75, 167, 220, 0.45);
  outline-offset: 3px;
}

.speedtest-button--secondary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.44);
  color: #fff;
}

.speedtest-button--secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.speedtest-button--outline {
  background: transparent;
  color: var(--speedtest-blue-dark);
  flex: 0 0 auto;
}

.speedtest-button--outline:hover {
  color: #102c3f;
}

.speedtest-action-status {
  color: #dcecf5;
  font-size: 12px;
  min-height: 18px;
  text-align: center;
}

.speedtest-content {
  padding-bottom: 74px;
  padding-top: 54px;
}

.speedtest-section-heading {
  align-items: end;
  display: flex;
  gap: 32px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.speedtest-section-heading h2,
.precise-location h3 {
  color: var(--speedtest-navy);
  font-size: 28px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}

.speedtest-section-heading > p {
  color: var(--speedtest-muted);
  font-size: 14px;
  margin: 0;
  max-width: 480px;
}

.speedtest-section-heading--compact {
  margin-bottom: 25px;
}

.diagnostic-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.diagnostic-card {
  align-items: flex-start;
  background: var(--speedtest-surface);
  border: 1px solid var(--speedtest-line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(24, 61, 83, 0.05);
  display: flex;
  gap: 14px;
  min-height: 118px;
  padding: 20px;
}

.diagnostic-card--wide {
  grid-column: span 2;
}

.diagnostic-card__icon {
  align-items: center;
  background: #e8f5fc;
  border-radius: 7px;
  color: var(--speedtest-blue-dark);
  display: flex;
  flex: 0 0 40px;
  font-size: 11px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  letter-spacing: 0.03em;
}

.diagnostic-card__body {
  min-width: 0;
}

.diagnostic-card__label,
.diagnostic-card__detail {
  color: var(--speedtest-muted);
  display: block;
  font-size: 12px;
}

.diagnostic-card__label {
  font-weight: 700;
  margin-bottom: 5px;
}

.diagnostic-card__value {
  color: var(--speedtest-navy);
  display: block;
  font-size: 18px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.diagnostic-card__detail {
  margin-top: 5px;
}

.diagnostic-card__detail #network-local-time:not(:empty)::before {
  content: " · ";
}

.ip-geolocation-attribution--speedtest {
  align-items: center;
  color: #7a8a95;
  display: flex;
  font-size: 10px;
  gap: 4px;
  margin-top: 8px;
}

.ip-geolocation-attribution--speedtest .ip-geolocation-attribution__logo {
  height: auto;
  max-width: 54px;
}

.precise-location {
  align-items: center;
  background: #e7f4fa;
  border: 1px solid #cae5f2;
  border-radius: 10px;
  display: flex;
  gap: 32px;
  justify-content: space-between;
  margin-top: 14px;
  padding: 22px 24px;
}

.precise-location__copy {
  max-width: 760px;
}

.precise-location h3 {
  font-size: 20px;
  margin-bottom: 5px;
}

.precise-location p {
  color: var(--speedtest-muted);
  font-size: 13px;
  margin: 0;
}

.precise-location__result {
  color: var(--speedtest-navy);
  font-size: 13px;
  font-weight: 700;
  margin-top: 7px;
  min-height: 0;
}

.speedtest-panel {
  background: var(--speedtest-surface);
  border: 1px solid var(--speedtest-line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(24, 61, 83, 0.06);
  margin-top: 34px;
  padding: 30px;
}

.speedtest-embed {
  background: #050505;
  border-radius: 9px;
  min-height: 520px;
  overflow: hidden;
  position: relative;
}

.speedtest-embed__placeholder {
  align-items: center;
  background:
    radial-gradient(circle at 50% 25%, rgba(75, 167, 220, 0.2), transparent 31%),
    #07141d;
  color: #fff;
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  padding: 30px;
  position: absolute;
  text-align: center;
}

.speedtest-embed__gauge {
  align-items: center;
  border: 8px solid rgba(75, 167, 220, 0.24);
  border-radius: 50%;
  color: #83cef3;
  display: flex;
  font-size: 24px;
  font-weight: 800;
  height: 105px;
  justify-content: center;
  margin-bottom: 20px;
  position: relative;
  width: 105px;
}

.speedtest-embed__gauge::after {
  background: var(--speedtest-blue);
  border-radius: 4px;
  bottom: 50%;
  content: "";
  height: 5px;
  left: 50%;
  position: absolute;
  transform: rotate(-42deg);
  transform-origin: left center;
  width: 41px;
}

.speedtest-embed__placeholder h3 {
  color: #fff;
  font-size: 25px;
  margin: 0 0 7px;
}

.speedtest-embed__placeholder p {
  color: #bdd1dc;
  font-size: 13px;
  margin: 0 0 20px;
}

.speedtest-embed iframe {
  border: 0;
  display: none;
  height: 620px;
  width: 100%;
}

.speedtest-embed.is-loaded {
  min-height: 620px;
}

.speedtest-embed.is-loaded .speedtest-embed__placeholder {
  display: none;
}

.speedtest-embed.is-loaded iframe {
  display: block;
}

.speedtest-provider {
  color: var(--speedtest-muted);
  font-size: 11px;
  margin: 10px 0 0;
  text-align: right;
}

.speedtest-provider a {
  color: var(--speedtest-blue-dark);
}

.quality-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.quality-card {
  background: var(--speedtest-wash);
  border-radius: 8px;
  padding: 18px;
}

.quality-card__metric {
  color: var(--speedtest-blue-dark);
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.quality-card strong {
  color: var(--speedtest-navy);
  font-size: 19px;
}

.quality-card p {
  color: var(--speedtest-muted);
  font-size: 12px;
  margin: 7px 0 0;
}

.speedtest-technical {
  border-top: 1px solid var(--speedtest-line);
  margin-top: 26px;
  padding-top: 18px;
}

.speedtest-technical summary {
  color: var(--speedtest-blue-dark);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.speedtest-technical dl {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0 0;
}

.speedtest-technical dl > div {
  background: var(--speedtest-wash);
  border-radius: 7px;
  min-width: 0;
  padding: 13px;
}

.speedtest-technical dt {
  color: var(--speedtest-muted);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
}

.speedtest-technical dd {
  color: var(--speedtest-navy);
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .diagnostic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diagnostic-card--wide {
    grid-column: span 1;
  }

  .quality-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .speedtest-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .speedtest-hero .speedtest-shell,
  .speedtest-section-heading,
  .precise-location {
    align-items: stretch;
    flex-direction: column;
  }

  .speedtest-hero .speedtest-shell {
    gap: 26px;
  }

  .speedtest-hero__actions {
    flex-basis: auto;
  }

  .speedtest-section-heading {
    gap: 10px;
  }

  .diagnostic-grid,
  .quality-grid,
  .speedtest-technical dl {
    grid-template-columns: 1fr;
  }

  .speedtest-panel {
    margin-top: 24px;
    padding: 20px 15px;
  }

  .speedtest-embed {
    min-height: 520px;
  }

  .speedtest-embed iframe {
    height: 560px;
  }

  .speedtest-embed.is-loaded {
    min-height: 560px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .speedtest-button {
    transition: none;
  }
}
