@font-face {
  font-family: OpenMono;
  src: url(/assets/openmono.woff2) format("woff2");
  font-display: swap;
}
@font-face {
  font-family: Inter;
  src: url(/assets/inter.woff2) format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #fafafa;
  --paper: #fff;
  --ink: #151515;
  --muted: #626262;
  --line: #dedede;
  --soft: #f2f2f2;
  --select: #ebebeb;
  --edge: #b9b9b9;
  --blue: #65758c;
  --orange: #a47e59;
  --map: #bebbb6;
  --action: #393836;
  --on: #fafafa;
  --mono: OpenMono, "PingFang SC", monospace;
  --ui: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0c0c0c;
  --paper: #141414;
  --ink: #fafafa;
  --muted: #aeaeae;
  --line: #303030;
  --soft: #1c1c1c;
  --select: #262626;
  --edge: #535353;
  --blue: #8798c6;
  --orange: #cf9c80;
  --map: #484848;
  --action: #d2cfca;
  --on: #21201e;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 15px/1.5 var(--ui);
}
button,
input,
select,
a.action {
  font: inherit;
  color: inherit;
}
button,
select,
a.action {
  cursor: pointer;
}
button {
  border: 0;
  background: transparent;
}
input,
select {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 11px;
  min-width: 0;
}
input::placeholder {
  color: var(--muted);
}
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
header {
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.band,
main,
#site-footer {
  max-width: 1264px;
  width: calc(100% - 64px);
  margin: auto;
}
#site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 24px;
  padding: 14px 0 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.build-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-variant-numeric: tabular-nums;
}
.band {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 203px;
}
.brand {
  z-index: 1;
  display: grid;
  gap: 8px;
}
h1,
h2,
p {
  margin: 0;
}
h1 {
  font: 400 38px/1.12 var(--mono);
  letter-spacing: -0.04em;
}
.brand h1 a,
.portal-link {
  color: inherit;
  text-decoration: none;
}
.brand h1 a:hover,
.brand p {
  color: var(--muted);
}
h2 {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.atlas {
  position: absolute;
  right: 0;
  top: 50px;
  overflow: visible;
  width: min(52%, 560px);
  height: auto;
  color: var(--orange);
  pointer-events: none;
}
.atlas-cities path {
  fill: none;
  stroke: currentColor;
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
}
.atlas [role="button"] circle:not(.map-hit) {
  fill: currentColor;
  stroke: var(--bg);
  stroke-width: 0.7;
}
.atlas-cities text {
  fill: var(--ink);
  font: 500 8px var(--ui);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 2.8;
  stroke-linejoin: round;
}
.atlas [role="button"] {
  pointer-events: all;
}
.atlas [data-node-id] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.atlas [data-node-id]:focus {
  outline: none;
}
.atlas [role="button"] .map-hit {
  fill: transparent;
  stroke: none;
}
.atlas [aria-disabled="true"] {
  color: var(--edge);
}
.atlas [aria-disabled="true"] text {
  fill: var(--muted);
}
.atlas [data-node-id]:is(:hover, :focus-visible) text {
  text-decoration: underline;
}
.atlas [data-node-id]:focus-visible .map-hit {
  stroke: var(--ink);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}
.atlas [aria-pressed="true"] circle:not(.map-hit) {
  r: 3px;
  fill: var(--bg);
  stroke: currentColor;
  stroke-width: 1.6;
}
#map-picker {
  width: min(340px, calc(100% - 32px));
  max-height: 75vh;
  padding: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--edge);
  border-radius: 8px;
}
#map-picker::backdrop { background: rgb(0 0 0 / 22%); }
.picker-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.picker-heading h2 { font-size: 16px; }
.picker-close { color: var(--muted); font-size: 13px; }
#map-options .node { width: 100%; border: 1px solid var(--line); }
.header-preferences {
  position: absolute;
  z-index: 2;
  top: 16px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.portal-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
}
.portal-link svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-linecap: round;
}
.portal-link:hover {
  background: var(--soft);
}
.preference {
  position: relative;
  color: var(--muted);
}
.preference svg {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  pointer-events: none;
}
.preference::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 5px;
  height: 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.preference select {
  appearance: none;
  min-width: 106px;
  padding: 0 28px 0 32px;
}
.preference select,
.portal-link {
  height: 34px;
  background: var(--paper);
  color: var(--ink);
  font: 400 13px/1.3 var(--ui);
}
.preference select:hover,
.portal-link:hover { border-color: var(--edge); }
@media (pointer: coarse) {
  .preference select, .portal-link { height: 44px; }
}
@media (max-width: 400px) {
  .header-preferences { gap: 5px; }
  .preference svg { display: none; }
  .preference select { min-width: 0; padding-inline: 7px 22px; }
  .preference::after { right: 9px; }
  .portal-link { padding-inline: 8px; gap: 5px; }
}
@media (max-width: 360px) {
  .portal-link svg { display: none; }
}
@media (forced-colors: active) {
  .preference select { appearance: auto; padding-inline: 8px; }
  .preference svg, .preference::after { display: none; }
}
main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 24px 0 44px;
}
.panel {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  min-width: 0;
}
aside {
  min-height: 350px;
}
aside input {
  width: 100%;
  margin: 20px 0 4px;
  font-size: 14px;
}
.region {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
  margin: 20px 0 7px;
}
.region-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.node {
  width: 100%;
  display: flex;
  text-align: left;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  border-radius: 4px;
  padding: 9px 10px;
}
.node-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.node-label small {
  font-size: 12px;
  color: var(--muted);
}
.node .mono {
  font-size: 13px;
  color: var(--muted);
}
.mono,
.readings strong,
pre {
  font-family: var(--mono);
  font-weight: 400;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 15px;
  min-width: 0;
}
@media (min-width: 1024px) {
  .workspace:has(#diagnostics:not([hidden])) {
    grid-template-columns: minmax(0, 36fr) minmax(0, 64fr);
  }
  #modes, #results {
    grid-column: 1 / -1;
  }
  .workspace:has(#diagnostics:not([hidden])) .connection {
    padding-inline: 16px;
  }
  #diagnostics {
    padding: 18px;
  }
  #tools {
    display: grid;
    grid-template-columns: repeat(4, auto);
  }
}
nav {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
}
nav button {
  padding: 5px 0 10px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
nav button[aria-pressed="true"] {
  border-color: var(--ink);
  color: var(--ink);
}
.foot,
.trip,
.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.connection,
.foot,
.hint,
#directory-note,
#file-note {
  font-size: 13px;
  color: var(--muted);
}
.connection {
  min-width: 0;
  padding: 18px 22px 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}
