/* ==========================================================================
   NEXA-PING design system — tool pages
   The command card every measurement starts from, the input with its history, the summary of
   resolved addresses, the figures of the run over the map, the map with its statistics and its
   tooltip, and the tables of results: whole on a desk, a card a line on a phone.
   ========================================================================== */

/* ---- command card -------------------------------------------------------- */

/* a layer over the cards that follow: the list of earlier targets opens out of it and over them
   (its own order counts only inside the card it is in) */
.nx-command { position: relative; z-index: 20; padding: 18px 20px 16px; }
.nx-command-form { display: grid; gap: 14px; }
.nx-target-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.nx-target { flex: 1 1 auto; min-width: 0; }
.nx-actions { display: flex; align-items: stretch; gap: 8px; flex: 0 0 auto; }
/* where there is room the buttons stand beside the input; below that they take the line under it */
@media (min-width: 1180px) {
	.nx-target-row { flex-wrap: nowrap; }
	.nx-target-row > .kkyun-history-input { flex: 1 1 0; width: auto; }
}

/* the input with the list of what was measured before (the history component builds the rest) */
.kkyun-history-input { position: relative; width: 100%; min-width: 0; }
.kkyun-history-input > .form-control { height: 46px; padding-right: 100px; font-family: var(--mono); font-size: 15px; font-weight: 500; }
.kkyun-history-input:not(.has-suffix) > .form-control { padding-right: 46px; }
.kkyun-history-suffix { position: absolute; top: 0; right: 0; display: flex; align-items: center; height: 100%; padding-right: 6px; }
.kkyun-compare-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border: 1.5px dashed var(--line-2); border-radius: var(--r-pill); background: transparent; color: var(--ink-3); font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.kkyun-compare-toggle .ic { font-size: 16px; }
.kkyun-compare-toggle:hover { border-color: var(--accent); border-style: solid; color: var(--accent-ink); background: var(--accent-soft); }
.kkyun-compare-toggle.active { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
/* the row of a comparison holds both targets: under the first target, across the card */
.kkyun-compare-row { flex: 1 1 420px; min-width: 0; }
.kkyun-compare-row .form-control { height: 44px; }
.kkyun-compare-row::before { content: "对比目标"; position: absolute; left: 16px; top: -9px; z-index: 1; padding: 1px 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 11.5px; font-weight: 600; line-height: 16px; }

/* the tag a typed target folds into, the clear button, and the list of earlier targets */
.kkyun-history-tag-wrap { display: flex; align-items: center; width: 100%; min-height: 46px; padding: 0 8px 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); cursor: text; transition: border-color 0.2s, box-shadow 0.2s; }
.kkyun-history-tag-wrap:hover, .kkyun-history-tag-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.kkyun-history-tag { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 32px; padding: 0 4px 0 12px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); font-size: 14px; font-weight: 600; }
.kkyun-history-tag > span { overflow-wrap: anywhere; }
.kkyun-history-tag-remove, .clear_input { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--accent-ink); font-size: 17px; line-height: 1; opacity: 0.7; transition: background 0.15s, opacity 0.15s; }
.kkyun-history-tag-remove:hover, .clear_input:hover { background: var(--accent-soft-2); opacity: 1; }
.kkyun-history-input > .clear_input { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); color: var(--ink-3); }
/* the list of earlier targets: a panel under the input. Its search and each of its lines begin
   with a mark of one size standing at one place, so that a target stands under the text of the
   search; a list longer than the panel scrolls inside it */
.kkyun-history-dropdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40; max-height: min(62vh, 440px); overflow-y: auto; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--sh-3); animation: nx-pop 0.2s var(--ease-out); }
.kkyun-history-search-wrap { position: relative; margin-bottom: 6px; }
.kkyun-history-search { width: 100%; height: 40px; padding: 0 14px 0 38px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 14px; outline: none; transition: background 0.2s, box-shadow 0.2s; }
.kkyun-history-search::placeholder { color: var(--ink-4); }
.kkyun-history-search:focus { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent); }
.kkyun-history-mark { position: absolute; top: 50%; left: 12px; width: 18px; height: 18px; color: var(--ink-4); font-size: 18px; transform: translateY(-50%); pointer-events: none; }
.kkyun-history-row { display: grid; grid-template-columns: minmax(0, 1fr) 30px 30px; align-items: center; gap: 2px; border-radius: 12px; transition: background 0.12s; }
.kkyun-history-row:hover, .kkyun-history-row.is-active { background: var(--accent-soft); }
.kkyun-history-item { display: flex; align-items: center; height: 40px; padding: 0 10px 0 12px; border: 0; background: transparent; color: var(--ink-2); font-family: var(--mono); font-size: 14px; text-align: left; overflow-wrap: anywhere; }
.kkyun-history-item .kkyun-history-mark { position: static; flex: 0 0 18px; margin-right: 8px; transform: none; }
.kkyun-history-row.is-active .kkyun-history-item { color: var(--accent-ink); font-weight: 600; }
.kkyun-history-favorite, .kkyun-history-delete { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-4); font-size: 15px; transition: background 0.15s, color 0.15s; }
.kkyun-history-favorite:hover, .kkyun-history-delete:hover { background: var(--surface-3); color: var(--ink); }
.kkyun-history-favorite.is-favorite { color: var(--warn); }
.kkyun-history-delete:hover { color: var(--bad); background: var(--bad-soft); }
.kkyun-history-empty { padding: 14px; color: var(--ink-3); font-size: 13.5px; text-align: center; }

