/* Netconnex voice connection check.
   Brand colours live in :root — adjust these to match the website. */
:root {
  /* netconnex corporate identity (unified portal) */
  --header: #11141f;
  --bg-1: #ebecf4;
  --bg-2: #d8def7;
  --panel: #f5f6fc;
  --ink: #11141f;
  --muted: #555a6e;
  --line: #d6d9ea;
  --field: #ffffff;
  --brand-blue: #288bff;
  --brand-purple: #5347f5;
  --action: #0078d6;
  --action-text: #ffffff;
  --scope: #11141f;
  --scope-grid: #2a2e44;
  --scope-text: #9ca2bd;
  --trace: #288bff;
  --bw-down: #288bff;
  --bw-up: #9a8cff;
  --loss: #ff5a4f;
  --good: #1d7a4f;
  --fair: #a56508;
  --poor: #c0262d;

  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Ubuntu, Cantarell, system-ui, sans-serif;
  --measure: 46rem;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(115deg, var(--bg-1) 0%, var(--bg-2) 60%, #e3e5f6 100%);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font);
  font-variant-numeric: tabular-nums;
}

.site { background: var(--header); color: #fff; }
.site-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: .875rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .625rem;
}
.logo { height: 28px; width: auto; display: block; }
.lockup { font-size: 1.25rem; line-height: 1; opacity: .85; }
.product { font-size: 1.375rem; font-weight: 400; letter-spacing: -.01em; line-height: 1; white-space: nowrap; }
.product b { font-weight: 700; }

main {
  max-width: var(--measure);
  margin: 2.5rem auto 4rem;
  padding: 2.75rem 2.5rem 3rem;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(17, 20, 31, .06), 0 8px 28px rgba(60, 70, 140, .08);
}

h1 {
  font-size: clamp(2rem, 5.5vw, 2.875rem);
  line-height: 1.08;
  letter-spacing: -.025em;
  font-weight: 700;
  margin: 0 0 1rem;
  max-width: 18ch;
}
h2 { font-size: 1.25rem; line-height: 1.3; margin: 2.5rem 0 .75rem; }

.lede { font-size: 1.1875rem; color: var(--muted); margin: 0 0 2.25rem; max-width: 38em; }

/* ---------- form */
fieldset { border: 0; padding: 0; margin: 0 0 1.75rem; }
legend { font-weight: 600; margin-bottom: .625rem; padding: 0; }

.choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.choices label {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .875rem;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: .9688rem;
}
.choices label:has(input:checked) { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.choices input { accent-color: var(--action); margin: 0; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2rem; }
.fields label { display: flex; flex-direction: column; gap: .375rem; font-weight: 600; font-size: .9688rem; }
.opt { margin-left: .25rem; }
.opt { font-weight: 400; color: var(--muted); }
.fields input {
  font: inherit; font-weight: 400;
  padding: .625rem .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--ink);
}

button { font: inherit; cursor: pointer; }
.primary {
  background: var(--action); color: var(--action-text);
  border: 0; border-radius: 6px;
  padding: .875rem 1.5rem;
  font-weight: 600; font-size: 1.0625rem;
}
.primary:hover { filter: brightness(1.1); }
.primary:disabled { opacity: .5; cursor: default; }

.actions button {
  background: var(--field); color: var(--ink);
  border: 1px solid #b9bdd2; border-radius: 6px;
  padding: .625rem 1rem; font-weight: 600;
}
.actions button:hover { border-color: var(--action); color: var(--action); }

:focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 2px; }

.fine { font-size: .9375rem; color: var(--muted); margin: 1rem 0 0; max-width: 34em; }

/* ---------- scope: the live packet trace */
.scope {
  background: var(--scope);
  border-radius: 10px;
  padding: 1rem 1rem .75rem;
  margin: 0 0 1.5rem;
}
#trace { display: block; width: 100%; height: 220px; }
.scope-key { display: flex; flex-wrap: wrap; gap: .375rem 1.25rem; margin-top: .5rem; font-size: .8125rem; color: var(--scope-text); }
.scope-key span { white-space: nowrap; }
.scope-key span::before {
  content: ""; display: inline-block; vertical-align: middle;
  margin-right: .5rem; width: 18px; height: 3px; border-radius: 2px;
}
.key-trace::before { background: var(--trace); }
.key-down::before { background: var(--bw-down); }
.key-up::before { background: var(--bw-up); }
.key-cap::before { background: repeating-linear-gradient(90deg, var(--scope-text) 0 5px, transparent 5px 9px) !important; height: 1px !important; }

