:root {
  color-scheme: dark;
  --bg: #11161e;
  --card: #1a212c;
  --muted: #9ba8ba;
  --text: #f0f4fa;
  --accent: #beed78;
  --line: #303b4b;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
a {
  color: inherit;
  text-decoration: none;
}
header,
main,
footer {
  width: min(1160px, 100%);
  margin-inline: auto;
}
header {
  height: 80px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 23px;
  letter-spacing: -0.6px;
  font-weight: 600;
}
.brand-icon {
  background: var(--accent);
  color: #182112;
  border-radius: 9px;
  width: 32px;
  height: 32px;
  text-align: center;
  font-size: 27px;
}
.badge {
  font-size: 8px;
  letter-spacing: 1.2px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 6px;
  margin-left: 6px;
}
nav {
  display: flex;
  gap: 24px;
}
button {
  font: inherit;
  cursor: pointer;
}
.tool-link,
.menu-button {
  background: none;
  color: var(--muted);
  border: 0;
  padding: 8px 0;
  font-size: 12px;
}
.tool-link:hover {
  color: var(--accent);
}
.menu-button {
  display: none;
  font-size: 25px;
  padding: 8px;
}
main {
  padding: 0 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 22px;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 1.8px;
  color: var(--accent);
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
h1 {
  font-size: 34px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -1.3px;
  margin: 10px 0 0;
}
p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.intro p {
  margin: 0;
  font-size: 12px;
  text-align: right;
}
.test-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.meter-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 26px;
}
.meter-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 28px 32px;
}
.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--muted);
}
#status {
  color: var(--accent);
  letter-spacing: 0;
}
.reading {
  margin-top: 20px;
  padding: 8px 4px 10px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
#speed {
  font-size: clamp(62px, 6.6vw, 94px);
  font-weight: 450;
  line-height: 1.1;
  letter-spacing: -5px;
  font-variant-numeric: tabular-nums;
}
.unit {
  font-size: 20px;
  color: var(--muted);
}
.secondary {
  font-size: 10px;
  color: var(--muted);
  min-height: 16px;
  margin-top: 4px;
}

progress {
  display: block;
  width: 100%;
  height: 3px;
  margin: 17px 0;
  background: var(--line);
  border: 0;
  border-radius: 4px;
}
progress::-webkit-progress-bar {
  background: var(--line);
}
progress::-webkit-progress-value {
  background: var(--accent);
}
progress::-moz-progress-bar {
  background: var(--accent);
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  padding-top: 17px;
  gap: 12px;
}
.stats span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
h2 {
  font-size: 19px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.4px;
  margin: 0 0 7px;
}
.settings-card > p {
  font-size: 11px;
  margin: 0 0 19px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}
