/* Theme variables match GatusMOD (up.iperf3serverlist.net). */
:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --primary: 222.2 47.4% 11.2%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 222.2 84% 4.9%;
  --radius: 0.5rem;
  --link: 221 83% 53%;
  --green: 142 71% 45%;
  --orange: 25 95% 53%;
  --red: 0 84% 60%;
  --blue: 221 83% 60%;
  --grey: 218 11% 65%;
  --code-bg: 210 40% 96.1%;
  color-scheme: light;
}
.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --primary: 210 40% 98%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 212.7 26.8% 83.9%;
  --link: 213 94% 68%;
  --grey: 215 14% 40%;
  --code-bg: 217.2 32.6% 12%;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: hsl(var(--link)); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code, pre, kbd, .mono { font-family: Consolas, Monaco, "Courier New", monospace; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: hsl(var(--muted-foreground)); }
.small { font-size: .8125rem; }
.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; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.main { flex: 1; padding-top: 1.75rem; padding-bottom: 2.5rem; }

/* Header */
.site-header { border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--background)); position: relative; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .625rem; color: inherit; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand-title { font-size: 1.375rem; font-weight: 800; line-height: 1; text-transform: uppercase; letter-spacing: -0.01em; white-space: nowrap; }
.brand-accent {
  background: linear-gradient(90deg, hsl(var(--link)) 40%, hsl(var(--green)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-i { text-transform: none; }

.site-nav { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .5rem .75rem; border-radius: calc(var(--radius) - 2px);
  font: inherit; font-size: .875rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
  color: hsl(var(--foreground)); background: none; border: 0; cursor: pointer;
}
.nav-link:hover { background: hsl(var(--accent)); text-decoration: none; }
.nav-link.active { background: hsl(var(--secondary)); }
.nav-sep { width: 1px; height: 1.5rem; background: hsl(var(--border)); margin: 0 .375rem; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--foreground)); background: none; border: 0; cursor: pointer;
}
.icon-btn:hover { background: hsl(var(--accent)); text-decoration: none; }
.icon-moon { display: none; }
.dark .icon-sun { display: none; }
.dark .icon-moon { display: block; }
.nav-toggle { display: none; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + .25rem); left: 0; min-width: 260px;
  padding: .25rem; display: none;
  background: hsl(var(--popover)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); box-shadow: 0 10px 25px -5px rgb(0 0 0 / .12), 0 4px 6px -4px rgb(0 0 0 / .08);
}
.dropdown.open .dropdown-menu { display: block; }
@media (hover: hover) and (min-width: 861px) {
  .dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu { display: block; }
  .dropdown::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: .375rem; }
}
.dropdown-item { display: flex; gap: .625rem; align-items: flex-start; padding: .5rem .625rem; border-radius: calc(var(--radius) - 2px); color: hsl(var(--foreground)); }
.dropdown-item:hover { background: hsl(var(--accent)); text-decoration: none; }
.dropdown-item svg { margin-top: .2rem; flex: none; color: hsl(var(--muted-foreground)); }
.dropdown-title { display: block; font-size: .875rem; font-weight: 500; }
.dropdown-desc { display: block; font-size: .75rem; color: hsl(var(--muted-foreground)); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: .125rem;
    padding: .5rem 1.25rem 1rem; background: hsl(var(--background));
    border-bottom: 1px solid hsl(var(--border)); box-shadow: 0 10px 20px -10px rgb(0 0 0 / .15);
  }
  .site-nav.open { display: flex; }
  .nav-link { width: 100%; justify-content: space-between; }
  .nav-sep { display: none; }
  .dropdown-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 .75rem; }
  .site-nav .icon-btn { display: inline-flex; }
  .brand-title { font-size: 1.25rem; }
}

/* Footer */
.site-footer { border-top: 1px solid hsl(var(--border)); padding: 1.75rem 0; font-size: .875rem; }
.footer-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .5rem; }
.footer-inner p { margin: 0; }
.footer-inner a:not(.sponsors a) { font-weight: 600; }
.sponsors { display: flex; gap: 1.5rem; align-items: center; margin: .25rem 0; }
.sponsors img { height: 28px; width: auto; }
.only-dark { display: none; }
.dark .only-dark { display: inline; }
.dark .only-light { display: none; }

