/* Prepaid-Host Looking Glass — mirrors the --ph-* tokens of prepaid-host.com (ph-tokens.css / ph-brand.css). */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/inter-normal-400-700-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("fonts/inter-normal-400-700-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --ph-canvas: #f6f7f9;
    --ph-surface: #ffffff;
    --ph-surface-2: #f1f3f6;
    --ph-line: rgba(15, 23, 42, 0.09);
    --ph-line-strong: rgba(15, 23, 42, 0.16);
    --ph-fg: #111827;
    --ph-fg-muted: #5b6474;
    --ph-accent: #009cff;
    --ph-accent-strong: #0077c7;
    --ph-accent-hover: #00649f;
    --ph-accent-ink: #0077c7;
    --ph-accent-tint: rgba(0, 156, 255, 0.10);
    --ph-on-accent: #ffffff;
    --ph-danger: #b42318;
    --ph-danger-tint: rgba(180, 35, 24, 0.08);
    --ph-term-bg: #0d1117;
    --ph-term-fg: #d6dde6;
    --ph-term-bar: #161b22;
    --ph-ok: #15803d;
    --ph-warn: #b45309;
    --ph-bad: #dc2626;
    --ph-sea: #dfe9f3;
    --ph-land: #f3f5f8;
    --ph-land-line: #ffffff;
    --ph-city: #9aa6b4;
    --ph-city-text: #6b7685;
    --ph-hl: rgba(0, 156, 255, 0.08);
    --ph-r-card: 8px;
    --ph-r-control: 6px;
    --ph-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
    --ph-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --ph-mono: ui-monospace, "SFMono-Regular", Menlo, "Cascadia Mono", "Liberation Mono", monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --ph-canvas: #111316;
        --ph-surface: #181b20;
        --ph-surface-2: #1f232a;
        --ph-line: rgba(255, 255, 255, 0.08);
        --ph-line-strong: rgba(255, 255, 255, 0.14);
        --ph-fg: #eceef2;
        --ph-fg-muted: #a2a9b6;
        --ph-accent-strong: #009cff;
        --ph-accent-hover: #33b0ff;
        --ph-accent-ink: #5cc0ff;
        --ph-accent-tint: rgba(51, 176, 255, 0.14);
        --ph-on-accent: #04121f;
        --ph-danger: #ff8a80;
        --ph-danger-tint: rgba(255, 138, 128, 0.10);
        --ph-term-bg: #0a0c0f;
        --ph-term-bar: #13161b;
        --ph-ok: #4ade80;
        --ph-warn: #fbbf24;
        --ph-bad: #f87171;
        --ph-sea: #101317;
        --ph-land: #22272e;
        --ph-land-line: #3a414c;
        --ph-city: #6b7482;
        --ph-city-text: #9aa3b0;
        --ph-hl: rgba(51, 176, 255, 0.10);
        --ph-shadow: none;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--ph-canvas);
    color: var(--ph-fg);
    font-family: var(--ph-font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--ph-accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .lg-mono { font-family: var(--ph-mono); font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--ph-accent); outline-offset: 2px; }