/* the options under the target: carriers as chips, the resolver on the right */
.nx-options { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.kkyun-network-checks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kkyun-dns-options { display: flex; align-items: center; gap: 6px; }
.kkyun-dns-options .nx-input { width: 180px; }
.kkyun-dns-options .nx-input:disabled { opacity: 0.6; }

/* ---- summary of the resolved addresses ----------------------------------- */

.nx-summary { border-radius: var(--r-lg); }
.dns-summary-panel { padding: 14px 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.dns-summary-panel[hidden] { display: none !important; }
.dns-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap; }
.dns-summary-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.dns-summary-title h2 { color: var(--ink-3); font-size: 14px; font-weight: 600; white-space: nowrap; }
.dns-summary-title strong { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.copy-ip-button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 600; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.copy-ip-button .ic { font-size: 14px; }
.copy-ip-button:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.copy-ip-button.copied { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.copy-ip-button.failed { border-color: transparent; background: var(--bad-soft); color: var(--bad); }
.dns-summary-display-control { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--surface-3); }
.dns-summary-display-control button { height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 500; transition: background 0.2s, color 0.2s; }
.dns-summary-display-control button.is-active { background: var(--surface); color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.dns-summary-mobile-toggle { display: none; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.dns-summary-mobile-toggle .ic { font-size: 14px; transition: transform 0.2s var(--ease); }
.dns-summary-mobile-toggle.is-expanded .ic { transform: rotate(180deg); }
.dns-summary-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; margin-top: 12px; }
.dns-summary-panel.is-aaaa .dns-summary-list { grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.dns-summary-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 6px 10px 6px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); font-size: 13.5px; cursor: pointer; transition: border-color 0.2s, background 0.2s; animation: nx-pop 0.3s var(--ease-out) backwards; }
.dns-summary-item span { min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; }
.dns-summary-item strong { flex: 0 0 auto; color: var(--accent-ink); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dns-summary-item:hover { border-color: var(--line-2); }
.dns-summary-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.dns-summary-compare-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 12px; }
.dns-summary-compare-col { min-width: 0; padding: 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.dns-summary-compare-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--ink); font-size: 13.5px; flex-wrap: wrap; }
.kkyun-summary-target { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; font-family: var(--mono); font-weight: 600; }
.dns-summary-compare-title strong { color: var(--accent-ink); }
.dns-summary-compare-col .dns-summary-item { width: 100%; }
/* a phone has not the width for the two sides of a comparison beside each other */
@media (max-width: 760px) { .dns-summary-compare-group { grid-template-columns: minmax(0, 1fr); gap: 10px; } }
.dns-summary-compare-empty { padding: 10px 14px; color: var(--ink-3); font-size: 13px; }

/* ---- the figures of the run ---------------------------------------------- */

.nx-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); animation: nx-rise 0.6s var(--ease-out) backwards; }
.nx-kpi { display: grid; gap: 4px; align-content: center; min-width: 0; padding: 18px 24px 17px; }
.nx-kpi + .nx-kpi { border-left: 1px solid var(--line); }
.nx-kpi-label { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; font-weight: 500; }
.nx-kpi-line { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.nx-kpi-value { color: var(--ink); font-size: 32px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nx-kpi-unit { color: var(--ink-3); font-size: 13px; font-weight: 500; white-space: nowrap; }
.nx-kpi-note { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.nx-kpi.is-alert .nx-kpi-value { color: var(--bad); }

/* ---- map with statistics (drawn by the script) --------------------------- */

.kkyun-map-stats-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; animation: nx-rise 0.6s var(--ease-out) backwards; }
.kkyun-map-card { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; height: 560px; overflow: hidden; padding: 18px 18px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.kkyun-map-logo { display: none; }
.kkyun-china-map { width: 100%; height: 100%; min-height: 360px; }
.kkyun-map-timeout-switch { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
.kkyun-map-lightning { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-3); color: var(--ink-4); font-size: 13px; transition: background 0.2s, color 0.2s; }
.kkyun-map-lightning.active { background: var(--warn-soft); color: var(--warn); }
.kkyun-switch { display: inline-flex; align-items: center; cursor: pointer; }
.kkyun-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kkyun-switch > span:last-child { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--surface-4); transition: background 0.2s; }
.kkyun-switch > span:last-child::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3); transition: transform 0.2s var(--ease); }
.kkyun-switch input:checked + span:last-child { background: var(--accent); }
.kkyun-switch input:checked + span:last-child::after { transform: translateX(16px); }
.kkyun-switch input:focus-visible + span:last-child { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
/* the province the map is filtered by, over its corner */
.kkyun-filter-chip { position: absolute; top: 16px; left: 16px; z-index: 5; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: var(--sh-2); animation: nx-pop 0.26s var(--ease-out); }
.kkyun-filter-chip button { height: 24px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; transition: background 0.15s, color 0.15s; }
.kkyun-filter-chip button:hover { background: var(--bad-soft); color: var(--bad); }
.kkyun-region-card { position: relative; display: flex; flex-direction: column; min-width: 0; height: 560px; padding: 16px 18px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.kkyun-region-head { display: grid; gap: 10px; }
.kkyun-region-tabs { display: inline-flex; padding: 3px; gap: 2px; justify-self: start; border-radius: var(--r-pill); background: var(--surface-3); }
.kkyun-region-tabs button { height: 30px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3); font-size: 13.5px; font-weight: 500; transition: background 0.2s, color 0.2s; }
.kkyun-region-tabs button.active { background: var(--surface); color: var(--accent-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--line); }
.progress-div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--ink-3); font-size: 12.5px; }
.progress-div > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.badge-light-primary { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-track-wrap { position: relative; display: flex; align-items: center; gap: 8px; flex: 1 1 100%; }
.progress-bar2 { position: relative; flex: 1 1 auto; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.progress-bar { display: block; height: 100%; border-radius: 999px; background-color: var(--accent); background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0.28) 75%, transparent 75%, transparent); background-size: 14px 14px; transition: width 0.5s var(--ease); animation: nx-stripe 0.55s linear infinite; }
.progress-percent { min-width: 40px; color: var(--ink); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.progress-loading { width: 14px; height: 14px; border: 2px solid var(--accent-soft-2); border-top-color: var(--accent); border-radius: 50%; animation: nx-spin 0.8s linear infinite; }
/* the list scrolls in what is left of the card, with no scrollbar of the browser's (the place
   one would take is the list's). The card draws its own thumb in the margin it has at its right
   (blocks.js): a round one, there under the pointer and while it is dragged. What the list still
   holds past its top or its bottom shows as a soft edge, which goes once that end is reached */
.stats-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; overflow-y: auto; flex: 1 1 auto; min-height: 0; scrollbar-width: none; }
.stats-grid::-webkit-scrollbar { display: none; }
.stats-thumb { position: absolute; top: 0; right: 3px; z-index: 3; width: 12px; cursor: default; touch-action: none; pointer-events: none; }
/* it takes the pointer where a pointer hovers; a finger scrolls the list itself */
@media (hover: hover) { .stats-thumb { pointer-events: auto; } }
.stats-thumb::before { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 6px; border-radius: 999px; background: var(--scroll-thumb); opacity: 0; transition: opacity 0.3s var(--ease); }
.kkyun-region-card:hover .stats-thumb::before, .kkyun-region-card.is-dragging .stats-thumb::before { opacity: 1; }
.kkyun-region-card::before, .kkyun-region-card::after { content: ""; position: absolute; right: 1px; left: 1px; z-index: 2; height: 34px; border-radius: var(--r-lg); pointer-events: none; opacity: 0; transition: opacity 0.3s var(--ease); }
.kkyun-region-card::before { top: var(--stats-top, 0px); background: linear-gradient(to bottom, var(--surface), transparent); }
.kkyun-region-card::after { bottom: 1px; background: linear-gradient(to top, var(--surface) 35%, transparent); }
.kkyun-region-card.has-past::before, .kkyun-region-card.has-more::after { opacity: 1; }
.stats-table-wrap { min-width: 0; }
.stats-section-title { margin-bottom: 4px; color: var(--ink-4); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
/* a line of the statistics: the place, the fastest and the slowest of its probes (each with
   the line it is on), and the average; a name that is long wraps, it is never cut */
.stats-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.stats-table th { height: 30px; padding: 0 8px; text-align: right; color: var(--ink-4); font-size: 12px; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--line); }
.stats-table th:first-child { width: 16%; text-align: left; }
.stats-table th:nth-child(2) { width: 32%; }
.stats-table th:nth-child(3) { width: 32%; }
.stats-table th:nth-child(4) { width: 20%; padding-right: 6px; }
/* each head stands over what it names: the places from the left of theirs, the figure at the right of its own */
.stats-table th:nth-child(2), .stats-table th:nth-child(3) { padding-left: 6px; text-align: left; }
.stats-table td { padding: 4px 6px; text-align: right; color: var(--ink-2); vertical-align: middle; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line); white-space: normal; overflow-wrap: anywhere; }
.stats-table td:first-child { padding-left: 8px; text-align: left; color: var(--ink); font-weight: 500; }
.stats-table tbody tr:last-child td { border-bottom: 0; }
/* a cell of a place: the name over the line it is on and its figure, and at the right the mark
   of a home line — a place kept for the mark whether or not the line carries one, so that in
   every line of a column the name begins, and the mark stands, at the same place */