legend,
.field-label {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-bottom: 8px;
}
.size-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.size-options input {
  position: absolute;
  opacity: 0;
}
.size-options label span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 4px;
  text-align: center;
  font-size: 14px;
}
.size-options small {
  display: block;
  font-size: 8px;
  color: var(--muted);
  margin-top: 4px;
}
.size-options input:checked + span {
  border-color: var(--accent);
  background: #beed7809;
  color: var(--accent);
}
.size-options input:focus-visible + span {
  outline: 2px solid white;
  outline-offset: 3px;
}
input[type="url"],
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px;
  color: var(--text);
  font:
    11px system-ui,
    sans-serif;
}
input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.hint {
  font-size: 10px !important;
  line-height: 1.5;
}
.settings-card .hint {
  margin: 9px 0 17px;
}
#start,
#cancel,
#api-start,
#api-cancel,
.quiet {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #1b2810;
  padding: 13px 15px;
  font-size: 12px;
  font-weight: 650;
}
button:hover {
  filter: brightness(1.06);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
.quiet,
#cancel,
#api-cancel {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  margin-top: 8px;
  justify-content: center;
}
.footnote {
  border-top: 1px solid var(--line);
  margin-top: 19px;
  padding-top: 15px;
  font-size: 9px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 7px;
}
.error {
  color: #ffb7a8 !important;
  overflow-wrap: anywhere;
  font-size: 10px !important;
  margin: 9px 0 0 !important;
}
.error:empty {
  display: none;
}
footer {
  border-top: 1px solid var(--line);
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 9px;
}
dialog {
  width: min(780px, calc(100% - 32px));
  height: fit-content;
  max-height: calc(100svh - 48px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--text);
  overflow: auto;
}
dialog::backdrop {
  background: #070a10ba;
  backdrop-filter: blur(6px);
}
.dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dialog-title {
  font-size: 16px;
  font-weight: 500;
}
.icon-button {
  background: none;
  color: var(--muted);
  border: 0;
  font-size: 20px;
  padding: 2px 6px;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tabs button {
  background: none;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 12px 15px;
  font-size: 12px;
}
.tabs button[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.method {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  padding: 5px 0 15px;
}
.method > div > span {
  font-size: 10px;
  color: var(--accent);
}
h3 {
  font-size: 14px;
  font-weight: 500;
  margin: 12px 0;
}
.method p {
  font-size: 12px;
}
.api-card {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.api-card h2 {
  font-size: 20px;
  margin: 6px 0;
}
.api-card p {
  font-size: 12px;
  margin: 0;
  max-width: 68ch;
}
.api-card .eyebrow {
  display: none;
}
#api-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.7fr);
  gap: 8px 14px;
  min-width: 0;
}
#api-form .field-label {
  margin: 0;
}
#api-form label[for="api-url"] {
  grid-column: 1;
  grid-row: 1;
}
#api-url {
  grid-column: 1;
  grid-row: 2;
}
#api-form label[for="transport"] {
  grid-column: 2;
  grid-row: 1;
}
#transport {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
}
#api-start,
#api-cancel,
#api-output {
  grid-column: 1 / -1;
}
#api-start {
  margin-top: 4px;
}
#api-output {
  margin: 0;
  height: 114px;
  max-height: 114px;
}
pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--accent);
  font: 11px/1.6 monospace;
}
.terminal-panel {
  max-width: none;
}
.terminal-panel h2 {
  margin: 6px 0;
  font-size: 20px;
}
.terminal-panel > p {
  margin: 8px 0;
  font-size: 12px;
}
.terminal-panel pre {
  margin: 10px 0;
  padding: 12px 14px;
}
.install-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  margin: 16px 0 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg);
}
.install-tabs button {
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.install-tabs button[aria-pressed="true"] {
  background: var(--accent);
  color: #20300f;
}
.terminal-panel .quiet {
  padding: 10px 14px;
  margin-top: 0;
  width: auto;
}
.terminal-panel > .field-label {
  margin-top: 22px;
}
.doc-link {
  color: var(--accent);
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 761px) and (max-height: 750px) {
  header {
    height: 65px;
  }
  .intro {
    margin: 18px 0;
  }
  .meter-card,
  .settings-card {
    padding: 22px;
  }
  .reading {
    margin-top: 16px;
  }
  #speed {
    font-size: 80px;
  }

  .test-grid {
    margin-bottom: 20px;
  }
  .footnote {
    margin-top: 15px;
    padding-top: 12px;
  }
}
@media (max-width: 760px) {
  header {
    height: 66px;
    padding: 0 20px;
  }
  .badge,
  nav {
    display: none;
  }
  .menu-button {
    display: block;
  }
  main {
    padding: 0 20px;
    justify-content: flex-start;
  }
  .intro {
    margin: 25px 0 19px;
  }
  .intro p {
    display: none;
  }
  h1 {
    font-size: 27px;
    letter-spacing: -0.8px;
  }
  .test-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .meter-card,
  .settings-card {
    padding: 22px;
  }
  .card-top {
    font-size: 8px;
  }
  .reading {
    margin-top: 16px;
  }
  #speed {
    font-size: 72px;
  }

  .stats strong {
    font-size: 18px;
  }
  .settings-card .footnote {
    margin-top: 14px;
  }
  .size-options label span {
    padding: 10px;
  }
  footer {
    padding: 18px 20px;
    font-size: 8px;
    gap: 14px;
  }
  .api-card,
  .method {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .method p {
    margin-bottom: 0;
  }
  .tabs button {
    padding: 12px 8px;
    font-size: 11px;
  }
  dialog {
    padding: 19px;
  }
  dialog {
    height: fit-content;
  }
  #api-form {
    grid-template-columns: minmax(0, 1fr);
  }
  #api-form label[for="transport"],
  #transport {
    grid-column: 1;
    grid-row: auto;
  }
  #api-output {
    height: 100px;
    max-height: 100px;
  }
  .brand {
    font-size: 22px;
  }
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 24px;
}
.source-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}
.source-link:hover {
  color: var(--accent);
}
@media (max-width: 760px) {
  .header-tools {
    gap: 10px;
  }
  .source-link span {
    display: none;
  }
  .source-link {
    padding: 8px;
  }
}