.scope-tabs { display: flex; gap: .25rem; margin: -.25rem 0 .75rem; }
.scope-tabs button {
  background: transparent; color: var(--scope-text);
  border: 1px solid transparent; border-radius: 999px;
  padding: .3rem .8rem; font-size: .8125rem; font-weight: 600;
}
.scope-tabs button:hover { color: #fff; }
.scope-tabs button[aria-pressed="true"] { color: #fff; border-color: var(--scope-grid); background: rgba(255, 255, 255, .06); }
.key-loss::before { background: var(--loss); width: 3px !important; height: 12px !important; }

.live { display: flex; gap: 2.5rem; margin: 0 0 1.75rem; }
.live div { display: flex; flex-direction: column-reverse; }
.live dt { color: var(--muted); font-size: .9375rem; }
.live dd { margin: 0; font-size: 1.75rem; font-weight: 650; letter-spacing: -.01em; }

.steps { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); counter-reset: step; }
.steps li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .75rem 0; border-bottom: 1px solid var(--line);
  color: var(--muted); counter-increment: step;
}
.steps .step-name::before { content: counter(step) ". "; }
.steps li.active { color: var(--ink); font-weight: 600; }
.steps li.done { color: var(--ink); }
.steps li.failed { color: var(--poor); }
.step-state { font-weight: 400; }

/* ---------- result */
#result { margin-top: 2.75rem; }
#run .lede { margin-bottom: 1.75rem; }
.verdict {
  font-size: clamp(1.625rem, 4.5vw, 2.25rem);
  line-height: 1.15; letter-spacing: -.02em; font-weight: 700;
  margin: 0 0 .5rem; padding-left: 1rem;
  border-left: 6px solid currentColor;
}
.verdict.good { color: var(--good); }
.verdict.fair { color: var(--fair); }
.verdict.poor { color: var(--poor); }
.verdict-sub { margin: 0 0 2rem; color: var(--muted); max-width: 38em; }

.metrics { width: 100%; border-collapse: collapse; }
.metrics th, .metrics td { text-align: left; padding: .7rem .5rem .7rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.metrics th { font-weight: 600; width: 38%; }
.metrics td.grade { text-align: right; white-space: nowrap; padding-right: 0; font-weight: 600; }
.metrics td.grade::before {
  content: ""; display: inline-block; width: .625rem; height: .625rem;
  border-radius: 50%; margin-right: .5rem; background: currentColor; vertical-align: .05em;
}
.grade.good { color: var(--good); }
.grade.fair { color: var(--fair); }
.grade.poor { color: var(--poor); }
.grade.none { color: var(--muted); }
.grade.none::before { background: transparent; border: 1px solid currentColor; }
.metrics .detail { display: block; color: var(--muted); font-size: .875rem; }

.advice { padding-left: 1.25rem; margin: 0; }
.advice li { margin-bottom: .625rem; max-width: 38em; }

.testid { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.testid strong { font-size: 1.125rem; letter-spacing: .04em; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.where { color: var(--muted); margin-top: -.25rem; }
.where strong { color: var(--ink); }
.attrib { font-size: .8125rem; margin-left: .25rem; color: var(--muted); }
.attrib a { color: var(--muted); }

.error { color: var(--poor); font-weight: 600; margin-top: 1.5rem; }

@media (max-width: 560px) {
  main { margin: 0 0 2rem; border-radius: 0; padding: 2rem 1.25rem 2.5rem; box-shadow: none; }
  .logo { height: 22px; }
  .product { font-size: .9375rem; }
  .site-inner { gap: .5rem; }
  .lockup { font-size: 1rem; }
  .fields { grid-template-columns: 1fr; }
  .live { gap: 1.5rem; }
  .live dd { font-size: 1.375rem; }
  #trace { height: 170px; }
  .metrics th { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
