/* WIMIP speed test: one structure, three deliberately different visual themes. */
.wimip .wimip-speed {
  display: grid;
  gap: clamp(18px, 3vw, 30px);
  width: 100%;
}

.wimip .wimip-speed-hero {
  max-width: 780px;
}

.wimip .wimip-speed-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 4.5vw, 48px);
  line-height: 1.04;
}

.wimip .wimip-speed-hero > p:last-child {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
}

.wimip .wimip-speed-eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.wimip .wimip-speed-console {
  display: grid;
  gap: 22px;
  padding: clamp(16px, 3vw, 26px);
}

.wimip .wimip-speed-toolbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 34px;
}

.wimip .wimip-speed-toolbar .muted {
  justify-self: end;
  overflow-wrap: anywhere;
  text-align: right;
}

.wimip .wimip-speed-lamp {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.wimip .wimip-speed-layout {
  display: grid;
  grid-template-columns: minmax(260px, .85fr) minmax(300px, 1.15fr);
  align-items: center;
  gap: clamp(22px, 5vw, 58px);
}

.wimip .wimip-speed-meter {
  position: relative;
  width: min(100%, 430px);
  margin-inline: auto;
  aspect-ratio: 11 / 7;
}

.wimip .wimip-speed-dial {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.wimip .wimip-speed-track,
.wimip .wimip-speed-value {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.wimip .wimip-speed-track {
  stroke: rgba(127, 127, 127, .22);
}

.wimip .wimip-speed-value {
  stroke: var(--accent);
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - (var(--speed-progress) * 1));
  transition: stroke-dashoffset .24s ease;
}

.wimip .wimip-speed-reading {
  position: absolute;
  inset: 35% 0 auto;
  display: grid;
  justify-items: center;
  line-height: 1;
}

.wimip .wimip-speed-reading strong {
  max-width: 100%;
  font-size: clamp(42px, 8vw, 82px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.05em;
}

.wimip .wimip-speed-reading > span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.wimip .wimip-speed-reading small {
  margin-top: 13px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
}

.wimip .wimip-speed-metrics {
  display: grid;
  gap: 10px;
}

.wimip .wimip-speed-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px;
}

.wimip .wimip-speed-metric > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wimip .wimip-speed-metric strong {
  font-size: clamp(22px, 3vw, 32px);
  font-variant-numeric: tabular-nums;
}

.wimip .wimip-speed-metric small {
  color: var(--muted);
  font-size: 12px;
}

.wimip .wimip-speed-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .7fr);
  gap: 18px 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(127, 127, 127, .24);
}

.wimip .wimip-speed-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.wimip .wimip-speed-form legend,
.wimip .wimip-speed-expected > span:first-child {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
}

.wimip .wimip-speed-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wimip .wimip-speed-options label {
  position: relative;
  cursor: pointer;
}

.wimip .wimip-speed-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wimip .wimip-speed-options span {
  display: block;
  padding: 9px 12px;
  border: 1px solid rgba(127, 127, 127, .35);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.wimip .wimip-speed-options input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 2px;
}

.wimip .wimip-speed-options input:checked + span {
  border-color: var(--accent);
  color: var(--accent);
}

.wimip .wimip-speed-expected small {
  color: var(--muted);
  font-weight: 400;
}