/* Cards */
.card {
  background: hsl(var(--card)); color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
}
.card-body { padding: 1rem 1.25rem; }
.card + .card, .stack > * + * { margin-top: 1.25rem; }
.card-divider { border-top: 1px solid hsl(var(--border)); }
.page-head { margin-bottom: 1.5rem; }
.page-head p { color: hsl(var(--muted-foreground)); margin: 0; }

/* Buttons and form controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 2.25rem; padding: 0 .875rem; border-radius: calc(var(--radius) - 2px);
  font: inherit; font-size: .875rem; font-weight: 500; white-space: nowrap;
  border: 1px solid hsl(var(--input)); background: hsl(var(--background)); color: hsl(var(--foreground));
  cursor: pointer; box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);
}
.btn:hover { background: hsl(var(--accent)); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { height: 2rem; padding: 0 .625rem; font-size: .8125rem; }

.input, .select {
  height: 2.5rem; padding: 0 .75rem; width: 100%;
  border: 1px solid hsl(var(--input)); border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background)); color: hsl(var(--foreground));
  font: inherit; font-size: .875rem;
}
.select {
  appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .625rem center;
}
.input::placeholder { color: hsl(var(--muted-foreground)); }
.input:focus, .select:focus { outline: none; box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / .35); }
.search { position: relative; flex: 1 1 280px; }
.search svg { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); pointer-events: none; }
.search .input { padding-left: 2.25rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .1rem .5rem; border-radius: 9999px;
  font-size: .75rem; font-weight: 600; line-height: 1.25rem; white-space: nowrap;
  background: hsl(var(--secondary)); color: hsl(var(--foreground));
}
.badge.opt-r { background: hsl(221 95% 55% / .28); color: hsl(224 90% 40%); box-shadow: inset 0 0 0 1px hsl(221 95% 55% / .7); }
.badge.opt-6 { background: hsl(0 90% 58% / .26); color: hsl(0 80% 40%); box-shadow: inset 0 0 0 1px hsl(0 90% 58% / .7); }
.badge.opt-u { background: hsl(142 80% 42% / .28); color: hsl(142 85% 24%); box-shadow: inset 0 0 0 1px hsl(142 80% 42% / .7); }
.dark .badge.opt-r { background: hsl(217 95% 60% / .32); color: hsl(213 100% 78%); box-shadow: inset 0 0 0 1px hsl(217 95% 60% / .75); }
.dark .badge.opt-6 { background: hsl(0 90% 60% / .3); color: hsl(0 100% 80%); box-shadow: inset 0 0 0 1px hsl(0 90% 60% / .75); }
.dark .badge.opt-u { background: hsl(142 70% 45% / .3); color: hsl(142 80% 66%); box-shadow: inset 0 0 0 1px hsl(142 70% 45% / .75); }
.badge-status { color: #fff; }
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-status.green { background: hsl(var(--green)); }
.badge-status.orange { background: hsl(var(--orange)); }
.badge-status.red { background: hsl(var(--red)); }
.badge-status.unknown { background: hsl(var(--grey)); }

/* Status dots */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--grey)); flex: none; vertical-align: middle; }
.dot.green { background: hsl(var(--green)); }
.dot.orange { background: hsl(var(--orange)); }
.dot.red { background: hsl(var(--red)); }

/* Hero */
.hero { position: relative; isolation: isolate; padding: 1.5rem 0 2.25rem; max-width: 820px; }
.hero::before {
  content: ""; position: absolute; z-index: -1; inset: -1.5rem 0 auto 0; height: 20rem; pointer-events: none;
  background:
    radial-gradient(40% 60% at 15% 30%, hsl(var(--blue) / .16), transparent 70%),
    radial-gradient(35% 55% at 70% 20%, hsl(var(--green) / .12), transparent 70%);
  filter: blur(8px);
}
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--green)); }
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: hsl(var(--green));
  animation: live-pulse 1.8s ease-out infinite;
}
@keyframes live-pulse { from { transform: scale(1); opacity: .7; } to { transform: scale(3); opacity: 0; } }
.hero-title { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 1rem; }
.hero-accent {
  background: linear-gradient(90deg, hsl(var(--link)), hsl(var(--green)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { font-size: 1.0625rem; line-height: 1.65; color: hsl(var(--muted-foreground)); margin-bottom: .5rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .625rem; }
.hero-sponsor {
  display: inline-flex; align-items: center; gap: .625rem; margin-top: 1.5rem;
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--muted-foreground)); opacity: .85; transition: opacity .15s;
}
.hero-sponsor:hover { opacity: 1; text-decoration: none; }
.list-hero { max-width: none; }
.list-hero .hero-title, .list-hero .hero-lead { max-width: 820px; }
.list-hero .hero-lead { margin-bottom: 1.5rem; }
.list-hero .hero-actions { align-items: center; }
.list-hero .hero-sponsor { margin: 0 0 0 auto; }
.hero-sponsor img { height: 20px; width: auto; }
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: hsl(var(--primary)); }
.btn-primary:hover { background: hsl(var(--primary) / .88); }
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; } }

