/* Shared styles for the probe tools: ping, traceroute, http-check, port-check.
   Colours come from the site variables; the three state colours are tuned to
   read on both the dark and the light theme. */
.np-root { --np-ok: #2fa866; --np-warn: #c98a1b; --np-bad: #d9534f; }

/* Panels that span both columns of .ub-tool-layout */
.np-wide { grid-column: 1 / -1; min-width: 0; }

.np-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.np-row2 > .ub-input-group { min-width: 0; margin-bottom: 18px; }
@media (max-width: 480px) { .np-row2 { grid-template-columns: 1fr; } }

.np-hint { font-size: 0.78rem; color: var(--text-tertiary); margin: 6px 0 0; line-height: 1.5; }
.np-err { margin-top: 12px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, #d9534f 45%, transparent); background: color-mix(in srgb, #d9534f 9%, transparent); color: var(--text-primary); font-size: 0.86rem; line-height: 1.5; }
.np-err[hidden], .np-banner[hidden] { display: none; }

.np-presets { margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-input); }
.np-presets__title { font-size: 0.75rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; font-weight: 600; }
.np-presets__row { display: flex; gap: 6px; flex-wrap: wrap; }
.np-presets__row .ub-tool-btn { flex: 1 1 auto; min-height: 40px; padding: 8px 12px; font-size: 0.82rem; white-space: nowrap; }
.np-presets__row .ub-tool-btn.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }

.np-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.np-chip { padding: 5px 10px; border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-secondary); font-family: var(--font-mono); font-size: 0.76rem; cursor: pointer; }
.np-chip:hover, .np-chip.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-muted); }

/* Example / live banner above the results */
.np-banner { margin: 12px 16px 0; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 0.82rem; line-height: 1.5; border: 1px solid var(--border); background: var(--bg-input); color: var(--text-secondary); }
.np-banner strong { color: var(--text-primary); }
.np-banner--example { border-color: var(--accent-border); background: var(--accent-muted); }
.np-banner--running { border-style: dashed; }
.np-banner--error { border-color: color-mix(in srgb, #d9534f 45%, transparent); }
.np-verdict { margin: 0 16px 12px; font-size: 0.86rem; line-height: 1.55; color: var(--text-secondary); }
.np-verdict strong { color: var(--text-primary); }

/* Map */
.np-map { width: 100%; height: auto; display: block; }
.np-map__sea { fill: var(--bg-input); }
.np-map__grid { stroke: var(--border-subtle); stroke-width: 1; }
.np-map__land { fill: color-mix(in srgb, var(--text-tertiary) 38%, transparent); stroke: none; }
.np-map__pt circle { stroke: var(--bg-card); stroke-width: 3; }
.np-map__pt text { font: 700 19px var(--font-mono, monospace); fill: #fff; pointer-events: none; }
.np-map__pt--ok circle { fill: var(--np-ok); }
.np-map__pt--warn circle { fill: var(--np-warn); }
.np-map__pt--bad circle { fill: var(--np-bad); }
.np-map__pt--idle circle { fill: var(--text-tertiary); }
.np-map__pt.is-sel circle { stroke: var(--accent); stroke-width: 5; }

/* Generic SVG chart text */
.np-svg text { font-family: var(--font-mono, monospace); fill: var(--text-secondary); }
.np-svg .np-axis { stroke: var(--border); stroke-width: 1; }
.np-svg .np-grid { stroke: var(--border-subtle); stroke-width: 1; }

/* Results */
.np-results { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); }
.np-results__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 0.8rem; color: var(--text-secondary); }
.np-results__bar .np-spacer { flex: 1; }
.np-results__bar a { color: var(--accent); }
.np-mini-btn { padding: 6px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: transparent; color: var(--text-primary); font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.np-mini-btn:hover { border-color: var(--accent); color: var(--accent); }
.np-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.np-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.np-table th, .np-table td { padding: 9px 12px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.np-table th { font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-tertiary); font-weight: 600; white-space: nowrap; }
.np-table td { color: var(--text-primary); }
.np-table .np-mono { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-secondary); white-space: nowrap; }
.np-table tr.is-sel td { background: var(--accent-muted); }
.np-table tbody tr[data-i] { cursor: pointer; }
.np-table tbody tr[data-i]:hover td { background: var(--bg-card-hover); }
.np-probe { display: flex; align-items: center; gap: 8px; }
.np-cc { display: inline-block; min-width: 26px; padding: 1px 4px; border-radius: 3px; border: 1px solid var(--border); font: 600 0.68rem var(--font-mono); text-align: center; color: var(--text-secondary); }
.np-probe__loc { display: block; font-weight: 500; }
.np-probe__net { display: block; color: var(--text-tertiary); font-family: var(--font-mono); font-size: 0.7rem; margin-top: 2px; }
.np-num { display: inline-block; min-width: 20px; padding: 0 5px; margin-right: 6px; border-radius: 10px; background: #5c6370; color: #fff; font: 700 0.7rem/18px var(--font-mono); text-align: center; }
.np-num--ok { background: #1d7a47; } .np-num--warn { background: var(--np-warn); color: #1a1a1a; } .np-num--bad { background: #b3302c; }   /* badge text needs 4.5:1: white on #1d7a47 = 5.35, #1a1a1a on #c98a1b = 5.91, white on #b3302c = 6.22, white on #5c6370 = 6.05 */

.np-st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.78rem; white-space: nowrap; }
.np-st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.np-st--ok { color: var(--np-ok); } .np-st--warn { color: var(--np-warn); } .np-st--bad { color: var(--np-bad); } .np-st--idle { color: var(--text-tertiary); }
.np-bar { display: inline-block; vertical-align: middle; width: 80px; height: 6px; margin-left: 8px; background: var(--border-subtle); border-radius: 3px; overflow: hidden; }
.np-bar > span { display: block; height: 100%; background: var(--accent); }
.np-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 3px; font-size: 0.68rem; font-weight: 600; border: 1px solid var(--border); color: var(--text-secondary); white-space: nowrap; }

.np-raw { margin: 0; padding: 10px 12px; max-height: 260px; overflow: auto; background: var(--bg-input); border-radius: var(--radius-sm); font: 0.74rem/1.5 var(--font-mono); color: var(--text-secondary); white-space: pre; }
.np-details > summary { cursor: pointer; color: var(--accent); font-size: 0.78rem; font-weight: 600; }
.np-details[open] > summary { margin-bottom: 6px; }
.np-empty { padding: 28px 16px; text-align: center; color: var(--text-tertiary); font-size: 0.88rem; }
.np-foot { padding: 10px 16px; font-size: 0.74rem; color: var(--text-tertiary); border-top: 1px solid var(--border-subtle); }
.np-foot a { color: var(--accent); }

/* Reference tables in the content area */
.np-ref { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.np-ref th, .np-ref td { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); text-align: left; vertical-align: top; }
.np-ref th { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); }
.np-ref td code { font-size: 0.8rem; }
.np-sw-note { font-family: var(--font-body); font-size: 0.8rem; color: var(--text-tertiary); margin: 12px 0 0; line-height: 1.6; }
.ub-tool-viz .np-canvas { padding: 14px 16px 6px; min-height: 0; display: block; flex: 0 0 auto; }