.stats-table td:nth-child(2), .stats-table td:nth-child(3) { text-align: left; }
.stats-probe-cell { display: grid; grid-template-columns: minmax(0, 1fr) 36px; align-items: center; gap: 4px; min-width: 0; }
.stats-probe-mark { display: grid; place-items: center start; min-width: 0; }
.stats-filter-cell { display: grid; justify-items: start; width: 100%; min-width: 0; min-height: 30px; padding: 4px 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.5; text-align: left; white-space: normal; overflow-wrap: anywhere; transition: background 0.15s, color 0.15s; }
.stats-filter-cell:not(:disabled):hover { background: var(--accent-soft); color: var(--accent-ink); }
.stats-probe { color: var(--ink); font-weight: 600; }
.stats-meta { color: var(--ink-3); font-size: 12px; }

/* ---- the tooltip of the map ---------------------------------------------- */

.nx-map-tip { pointer-events: auto; }
.map-tip { min-width: 224px; max-width: 304px; padding: 14px 16px 12px; border-radius: 18px; font-family: var(--font); text-align: left; }
.map-tip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.map-tip-name { color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.map-tip-count { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.map-tip-kpi { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.map-tip-kpi b { color: var(--accent-ink); font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.map-tip-kpi span { color: var(--ink-3); font-size: 12.5px; }
.map-tip-rows { display: grid; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.map-tip-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; min-height: 28px; padding: 0 4px; border-radius: 8px; color: var(--ink-2); font-size: 13px; }
.map-tip-row:hover { background: var(--surface-2); }
.map-tip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-4)); }
.map-tip-row b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.map-tip-row small { min-width: 48px; color: var(--ink-3); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.map-tip-row .is-bad { color: var(--bad); }
.map-tip-list { display: grid; gap: 1px; max-height: 150px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); overflow-y: auto; }
.map-tip-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 26px; padding: 0 6px; border-radius: 8px; color: var(--ink-2); font-size: 12.5px; }
.map-tip-item:hover { background: var(--surface-2); }
.map-tip-item span { min-width: 0; overflow-wrap: anywhere; }
.map-tip-item b { flex: 0 0 auto; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.map-tip-item .is-bad { color: var(--bad); }
.map-tip-bar { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.map-tip-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.map-tip-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-4); font-size: 12px; }
.map-tip-empty { color: var(--ink-3); font-size: 13px; }

/* ---- results ------------------------------------------------------------- */