/* Overview / info table (Gatus style) */
.info-text { padding: .75rem 1rem; border-bottom: 1px solid hsl(var(--border)); font-size: .875rem; }
.info-text p:last-child { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .75rem 1rem; font-size: .8125rem; align-items: center; }
.legend-item { display: inline-flex; align-items: center; gap: .5rem; color: hsl(var(--muted-foreground)); }
.legend-live { margin-left: auto; font-weight: 600; }
.info-tip { display: inline-flex; vertical-align: -2px; margin-left: .25rem; cursor: help; color: hsl(var(--muted-foreground)); }
.info-tip:hover, .info-tip:focus-visible { color: hsl(var(--foreground)); outline: none; }
.info-tip[data-tip]:hover::after, .info-tip[data-tip]:focus-visible::after { left: -.5rem; transform: none; text-transform: none; letter-spacing: normal; }
.legend-title { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); margin-right: .25rem; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: .75rem 1rem; border-right: 1px solid hsl(var(--border)); }
.stat:last-child { border-right: 0; }
.stat-label { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); display: flex; align-items: center; gap: .4rem; }
.stat-value { font-size: 1.375rem; font-weight: 700; margin-top: .125rem; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid hsl(var(--border)); }
}

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem .625rem; align-items: center; padding: .625rem .75rem; }
.toolbar .input, .toolbar .select, .toolbar .btn { height: 2rem; font-size: .8125rem; }
.toolbar .select { padding: 0 1.75rem 0 .625rem; background-position: right .5rem center; }
.toolbar .btn { padding: 0 .625rem; gap: .375rem; }
.toolbar .btn svg { width: 14px; height: 14px; }
.toolbar .search { flex: 1 1 100%; }
.toolbar .search svg { left: .625rem; width: 14px; height: 14px; }
.toolbar .search .input { padding-left: 2rem; }
.toolbar-group { display: flex; align-items: center; gap: .375rem; }
.toolbar-group label { font-size: .75rem; font-weight: 500; color: hsl(var(--muted-foreground)); white-space: nowrap; }
.toolbar-group .select { width: auto; min-width: 5rem; }
.toolbar-actions { display: flex; gap: .375rem; margin-left: auto; }
.toolbar-actions .toolbar-group { margin-left: .5rem; }
@media (max-width: 640px) {
  .toolbar .toolbar-group { flex: 1 1 calc(50% - .625rem); flex-direction: column; align-items: stretch; gap: .25rem; }
  .toolbar .toolbar-group .select { width: 100%; }
  .toolbar-actions { margin-left: 0; width: 100%; }
  .toolbar-actions .btn { flex: 1; }
}

/* Server table */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .875rem; }
table.data th {
  text-align: left; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--muted-foreground)); padding: .625rem 1rem; border-bottom: 1px solid hsl(var(--border)); white-space: nowrap;
}
table.data td { padding: .625rem 1rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: hsl(var(--muted) / .5); }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: hsl(var(--foreground)); }
table.data th.sortable::after { content: ""; display: inline-block; width: 0; height: 0; margin-left: .35rem; vertical-align: middle; }
table.data th[aria-sort="ascending"]::after { border: 4px solid transparent; border-bottom-color: currentColor; margin-top: -4px; }
table.data th[aria-sort="descending"]::after { border: 4px solid transparent; border-top-color: currentColor; margin-top: 4px; }
.col-status { width: 1%; text-align: center; }
.col-num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.options { display: flex; gap: .25rem; flex-wrap: nowrap; }
.country { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; }
.country img { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px hsl(var(--border)); }

