@layer pages {
/* /network-health: a drafting sheet, not a speedometer. Numbered sheet heads (01 setup, 02 test, 03 measuring,
   then the result), a hairline readout like a dimension table, and every figure labelled measured, derived or not
   available in words, so colour is never the only signal. */

.nh-intro h1 { max-width: 20ch; }
.nh-intro .lede { max-width: 58ch; }
.nh-motto {
  margin-top: var(--space-4); font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; font-weight: var(--fw-semibold); color: var(--accent);
}
.nh-body { max-width: calc(var(--w-content) + 2 * var(--gutter)); padding-bottom: var(--section-y-tight); }
.nh-noscript { padding: var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); margin-top: var(--space-6); }

.nh-label, .nh-sheet-n, .nh-verdict-label, .nh-finding-k, .nh-fig-k, .nh-fig dt, .nh-cell dt {
  font-family: var(--font-mono); font-size: var(--fs-label); line-height: var(--lh-label); letter-spacing: var(--ls-label);
  text-transform: uppercase; font-weight: var(--fw-semibold); color: var(--text-muted);
}
.nh-label { display: block; margin: 0 0 var(--space-2); }
.nh-opt { text-transform: none; letter-spacing: 0; font-weight: var(--fw-regular); }

/* ----- Sheets ----- */
.nh-sheet { margin-top: var(--space-8); }
.nh-sheet-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-3); align-items: baseline; padding-bottom: var(--space-3); border-bottom: 1px solid var(--border-strong); margin-bottom: var(--space-5); }
.nh-sheet-head + .nh-grid + .nh-sheet-head, .nh-grid + .nh-sheet-head { margin-top: var(--space-8); }
.nh-sheet-n { color: var(--primary); }
.nh-sheet-head h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); margin: 0; }
.nh-sheet-head p { grid-column: 2; margin: var(--space-1) 0 0; color: var(--text-muted); max-width: var(--w-prose); }

/* ----- Setup ----- */
.nh-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
@media (min-width: 768px) { .nh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); } }
.nh-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.nh-field input[type="number"], .nh-field input[type="text"] {
  width: 100%; min-height: var(--control-md); padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font-size: var(--fs-ui);
}
.nh-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.nh-pair label { display: grid; gap: var(--space-1); }
.nh-unit { font-size: var(--fs-small); color: var(--text-muted); }
.nh-choice { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.nh-choice legend { width: 100%; }
.nh-choice label, .nh-mode { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-sm); cursor: pointer; }
.nh-select { position: relative; display: block; }
.nh-select select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: var(--control-md);
  padding: var(--space-2) var(--space-10) var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font-size: var(--fs-ui); cursor: pointer;
}
.nh-select::after {
  content: ""; position: absolute; right: var(--space-4); top: 50%; width: 8px; height: 8px; pointer-events: none;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: translateY(-70%) rotate(45deg);
}

.nh-modes { margin: 0; padding: 0; border: 0; display: grid; gap: var(--space-3); }
.nh-mode { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.nh-mode:has(input:checked) { border-color: var(--primary); }
.nh-mode input { margin-top: var(--space-1); }
.nh-mode-name { font-weight: var(--fw-semibold); }
.nh-mode-note { grid-column: 2; color: var(--text-muted); font-size: var(--fs-small); }
.nh-data-note { color: var(--text-muted); font-size: var(--fs-small); max-width: var(--w-prose); margin-top: var(--space-3); }
.nh-actions { margin-top: var(--space-5); }

/* ----- Live readout: a dimension table that fills in ----- */
.nh-meter { height: var(--space-1); background: var(--border); border-radius: var(--radius-pill); overflow: hidden; }
.nh-meter span { display: block; height: 100%; width: 0; background: var(--primary); transition: width var(--dur) var(--ease); }
.nh-readout, .nh-figures { display: grid; grid-template-columns: minmax(0, 1fr); margin: var(--space-5) 0 0; border-top: 1px solid var(--border); }
@media (min-width: 768px) { .nh-readout, .nh-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); } }
.nh-cell, .nh-fig { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
.nh-cell dd { margin: 0; font-family: var(--font-mono); font-size: var(--fs-h3); font-weight: var(--fw-bold); color: var(--text-muted); }
.nh-cell.is-set dd { color: var(--text); }

/* ----- Result ----- */
.nh-result { padding-top: var(--space-8); }
.nh-result:focus { outline: none; }
.nh-result:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: var(--space-2); }
.nh-verdict { padding-bottom: var(--space-5); border-bottom: 1px solid var(--border-strong); }
.nh-verdict > * + * { margin-top: var(--space-2); }
.nh-verdict-label { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.nh-verdict-label::before { content: ""; width: 8px; height: 8px; flex: none; background: var(--text-muted); }
.nh-verdict--good .nh-verdict-label::before { background: var(--success); }
.nh-verdict--probable .nh-verdict-label::before { background: var(--accent); }
.nh-verdict--possible .nh-verdict-label::before { background: var(--warning); }
.nh-verdict-title { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); font-weight: var(--fw-bold); text-wrap: balance; max-width: 30ch; }
.nh-verdict-meta { color: var(--text-muted); font-size: var(--fs-small); }