.station-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.station-heading h2 {
  font: 550 17px/1.45 var(--ui);
  color: var(--ink);
  overflow-wrap: anywhere;
}
#station-code { font-size: 12px; }
.station-status {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 6px;
  margin: 4px 0 14px;
  line-height: 1.5;
}
#status {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
}
#node-network { margin: 0; }
.address-row {
  display: grid;
  grid-template-columns: 3.5em minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}
.address-row dt { color: var(--muted); font: 13px var(--mono); }
.address-row dd {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.address-row code {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
  min-width: 0;
  user-select: all;
}
.address-row button, #retry {
  flex: none;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  border-radius: 5px;
  font-size: 12px;
}
:is(.address-row button, #retry):is(:hover, :active, :focus-visible) {
  color: var(--ink);
  border-color: var(--edge);
  background: var(--soft);
}
@media (max-width: 480px) {
  .connection { padding: 14px 14px 4px; }
  .address-row { grid-template-columns: 3em minmax(0, 1fr); gap: 6px; }
  .address-row dd { gap: 6px; }
  .address-row button, #retry { min-height: 40px; }
}
#retry {
  grid-column: 2;
  justify-self: start;
  margin-top: 6px;
}
#directory-note:not(:empty) {
  margin-top: 16px;
}
.choices {
  display: inline-flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.choices button {
  border-radius: 4px;
  padding: 6px 11px;
  font-size: 14px;
}
.choices button:is(:hover, :active, [aria-pressed="true"]),
.node:is(:hover, [aria-pressed="true"]) {
  background: var(--select);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--edge);
}
#tools {
  margin-bottom: 15px;
}
#run {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 12px;
}
#target-fields,
#iperf-fields,
#server-fields,
#media-fields {
  grid-area: 1 / 1;
}
#media-fields { display: flex; flex-wrap: wrap; gap: 8px 12px; }
#media-fields select { max-width: 100%; }
#server {
  width: 100%;
}
form label {
  font-size: 14px;
  display: block;
  margin-bottom: 6px;
}
.input-row input {
  flex: 1;
}
.hint:not(:empty) {
  grid-column: 1 / -1;
  margin-top: 7px;
}
.hint:empty {
  display: none;
}
#target-fields[hidden] + #iperf-fields[hidden] + #server-fields[hidden] + #media-fields[hidden] + .hint {
  grid-area: 1 / 1;
  align-self: center;
  margin: 0;
}
.action,
a.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--action);
  color: var(--on);
  text-decoration: none;
  border-radius: 5px;
  min-height: 37px;
  padding: 7px 16px;
  font-size: 14px;
}
.action:hover:not(:disabled) {
  filter: brightness(0.91);
}
#run-button {
  grid-area: 1 / 2;
  height: 42px;
  white-space: nowrap;
}
#run input,
#run select {
  height: 42px;
}
@media (max-width: 480px) {
  #run,
  #run .input-row {
    column-gap: 6px;
  }
  #run-button {
    padding-inline: 10px;
  }
}
.foot {
  justify-content: space-between;
  flex-wrap: wrap;
}
.speed-actions { display: flex; align-items: stretch; gap: 8px; }
#file-ticket { display: flex; flex-wrap: wrap; gap: 8px; }
.terminal {
  min-width: 0;
  min-height: clamp(270px, 37vh, 395px);
  color: #e7e8ee;
  background: #262936;
  border: 1px solid #323543;
  border-radius: 10px;
  font: 400 14px/1.65 var(--mono);
}
.terminal-bar {
  position: relative;
  padding: 8px 78px;
  text-align: center;
  color: #d0d1d9;
}
#terminal-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.terminal-lights {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}
.terminal-lights i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff6058;
}
.terminal-lights i:nth-child(2) {
  background: #ffbd44;
}
.terminal-lights i:nth-child(3) {
  background: #00c853;
}
.terminal-body {
  padding: 9px 16px 18px;
}
#route {
  color: #d0d1d9;
  overflow-wrap: anywhere;
  margin: 0 0 4px;
}
#route:empty {
  display: none;
}
#command-line {
  margin: 0 0 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#command-line:empty {
  display: none;
}
#run-state {
  color: #b6b8c5;
  font-size: 13px;
  font-style: italic;
}
#mtr-report table {
  border-collapse: collapse;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