.cmd {
  display: inline-flex; align-items: center; gap: .5rem; max-width: 100%;
  font-family: Consolas, Monaco, "Courier New", monospace; font-size: .8125rem;
  padding: .3rem .5rem; border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--code-bg)); color: hsl(var(--foreground));
  border: 1px solid transparent; cursor: pointer; text-align: left; white-space: nowrap;
}
.cmd:hover { border-color: hsl(var(--border)); }
.cmd svg { flex: none; color: hsl(var(--muted-foreground)); }
.cmd.copied svg { color: hsl(var(--green)); }

.table-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .75rem 1rem; border-top: 1px solid hsl(var(--border)); font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.pager { display: flex; align-items: center; gap: .375rem; }
.pager-info { min-width: 6rem; text-align: center; }
.empty { padding: 2.5rem 1rem; text-align: center; color: hsl(var(--muted-foreground)); }

/* Mobile: table rows become cards */
@media (max-width: 760px) {
  table.data thead { display: none; }
  table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
  table.data tr { padding: .75rem 1rem; border-bottom: 1px solid hsl(var(--border)); display: grid; grid-template-columns: auto 1fr; gap: .375rem .75rem; }
  table.data tbody tr:last-child { border-bottom: 0; }
  table.data td { padding: 0; border: 0; }
  table.data tbody tr:hover td { background: none; }
  table.data td.col-status { grid-row: 1; grid-column: 1; align-self: center; width: auto; }
  table.data td.col-cmd { grid-row: 1; grid-column: 2; min-width: 0; }
  table.data td:not(.col-status):not(.col-cmd) { grid-column: 2; display: flex; gap: .5rem; align-items: center; font-size: .8125rem; }
  table.data td[data-label]:not(.col-status):not(.col-cmd)::before { content: attr(data-label); width: 5.5rem; flex: none; color: hsl(var(--muted-foreground)); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
  table.data td.col-num { text-align: left; }
  table.data td:empty { display: none; }
  .cmd { white-space: normal; word-break: break-all; }
}

/* Documentation pages */
.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 1.5rem; align-items: start; }
.doc-layout.single { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.toc { position: sticky; top: 1.25rem; }
.toc h2 { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); padding: .875rem 1rem 0; margin: 0; }
.toc nav { display: flex; flex-direction: column; padding: .5rem; }
.toc a { padding: .3rem .5rem; border-radius: calc(var(--radius) - 2px); color: hsl(var(--foreground)); font-size: .8125rem; }
.toc a:hover { background: hsl(var(--accent)); text-decoration: none; }
.toc a.sub { padding-left: 1.25rem; color: hsl(var(--muted-foreground)); }
@media (max-width: 960px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}
.prose section { padding: 1.25rem 1.5rem; border-bottom: 1px solid hsl(var(--border)); }
.prose section:last-child { border-bottom: 0; }
.prose h2 { margin-bottom: .75rem; }
.prose h3 { margin-top: 1.25rem; }
.prose section > h3:first-child { margin-top: 0; }
.prose h4 { margin-top: 1rem; margin-bottom: .375rem; font-size: .9375rem; }
.prose ul { margin: 0 0 .75rem; padding-left: 1.25rem; }
.prose li { margin: .2rem 0; }
.prose p code, .prose li code, .prose td code {
  font-size: .8125rem; padding: .1rem .35rem; border-radius: 4px; background: hsl(var(--code-bg)); border: 1px solid hsl(var(--border));
}
.code {
  position: relative; margin: 0 0 .875rem;
  background: hsl(var(--code-bg)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px);
}
.code pre { margin: 0; padding: .75rem 3rem .75rem 1rem; overflow-x: auto; font-size: .8125rem; line-height: 1.6; }
.code .copy-btn { position: absolute; top: .375rem; right: .375rem; width: 2rem; height: 2rem; }
.prose table { width: 100%; border-collapse: collapse; font-size: .875rem; margin-bottom: .875rem; border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) - 2px); overflow: hidden; }
.prose th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / .5); }
.prose th, .prose td { padding: .5rem .75rem; border-bottom: 1px solid hsl(var(--border)); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-family: Consolas, Monaco, "Courier New", monospace; font-size: .8125rem; white-space: nowrap; }
.prose .table-wrap { margin-bottom: .875rem; }
.prose .table-wrap table { margin: 0; }

.callout { display: flex; gap: .625rem; padding: .75rem 1rem; border-radius: calc(var(--radius) - 2px); background: hsl(var(--muted) / .6); border: 1px solid hsl(var(--border)); font-size: .875rem; }
.callout p { margin: 0; }

