:root {
      --panel: rgba(255,255,255,0.08);
      --panel-2: rgba(255,255,255,0.12);
      --text: #f4f8ff;
      --muted: #9fb1c8;
      --good: #30d158;
      --warn: #ffd60a;
      --bad: #ff453a;
      --accent: #59c2ff;
      --accent-2: #ad7bff;
      --shadow: 0 24px 80px rgba(0,0,0,0.35);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      min-height: 100vh;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text);
      background:
        radial-gradient(circle at top left, rgba(89, 194, 255, 0.24), transparent 32rem),
        radial-gradient(circle at bottom right, rgba(173, 123, 255, 0.22), transparent 34rem),
        linear-gradient(135deg, #070d18 0%, #0b1526 45%, #111827 100%);
      padding: 34px;
    }

    .wrap { max-width: 1240px; margin: 0 auto; }

    .site-nav {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: flex-end;
      margin-top: 12px;
      color: var(--muted);
      font-size: .95rem;
    }

    .site-nav a,
    .footer-links a {
      color: var(--accent);
      text-decoration: none;
      font-weight: 750;
    }

    .site-nav a:hover,
    .footer-links a:hover {
      text-decoration: underline;
    }

    footer {
      color: var(--muted);
      text-align: center;
      padding: 24px 0 0;
    }

    .footer-links {
      display: flex;
      gap: 12px;
      flex-wrap: wrap;
      justify-content: center;
      margin-bottom: 10px;
      font-size: .94rem;
    }

    header {
      display: flex;
      justify-content: space-between;
      gap: 24px;
      align-items: flex-start;
      margin-bottom: 26px;
    }

    h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 4.2rem); line-height: 0.95; letter-spacing: -0.055em; }
    .lead { margin: 0; color: var(--muted); font-size: 1.05rem; max-width: 760px; line-height: 1.55; }

    .status-pill {
      border: 1px solid rgba(255,255,255,0.12);
      background: rgba(255,255,255,0.08);
      backdrop-filter: blur(18px);
      border-radius: 999px;
      padding: 10px 15px;
      color: var(--muted);
      white-space: nowrap;
      display: inline-flex;
      gap: 9px;
      align-items: center;
    }

    .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 16px var(--warn); }
    .dot.ready { background: var(--good); box-shadow: 0 0 16px var(--good); }
    .dot.busy { background: var(--accent); box-shadow: 0 0 16px var(--accent); }
    .dot.error { background: var(--bad); box-shadow: 0 0 16px var(--bad); }

    .grid { display: grid; grid-template-columns: 1fr; gap: 22px; }
    .card {
      background: var(--panel);
      border: 1px solid rgba(255,255,255,0.12);
      box-shadow: var(--shadow);
      border-radius: 28px;
      overflow: hidden;
      backdrop-filter: blur(18px);
    }

    .main-card { padding: clamp(20px, 4vw, 34px); }
    .download-hero {
      display: grid;
      grid-template-columns: minmax(260px, 0.9fr) minmax(260px, 1.1fr);
      gap: 22px;
      align-items: center;
      margin-bottom: 22px;
    }
    .meter {
      width: min(380px, 100%);
      aspect-ratio: 1;
      margin: 0 auto;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: conic-gradient(from 210deg, var(--accent) var(--progress, 0%), rgba(255,255,255,0.11) 0);
      position: relative;
    }
    .meter::before { content: ""; position: absolute; inset: 18px; border-radius: 50%; background: #0b1424; border: 1px solid rgba(255,255,255,0.1); }
    .meter-inner { position: relative; text-align: center; z-index: 1; padding: 12px; }
    .hero-kicker { color: var(--accent); font-weight: 900; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; margin-bottom: 8px; }
    .metric { font-size: clamp(4.2rem, 10vw, 7.6rem); font-weight: 900; letter-spacing: -0.09em; line-height: .88; }
    .unit { color: var(--muted); font-size: 1.05rem; margin-top: 8px; }
    .gauge-upload { margin: 16px auto 0; width: min(230px, 92%); padding: 10px 13px; border-radius: 999px; background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.12); display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
    .gauge-upload span:first-child { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 850; }
    .gauge-upload strong { font-size: 1.05rem; }
    .phase { color: var(--accent); margin-top: 14px; min-height: 24px; font-weight: 800; }
    .hero-copy h2 { margin: 0; font-size: clamp(2rem, 4vw, 4.4rem); letter-spacing: -0.06em; line-height: .95; }
    .hero-copy p { color: var(--muted); line-height: 1.55; margin: 14px 0 0; }
    .headline-summary { margin-top: 16px; padding: 14px 16px; border-radius: 18px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1); color: var(--text); font-weight: 750; }

    .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
    button {
      border: 0;
      border-radius: 16px;
      padding: 14px 20px;
      font-size: 1rem;
      font-weight: 800;
      cursor: pointer;
      color: #06101d;
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      box-shadow: 0 14px 38px rgba(89,194,255,0.22);
      transition: transform .18s ease, opacity .18s ease;
    }
    button:hover { transform: translateY(-1px); }
    button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
    .ghost { background: rgba(255,255,255,0.1); color: var(--text); box-shadow: none; border: 1px solid rgba(255,255,255,0.12); }

    .results { display: grid; grid-template-columns: 1.2fr repeat(4, 1fr); gap: 12px; margin-top: 22px; }
    .result-box { background: var(--panel-2); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 16px; min-width: 0; }
    .result-box.primary { background: linear-gradient(135deg, rgba(89,194,255,0.22), rgba(173,123,255,0.18)); border-color: rgba(89,194,255,0.36); }
    .result-box.primary .value { font-size: clamp(1.8rem, 4vw, 2.8rem); }
    .label { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
    .value { font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 800; margin-top: 5px; letter-spacing: -0.04em; overflow-wrap: anywhere; }
    .small { color: var(--muted); font-size: .86rem; margin-top: 6px; }

    .speed-insights {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 12px;
      margin-top: 16px;
    }
    .insight-box {
      background: rgba(0,0,0,0.16);
      border: 1px solid rgba(255,255,255,0.1);
      border-radius: 20px;
      padding: 16px;
      min-width: 0;
    }
    .insight-title {
      color: var(--muted);
      font-size: .78rem;
      text-transform: uppercase;
      letter-spacing: .08em;
      margin-bottom: 8px;
      font-weight: 850;
    }
    .insight-main {
      font-size: clamp(1.2rem, 2vw, 1.65rem);
      font-weight: 900;
      letter-spacing: -0.04em;
      overflow-wrap: anywhere;
    }
    .insight-sub {
      color: var(--muted);
      line-height: 1.45;
      font-size: .88rem;
      margin-top: 6px;
    }

    .rating-card { margin-top: 16px; background: rgba(0,0,0,0.16); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; padding: 16px; }
    .rating-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
    .badge { padding: 7px 11px; border-radius: 999px; font-weight: 900; background: rgba(255,255,255,0.12); }
    .use-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .use { padding: 11px; border-radius: 14px; background: rgba(255,255,255,0.08); color: var(--muted); font-size: .9rem; }
    .use strong { display: block; color: var(--text); margin-bottom: 4px; }

    .progress-wrap { margin-top: 18px; display: grid; gap: 10px; }
    .progress-row { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
    .bar { height: 10px; background: rgba(255,255,255,0.10); border-radius: 999px; overflow: hidden; }
    .bar span { display: block; width: 0%; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .16s linear; }

    .chart-wrap { margin-top: 18px; background: rgba(0,0,0,0.18); border-radius: 18px; padding: 12px; border: 1px solid rgba(255,255,255,0.08); }
    canvas { width: 100%; height: 150px; display: block; }

    .side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
    .info-card { padding: 24px; }
    .info-card h2 { margin: 0 0 16px; letter-spacing: -0.03em; }
    .info-list { display: grid; gap: 11px; }
    .row { display: grid; grid-template-columns: 132px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .row:last-child { border-bottom: 0; }
    .key { color: var(--muted); }
    .val { overflow-wrap: anywhere; }

    .warning { margin-top: 14px; display: none; border: 1px solid rgba(255,214,10,0.32); background: rgba(255,214,10,0.08); border-radius: 16px; padding: 12px; color: #ffe783; line-height: 1.45; }
    .log { max-height: 160px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .84rem; color: var(--muted); background: rgba(0,0,0,0.18); border-radius: 16px; padding: 14px; white-space: pre-wrap; }
    .notice { color: var(--muted); line-height: 1.5; font-size: .93rem; margin-top: 16px; }

    .support-card {
      margin-top: 24px;
      margin-bottom: 20px;
      padding: 20px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 20px;
      border-radius: 20px;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.12);
      box-shadow: 0 14px 38px rgba(89,194,255,0.10);
    }

    .support-content { flex: 1; }

    .support-title {
      font-size: 1.1rem;
      font-weight: 850;
      margin-bottom: 6px;
      letter-spacing: -0.02em;
    }

    .support-text {
      color: var(--muted);
      line-height: 1.5;
      font-size: .95rem;
    }

    .support-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      white-space: nowrap;
      padding: 14px 22px;
      border-radius: 16px;
      font-weight: 900;
      text-decoration: none;
      color: var(--text);
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      box-shadow: 0 14px 38px rgba(89,194,255,0.22);
      text-shadow: 0 1px 2px rgba(0,0,0,.4);
      transition: transform .18s ease, opacity .18s ease;
    }

    .support-btn:hover {
      transform: translateY(-2px);
      color: #ffffff;
      text-decoration: none;
    }

    .support-btn:visited {
      color: var(--text);
    }

    .history { display: grid; gap: 10px; }
    .history-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px; border-radius: 16px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
    .history-item small { color: var(--muted); }

    .faq-full-width {
      grid-column: 1 / -1;
      width: 100%;
    }


    @media (max-width: 1040px) { .download-hero { grid-template-columns: 1fr; text-align: center; } .results { grid-template-columns: repeat(2, 1fr); } .use-grid { grid-template-columns: repeat(2, 1fr); } .speed-insights { grid-template-columns: 1fr; } }
    @media (max-width: 870px) {
      body { padding: 20px; }
      header { display: block; }
      .site-nav { justify-content: flex-start; }
      .status-pill { margin-top: 18px; }
      .grid { grid-template-columns: 1fr; }
      .side { grid-template-columns: 1fr; }
      .results { grid-template-columns: 1fr; }
      .row { grid-template-columns: 1fr; gap: 4px; }
      button { width: 100%; }
      .progress-row { grid-template-columns: 1fr; }
      .use-grid { grid-template-columns: 1fr; }
      .speed-insights { grid-template-columns: 1fr; }
      .support-card { flex-direction: column; text-align: center; align-items: stretch; }
      .support-btn { width: 100%; }
    }


/* Shared content page styles */
.breadcrumbs {
  color: var(--muted);
  font-size: .95rem;
  margin: 0 0 22px;
}
.breadcrumbs a,
.content-card a,
.footer-links a,
.site-nav a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumbs a:hover,
.content-card a:hover,
.footer-links a:hover,
.site-nav a:hover {
  text-decoration: underline;
}
.content-card {
  padding: clamp(22px, 4vw, 38px);
}
.content-card h2 {
  margin: 34px 0 12px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: -0.035em;
}
.content-card h3 {
  margin: 24px 0 8px;
  font-size: 1.15rem;
}
.content-card p,
.content-card li {
  color: var(--muted);
  line-height: 1.65;
  font-size: 1.02rem;
}
.content-card ul {
  padding-left: 1.25rem;
}
.page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 16px;
  font-weight: 900;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 38px rgba(89,194,255,0.22);
  text-shadow: 0 1px 2px rgba(0,0,0,.38);
  transition: transform .18s ease, opacity .18s ease;
}

.page-btn:hover {
  transform: translateY(-2px);
  color: #ffffff;
  text-decoration: none;
}

.page-btn:visited {
  color: var(--text);
}

.page-btn.secondary {
  color: var(--text);
  background: rgba(255,255,255,0.10);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.12);
  text-shadow: none;
}