#mtr-report th, #mtr-report td {
  padding: 0 1ch;
  text-align: left;
  white-space: nowrap;
}
#mtr-report th {
  position: sticky;
  top: 0;
  background: #262936;
  color: #b6b8c5;
  font-weight: 400;
}
#mtr-report,
#output {
  --scroll-thumb: #787e90;
  --scroll-track: #262936;
  color-scheme: dark;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
  margin: 12px 0 0;
  max-height: 420px;
  overflow: auto;
  font: inherit;
  tab-size: 4;
}
#mtr-report {
  margin: 0 0 .5em;
  white-space: normal;
}
#output { white-space: pre; }
@supports not (scrollbar-color: auto) {
  #output::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  #output::-webkit-scrollbar-track,
  #output::-webkit-scrollbar-corner {
    background: var(--scroll-track);
  }
  #output::-webkit-scrollbar-thumb {
    background: var(--scroll-thumb);
    border: 1px solid var(--scroll-track);
    border-radius: 8px;
  }
}
@media (max-width: 480px) {
  .terminal {
    font-size: 13px;
    min-height: 220px;
  }
  .terminal-bar {
    padding-inline: 62px;
  }
  .terminal-lights {
    gap: 5px;
  }
  .terminal-lights i {
    width: 9px;
    height: 9px;
  }
}
.trip {
  margin-bottom: 22px;
}
.trip strong {
  font-size: 15px;
  font-weight: 500;
}
.trip i {
  flex: 1;
  border-top: 1px dashed var(--edge);
}
.trip i:before,
.trip i:after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--orange);
  float: left;
  margin-top: -3px;
}
.trip i:after {
  float: right;
}
.readings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px;
  margin-top: 22px;
}
.speed-figure { --trace: var(--blue); margin: 0; min-width: 0; }
#ul-figure { --trace: var(--orange); }
.speed-figure figcaption { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.speed-figure figcaption svg { width: 18px; height: 18px; fill: none; stroke: var(--trace); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.speed-value { display: flex; align-items: baseline; gap: 6px; margin: 3px 0 12px; }
.speed-value strong { font-size: 32px; letter-spacing: -.035em; line-height: 1.3; }
.speed-value small, .plot-title { color: var(--muted); }
.plot-title { font-size: 12px; }
.speed-graph { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; margin-top: 6px; }
.speed-scale, .speed-time { color: var(--muted); font: 11px/1 var(--mono); }
.speed-scale { display: flex; flex-direction: column; justify-content: space-between; text-align: end; height: 74px; min-width: 1ch; }
.chart { width: 100%; height: 74px; display: block; fill: none; }
.plot-grid, .plot-line { vector-effect: non-scaling-stroke; }
.plot-grid { stroke: var(--line); stroke-dasharray: 2 4; }
.plot-line { stroke: var(--trace); stroke-width: 2; stroke-linejoin: round; }
.plot-fill { fill: var(--trace); fill-opacity: .09; }
.speed-time { display: flex; justify-content: space-between; margin-top: 5px; }
@media (max-width: 540px) {
  .readings { grid-template-columns: 1fr; gap: 18px; }
  .speed-value { margin-bottom: 6px; }
}
.foot {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
#file-note {
  margin: 18px 0 8px;
}
@media (max-width: 960px) {
  .band {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 16px 0 0;
  }
  .header-preferences {
    position: static;
    grid-row: 1;
    grid-column: 2;
  }
  .atlas {
    position: static;
    overflow: hidden;
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(100%, 560px);
    justify-self: center;
  }
}
@media (max-width: 760px) {
  .band { grid-template-columns: minmax(0, 1fr); }
  .header-preferences { grid-column: 1; justify-content: flex-end; flex-wrap: wrap; }
  .brand { grid-row: 2; }
  .atlas { grid-row: 3; }
}
@media (max-width: 600px) {
  .atlas-cities text { font-size: 10px; }
}
@media (max-width: 450px) {
  .atlas-cities text { font-size: 13px; }
}
@media (max-width: 760px) {
  .band,
  main,
  #site-footer {
    width: calc(100% - 28px);
  }
  .brand {
    gap: 6px;
  }
  h1 {
    font-size: clamp(26px, 5vw, 32px);
  }
  .brand p {
    font-size: 13px;
  }
  .header-preferences {
    top: 8px;
  }
  main {
    display: block;
    padding-top: 14px;
  }
  aside {
    min-height: 0;
    margin-bottom: 16px;
  }
  .panel {
    padding: 16px;
  }
  .region {
    margin: 10px 0 3px;
  }
  aside input {
    margin: 10px 0 0;
  }
  .workspace {
    gap: 12px;
  }
  .choices button {
    padding: 6px 8px;
  }
  .readings strong {
    font-size: 28px;
  }
}

.terminal .summary {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 16px;
  color: #b6b8c5;
  font-size: 13px;
}
.terminal .summary strong {
  display: block;
  font: 400 24px/1.4 var(--mono);
  color: #e7e8ee;
}

.term-hop {
  color: #f5dd70;
}
.term-as,
.term-ok,
#run-state[data-state="done"] {
  color: #77e27b;
}
.term-time {
  color: #70e3ec;
}
.term-timeout,
#run-state[data-state="error"] {
  color: #ff858d;
}

.iperf-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #414553;
}
.iperf-row span {
  color: #b6b8c5;
  font-size: 13px;
}
.iperf-row summary { cursor: pointer; }
.iperf-row code {
  white-space: pre-wrap;
  font: inherit;
  overflow-wrap: anywhere;
  user-select: all;
}
.iperf-row button {
  font: 13px var(--ui);
  color: #e7e8ee;
  border: 1px solid #656b7b;
  border-radius: 4px;
  padding: 5px 9px;
}
.iperf-row button:hover {
  background: #373b49;
}

@media (max-width: 480px) {
  .band {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 8px 0 16px;
    gap: 12px;
  }
  .header-preferences {
    position: relative;
    top: auto;
    order: -1;
    align-self: flex-end;
  }
  .brand p {
    max-width: 31ch;
  }
}