.lg-inner { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.lg-muted { color: var(--ph-fg-muted); }
.lg-small { font-size: 13.5px; margin: 0; }
.lg-break { overflow-wrap: anywhere; }

/* Top bar */
.lg-top { background: var(--ph-surface); border-bottom: 1px solid var(--ph-line); }
.lg-top__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.lg-logo { display: inline-flex; align-items: center; }
.lg-logo img { height: 32px; width: auto; display: block; }
.lg-logo--dark { display: none !important; }
@media (prefers-color-scheme: dark) {
    .lg-logo--light { display: none !important; }
    .lg-logo--dark { display: block !important; }
}
.lg-top__nav { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 500; }
.lg-top__nav > a:not(.lg-btn) { color: var(--ph-fg); }
@media (max-width: 560px) { .lg-top__nav > a:not(.lg-btn) { display: none; } }

/* Subhead */
.lg-subhead { background: var(--ph-surface); border-bottom: 1px solid var(--ph-line); padding: 44px 0 36px; }
.lg-eyebrow { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ph-accent-ink); }
.lg-h1 { margin: 0 0 10px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
.lg-lead { margin: 0; max-width: 680px; font-size: 16.5px; color: var(--ph-fg-muted); }
.lg-reassure { margin: 18px 0 0; font-size: 14px; color: var(--ph-fg-muted); }
.lg-reassure span { display: inline-flex; align-items: center; gap: 8px; }
.lg-reassure svg { width: 16px; height: 16px; color: var(--ph-accent); flex: none; }

/* Cards */
.lg-main { display: grid; gap: 20px; padding-top: 28px; padding-bottom: 48px; }
.lg-card { background: var(--ph-surface); border: 1px solid var(--ph-line); border-radius: var(--ph-r-card); box-shadow: var(--ph-shadow); padding: 22px; min-width: 0; }
.lg-card__head { margin-bottom: 18px; }
.lg-h2 { margin: 0 0 4px; font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.lg-h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }

/* Network facts */
.lg-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--ph-line); border: 1px solid var(--ph-line); border-radius: var(--ph-r-control); overflow: hidden; }
.lg-fact { background: var(--ph-surface); padding: 12px 14px; min-width: 0; }
.lg-fact--wide { grid-column: 1 / -1; }
.lg-fact dt { font-size: 12.5px; font-weight: 500; color: var(--ph-fg-muted); margin-bottom: 3px; }
.lg-fact dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-weight: 500; }
@media (max-width: 640px) { .lg-facts { grid-template-columns: minmax(0, 1fr); } }

.lg-link { font-size: 13.5px; font-weight: 500; }
.lg-link--btn { background: none; border: 0; padding: 0; font: inherit; font-size: 13.5px; font-weight: 500; color: var(--ph-accent-ink); cursor: pointer; }
.lg-link--btn:hover { text-decoration: underline; }

/* Buttons */
.lg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: var(--ph-r-control); border: 1px solid transparent; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: background-color .15s, border-color .15s, color .15s; }
.lg-btn svg { width: 16px; height: 16px; }
.lg-btn--sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.lg-btn--primary { background: var(--ph-accent-strong); color: var(--ph-on-accent); }
.lg-btn--primary:hover { background: var(--ph-accent-hover); }
.lg-btn--primary:disabled { opacity: .7; cursor: progress; }
.lg-btn--ghost { background: var(--ph-surface); color: var(--ph-fg); border-color: var(--ph-line-strong); }
.lg-btn--ghost:hover { border-color: var(--ph-accent); color: var(--ph-accent-ink); }
.lg-copy { border: 1px solid var(--ph-line-strong); background: var(--ph-surface); color: var(--ph-fg-muted); font: inherit; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 5px; cursor: pointer; }
.lg-copy:hover { color: var(--ph-accent-ink); border-color: var(--ph-accent); }
.lg-copy.is-done { color: var(--ph-accent-ink); border-color: var(--ph-accent); }

/* Form */
.lg-form { display: grid; gap: 16px; }
.lg-field { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 6px; }
.lg-field > label, .lg-field > legend { font-size: 13.5px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.lg-input { width: 100%; height: 44px; padding: 0 12px; background: var(--ph-surface); color: var(--ph-fg); border: 1px solid var(--ph-line-strong); border-radius: var(--ph-r-control); font-size: 15px; }
.lg-input:focus { outline: none; border-color: var(--ph-accent); box-shadow: 0 0 0 3px var(--ph-accent-tint); }
.lg-input::placeholder { color: var(--ph-fg-muted); opacity: .8; }
.lg-methods { display: flex; flex-wrap: wrap; gap: 8px; }
.lg-method { position: relative; }
.lg-method input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.lg-method span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--ph-line-strong); border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--ph-surface); transition: background-color .15s, border-color .15s, color .15s; }
.lg-method:hover span { border-color: var(--ph-accent); }
.lg-method input:checked + span { background: var(--ph-accent-tint); border-color: var(--ph-accent); color: var(--ph-accent-ink); font-weight: 600; }
.lg-method input:focus-visible + span { outline: 2px solid var(--ph-accent); outline-offset: 2px; }
.lg-form__foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.lg-check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; margin-right: auto; }
.lg-alert { padding: 10px 14px; border-radius: var(--ph-r-control); background: var(--ph-danger-tint); color: var(--ph-danger); border: 1px solid currentColor; font-size: 14px; font-weight: 500; }
@media (max-width: 560px) { .lg-form__foot .lg-btn { width: 100%; } }

