:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --card: #f7f7f8;
  --raised: #f0f0f0;
  --raised-hover: #e5e5e5;
  --line: #ececec;
  --border: #ececec;
  --fg: #0d0d0d;
  --muted: #5d5d5d;
  --faint: #767676;
  --accent: #52b795;
  --accent-hover: #44a786;
  --accent-ink: #0e7a5c;
  --on-accent: #0d0d0d;
  --accent-soft: rgba(82, 183, 149, 0.14);
  --warn: #b54708;
  --warn-soft: #fff4e5;
  --on-warn: #ffffff;
  --down: #d92d20;
  --down-soft: #feeceb;
  --down-hover: #fddcd9;
  --backdrop: rgba(13, 13, 13, 0.4);
  --shadow: 0 24px 64px rgba(13, 13, 13, 0.16);
  --sans:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui,
    sans-serif;
  --mono:
    ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, Consolas,
    monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111111;
    --surface: #1a1a1a;
    --card: #212121;
    --raised: #2a2a2a;
    --raised-hover: #363636;
    --line: #2a2a2a;
    --border: #222222;
    --fg: #fcfcfc;
    --muted: #a1a1a1;
    --faint: #858585;
    --accent: #52b795;
    --accent-hover: #66c6a5;
    --accent-ink: #5cc29f;
    --on-accent: #0d0d0d;
    --accent-soft: rgba(82, 183, 149, 0.14);
    --warn: #f5a524;
    --warn-soft: rgba(245, 165, 36, 0.14);
    --on-warn: #0d0d0d;
    --down: #f26b6b;
    --down-soft: rgba(242, 107, 107, 0.14);
    --down-hover: rgba(242, 107, 107, 0.22);
    --backdrop: rgba(0, 0, 0, 0.64);
    --shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

button,
input {
  font: inherit;
  color: inherit;
}

a {
  color: var(--accent-ink);
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--fg);
}

.logo i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: none;
}

.logo i svg {
  width: 100%;
  height: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.btn.sm {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 6px;
}

.btn.lg {
  height: 48px;
  padding: 0 24px;
  font-size: 16px;
}

.btn.ghost {
  background: var(--raised);
  color: var(--fg);
}

.btn.ghost:hover {
  background: var(--raised-hover);
}

.btn.danger {
  background: var(--down-soft);
  color: var(--down);
}

.btn.danger:hover {
  background: var(--down-hover);
}

.btn.red {
  background: var(--down);
  color: #fff;
}

.btn.red:hover {
  background: var(--down);
  filter: brightness(1.08);
}

.btn.warn {
  background: var(--warn);
  color: var(--on-warn);
}

.btn.warn:hover {
  background: var(--warn);
  filter: brightness(1.08);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--fg);
  outline: none;
  transition: border-color 0.12s;
}

.input:hover {
  border-color: var(--raised-hover);
}

.input:focus {
  border-color: var(--accent);
}

.input::placeholder {
  color: var(--faint);
}

.error {
  color: var(--down);
  font-size: 13px;
  min-height: 20px;
  margin-top: 8px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: var(--raised);
  color: var(--muted);
  white-space: nowrap;
}

.badge.own,
.badge.proxy,
.badge.ok {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.badge.stranger,
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.bad,
.badge.block {
  background: var(--down-soft);
  color: var(--down);
}

.badge.ok::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.tabs {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button {
  position: relative;
  appearance: none;
  background: none;
  border: 0;
  padding: 0 0 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tabs button:hover {
  color: var(--fg);
}

.tabs button[aria-selected="true"],
.tabs button[aria-pressed="true"] {
  color: var(--fg);
}

.tabs button[aria-selected="true"]::after,
.tabs button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 20px;
  height: 3px;
  margin-left: -10px;
  border-radius: 2px;
  background: var(--accent);
}

.tabs .n {
  margin-left: 4px;
  font-weight: 500;
  color: var(--muted);
}

.tabs .n.warn {
  color: var(--warn);
  font-weight: 600;
}

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
}

.seg button {
  border: 0;
  background: none;
  height: 32px;
  padding: 0 14px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}

.seg button:hover {
  color: var(--fg);
}

.seg button[aria-pressed="true"] {
  background: var(--raised);
  color: var(--fg);
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex: none;
  border: 0;
  border-radius: 99px;
  background: var(--raised-hover);
  cursor: pointer;
  transition: background 0.15s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}

.switch[aria-checked="true"] {
  background: var(--accent);
}

.switch[aria-checked="true"]::after {
  transform: translateX(20px);
}

.dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--fg);
  margin: auto;
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: var(--backdrop);
}