.page-btn.secondary:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.14);
  text-decoration: none;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.related-card {
  background: var(--panel-2);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  padding: 18px;
}
.related-card p {
  color: var(--muted);
  line-height: 1.55;
}
.page-form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
.page-form label {
  font-weight: 800;
}
.page-form input,
.page-form textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
}
.page-form textarea {
  min-height: 160px;
  resize: vertical;
}
.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}
.form-status {
  border-radius: 16px;
  padding: 14px 16px;
  margin: 18px 0;
}
.form-status.success {
  background: rgba(48,209,88,.12);
  border: 1px solid rgba(48,209,88,.32);
  color: #bfffd0;
}
.form-status.error {
  background: rgba(255,69,58,.12);
  border: 1px solid rgba(255,69,58,.32);
  color: #ffd0cc;
}
.footer-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 10px;
  font-size: .94rem;
}
@media (max-width: 760px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
  .page-btn {
    width: 100%;
  }
}



/* Homepage layout safety */
main.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

main.grid > .main-card {
  width: 100%;
}


/* Global recent results */
.global-history-item small {
  line-height: 1.45;
}

.history-item strong {
  word-break: break-word;
}


/* Layout naming cleanup / safety
   - .grid is reserved for the homepage speed-test layout.
   - .related-grid is reserved for related article/provider cards only.
*/
main.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