/* iPerf3 docs page: open layout without cards */
.docs-hero { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 2.5rem; align-items: center; padding-bottom: 3rem; }
@media (max-width: 960px) { .docs-hero { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; } }

.term {
  --term-bg: 222 47% 9%;
  background: hsl(var(--term-bg)); color: hsl(210 40% 90%);
  border-radius: calc(var(--radius) + 4px); overflow: hidden;
  box-shadow: 0 24px 48px -16px rgb(15 23 42 / .45), 0 0 0 1px hsl(0 0% 100% / .06);
}
.term-bar { display: flex; align-items: center; gap: .4rem; padding: .625rem .875rem; background: hsl(0 0% 100% / .04); }
.term-bar > span { width: 10px; height: 10px; border-radius: 50%; background: hsl(var(--red)); }
.term-bar > span:nth-child(2) { background: hsl(var(--orange)); }
.term-bar > span:nth-child(3) { background: hsl(var(--green)); }
.term-bar em { margin-left: auto; font-style: normal; font-size: .7rem; color: hsl(215 20% 55%); font-family: Consolas, Monaco, "Courier New", monospace; }
.term-bar .term-live { display: inline-flex; align-items: center; gap: .5rem; font-family: inherit; font-weight: 600; }
.term pre { margin: 0; padding: 1rem 1.125rem 1.25rem; font-size: .78rem; line-height: 1.7; overflow-x: auto; }
.term b { font-weight: 600; color: hsl(var(--green)); }
.t-prompt { color: hsl(var(--green)); }
.t-dim { color: hsl(215 20% 55%); }
.t-type { display: inline-block; vertical-align: bottom; overflow: hidden; white-space: nowrap; width: 0; animation: t-type 1.4s steps(34, end) .3s forwards; }
.t-line { opacity: 0; animation: t-in .3s ease-out forwards; animation-delay: calc(1.9s + var(--d) * .35s); }
.t-cursor { display: inline-block; width: .55em; height: 1.1em; vertical-align: text-bottom; background: hsl(210 40% 90%); animation: t-blink 1s step-end infinite; }
@keyframes t-type { to { width: 34ch; } }
@keyframes t-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes t-blink { 50% { opacity: 0; } }

.docs { grid-template-columns: minmax(0, 1fr) 220px; gap: 3.5rem; }
.docs-body { max-width: 860px; }
.docs-body section { padding: 0 0 3.5rem; border: 0; }
.docs-body .lead { font-size: 1.0625rem; line-height: 1.7; }
.section-head { display: flex; align-items: baseline; gap: .875rem; margin-bottom: 1rem; }
.section-head h2 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.docs-body .section-head { margin-bottom: 1.25rem; }
.docs-body .section-head h2::after {
  content: ""; display: block; width: 2.5rem; height: 3px; margin-top: .6rem; border-radius: 999px;
  background: hsl(var(--border));
}
.docs-body h3 { font-size: 1.15rem; margin-top: 2rem; }
.docs-body h4 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin-top: 1.5rem; }
.sub-num { color: hsl(var(--link)); font-variant-numeric: tabular-nums; margin-right: .25rem; }
.docs-body h3 .muted { font-weight: 500; font-size: .9em; }