/* Speed test */
.lg-speed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.lg-speed__item { min-width: 0; }
.lg-speed__item--wide { grid-column: 1 / -1; }
.lg-cmd { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; background: var(--ph-surface-2); border: 1px solid var(--ph-line); border-radius: var(--ph-r-control); }
.lg-cmd code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; }
.lg-files { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.lg-speed code { overflow-wrap: anywhere; }
@media (max-width: 640px) { .lg-speed { grid-template-columns: minmax(0, 1fr); } }

/* Footer */
.lg-foot { border-top: 1px solid var(--ph-line); background: var(--ph-surface); font-size: 13.5px; color: var(--ph-fg-muted); }
.lg-foot__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; min-height: 60px; padding-top: 12px; padding-bottom: 12px; }
.lg-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.lg-foot a { color: var(--ph-fg-muted); }
.lg-foot a:hover { color: var(--ph-accent-ink); }

/* Target row */
.lg-target-row { display: flex; gap: 8px; }
.lg-target-row .lg-input { flex: 1; min-width: 0; }
.lg-btn--input { min-height: 44px; padding: 0 14px; flex: none; }

/* Notices */
.lg-notice { padding: 12px 16px; border-radius: var(--ph-r-card); background: var(--ph-accent-tint); border: 1px solid var(--ph-accent); font-size: 14.5px; }
.lg-notice--warn { background: var(--ph-danger-tint); border-color: var(--ph-danger); }

/* Result */
.lg-result { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--ph-line); display: grid; gap: 14px; min-width: 0; }
.lg-result[hidden] { display: none; }
.lg-result__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lg-result__title { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; }
.lg-result__title .lg-mono { overflow-wrap: anywhere; }
.lg-result__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lg-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--ph-surface-2); color: var(--ph-fg-muted); flex: none; }
.lg-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lg-status--running { color: var(--ph-accent-ink); background: var(--ph-accent-tint); }
.lg-status--running::before { animation: lg-pulse 1s ease-in-out infinite; }
.lg-status--done { color: var(--ph-ok); }
.lg-status--error { color: var(--ph-danger); background: var(--ph-danger-tint); }
@keyframes lg-pulse { 50% { opacity: .3; } }

