:root {
  color-scheme: dark;
  --blue: #3d9bf2;
  --blue-dark: #2584dc;
  --text: #e4e4e4;
  --muted: #9b9b9b;
  --line: #3a3a3a;
  --light: #252525;
  --error: #ef7777;
  --sans: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: #151515;
  font-family: var(--sans);
  line-height: 1.4;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.is-hidden {
  display: none !important;
}

.page {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 60px;
}

.page-header {
  margin-bottom: 26px;
  text-align: center;
}

.page-header h1 {
  margin: 0;
  color: #f0f0f0;
  font-size: 36px;
  font-weight: 400;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tester {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0 0 30px;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 24px;
}

.tab {
  padding: 11px 2px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.tab:hover,
.tab.is-active {
  border-bottom-color: var(--blue);
  color: var(--text);
}

.controls {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
}

.field {
  width: min(420px, 100%);
}

.field span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

select {
  width: 100%;
  height: 40px;
  padding: 0 10px;
  border: 1px solid #555555;
  border-radius: 2px;
  background: #1c1c1c;
  color: var(--text);
}

select:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.text-button {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #555555;
  border-radius: 2px;
  background: var(--light);
  color: var(--text);
  font-size: 13px;
}

.text-button:hover:not(:disabled) {
  background: #303030;
}

.note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.test-action {
  display: flex;
  justify-content: center;
  margin: 28px 0 16px;
}

.start-button {
  width: 112px;
  height: 112px;
  border: 5px solid #284d70;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
  text-transform: uppercase;
}

.start-button:hover:not(:disabled) {
  border-color: #32658f;
  background: var(--blue-dark);
}

.start-button--cancel {
  background: #666666;
  border-color: #3b3b3b;
  font-size: 14px;
}

.run-status {
  width: min(500px, 100%);
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

progress {
  display: block;
  width: 100%;
  height: 5px;
  margin-top: 7px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #333333;
}

progress::-webkit-progress-bar {
  background: #333333;
}

progress::-webkit-progress-value {
  background: var(--blue);
}

progress::-moz-progress-bar {
  background: var(--blue);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 760px;
  margin: 0 auto;
}

.metrics article {
  min-width: 0;
  padding: 5px 16px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.metrics article:last-child {
  border-right: 0;
}

.metrics strong {
  display: block;
  min-height: 43px;
  overflow: hidden;
  color: var(--blue);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.metrics span {
  display: inline-block;
  margin-top: 3px;
  font-size: 13px;
}

.metrics small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10px;
}

.locations {
  margin-top: 38px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid #555555;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th,
td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
}

th:last-child,
td:last-child {
  text-align: right;
}

.region-row th {
  padding-top: 13px;
  padding-bottom: 6px;
  background: var(--light);
  color: #bdbdbd;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.latency-value {
  color: #bdbdbd;
  font-variant-numeric: tabular-nums;
}

.latency-error {
  color: var(--error);
}

.empty-row {
  padding: 24px;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 640px) {
  .page {
    width: min(100% - 24px, 900px);
    padding-top: 26px;
  }

  .page-header h1 {
    font-size: 31px;
  }

  .controls {
    display: block;
  }

  .field {
    width: 100%;
  }

  .text-button {
    width: 100%;
    margin-top: 8px;
  }

  .metrics {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 22px;
  }

  .metrics article:nth-child(2) {
    border-right: 0;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 3px;
  }
}