.wimip .wimip-speed-input-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.wimip .wimip-speed-input-wrap input {
  width: min(160px, 100%);
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid rgba(127, 127, 127, .4);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.wimip .wimip-speed-consent {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  font-size: 12px;
  line-height: 1.5;
}

.wimip .wimip-speed-consent input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.wimip .wimip-speed-consent a {
  color: var(--accent);
}

.wimip .wimip-speed-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wimip .wimip-speed-actions .muted {
  font-size: 12px;
}

.wimip .wimip-speed-start:disabled {
  cursor: not-allowed;
  filter: grayscale(.65);
  opacity: .48;
}

.wimip .wimip-speed-result {
  padding: 17px 18px;
  border-left: 4px solid var(--accent);
}

.wimip .wimip-speed-result h2 {
  margin: 0 0 6px;
  font-size: clamp(18px, 2.6vw, 24px);
}

.wimip .wimip-speed-result p {
  margin: 0;
  color: var(--muted);
}

.wimip .wimip-speed-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.wimip .wimip-speed-footnote,
.wimip .wimip-speed-notice {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Neon: luminous instrument panel. */
.wimip[data-theme="neon"] .wimip-speed-console {
  background:
    radial-gradient(circle at 25% 35%, rgba(51, 231, 255, .08), transparent 34%),
    linear-gradient(145deg, rgba(23, 21, 40, .94), rgba(10, 9, 21, .94));
  border: 1px solid rgba(255, 255, 255, .13);
  box-shadow: 0 20px 70px rgba(0, 0, 0, .42), 0 0 34px rgba(51, 231, 255, .07);
}

.wimip[data-theme="neon"] .wimip-speed-lamp {
  box-shadow: 0 0 6px var(--accent), 0 0 18px var(--accent);
}

.wimip[data-theme="neon"] .wimip-speed-value {
  filter: drop-shadow(0 0 6px rgba(51, 231, 255, .75));
}

.wimip[data-theme="neon"] .wimip-speed-reading strong {
  color: #fff;
  text-shadow: 0 0 10px var(--accent), 0 0 28px rgba(255, 77, 219, .65);
}

.wimip[data-theme="neon"] .wimip-speed-metric,
.wimip[data-theme="neon"] .wimip-speed-consent,
.wimip[data-theme="neon"] .wimip-speed-result {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 13px;
  background: rgba(10, 9, 22, .62);
}

.wimip[data-theme="neon"] .wimip-speed-result {
  border-left: 4px solid var(--accent);
}

/* Windows 95: dialog, status bar and progress styling. */
.wimip[data-theme="win95"] .wimip-speed-eyebrow {
  color: #000080;
}

.wimip[data-theme="win95"] .wimip-speed-console {
  padding: 4px;
  border: 2px solid #fff;
  border-right-color: #000;
  border-bottom-color: #000;
  border-radius: 0;
  background: #c0c0c0;
  box-shadow: inset 1px 1px 0 #dfdfdf, inset -1px -1px 0 #808080;
}

.wimip[data-theme="win95"] .wimip-speed-toolbar {
  min-height: 36px;
  padding: 6px 8px;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
}

.wimip[data-theme="win95"] .wimip-speed-toolbar .muted {
  color: #fff;
}

.wimip[data-theme="win95"] .wimip-speed-lamp {
  border: 1px solid #fff;
  border-radius: 0;
  background: #00ff00;
}

.wimip[data-theme="win95"] .wimip-speed-layout,
.wimip[data-theme="win95"] .wimip-speed-form,
.wimip[data-theme="win95"] .wimip-speed-result {
  margin: 8px;
}

.wimip[data-theme="win95"] .wimip-speed-track {
  stroke: #808080;
}

.wimip[data-theme="win95"] .wimip-speed-value {
  stroke: #000080;
  stroke-linecap: square;
}

.wimip[data-theme="win95"] .wimip-speed-reading strong,
.wimip[data-theme="win95"] .wimip-speed-reading small {
  color: #000080;
  text-shadow: none;
}

.wimip[data-theme="win95"] .wimip-speed-metric,
.wimip[data-theme="win95"] .wimip-speed-consent,
.wimip[data-theme="win95"] .wimip-speed-result,
.wimip[data-theme="win95"] .wimip-speed-options span,
.wimip[data-theme="win95"] .wimip-speed-input-wrap input {
  border: 2px solid #808080;
  border-right-color: #fff;
  border-bottom-color: #fff;
  border-radius: 0;
  background: #efefef;
  color: #000;
  box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #dfdfdf;
}

.wimip[data-theme="win95"] .wimip-speed-options input:checked + span {
  outline: 1px dotted #000;
  outline-offset: -5px;
  background: #d8d8d8;
  color: #000;
}

.wimip[data-theme="win95"] .wimip-speed-result {
  border-left-color: #000080;
}

/* MS-DOS: textual benchmark with strict terminal geometry. */
.wimip[data-theme="msdos"] .wimip-speed-hero h1::before {
  content: "C:\\NET\\> ";
  color: var(--accent);
}

.wimip[data-theme="msdos"] .wimip-speed-console {
  border: 1px solid var(--accent);
  border-radius: 0;
  background: #000;
  box-shadow: none;
}

.wimip[data-theme="msdos"] .wimip-speed-toolbar {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--accent);
  color: var(--accent);
}

.wimip[data-theme="msdos"] .wimip-speed-toolbar strong::before {
  content: "STATUS: ";
}

.wimip[data-theme="msdos"] .wimip-speed-lamp {
  width: 12px;
  height: 12px;
  border-radius: 0;
  background: var(--accent);
  box-shadow: none;
}

.wimip[data-theme="msdos"] .wimip-speed-track {
  stroke: #063;
  stroke-dasharray: 2 3;
  stroke-linecap: butt;
}

.wimip[data-theme="msdos"] .wimip-speed-value {
  stroke: var(--accent);
  stroke-linecap: butt;
}

.wimip[data-theme="msdos"] .wimip-speed-reading strong,
.wimip[data-theme="msdos"] .wimip-speed-reading small {
  color: var(--accent);
  text-shadow: none;
}

.wimip[data-theme="msdos"] .wimip-speed-reading small::after {
  content: "_";
  animation: wimip-speed-cursor 1s steps(2, jump-none) infinite;
}

.wimip[data-theme="msdos"] .wimip-speed-metric,
.wimip[data-theme="msdos"] .wimip-speed-consent,
.wimip[data-theme="msdos"] .wimip-speed-result,
.wimip[data-theme="msdos"] .wimip-speed-options span,
.wimip[data-theme="msdos"] .wimip-speed-input-wrap input {
  border: 1px dashed var(--accent);
  border-radius: 0;
  background: #000;
  color: var(--text);
  box-shadow: none;
}

.wimip[data-theme="msdos"] .wimip-speed-metric::before {
  content: ">";
  color: var(--accent);
}

.wimip[data-theme="msdos"] .wimip-speed-metric > span {
  margin-right: auto;
}

.wimip[data-theme="msdos"] .wimip-speed-options input:checked + span {
  background: var(--accent);
  color: #000;
}

.wimip[data-theme="msdos"] .wimip-speed-input-wrap input {
  color: var(--accent);
}

@keyframes wimip-speed-cursor {
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wimip .wimip-speed-value { transition: none; }
  .wimip[data-theme="msdos"] .wimip-speed-reading small::after { animation: none; }
}

@media (max-width: 760px) {
  .wimip .wimip-speed-layout,
  .wimip .wimip-speed-form {
    grid-template-columns: 1fr;
  }

  .wimip .wimip-speed-toolbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .wimip .wimip-speed-toolbar .muted {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }

  .wimip .wimip-speed-meter {
    max-width: 330px;
  }

  .wimip .wimip-speed-consent,
  .wimip .wimip-speed-actions {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .wimip-speed-template .wimip-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 11px;
  }

  .wimip-speed-template .wimip-header > .row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
  }

  .wimip-speed-template .wimip-header > .row .btn {
    justify-content: center;
    text-align: center;
  }

  .wimip .wimip-speed-console {
    gap: 16px;
    padding: 13px;
  }

  /* Let visitors configure and start the test before showing the large dial. */
  .wimip .wimip-speed-toolbar { order: 1; }
  .wimip .wimip-speed-form { order: 2; }
  .wimip .wimip-speed-layout { order: 3; }
  .wimip .wimip-speed-result { order: 4; }

  .wimip[data-theme="win95"] .wimip-speed-console {
    padding: 4px;
  }

  .wimip .wimip-speed-reading strong {
    font-size: 42px;
  }

  .wimip .wimip-speed-metric {
    padding: 13px;
  }

  .wimip .wimip-speed-options {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wimip .wimip-speed-options span {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .wimip .wimip-speed-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .wimip .wimip-speed-actions .btn {
    justify-content: center;
    min-height: 44px;
    width: 100%;
  }

  .wimip .wimip-speed-result-actions .btn {
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-align: center;
  }
}