.docs .code { background: hsl(222 47% 9%); border: 0; border-radius: var(--radius); box-shadow: 0 6px 16px -10px rgb(15 23 42 / .5); }
.dark .docs .code { background: hsl(222 47% 7%); box-shadow: 0 0 0 1px hsl(var(--border)); }
.docs .code pre { color: hsl(210 40% 92%); padding-top: .8rem; padding-bottom: .8rem; }
.docs .code pre::before { content: "$ "; color: hsl(var(--green)); }
.docs .code .copy-btn { color: hsl(215 20% 60%); }
.docs .code .copy-btn:hover { background: hsl(0 0% 100% / .08); color: #fff; }
.docs .code .copy-btn.copied { color: hsl(var(--green)); }
.docs-body p code, .docs-body li code, .docs-body dd code { border: 0; background: hsl(var(--link) / .1); color: hsl(var(--link)); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 !important; margin: 1.25rem 0 0 !important; }
.chips li { margin: 0; padding: .3rem .8rem; border-radius: 999px; font-size: .8125rem; font-weight: 600; background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.chips .c-blue { background: hsl(var(--blue) / .14); color: hsl(var(--link)); }
.chips .c-green { background: hsl(var(--green) / .15); color: hsl(142 70% 32%); }
.chips .c-orange { background: hsl(var(--orange) / .15); color: hsl(28 90% 40%); }
.chips .c-red { background: hsl(var(--red) / .13); color: hsl(0 70% 48%); }
.dark .chips .c-green { color: hsl(142 70% 60%); }
.dark .chips .c-orange { color: hsl(32 95% 62%); }
.dark .chips .c-red { color: hsl(0 90% 72%); }

.flow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 1rem; margin: 1.75rem 0 2rem; }
.flow-node { display: flex; flex-direction: column; align-items: center; gap: .25rem; text-align: center; }
.flow-icon {
  display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; margin-bottom: .25rem;
  color: hsl(var(--link)); background: hsl(var(--blue) / .12); box-shadow: 0 0 0 6px hsl(var(--blue) / .05);
}
.flow-node:last-child .flow-icon { color: hsl(142 70% 38%); background: hsl(var(--green) / .14); box-shadow: 0 0 0 6px hsl(var(--green) / .06); }
.flow-link { position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem; padding-bottom: 1.5rem; }
.flow-wire {
  width: 100%; height: 4px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, hsl(var(--link)) 0 10px, transparent 10px 22px), hsl(var(--border));
  background-size: 22px 100%, auto; animation: flow-run .8s linear infinite;
}
.flow-label { font-size: .75rem; font-weight: 600; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: .05em; }
@keyframes flow-run { to { background-position: 22px 0, 0 0; } }

.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; margin: 1.5rem 0; }
.split h4:first-child, .split h3:first-child { margin-top: 0; }
.split > div { display: flex; flex-direction: column; align-items: flex-start; }
.split > div > * { align-self: stretch; }
.split > div > .direction { align-self: flex-start; }
.split > div > .code { margin-top: auto; }
@media (max-width: 720px) { .split { grid-template-columns: minmax(0, 1fr); gap: .5rem; } }
.step {
  display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  font-size: .75rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, hsl(var(--link)), hsl(var(--green)));
}

.tab-list { display: flex; flex-wrap: wrap; gap: .375rem; margin: 1rem 0 1.25rem; }
.tab-list button {
  font: inherit; font-size: .8125rem; font-weight: 500; cursor: pointer;
  padding: .4rem .875rem; border-radius: 999px; border: 0;
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); transition: background .15s, color .15s;
}
.tab-list button:hover { color: hsl(var(--foreground)); }
.tab-list button[aria-selected="true"] { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.tabs.ready .tab-panel h4 { display: none; }
.tabs.ready .tab-panel { animation: t-in .25s ease-out; }

.opts { margin: 1rem 0 1.75rem; }
.opts > div { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem; padding: .55rem .5rem; border-radius: calc(var(--radius) - 2px); transition: background .15s; }
.opts > div:nth-child(odd) { background: hsl(var(--muted) / .45); }
.opts > div:hover { background: hsl(var(--blue) / .1); }
.opts dt { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; font-family: Consolas, Monaco, "Courier New", monospace; font-size: .8125rem; }
.opts dt code { font-weight: 600; color: hsl(var(--link)); }
.opts dt code + code { font-weight: 400; color: hsl(var(--foreground)); }
.opts .arg { color: hsl(var(--muted-foreground)); }
.opts dd { margin: 0; font-size: .875rem; }
@media (max-width: 640px) { .opts > div { grid-template-columns: minmax(0, 1fr); gap: .125rem; } }

.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem; margin: 1.75rem 0 2.5rem; }
@media (max-width: 760px) { .compare { grid-template-columns: minmax(0, 1fr); gap: 2rem; } }
.compare-col { --c: var(--blue); display: flex; flex-direction: column; }
.compare-col .facts { margin-top: auto; }
.compare-col .callout { margin-bottom: .75rem; }
.compare-col.c-green { --c: var(--green); }
.compare-col h3 { margin-top: .5rem; }
.compare-col h3::after { content: ""; display: block; width: 2.5rem; height: 3px; margin-top: .5rem; border-radius: 2px; background: hsl(var(--c)); }
.proto { align-self: flex-start; display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .1em; padding: .15rem .5rem; border-radius: 4px; color: #fff; background: hsl(var(--c)); }
.proscons { list-style: none; padding: 0 !important; }
.proscons li { position: relative; padding-left: 1.5rem; }
.proscons li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.proscons .pro::before { content: "+"; color: hsl(var(--green)); }
.proscons .con::before { content: "\2212"; color: hsl(var(--red)); }
.facts { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .8125rem; color: hsl(var(--muted-foreground)); }
.facts strong { color: hsl(var(--foreground)); font-weight: 600; }
.docs .callout { border: 0; border-left: 3px solid hsl(var(--orange)); border-radius: 0 calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0; background: hsl(var(--orange) / .1); }

.direction { display: inline-flex; align-items: center; gap: .625rem; margin-bottom: .25rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: hsl(var(--muted-foreground)); }
.split .direction + h3 { margin-top: .375rem; }
.arrow { position: relative; display: inline-block; width: 3.5rem; height: 2px; background: hsl(var(--link)); }
.arrow::before, .arrow::after { content: ""; position: absolute; top: -4px; border: 5px solid transparent; }
.arrow.left::before, .arrow.both::before { left: -6px; border-right-color: hsl(var(--link)); border-left: 0; }
.arrow.both::after { right: -6px; border-left-color: hsl(var(--link)); border-right: 0; }

.glossary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 2.5rem; margin: 1rem 0 0; }
@media (max-width: 640px) { .glossary { grid-template-columns: minmax(0, 1fr); } }
.glossary dt { font-weight: 600; font-family: Consolas, Monaco, "Courier New", monospace; font-size: .875rem; color: hsl(var(--link)); }
.glossary dt .muted { font-family: inherit; font-weight: 400; }
.glossary dd { margin: .125rem 0 0; color: hsl(var(--muted-foreground)); font-size: .875rem; }