/* Small, compositor-friendly cues; measurement values stay unanimated. */
button,
.source-link,
.doc-link,
.size-options label span,
input[type="url"],
select {
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    filter 160ms ease,
    opacity 160ms ease;
}
.tabs button:hover,
.icon-button:hover,
.doc-link:hover,
.source-link:focus-visible {
  color: var(--accent);
}
.size-options label:hover span {
  border-color: var(--muted);
}
.size-options label:hover input:checked + span {
  border-color: var(--accent);
}
progress::-webkit-progress-value {
  transition: width 200ms ease-out;
}
progress::-moz-progress-bar {
  transition: width 200ms ease-out;
}
dialog[open] {
  animation: toolkit-enter 180ms ease-out;
}
dialog[open]::backdrop {
  animation: backdrop-enter 180ms ease-out;
}
.meter-card:has(~ .settings-card #start:disabled) #status {
  animation: status-pulse 1.6s ease-in-out infinite;
}
@keyframes toolkit-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes backdrop-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  dialog::backdrop {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* The test action is the center of the screen; setup stays secondary. */
main {
  justify-content: center;
}
.intro {
  width: min(680px, 100%);
  margin: 18px auto 20px;
}
.intro p {
  display: none;
}
.intro h1 {
  font-size: 30px;
}
.test-grid {
  display: block;
  width: min(680px, 100%);
  margin: 0 auto 22px;
}
.meter-card {
  position: relative;
  padding: 24px 34px;
  border-radius: 22px;
  box-shadow: 0 16px 60px #0002;
}
.reading {
  justify-content: center;
  margin-top: 10px;
  padding: 6px 0;
}
#speed {
  font-size: 76px;
  letter-spacing: -4px;
}
.secondary {
  text-align: center;
  margin: 0 0 18px;
}
.launch-controls {
  width: min(380px, 100%);
  margin: 0 auto;
}
#start {
  font-size: 18px;
  min-height: 56px;
  padding: 14px 22px;
  border-radius: 12px;
}
#cancel {
  min-height: 44px;
  margin-top: 0;
}
.launch-controls:has(#start:disabled) #start {
  display: none;
}
.payload-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 0;
}
.payload-control legend {
  float: left;
  margin: 0;
  padding: 10px 0;
}
.size-options {
  width: 240px;
  gap: 5px;
}
.size-options label span {
  padding: 8px 12px;
  font-size: 12px;
}