.lg-chips { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lg-chips[hidden] { display: none; }
.lg-chip { display: flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: var(--ph-r-control); background: var(--ph-surface-2); font-size: 13px; min-width: 0; max-width: 100%; }
.lg-chip dt { color: var(--ph-fg-muted); flex: none; }
.lg-chip dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* Terminal (plain output) */
.lg-term { margin: 0; padding: 14px 16px; border-radius: var(--ph-r-card); background: var(--ph-term-bg); color: var(--ph-term-fg); font-family: var(--ph-mono); font-size: 12.5px; line-height: 1.6; white-space: pre; overflow: auto; max-height: 460px; tab-size: 4; }
.lg-term[hidden] { display: none; }

/* Hop table */
.lg-hops { overflow-x: auto; border: 1px solid var(--ph-line); border-radius: var(--ph-r-card); }
.lg-hops[hidden] { display: none; }
.lg-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lg-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ph-fg-muted); padding: 9px 10px; background: var(--ph-surface-2); white-space: nowrap; }
.lg-table td { padding: 8px 10px; border-top: 1px solid var(--ph-line); vertical-align: top; }
.lg-table tbody tr { cursor: pointer; transition: background-color .12s; }
.lg-table tbody tr:hover, .lg-table tbody tr.is-hl { background: var(--ph-hl); }
.lg-td-n { color: var(--ph-fg-muted); font-variant-numeric: tabular-nums; width: 1%; }
.lg-td-num, .lg-td-loss { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-table th:nth-child(n+5) { text-align: right; }
.lg-td-avg { font-weight: 600; }
.lg-td-as, .lg-td-loc { color: var(--ph-fg-muted); max-width: 220px; }
.lg-host { display: flex; flex-direction: column; min-width: 0; }
.lg-host__name { font-weight: 500; overflow-wrap: anywhere; }
.lg-host__ip { font-size: 12px; color: var(--ph-fg-muted); }
.lg-td-loss[data-state="ok"] { color: var(--ph-ok); }
.lg-td-loss[data-state="warn"] { color: var(--ph-warn); font-weight: 600; }
.lg-td-loss[data-state="bad"] { color: var(--ph-bad); font-weight: 600; }
.lg-hint { margin-top: -4px; }

/* Mobile: every hop becomes a compact card */
@media (max-width: 720px) {
    .lg-hops { border: 0; overflow: visible; }
    .lg-table, .lg-table tbody { display: block; }
    .lg-table thead { display: none; }
    .lg-table tbody { display: grid; gap: 8px; }
    .lg-table tr { display: grid; grid-template-columns: 34px 1fr auto; column-gap: 10px; row-gap: 2px; padding: 10px 12px; border: 1px solid var(--ph-line); border-radius: var(--ph-r-card); background: var(--ph-surface); }
    .lg-table td { border: 0; padding: 0; }
    .lg-td-n { grid-row: 1 / span 3; font-size: 15px; font-weight: 600; color: var(--ph-fg); width: auto; padding-top: 1px; }
    .lg-td-host { grid-column: 2; }
    .lg-td-loss { grid-column: 3; grid-row: 1; font-size: 14px; }
    .lg-td-avg { grid-column: 3; grid-row: 2; text-align: right; }
    .lg-td-as, .lg-td-loc { grid-column: 2; font-size: 12.5px; max-width: none; }
    .lg-td-num:not(.lg-td-avg) { display: none; }
    .lg-td-empty { display: none; }
    .lg-hint { margin-top: 0; }
}

/* Map */
.lg-map { position: relative; border-radius: var(--ph-r-card); overflow: hidden; border: 1px solid var(--ph-line); background: var(--ph-sea); }
.lg-map[hidden] { display: none; }
.lg-map__canvas { width: 100%; aspect-ratio: 1.9; min-height: 280px; background: var(--ph-sea); }
@media (max-width: 600px) { .lg-map__canvas { aspect-ratio: 1.05; } }
.lg-map .maplibregl-ctrl-group { border-radius: 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.lg-map .maplibregl-ctrl-attrib { font-size: 11px; }
.lg-map .maplibregl-cooperative-gesture-screen { font-family: var(--ph-font); font-size: 15px; }
.lg-map__tip { position: absolute; z-index: 2; max-width: min(320px, calc(100% - 16px)); padding: 10px 12px; border-radius: var(--ph-r-control); background: var(--ph-surface); border: 1px solid var(--ph-line-strong); box-shadow: 0 6px 24px rgba(0, 0, 0, .14); font-size: 12.5px; display: grid; gap: 4px; pointer-events: none; }
.lg-map__tip[hidden] { display: none; }
.lg-map__tip strong { font-size: 13.5px; }
.lg-map__tiprow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.lg-map__tiprow b { color: var(--ph-fg-muted); font-weight: 600; }
.lg-map__tiprow .lg-mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-map__tiprow em { font-style: normal; white-space: nowrap; color: var(--ph-fg-muted); }
.lg-loss--warn { color: var(--ph-warn) !important; }
.lg-loss--bad { color: var(--ph-bad) !important; }
.lg-map__foot { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; padding: 7px 12px; font-size: 11.5px; color: var(--ph-fg-muted); background: var(--ph-surface); border-top: 1px solid var(--ph-line); }
@media (prefers-reduced-motion: reduce) { .lg-status--running::before { animation: none; } }
.lg-src { font-size: 9.5px; color: var(--ph-accent-ink); margin-left: 2px; }

@media (max-width: 600px) {
    .lg-map__tip { position: static; max-width: none; border: 0; border-top: 1px solid var(--ph-line); border-radius: 0; box-shadow: none; }
}

/* ---------- map bar: colour mode + legend ---------- */
.lg-map__bar { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 8px 12px; background: var(--ph-surface); border-top: 1px solid var(--ph-line); }
.lg-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 12px; color: var(--ph-fg-muted); min-width: 0; }
.lg-legend__item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.lg-legend__item i { width: 16px; height: 4px; border-radius: 2px; background: var(--c); flex: none; }
.lg-legend__item i.is-dashed { background: repeating-linear-gradient(90deg, var(--c) 0 5px, transparent 5px 8px); }
.lg-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* segmented buttons (map mode, IPv4/IPv6 tabs, OS tabs) */
.lg-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 8px; background: var(--ph-surface-2); border: 1px solid var(--ph-line); flex: none; }
.lg-seg[hidden] { display: none; }
.lg-seg button { font: inherit; font-size: 13px; font-weight: 500; color: var(--ph-fg-muted); background: transparent; border: 0; border-radius: 6px; padding: 5px 12px; min-height: 30px; cursor: pointer; }
.lg-seg button[aria-pressed="true"], .lg-seg button[aria-selected="true"] { background: var(--ph-surface); color: var(--ph-fg); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.lg-seg button:focus-visible { outline: 2px solid var(--ph-accent); outline-offset: 1px; }
.lg-famtabs { justify-self: start; }

/* port field next to the target */
.lg-input--port { flex: 0 0 96px !important; }
.lg-input--port[hidden] { display: none; }

/* ---------- IPv4 / IPv6 comparison ---------- */
.lg-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.lg-compare[hidden] { display: none; }
.lg-compare__card { display: grid; gap: 2px; text-align: left; font: inherit; color: inherit; padding: 12px 14px; border-radius: var(--ph-r-card); border: 1px solid var(--ph-line-strong); background: var(--ph-surface); cursor: pointer; min-width: 0; }
.lg-compare__card:hover { border-color: var(--ph-accent); }
.lg-compare__card[data-fam="6"] .lg-compare__fam { color: #8b5cf6; }
.lg-compare__fam { font-size: 12px; font-weight: 700; color: var(--ph-accent-ink); letter-spacing: .02em; }
.lg-compare__ip { font-size: 12px; color: var(--ph-fg-muted); overflow-wrap: anywhere; }
.lg-compare__ms { font-size: 22px; font-weight: 700; }
.lg-compare .lg-muted { font-size: 12.5px; }
.lg-compare__verdict { grid-column: 1 / -1; margin: 0; font-size: 13.5px; font-weight: 600; }
@media (max-width: 520px) { .lg-compare { grid-template-columns: minmax(0, 1fr); } }

/* ---------- structured panels ---------- */
.lg-panel { display: grid; gap: 14px; min-width: 0; }
.lg-panel[hidden] { display: none; }
.lg-panel__h { margin: 4px 0 -4px; }
.lg-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--ph-surface-2); color: var(--ph-fg-muted); white-space: nowrap; }
.lg-badge--ok { color: var(--ph-ok); background: color-mix(in srgb, var(--ph-ok) 12%, transparent); }
.lg-badge--warn { color: var(--ph-warn); background: color-mix(in srgb, var(--ph-warn) 14%, transparent); }
.lg-badge--bad { color: var(--ph-bad); background: color-mix(in srgb, var(--ph-bad) 12%, transparent); }
.lg-badge--info { color: var(--ph-accent-ink); background: var(--ph-accent-tint); }