.nx-results { overflow: hidden; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.nx-results-head { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.nx-results-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kkyun-result-title { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 17px; font-weight: 700; white-space: nowrap; }
.kkyun-result-title::before { content: ""; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 0 4px var(--accent-soft); }
.nx-seg--scroll { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.nx-seg--scroll::-webkit-scrollbar { display: none; }
.kkyun-result-tabs { flex: 0 1 auto; }
.kkyun-result-tabs > button { height: 32px; }
.kkyun-result-tab-count { display: inline-grid; place-items: center; min-width: 20px; height: 19px; padding: 0 6px; border-radius: var(--r-pill); background: var(--bad-soft); color: var(--bad); font-size: 11.5px; font-weight: 700; }
.kkyun-result-tabs > button.active .kkyun-result-tab-count { background: var(--bad); color: #fff; }
.kkyun-result-count { margin-left: auto; color: var(--ink-3); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kkyun-result-count .show_record { color: var(--accent-ink); font-size: 16px; font-weight: 700; }
/* a run that came back without one answer says why, once, above the table */
.nx-result-failure { margin: 14px 20px 0; padding: 11px 16px; border: 1px solid color-mix(in srgb, var(--bad) 26%, transparent); border-radius: var(--r-md); background: var(--bad-soft); color: var(--bad); font-size: 13.5px; line-height: 1.6; overflow-wrap: anywhere; animation: nx-fade 0.3s ease; }
.nx-result-failure[hidden] { display: none; }
.nx-result-failure strong { margin-right: 4px; font-weight: 700; }
.nx-table-wrap.is-empty .kkyun-base-table { display: none; }
.nx-table-wrap.is-empty .nx-skel-rows { display: none; }
.kkyun-empty-table-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 220px; padding: 28px 16px; color: var(--ink-3); font-size: 14px; text-align: center; animation: nx-fade 0.3s ease; }
.kkyun-empty-table-state::before { content: ""; width: 56px; height: 56px; margin-bottom: 4px; border: 1px dashed var(--line-2); border-radius: 50%; background-color: var(--surface-3); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='10.8' cy='10.8' r='6.4'/%3E%3Cpath d='M15.4 15.4 19.8 19.8M8.2 10.8h5.2'/%3E%3C/svg%3E") center / 26px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='10.8' cy='10.8' r='6.4'/%3E%3Cpath d='M15.4 15.4 19.8 19.8M8.2 10.8h5.2'/%3E%3C/svg%3E") center / 26px no-repeat; }

/* the sticky head stays under the bar of the header */
.kkyun-base-table thead th { top: var(--header-h); }
/* a table's rows rise in the first time it is filled; a body that fills up as results arrive
   (marked is-filled by mountRows) draws what changed without flashing */
.kkyun-base-table tbody:not(.is-filled) > tr { animation: nx-row-in 0.5s var(--ease-out) backwards; }
@keyframes nx-row-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.kkyun-base-table tbody tr.is-stat-highlight > td { animation: nx-flash 1.6s ease; }
@keyframes nx-flash { 0%, 100% { background-color: transparent; } 25% { background-color: var(--accent-soft-2); } }

/* the probe: the carrier pill, the name (it wraps: it is never cut), the home broadband mark */
.kkyun-probe-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kkyun-line-label, .isp-badge {
	--isp-color: var(--ink-3);
	display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 0 0 auto; height: 23px; padding: 0 9px 0 7px;
	border-radius: var(--r-pill); background: color-mix(in srgb, var(--isp-color) 12%, var(--surface)); color: color-mix(in srgb, var(--isp-color) 85%, var(--ink));
	font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.kkyun-line-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--isp-color); }
.kkyun-probe-info { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; flex: 1 1 auto; min-width: 0; }
.kkyun-probe-name { min-width: 0; color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.probe-cell-info { min-width: 0; }
.kkyun-access-badge-inline { display: inline-flex; align-items: center; flex: 0 0 auto; height: 19px; padding: 0 7px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 700; line-height: 1; }

/* the address and its tools, the place */
.latency-ip-cell { position: relative; display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.latency-ip-cell > span { min-width: 0; color: var(--ink-2); font-family: var(--mono); font-size: 13.5px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.latency-ip-cell.has-tools > span { flex: 1 1 auto; }
.latency-ip-tools { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; color: var(--ink-4); font-size: 17px; opacity: 0; cursor: pointer; transition: opacity 0.15s, background 0.15s, color 0.15s; }
.latency-ip-cell.has-tools:hover .latency-ip-tools, .latency-ip-tools.is-menu-open, .latency-ip-tools:focus-visible, .latency-ip-tools:focus-within { opacity: 1; }
.latency-ip-tools:hover, .latency-ip-tools.is-menu-open { background: var(--accent-soft); color: var(--accent-ink); }
.latency-ip-tools-trigger { display: grid; place-items: center; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; }
/* where there is no pointer to hover with, the tool menu of an address stands open to the touch */
@media (hover: none) { .latency-ip-tools { opacity: 1; } }
.adaptive-ip-geo { display: block; max-width: 100%; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.time-main, .col-response-time, .col-metric, .table-avg, .col-loss, .col-sent { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }
.cell-loading-spin { display: inline-block; position: relative; width: 46px; height: 12px; overflow: hidden; border-radius: 6px; background: var(--surface-3); vertical-align: middle; }
.cell-loading-spin::after { content: ""; position: absolute; inset: 0; background: var(--skeleton); animation: nx-sheen 1.5s var(--ease) infinite; }
.node_tr.pending > td { color: var(--ink-3); }

/* ---- a line of the tables on a desk: whole, nothing cut ------------------- */

.kkyun-latency-table { min-width: 640px; table-layout: fixed; }
.kkyun-base-table th, .kkyun-base-table td { vertical-align: middle; }
.kkyun-latency-table .col-probe { width: 34%; }
.kkyun-latency-table .col-response-ip { width: 24%; }
.kkyun-latency-table .col-ip-geo { width: 32%; }
.kkyun-latency-table .col-response-time { width: 10%; text-align: right; font-size: 15.5px; font-weight: 700; white-space: nowrap; }
/* the continuous table has the packets and the latency figures besides */
.kkyun-latency-table:not(.is-once-table) { min-width: 1080px; }
.kkyun-latency-table:not(.is-once-table) .col-probe { width: 21%; }
.kkyun-latency-table:not(.is-once-table) .col-response-ip { width: 14%; }
.kkyun-latency-table:not(.is-once-table) .col-ip-geo { width: 18%; }
.kkyun-latency-table:not(.is-once-table) .col-loss, .kkyun-latency-table:not(.is-once-table) .col-sent { width: 6.5%; text-align: right; white-space: nowrap; }
.kkyun-latency-table:not(.is-once-table) .col-metric { width: 6.5%; text-align: right; white-space: nowrap; }
.kkyun-latency-table:not(.is-once-table) .col-quality { width: 12%; }
.kkyun-network-quality-canvas { display: flex; align-items: center; justify-content: flex-end; width: 100%; height: 22px; overflow: hidden; border-radius: 6px; }
/* a comparison has one column more, the target of each side */
.kkyun-compare-table .col-target { width: 13%; }
.kkyun-compare-table .col-target > span { display: block; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.kkyun-compare-table.is-once-table { min-width: 900px; }
.kkyun-compare-table.is-once-table .col-probe { width: 25%; }
.kkyun-compare-table.is-once-table .col-response-ip { width: 18%; }
.kkyun-compare-table.is-once-table .col-ip-geo { width: 22%; }
.kkyun-compare-table.is-once-table .col-response-time { width: 10%; }
.kkyun-pair-zebra tbody tr.is-row-b > td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

/* the website test: ten columns */
.website-table { min-width: 1120px; table-layout: fixed; }
.website-table .webtest-col-probe { width: 17.5%; }
.website-table .webtest-col-response-ip { width: 13.5%; }
.website-table .webtest-col-ip-geo { width: 17%; }
.website-table .webtest-col-status { width: 6%; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.website-table .webtest-col-time { width: 6.6%; white-space: nowrap; }
.website-table .webtest-col-time:nth-child(6) { width: 6.2%; }
.website-table .webtest-col-time:nth-child(8) { width: 7.2%; }
.website-table .webtest-col-redirect { width: 8.6%; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.website-table .webtest-col-head { width: 92px; text-align: right; white-space: nowrap; }
.website-table th.webtest-col-head { padding-right: 25px; }
.website-table.kkyun-compare-table { min-width: 1280px; }
.website-table.kkyun-compare-table .webtest-col-target { width: 10.5%; }
.website-table.kkyun-compare-table .webtest-col-probe { width: 15%; }
.website-table.kkyun-compare-table .webtest-col-response-ip { width: 12%; }
.website-table.kkyun-compare-table .webtest-col-ip-geo { width: 14.5%; }
.website-table.kkyun-compare-table .webtest-col-status { width: 5.2%; }
.website-table.kkyun-compare-table .webtest-col-time { width: 6%; }
.website-table.kkyun-compare-table .webtest-col-time:nth-child(7) { width: 5.6%; }
.website-table.kkyun-compare-table .webtest-col-time:nth-child(9) { width: 6.4%; }
.website-table.kkyun-compare-table .webtest-col-redirect { width: 7.4%; }
.website-table.kkyun-compare-table .webtest-col-head { width: 6.6%; }
.website-table .webtest-col-waiting { padding-top: 16px; padding-bottom: 16px; }
/* the button that unfolds the response head of a probe */
.link-button { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.link-button .ic { font-size: 14px; transition: transform 0.2s var(--ease); }
.link-button.is-expanded .ic { transform: rotate(180deg); }
.link-button:not(:disabled, .is-disabled):hover { background: var(--accent-soft-2); }
.link-button:disabled, .link-button.is-disabled { background: transparent; color: var(--ink-4); cursor: not-allowed; }
.dns-expand-cell { padding: 0 !important; height: auto !important; background: var(--surface-2); }
.dns-expand-card { animation: nx-unfold 0.3s var(--ease-out); transform-origin: top; }
@keyframes nx-unfold { from { opacity: 0; transform: scaleY(0.92); } to { opacity: 1; transform: none; } }
.dns-expand-inner { padding: 14px 20px 16px; }
.dns-expand-result-section { display: grid; gap: 8px; }
.dns-expand-answers { margin: 0; padding: 12px 16px; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); font-family: var(--mono); font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.dns-expand-meta { color: var(--ink-3); font-size: 13px; }
.dns-expand-result-label { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.dns-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* the DNS lookup */
.dns-results-table { min-width: 1000px; table-layout: fixed; }
.dns-results-table .dns-col-probe { width: 19%; }
.dns-results-table .dns-col-target { width: 14%; }
.dns-results-table .dns-col-type { width: 6.5%; }
.dns-type { color: var(--accent-ink); font-weight: 700; }
.dns-results-table .dns-col-answer { width: 25%; }
.dns-answer-td > div { color: var(--ink); font-size: 13.5px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.dns-answer-td.text-danger > div { color: var(--bad); }
.dns-answer-more { height: 24px; margin-top: 6px; padding: 0 11px; border: 0; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.dns-answer-more:disabled { opacity: 0.5; }
.dns-results-table .dns-col-count, .dns-results-table .dns-col-time, .dns-results-table .dns-col-resolver { width: 7.5%; font-size: 13px; overflow-wrap: anywhere; }
.dns-results-table .dns-col-detail { width: 92px; text-align: right; white-space: nowrap; }
.dns-results-table th.dns-col-detail { padding-right: 25px; }
.kkyun-answer-count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); font-size: 12.5px; font-weight: 700; }

/* ---- record type of the DNS page ----------------------------------------- */

.kkyun-dns-record-select { position: relative; display: flex; }
.kkyun-dns-record-select .kkyun-dns-record-trigger { gap: 8px; }
.kkyun-dns-record-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.kkyun-dns-record-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: 208px; padding: 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-3); animation: nx-pop 0.2s var(--ease-out); }
.kkyun-dns-record-option { display: flex; align-items: center; justify-content: center; height: 36px; border-radius: 10px; color: var(--ink-2); font-family: var(--mono); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s, color 0.15s; }
.kkyun-dns-record-option:hover { background: var(--accent-soft); }
.kkyun-dns-record-option.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }

/* ---- advanced options of the website test -------------------------------- */

.kkyun-advanced-btn-arrow { font-size: 15px; transition: transform 0.25s var(--ease); }
.kkyun-advanced-btn-arrow.is-open { transform: rotate(180deg); }
.kkyun-advanced-btn.is-open { border-color: transparent; color: var(--accent-ink); background: var(--accent-soft); }
/* the panel stays in the page from its first opening on: it shows while the form has it open */
.kkyun-advanced-panel { padding: 16px 20px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); animation: nx-unfold 0.3s var(--ease-out); transform-origin: top; }
.nx-command-form:not(.has-advanced) .kkyun-advanced-panel { display: none; }
.kkyun-advanced-polygon { display: none; }
.kkyun-advanced-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: start; gap: 12px; padding: 9px 0; }
.kkyun-advanced-row + .kkyun-advanced-row { border-top: 1px solid var(--line); }
.kkyun-advanced-label { padding-top: 9px; color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.kkyun-advanced-radios { display: flex; gap: 6px; flex-wrap: wrap; }
.kkyun-adv-radio { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-pill); color: var(--ink-2); font-size: 13.5px; cursor: pointer; transition: border-color 0.2s, background 0.2s, color 0.2s; }
.kkyun-adv-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kkyun-adv-radio::before { content: ""; width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 50%; background: var(--surface); transition: border 0.2s var(--ease); }
.kkyun-adv-radio.active { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.kkyun-adv-radio.active::before { border: 5px solid var(--accent); }
.kkyun-adv-input { width: 100%; height: 38px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 13.5px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.kkyun-adv-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.kkyun-adv-redirect-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kkyun-adv-number { width: 88px; height: 38px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); outline: none; }
.kkyun-adv-number:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.kkyun-adv-redirect-hint { color: var(--ink-3); font-size: 12.5px; }

/* ---- the switch of the address family ------------------------------------ */

.nx-seg--version { flex: 0 0 auto; }
.nx-seg--version .kkyun-ip-version-option { cursor: pointer; }
.nx-seg--version .kkyun-ip-version-option:not(.is-active):hover { color: var(--accent-ink); }
.nx-seg--version .kkyun-ip-version-option.is-active { cursor: default; }

/* ---- a table that does not fit its card scrolls in its box ----------------- */

/* The widths are those of the tables with the margins of the page beside them: a website test
   is 1120, a comparison of websites 1280, a continuous ping 1080, a DNS lookup 1000. Inside its
   box the head sticks to the box; where the table fits, the page scrolls and the head sticks
   under the bar of the header. */
@media (max-width: 1339px) {
	.nx-table-wrap:has(.website-table.kkyun-compare-table) { overflow: auto; max-height: min(76vh, 860px); }
	.nx-table-wrap:has(.website-table.kkyun-compare-table) thead th { top: 0; }
}
@media (max-width: 1169px) {
	.nx-table-wrap:has(.website-table), .nx-table-wrap:has(.kkyun-latency-table:not(.is-once-table)), .nx-table-wrap:has(.kkyun-compare-table) { overflow: auto; max-height: min(76vh, 860px); }
	.nx-table-wrap:has(.website-table) thead th, .nx-table-wrap:has(.kkyun-latency-table:not(.is-once-table)) thead th, .nx-table-wrap:has(.kkyun-compare-table) thead th { top: 0; }
}
@media (max-width: 1039px) {
	.nx-table-wrap:has(.dns-results-table) { overflow: auto; max-height: min(76vh, 860px); }
	.nx-table-wrap:has(.dns-results-table) thead th { top: 0; }
}
/* ---- tablets and small desks --------------------------------------------- */

@media (max-width: 1024px) {
	.kkyun-map-stats-layout { grid-template-columns: minmax(0, 1fr); }
	.kkyun-map-card { min-height: 380px; }
	.kkyun-china-map { min-height: 300px; }
	.kkyun-region-card { max-height: 520px; }
	.nx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.nx-kpi:nth-child(3) { border-left: 0; }
	.nx-kpi:nth-child(n + 3) { border-top: 1px solid var(--line); }
}
@media (max-width: 767px) {
	.nx-target-row { flex-wrap: wrap; }
	.nx-target { flex: 1 0 100%; }
	.nx-target-row > .kkyun-history-input { width: 100%; }
	.nx-actions { flex: 1 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
	.nx-actions > * { width: 100%; min-width: 0; }
	.nx-actions.kkyun-action-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.kkyun-screenshot-btn { grid-column: 1 / -1; height: 42px; }
	.kkyun-compare-toggle-label-full { display: none; }
	.nx-options { align-items: flex-start; flex-direction: column; }
	.kkyun-dns-options { width: 100%; flex-wrap: wrap; }
	.kkyun-dns-options .nx-input { flex: 1 1 140px; width: auto; }
	.nx-results-head { gap: 10px 12px; padding: 14px 16px; }
	.kkyun-result-count { flex: 1 0 100%; margin-left: 0; text-align: right; }
	.kkyun-result-tabs { flex: 1 0 100%; order: 3; }
	.kkyun-result-tabs > button { flex: 1 0 auto; }
	.dns-summary-panel.is-aaaa .dns-summary-list { grid-template-columns: minmax(0, 1fr); }
	.dns-summary-display-control { display: none; }
	.dns-summary-mobile-toggle { display: inline-flex; }
	.kkyun-map-card { min-height: 300px; height: auto; padding: 14px 12px 10px; }
	.kkyun-china-map { min-height: 250px; }
	.kkyun-region-card { max-height: 460px; padding: 14px 14px 12px; }
	.kkyun-advanced-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
	.kkyun-advanced-label { padding-top: 0; }
	.nx-kpi { padding: 14px 16px 13px; }
	.nx-kpi-value { font-size: 26px; }
}
/* the statistics of a phone: a row is a block, the carrier or region with its average over its
   fastest and slowest probes (the cells carry the names of their columns) */
@media (max-width: 640px) {
	.stats-table, .stats-table tbody { display: block; width: 100%; }
	.stats-table thead { display: none; }
	.stats-table tbody { display: grid; gap: 8px; }
	.stats-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
	.stats-table tbody tr td, .stats-table tbody tr:last-child td { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; text-align: left; }
	.stats-table tbody tr td:first-child { grid-column: 1; grid-row: 1; padding: 0; font-weight: 600; }
	.stats-table tbody tr td:last-child { grid-column: 2; grid-row: 1; font-weight: 700; }
	.stats-table tbody tr td:nth-child(2), .stats-table tbody tr td:nth-child(3) { grid-column: 1 / -1; }
	.stats-table tbody tr td:nth-child(2)::before, .stats-table tbody tr td:nth-child(3)::before { content: attr(data-th); flex: 0 0 34px; color: var(--ink-4); font-size: 12.5px; font-weight: 500; }
	.stats-probe-cell { flex: 1 1 auto; }
}
@media (max-width: 640px) {
	.nx-command { padding: 14px 14px 12px; }
	.kkyun-history-input > .form-control { height: 46px; font-size: 16px; }
	.kkyun-history-input.has-suffix > .form-control { padding-right: 58px; }
	.kkyun-history-input:not(.has-suffix) > .form-control { padding-right: 46px; }
	.kkyun-compare-toggle { width: 34px; height: 34px; padding: 0; justify-content: center; border-style: solid; }
	.nx-check { height: 36px; padding: 0 13px 0 8px; }
	.nx-radio { height: 34px; padding: 0 11px; }
	.nx-results { border-radius: var(--r-md); }
	.kkyun-map-lightning { display: none; }
	.kkyun-region-tabs button { padding: 0 12px; }
	.dns-summary-panel { padding: 12px 14px; }
	.kkyun-filter-chip { top: 12px; left: 12px; }
}

/* ---- a phone: a card a line ---------------------------------------------- */

/* Every table of results gives each of its lines a card: the probe is the head of the card, the
   response time or the state stands at its right, and every other cell is a line of the card
   with the name of its column before it (the scripts write data-th on the cells). Nothing is
   cut: what is long wraps. */
@media (max-width: 767px) {
	.nx-table-wrap, .icpsearch-results-section .table-responsive { position: relative; overflow: visible; max-height: none; }
	.nx-table-wrap .kkyun-base-table, .nx-table-wrap tbody, .icpsearch-results-section .icpsearch-results-table, .icpsearch-results-section tbody { display: block; width: 100%; min-width: 0; }
	.nx-table-wrap thead, .icpsearch-results-section thead { display: none; }
	.nx-table-wrap tbody, .icpsearch-results-section tbody { display: grid; gap: 12px; padding: 12px; }
	.nx-table-wrap tbody > tr, .icpsearch-results-section tbody > tr {
		display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px 14px;
		padding: 14px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--sh-1);
	}
	.nx-table-wrap tbody > tr:hover { background: var(--surface); }
	.nx-table-wrap tbody > tr > td, .icpsearch-results-section tbody > tr > td {
		display: flex; align-items: baseline; justify-content: space-between; gap: 12px; grid-column: 1 / -1;
		min-width: 0; height: auto; padding: 0; border: 0; color: var(--ink); text-align: right;
		white-space: normal; overflow: visible; overflow-wrap: anywhere;
	}
	.nx-table-wrap tbody > tr > td::before, .icpsearch-results-section tbody > tr > td::before { content: attr(data-th); flex: 0 0 auto; color: var(--ink-4); font-size: 12.5px; font-weight: 500; text-align: left; }
	.nx-table-wrap tbody > tr > td:not([data-th])::before, .icpsearch-results-section tbody > tr > td:not([data-th])::before { content: none; }
	/* the share of the table a column takes on a desk (a third, a quarter) means nothing in a card:
	   it goes for every table, whatever the weight of the rule that set it */
	.nx-table-wrap tbody > tr > td, .icpsearch-results-section tbody > tr > td { width: auto !important; max-width: none !important; min-width: 0 !important; }
	/* the head of the card: the probe over the full width, unless a figure stands at its right */
	.nx-table-wrap td.col-probe, .nx-table-wrap td.webtest-col-probe, .nx-table-wrap td.dns-col-probe { grid-column: 1 / -1; grid-row: 1; display: block; }
	.nx-table-wrap td.col-probe .kkyun-probe-cell { height: 100%; }
	.nx-table-wrap .kkyun-probe-name { font-size: 15px; }
	.nx-table-wrap .kkyun-probe-cell.website-probe-cell { flex-wrap: wrap; gap: 6px 8px; }
	/* ping and tcping: the response time stands at the right of the head */
	.kkyun-latency-table.is-once-table:not(.kkyun-compare-table) td.col-probe { grid-column: 1; }
	.kkyun-latency-table.is-once-table:not(.kkyun-compare-table) td.col-response-time { grid-column: 2; grid-row: 1; align-self: center; justify-content: flex-end; font-size: 20px; font-weight: 800; }
	/* the continuous table: the packets and the latency figures three to a row */
	.kkyun-latency-table:not(.is-once-table) tbody > tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.kkyun-latency-table:not(.is-once-table) td.col-loss, .kkyun-latency-table:not(.is-once-table) td.col-sent, .kkyun-latency-table:not(.is-once-table) td.col-metric { grid-column: auto; display: grid; justify-items: stretch; gap: 2px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); text-align: left; }
	.kkyun-latency-table:not(.is-once-table) td.col-loss::before, .kkyun-latency-table:not(.is-once-table) td.col-sent::before, .kkyun-latency-table:not(.is-once-table) td.col-metric::before { font-size: 12px; }
	.kkyun-latency-table:not(.is-once-table) td.col-quality { grid-column: 1 / -1; }
	.kkyun-latency-table:not(.is-once-table) .kkyun-network-quality-canvas { justify-content: stretch; }
	/* a comparison: the two lines of a probe make one card of two storeys */
	.nx-table-wrap tbody:has(.is-row-a) { gap: 0; }
	.nx-table-wrap tbody > tr.is-row-a { margin-top: 12px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
	.nx-table-wrap tbody > tr.is-row-b { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; background: var(--surface-2); box-shadow: var(--sh-1); }
	.nx-table-wrap tbody > tr.is-row-b > td::before { color: var(--ink-3); }
	.nx-table-wrap td.col-target, .nx-table-wrap td.webtest-col-target { color: var(--accent-ink); font-family: var(--mono); font-weight: 600; }

	/* the website test: the state at the right of the head, the times two to a row */
	.nx-table-wrap td.webtest-col-status { grid-column: 2; grid-row: 1; align-self: center; justify-content: flex-end; }
	.nx-table-wrap td.webtest-col-status::before { content: none; }
	.nx-table-wrap td.webtest-col-time { grid-column: auto; display: grid; justify-items: stretch; gap: 2px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); text-align: left; }
	.nx-table-wrap td.webtest-col-time.time-main { background: var(--accent-soft); }
	.nx-table-wrap td.webtest-col-time::before { font-size: 12px; }
	.nx-table-wrap td.webtest-col-redirect { color: var(--ink-2); font-size: 13px; }
	.nx-table-wrap td.webtest-col-head { white-space: normal; }
	.nx-table-wrap td.webtest-col-head .link-button { width: 100%; height: 38px; justify-content: center; background: var(--surface-3); font-size: 14px; }
	.nx-table-wrap td.webtest-col-head .link-button.is-disabled { background: transparent; }

	/* the DNS lookup: the type at the right of the head, the answer in a line of its own */
	.nx-table-wrap td.dns-col-type { grid-column: 2; grid-row: 1; align-self: center; justify-content: flex-end; }
	.nx-table-wrap td.dns-col-type::before { content: none; }
	.nx-table-wrap td.dns-col-type { padding: 0; background: none; }
	.nx-table-wrap td.dns-col-type .dns-type { padding: 3px 11px; border-radius: var(--r-pill); background: var(--accent-soft); font-size: 13px; }
	.nx-table-wrap td.dns-answer-td { justify-content: flex-start; color: var(--ink-2); }
	.nx-table-wrap td.dns-answer-td > div { flex: 1 1 0; text-align: right; }
	.nx-table-wrap td.dns-col-count, .nx-table-wrap td.dns-col-time { grid-column: auto; display: grid; justify-items: stretch; gap: 2px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); text-align: left; }
	.nx-table-wrap td.dns-col-count::before, .nx-table-wrap td.dns-col-time::before { font-size: 12px; }
	/* the way to the details of an answer comes last, under its figures */
	.nx-table-wrap td.dns-col-detail { order: 9; white-space: normal; }
	.nx-table-wrap td.dns-col-detail .link-button { width: 100%; height: 38px; justify-content: center; background: var(--surface-3); font-size: 14px; }
	.nx-table-wrap td.dns-col-detail .link-button.is-disabled { background: transparent; }

	/* traceroute: the hop and its address share the head, the packets three to a row */
	.kkyun-traceroute-table tbody > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; align-self: center; justify-content: flex-start; }
	.kkyun-traceroute-table tbody > tr > td:nth-child(1)::before { content: none; }
	.kkyun-traceroute-table tbody > tr > td:nth-child(2) { grid-column: 2; grid-row: 1; color: var(--ink); font-family: var(--mono); font-weight: 600; }
	.kkyun-traceroute-table tbody > tr > td:nth-child(2)::before { content: none; }
	.kkyun-traceroute-table tbody > tr > td:nth-child(n + 6) { grid-column: auto; display: grid; justify-items: stretch; gap: 2px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); text-align: left; }
	.kkyun-traceroute-table tbody > tr > td:nth-child(n + 6)::before { font-size: 12px; }
	.kkyun-traceroute-table .trace-empty-cell { grid-column: 1 / -1; }

	/* the batch matrix: the number and the target share the head, every node a block */
	.kbp-result-table tbody > tr > td:nth-child(1) { grid-column: 1; grid-row: 1; align-self: center; justify-content: flex-start; color: var(--ink-4); font-weight: 700; }
	.kbp-result-table tbody > tr > td:nth-child(1)::before { content: none; }
	.kbp-result-table tbody > tr > td:nth-child(2) { grid-column: 2; grid-row: 1; color: var(--ink); font-family: var(--mono); font-weight: 600; }
	.kbp-result-table tbody > tr > td:nth-child(2)::before { content: none; }
	.kbp-result-table tbody > tr > td.kbp-cell { display: block; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); text-align: left; }
	.kbp-result-table tbody > tr > td.kbp-cell::before { display: block; margin-bottom: 4px; color: var(--ink-4); font-size: 12px; }
	.kbp-result-table tbody > tr > td.kbp-cell p { margin: 0; line-height: 1.55; }
	.kbp-result-table .total_time { font-size: 16px; }
}