progress {
  margin: 12px 0;
}
.stats {
  padding-top: 12px;
}
.stats strong {
  font-size: 20px;
}
.meter-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
}
.advanced-settings summary {
  cursor: pointer;
  color: var(--accent);
  padding: 6px;
}
.advanced-panel {
  position: absolute;
  z-index: 2;
  bottom: 45px;
  right: 20px;
  left: 20px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 40px #0008;
}
.meter-card:has(#start:disabled) #status {
  animation: status-pulse 1.6s ease-in-out infinite;
}
@media (max-width: 760px) {
  body {
    height: 100svh;
    min-height: 0;
  }
  header {
    height: 58px;
    flex: 0 0 58px;
    padding: 0 18px;
  }
  main {
    padding: 0 16px;
    min-height: 0;
    justify-content: center;
  }
  .intro {
    margin: 12px 0;
  }
  .intro h1 {
    font-size: 25px;
    margin-top: 7px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .test-grid {
    margin: 0 0 12px;
  }
  .meter-card {
    padding: 20px;
    border-radius: 18px;
  }
  .card-top {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
  #speed {
    font-size: 64px;
  }
  .reading {
    margin-top: 12px;
    padding: 4px 0;
  }
  .unit {
    font-size: 17px;
  }
  .secondary {
    font-size: 9px;
    margin-bottom: 16px;
  }
  #start {
    min-height: 56px;
    font-size: 17px;
  }
  .payload-control {
    gap: 8px;
    margin-top: 12px;
  }
  .payload-control legend {
    font-size: 9px;
  }
  .size-options {
    width: 210px;
  }
  .size-options label span {
    padding: 8px 6px;
  }

  .stats {
    gap: 8px;
  }
  .stats span {
    font-size: 9px;
  }
  .stats strong {
    font-size: 17px;
    margin-top: 5px;
  }
  .meter-bottom {
    margin-top: 10px;
    font-size: 9px;
  }
  footer {
    padding: 10px 18px;
    flex: 0 0 auto;
    font-size: 8px;
  }
  footer span:last-child {
    display: none;
  }
}
@media (max-width: 760px) and (max-height: 740px) {
  .meter-card {
    padding: 16px 20px;
  }
  .intro {
    margin: 8px 0 12px;
  }
  .intro h1 {
    font-size: 23px;
  }

  .secondary {
    margin-bottom: 12px;
  }
}
header {
  height: 60px;
  flex-shrink: 0;
}
footer {
  padding-block: 10px;
}
.intro {
  margin-top: 10px;
  margin-bottom: 14px;
}
.intro h1 {
  font-size: 26px;
  margin-top: 6px;
}
.meter-card {
  padding: 20px 30px;
}
.reading {
  margin-top: 6px;
  padding: 0;
}
#speed {
  font-size: 64px;
}
.secondary {
  margin-bottom: 12px;
}

.stats {
  padding-top: 10px;
}
.stats strong {
  font-size: 18px;
  margin-top: 4px;
}
.meter-bottom {
  margin-top: 8px;
}
@media (max-width: 760px) {
  header {
    height: 58px;
  }
  .meter-card {
    padding: 18px 20px;
  }
  .intro h1 {
    font-size: 23px;
  }
}

/* The gauge replaces the history chart: the measured weighted rate is the focus. */
.speed-gauge {
  position: relative;
  width: 320px;
  max-width: 100%;
  height: 180px;
  margin: 14px auto 0;
}
#gauge {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.gauge-track,
#gauge-fill {
  fill: none;
  stroke-width: 18;
  stroke-linecap: round;
}
.gauge-track {
  stroke: #343e49;
}
#gauge-fill {
  stroke: var(--accent);
  transition: stroke-dasharray 0.35s ease;
}
.gauge-ticks {
  fill: none;
  stroke: var(--card);
  stroke-width: 2;
}
.gauge-scale {
  fill: var(--muted);
  font-size: 10px;
  text-anchor: middle;
}
.speed-gauge .reading {
  position: absolute;
  inset: 70px 0 auto;
  margin: 0;
  padding: 0;
  justify-content: center;
  align-items: baseline;
  gap: 8px;
}
.speed-gauge #speed {
  font-size: 60px;
  letter-spacing: -3px;
}
.speed-gauge .unit {
  font-size: 15px;
}
.secondary {
  text-align: center;
  margin-top: -5px;
  margin-bottom: 16px;
}
progress {
  margin: 14px 0 10px;
}
@media (max-width: 760px) {
  .speed-gauge {
    width: 290px;
    height: 163px;
    margin-top: 12px;
  }
  .speed-gauge .reading {
    top: 62px;
  }
  .speed-gauge #speed {
    font-size: 54px;
  }
  .secondary {
    font-size: 8px;
    margin-bottom: 14px;
  }
  .meter-card {
    padding: 18px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  #gauge-fill {
    transition: none;
  }
}
@media (min-width: 761px) {
  .speed-gauge {
    width: 248px;
    height: 140px;
    margin-top: 10px;
  }
  .speed-gauge .reading {
    top: 54px;
  }
  .speed-gauge #speed {
    font-size: 48px;
  }
  .speed-gauge .unit {
    font-size: 13px;
  }
}