.lg-paths { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lg-path { display: flex; align-items: center; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--ph-line); border-radius: var(--ph-r-control); }
.lg-path__chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.lg-path__as { display: inline-grid; padding: 4px 9px; border-radius: 6px; background: var(--ph-surface-2); line-height: 1.25; max-width: 100%; }
.lg-path__as b { font-weight: 600; font-size: 12.5px; }
.lg-path__as small { font-size: 11px; color: var(--ph-fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-path__as.is-origin { background: var(--ph-accent-tint); }
.lg-path__arrow { color: var(--ph-fg-muted); font-size: 12px; }

.lg-http__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.lg-http__total { margin-left: auto; font-size: 18px; }
.lg-http__redirect { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.lg-wf { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; background: var(--ph-surface-2); }
.lg-wf__seg { display: block; min-width: 3px; flex-basis: 0; }
.lg-wf__seg--dns { background: #64748b; }
.lg-wf__seg--connect { background: #f59e0b; }
.lg-wf__seg--tls { background: #8b5cf6; }
.lg-wf__seg--wait { background: var(--ph-accent); }
.lg-wf__seg--download { background: #10b981; }
.lg-wf__legend { margin: -4px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.lg-wf__item { display: flex; align-items: center; gap: 8px; }
.lg-wf__item dt { display: inline-flex; align-items: center; gap: 6px; color: var(--ph-fg-muted); }
.lg-wf__item dd { margin: 0; font-weight: 600; }
.lg-wf__dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

.lg-port { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--ph-r-card); border: 1px solid currentColor; font-size: 14.5px; }
.lg-port span { color: var(--ph-fg); }
.lg-port__state { font-size: 20px; }
.lg-port--open { color: var(--ph-ok); background: color-mix(in srgb, var(--ph-ok) 8%, transparent); }
.lg-port--closed { color: var(--ph-warn); background: color-mix(in srgb, var(--ph-warn) 8%, transparent); }
.lg-port--filtered { color: var(--ph-bad); background: color-mix(in srgb, var(--ph-bad) 7%, transparent); }

/* ---------- test from your side ---------- */
.lg-yourside { display: grid; gap: 16px; }
.lg-yourside__bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; }
.lg-yourside__os { display: grid; gap: 14px; }
.lg-yourside__os[hidden] { display: none; }
.lg-yourside__os .lg-muted { margin: 0; }

/* ---------- latency board ---------- */
.lg-lat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; }
.lg-lat__list { list-style: none; margin: 0; padding: 0; display: grid; }
.lg-lat__row { display: grid; grid-template-columns: minmax(0, 1fr) 72px 58px; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--ph-line); font-size: 13.5px; }
.lg-lat__row:last-child { border-bottom: 0; }
.lg-lat__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-lat__name strong { font-weight: 600; }
.lg-lat__spark { display: block; height: 22px; }
.lg-spark { display: block; width: 100%; height: 100%; overflow: visible; }
.lg-spark path { fill: none; stroke: var(--ph-accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.lg-lat__now { text-align: right; font-weight: 600; white-space: nowrap; }
@media (max-width: 900px) { .lg-lat { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .lg-lat { grid-template-columns: minmax(0, 1fr); } }

/* ---------- preview card (rendered at 1200 × 630 by lg-og) ---------- */
.lg-og__head { display: none; }
body.lg-og { width: 1200px; height: 630px; overflow: hidden; background: var(--ph-surface); }
body.lg-og > *:not(.lg-og__head):not(main) { display: none !important; }
body.lg-og main > *:not(#tools) { display: none !important; }
body.lg-og #tools > *:not(#result) { display: none !important; }
body.lg-og #result > *:not(#map):not(#panel) { display: none !important; }
body.lg-og .lg-og__head { display: grid; position: fixed; inset: 0 0 auto 0; height: 150px; padding: 26px 40px 0; box-sizing: border-box; gap: 2px; align-content: start; z-index: 5; background: var(--ph-surface); border-bottom: 1px solid var(--ph-line); }
body.lg-og .lg-og__head img { position: absolute; right: 40px; top: 30px; }
.lg-og__eyebrow { margin: 0; font-size: 15px; font-weight: 600; color: var(--ph-accent-ink); text-transform: uppercase; letter-spacing: .06em; }
.lg-og__title { margin: 4px 0 0; font-size: 34px; font-weight: 700; max-width: 900px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-og__text { margin: 6px 0 0; font-size: 19px; color: var(--ph-fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.lg-og #map { position: fixed; left: 0; top: 150px; width: 1200px; height: 480px; border: 0; border-radius: 0; z-index: 4; }
body.lg-og #map .lg-map__canvas { width: 1200px; height: 480px; aspect-ratio: auto; }
body.lg-og #map > :not(.lg-map__canvas) { display: none !important; }
body.lg-og #panel { position: fixed; left: 40px; right: 40px; top: 180px; z-index: 4; font-size: 17px; }
.lg-facts > .lg-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
body.lg-og .lg-btn { display: none !important; }