.more-links { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.more-links a { font-weight: 600; font-size: 1rem; }
.more-links a span { display: inline-block; transition: transform .15s; }
.more-links a:hover { text-decoration: none; }
.more-links a:hover span { transform: translateX(4px); }

.docs .toc { top: 1.5rem; border-left: 1px solid hsl(var(--border)); padding-left: .25rem; }
.docs .toc h2 { padding: 0 .75rem; margin-bottom: .5rem; }
.docs .toc nav { padding: 0; gap: .0625rem; }
.docs .toc a { position: relative; border-radius: 0; padding: .3rem .75rem; color: hsl(var(--muted-foreground)); transition: color .15s; }
.docs .toc a.sub { padding-left: 1.5rem; font-size: .78rem; }
.docs .toc a:hover { background: none; color: hsl(var(--foreground)); }
.docs .toc a.active { color: hsl(var(--link)); font-weight: 600; }
.docs .toc a.active::before { content: ""; position: absolute; left: calc(-.25rem - 1px); top: .2rem; bottom: .2rem; width: 2px; border-radius: 2px; background: hsl(var(--link)); }

/* Testing process page */
.journey { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; list-style: none; padding: 0 !important; margin: 1.75rem 0 2.25rem !important; }
.journey::before {
  content: ""; position: absolute; top: calc(1.625rem - 2px); left: 12.5%; right: 12.5%; height: 4px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, hsl(var(--link)) 0 10px, transparent 10px 22px), hsl(var(--border));
  background-size: 22px 100%, auto; animation: flow-run .8s linear infinite;
}
.journey li { display: flex; flex-direction: column; align-items: center; gap: .125rem; margin: 0; text-align: center; }
.journey .flow-icon { position: relative; box-shadow: none; background-color: hsl(var(--background)); background-image: linear-gradient(hsl(var(--blue) / .1), hsl(var(--blue) / .1)); }
@media (max-width: 640px) {
  .journey { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.5rem; }
  .journey::before { display: none; }
}

.checks { list-style: none; padding: 0 !important; }
.checks li { position: relative; padding-left: 1.5rem; margin: .4rem 0; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .2rem; width: 1rem; height: 1rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322c55e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / .85rem no-repeat;
}
.checks.crosses li::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / .75rem no-repeat;
}