/* Design code DC-01/05/15/16/18: one action, proportional card, readable metadata. */
.intro {
  width: min(560px, 100%);
  justify-content: center;
  text-align: center;
  margin-bottom: 18px;
}
.intro .eyebrow {
  justify-content: center;
}
.test-grid {
  width: min(560px, 100%);
}
.meter-card {
  padding: 24px 28px;
  box-shadow: 0 12px 36px #0002;
}
.card-top {
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.8px;
}
#status {
  padding: 5px 8px;
  border: 1px solid #beed7833;
  border-radius: 20px;
  background: #beed7809;
  font-size: 10px;
}
.secondary {
  font-size: 11px;
  line-height: 1.5;
}
.payload-control legend {
  font-size: 11px;
}
.size-options label span {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
progress[value="0"] {
  display: none;
}
.stats {
  margin-top: 16px;
  padding-top: 14px;
}
.stats span {
  font-size: 11px;
}
.stats strong {
  font-size: 20px;
  margin-top: 6px;
}
.meter-bottom {
  margin-top: 14px;
  font-size: 11px;
}
@media (max-width: 760px) {
  .intro {
    width: 100%;
    margin: 10px 0 16px;
  }
  .meter-card {
    padding: 20px;
  }
  .speed-gauge {
    width: 260px;
    height: 146px;
  }
  .speed-gauge .reading {
    top: 57px;
  }
  .speed-gauge #speed {
    font-size: 48px;
  }
  .secondary {
    font-size: 10px;
    margin-bottom: 16px;
  }
  .payload-control {
    gap: 8px;
  }
  .payload-control legend {
    font-size: 10px;
  }
  .size-options {
    width: 204px;
  }
  .stats {
    margin-top: 14px;
    padding-top: 12px;
  }
  .stats span {
    font-size: 10px;
  }
  .stats strong {
    font-size: 18px;
  }
  .meter-bottom {
    font-size: 10px;
    margin-top: 12px;
  }
}
@media (min-width: 761px) and (max-height: 750px) {
  header {
    height: 54px;
  }
  .intro {
    margin: 10px auto 12px;
  }
  .test-grid {
    margin-bottom: 16px;
  }
  .meter-card {
    padding: 18px 26px;
  }
  .speed-gauge {
    width: 224px;
    height: 126px;
    margin-top: 8px;
  }
  .speed-gauge .reading {
    top: 47px;
  }
  .speed-gauge #speed {
    font-size: 44px;
  }
  .secondary {
    margin-bottom: 10px;
  }
  .stats {
    margin-top: 12px;
    padding-top: 12px;
  }
  .meter-bottom {
    margin-top: 10px;
  }
}

/* Center the numeric reading independently of the display unit. */
.speed-gauge .reading {
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1;
}
.speed-gauge .unit {
  margin-top: 5px;
  line-height: 1;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#tools > .advanced-settings { margin: 12px 0; }

/* Compact primary action and optional measurement controls. */
.launch-controls { width: min(250px, 100%); margin: 14px auto 0; }
#start, #cancel { justify-content: center; text-align: center; min-height: 48px; padding: 12px 18px; font-size: 16px; }
.measurement-settings { position: absolute; top: 12px; right: 12px; }
.settings-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--muted); }
.settings-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.payload-settings { position: absolute; z-index: 3; top: 48px; right: 0; width: 264px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: 0 10px 30px #0005; }
.payload-settings .payload-control { display: block; margin: 0; }
.payload-settings .payload-control legend { float: none; padding: 0 0 10px; }
.payload-settings .size-options { width: 100%; }
.payload-settings[hidden] { display: none; }

/* Keep the numeric reading calm and give scale labels radial breathing room. */
.speed-gauge #speed { font-size: 46px; letter-spacing: -2px; }
@media (max-width: 760px) { .speed-gauge #speed { font-size: 41px; } }
@media (max-height: 700px) and (min-width: 761px) { .speed-gauge #speed { font-size: 36px; } }

/* Preserve the full-size arc while reducing only its inner numeric reading. */
#gauge { position: absolute; top: -18px; left: 0; height: auto; aspect-ratio: 320 / 218; }
.speed-gauge #speed { font-size: 38px; letter-spacing: -1px; }
@media (max-width: 760px) { .speed-gauge #speed { font-size: 34px; } }