.nh-fig { flex-wrap: wrap; }
.nh-fig dt { flex: 1 1 auto; }
.nh-fig dd { margin: 0; display: grid; justify-items: end; text-align: right; }
.nh-fig-v { font-family: var(--font-mono); font-size: var(--fs-h3); font-weight: var(--fw-bold); }
.nh-fig--derived .nh-fig-v { color: var(--primary); }
.nh-fig--unavailable .nh-fig-v { color: var(--text-muted); font-size: var(--fs-body); }
.nh-fig-note { font-size: var(--fs-small); color: var(--text-muted); max-width: 34ch; }

.nh-scores { margin-top: var(--space-5); display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.nh-scores .nh-label { margin: 0 var(--space-2) 0 0; }
.nh-score { padding: var(--space-1) var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: var(--fs-small); text-transform: capitalize; }

.nh-findings { list-style: none; margin: var(--space-6) 0 0; padding: 0; border-top: 1px solid var(--border-strong); }
.nh-finding { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding-block: var(--space-5); border-bottom: 1px solid var(--border); }
@media (min-width: 768px) { .nh-finding { grid-template-columns: var(--space-12) minmax(0, 1fr); column-gap: var(--space-4); } }
.nh-finding-n { font-family: var(--font-mono); font-weight: var(--fw-bold); color: var(--primary); }
.nh-finding h3 { font-size: var(--fs-title); line-height: var(--lh-title); margin: var(--space-1) 0 var(--space-2); }
.nh-finding p { max-width: var(--w-prose); }
.nh-finding--good .nh-finding-k { color: var(--success); }
.nh-finding--probable .nh-finding-k { color: var(--accent); }
.nh-steps { margin: var(--space-3) 0 0; padding-left: 1.2em; max-width: var(--w-prose); }
.nh-steps li + li { margin-top: var(--space-1); }
.nh-finding-links { margin-top: var(--space-3); font-weight: var(--fw-semibold); }

.nh-buy { margin-top: var(--space-5); padding: var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); max-width: var(--w-prose); }
.nh-buy .nh-label { display: inline; margin-right: var(--space-2); }
.nh-result-actions { margin-top: var(--space-5); }
.nh-action-note { margin-top: var(--space-3); min-height: var(--space-5); }
.nh-limits { color: var(--text-muted); font-size: var(--fs-small); max-width: var(--w-prose); margin-top: var(--space-3); }

/* ----- History ----- */
.nh-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.nh-table th, .nh-table td { text-align: left; padding: var(--space-2) var(--space-3) var(--space-2) 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.nh-table thead th { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: var(--ls-label); color: var(--text-muted); font-weight: var(--fw-semibold); }
.nh-table td { font-family: var(--font-mono); white-space: nowrap; }
.nh-row-actions { text-align: right; }
.nh-row-actions .link-button { color: var(--link); text-decoration: underline; }
@media (max-width: 767px) {
  .nh-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .nh-table tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-1); padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
  .nh-table th[scope="row"] { grid-column: 1 / -1; border: 0; padding: 0; }
  .nh-table td { border: 0; padding: 0; }
  .nh-row-actions { grid-column: 1 / -1; text-align: left; }
}
.nh-compare { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
@media (min-width: 768px) { .nh-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-5); } .nh-compare .nh-label, .nh-compare-out { grid-column: 1 / -1; } }
.nh-compare-out { margin: 0; max-width: var(--w-prose); }
.nh-history p:last-child { margin-top: var(--space-5); }

/* ----- About and next ----- */
.nh-prose { max-width: var(--w-prose); }
.nh-prose h3 { font-size: var(--fs-title); line-height: var(--lh-title); margin: var(--space-6) 0 var(--space-2); }
.nh-prose h3:first-child { margin-top: 0; }
.nh-prose ul { padding-left: 1.2em; }
.nh-prose li + li { margin-top: var(--space-2); }
.nh-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--border); }
@media (min-width: 768px) { .nh-links { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-8); } }
.nh-links li { display: grid; gap: var(--space-1); padding-block: var(--space-3); border-bottom: 1px solid var(--border); }
.nh-links a { font-weight: var(--fw-semibold); }
.nh-links span { color: var(--text-muted); font-size: var(--fs-small); }
.nh-meta { margin-top: var(--space-8); }
}