.dialog-body {
  padding: 24px;
}

.dialog h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.dialog .label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  margin: 20px 0 8px;
}

.dialog .input {
  margin-top: 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

body {
  font-size: 16px;
  line-height: 1.55;
}

.mono {
  font-size: 0.875em;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.topbar .wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 14px max(20px, env(safe-area-inset-right)) 14px
    max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar .logo i {
  width: 28px;
  height: 28px;
}

.host {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px max(16px, env(safe-area-inset-right)) 40px
    max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

footer a {
  text-decoration: none;
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

.hero,
section.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}

@media (max-width: 480px) {
  section.block {
    padding: 20px 18px;
  }
}

@media (min-width: 760px) {
  main {
    padding-top: 32px;
  }
}

.hero {
  padding: 32px 28px;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  background: var(--raised);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.state .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.state.ok {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.state.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.state.bad {
  background: var(--down-soft);
  color: var(--down);
}

.state.wait .dot {
  animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

h1 {
  font-size: clamp(36px, 10vw, 48px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 18px;
}

.lede {
  margin-top: 14px;
  color: var(--muted);
  max-width: 32em;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  font-size: 13px;
}

.facts div {
  display: flex;
  gap: 8px;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--card);
  border: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  font-family: var(--mono);
}

.facts:empty {
  display: none;
}

@media (max-width: 480px) {
  .hero {
    padding: 26px 20px;
  }
}

.label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 18px;
}

.label span:first-child {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--mono);
  font-size: 12px;
}

.tabs {
  margin-bottom: 12px;
}

.tabs button {
  font-size: 15px;
  padding-bottom: 14px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

ol.steps {
  list-style: none;
  counter-reset: s;
}

ol.steps > li {
  counter-increment: s;
  display: grid;
  grid-template-columns: 36px 1fr;
  padding: 9px 0;
}

ol.steps > li::before {
  content: counter(s);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--raised);
  color: var(--fg);
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

ol.steps.cont {
  counter-reset: s 2;
}

.path {
  font-weight: 600;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin: 8px 0 8px 36px;
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.copy {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  transition:
    background-color 0.12s,
    border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.copy:hover {
  background: var(--raised);
}

.copy .k {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.copy .v {
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
}

.copy .c {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  white-space: nowrap;
}

.copy.done {
  border-color: var(--accent);
}

.inline-copy {
  margin: 4px 0 0 36px;
}

.inline-copy .copy {
  grid-template-columns: 1fr auto;
}

.note {
  color: var(--muted);
  font-size: 14px;
  margin-top: 16px;
}

@media (max-width: 480px) {
  .copy {
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }
  .copy .k {
    grid-column: 1 / -1;
  }
  .actions {
    margin-left: 0;
  }
  .actions .btn {
    width: 100%;
  }
  .inline-copy {
    margin-left: 0;
  }
}

.speed {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.big {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.big small {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--muted);
  margin-left: 8px;
}

.meter {
  height: 4px;
  border-radius: 2px;
  background: var(--raised);
  margin: 22px 0 12px;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.15s linear;
}

#tres {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}

#twarn {
  display: none;
  margin-top: 14px;
  color: var(--warn);
  font-size: 15px;
}

.svc {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.svc:first-child {
  border-top: 0;
  padding-top: 0;
}

.svc dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding-top: 2px;
}

.svc .mono {
  color: var(--accent-ink);
  font-weight: 600;
}

@media (max-width: 480px) {
  .svc {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}