main.grid > .main-card,
main.grid > .side {
  width: 100%;
}

.provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.provider-card {
  background: var(--panel-2);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 20px;
  padding: 18px;
}

.provider-card p {
  color: var(--muted);
  line-height: 1.55;
}

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

/* Dark theme card links */
.card a,
.info-card a,
.faq-full-width a,
.content-card a,
.related-card a,
.provider-card a,
.notice a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

.card a:hover,
.info-card a:hover,
.faq-full-width a:hover,
.content-card a:hover,
.related-card a:hover,
.provider-card a:hover,
.notice a:hover {
  color: #87d8ff;
  text-decoration: underline;
}

.card a:visited,
.info-card a:visited,
.faq-full-width a:visited,
.content-card a:visited,
.related-card a:visited,
.provider-card a:visited,
.notice a:visited {
  color: #8fd6ff;
}

/* Keep CTA buttons readable on guide/provider pages */
.card a.page-btn,
.content-card a.page-btn,
.notice a.page-btn,
.related-card a.page-btn,
.provider-card a.page-btn {
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.card a.page-btn:hover,
.content-card a.page-btn:hover,
.notice a.page-btn:hover,
.related-card a.page-btn:hover,
.provider-card a.page-btn:hover {
  color: #ffffff;
  text-decoration: none;
}

.card a.page-btn:visited,
.content-card a.page-btn:visited,
.notice a.page-btn:visited,
.related-card a.page-btn:visited,
.provider-card a.page-btn:visited {
  color: var(--text);
}

/* Keep support CTA button readable */
.card a.support-btn,
.info-card a.support-btn,
.notice a.support-btn {
  color: var(--text);
  text-decoration: none;
  font-weight: 900;
}

.card a.support-btn:hover,
.info-card a.support-btn:hover,
.notice a.support-btn:hover {
  color: #ffffff;
  text-decoration: none;
}

.card a.support-btn:visited,
.info-card a.support-btn:visited,
.notice a.support-btn:visited {
  color: var(--text);
}

/* LinkSpeed header/nav left-alignment fix
   Keeps the visible page header and menu consistently left-aligned on all pages.
   Add this near the bottom of /assets/linkspeed.css, or load this file after linkspeed.css.
*/

header {
  text-align: left;
}

header > div:first-child {
  width: 100%;
  min-width: 0;
}

header h1,
header .lead {
  text-align: left;
}

.site-nav {
  justify-content: flex-start !important;
  text-align: left;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.site-nav a {
  text-align: left;
}

/* If a page has a header status pill, keep it to the right without centering the menu */
@media (min-width: 871px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
  }
}

/* Mobile/tablet should also remain left-aligned */
@media (max-width: 870px) {
  header {
    display: block;
    text-align: left;
  }

  .site-nav {
    justify-content: flex-start !important;
  }

  .status-pill {
    margin-top: 18px;
  }
}