.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 1.5rem 0 1.75rem; }
@media (max-width: 640px) { .kpis { grid-template-columns: minmax(0, 1fr); gap: 1rem; } }
.kpi { padding-left: 1rem; border-left: 2px solid hsl(var(--border)); }
.kpi-value { display: block; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-label { display: block; margin-top: .125rem; font-size: .8125rem; color: hsl(var(--muted-foreground)); }

.res-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem 1.5rem; margin: 1rem -.625rem 0; }
@media (max-width: 640px) { .res-links { grid-template-columns: minmax(0, 1fr); } }
.res-links a { display: flex; align-items: center; gap: .875rem; padding: .625rem; border-radius: var(--radius); color: hsl(var(--foreground)); transition: background .15s; }
.res-links a:hover { text-decoration: none; background: hsl(var(--muted) / .6); }
.res-icon { flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); transition: color .15s; }
.res-links a:hover .res-icon { color: hsl(var(--link)); }
.res-links strong { display: block; font-size: .9375rem; }
.res-links small { display: block; font-size: .8125rem; color: hsl(var(--muted-foreground)); word-break: break-word; }
.res-links .go { margin-left: auto; color: hsl(var(--muted-foreground)); opacity: 0; transition: transform .15s, opacity .15s; }
.res-links a:hover .go { opacity: 1; transform: translateX(4px); }

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease-out, transform .5s ease-out; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .t-type { animation: none; width: auto; }
  .t-line { animation: none; opacity: 1; }
  .t-cursor, .flow-wire, .journey::before { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* About page */
.about-hero { display: flex; align-items: flex-start; gap: 1.75rem; }
.avatar {
  flex: none; align-self: center; width: 96px; height: 96px; border-radius: 50%;
  box-shadow: 0 0 0 4px hsl(var(--background)), 0 0 0 6px hsl(var(--link) / .35), 0 12px 28px -10px rgb(15 23 42 / .35);
}
@media (max-width: 640px) {
  .about-hero { flex-direction: column; gap: 1.25rem; }
  .avatar { align-self: flex-start; width: 72px; height: 72px; }
}
.about-body { max-width: 1000px; margin-top: .5rem; }
.about-body h3 { margin-top: 0; }
.about-body .res-links { margin-top: .75rem; }

.feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; margin: 2.25rem 0 3.25rem; }
.feature.flip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.feature.flip .feature-shots { order: 2; }
@media (max-width: 760px) {
  .feature, .feature.flip { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin-bottom: 2.75rem; }
  .feature.flip .feature-shots { order: 0; }
}
.feature-shots { position: relative; padding: 0 2.5rem 2.25rem 0; }
.feature-shots a {
  display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius);
  background: hsl(var(--muted)); box-shadow: 0 18px 40px -18px rgb(15 23 42 / .45), 0 0 0 1px hsl(var(--border));
  transition: transform .25s ease-out;
}
.feature-shots.single { padding: 0; }
.feature-shots a + a { position: absolute; right: 0; bottom: 0; width: 55%; }
.feature-shots a:hover { transform: translateY(-4px); z-index: 1; }
.feature-shots img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.feature h3 { font-size: 1.35rem; margin: .25rem 0 .625rem; }
.feature p { color: hsl(var(--muted-foreground)); }
.app-tech { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: hsl(var(--link)); }
@media (prefers-reduced-motion: reduce) { .feature-shots a { transition: none; } }

/* Not found */
.notfound { padding-top: 2rem; }
.notfound .hero-title { margin-top: .5rem; }
.notfound-tip { margin-top: 1.25rem; font-size: .875rem; }
.notfound-term i { font-style: normal; font-weight: 600; color: hsl(var(--red)); }
.notfound-term .t-type { animation: nf-type 1.4s steps(37, end) .3s forwards; }
@keyframes nf-type { to { width: 37ch; } }
@media (prefers-reduced-motion: reduce) { .notfound-term .t-type { animation: none; width: auto; } }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 1rem);
  padding: .5rem .875rem; border-radius: var(--radius); font-size: .875rem; font-weight: 500;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  box-shadow: 0 10px 25px -5px rgb(0 0 0 / .25); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Tooltip for status dots */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  padding: .375rem .625rem; border-radius: calc(var(--radius) - 2px); white-space: nowrap;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: .75rem; font-weight: 500; z-index: 30; pointer-events: none;
}
@media (max-width: 760px) {
  [data-tip]:hover::after, [data-tip]:focus-visible::after { left: 0; transform: none; }
}

noscript .card-body { color: hsl(var(--muted-foreground)); }
