/* Internet Health & Outage Monitor (tools/internet-monitor, assets/js/netmon.js). Site theme tokens; dark via data-theme. */
:root { --nm-empty: #e5e7eb; --nm-ocean: #f1f5f9; --nm-land-line: #ffffff; }
[data-theme="dark"] { --nm-empty: #243041; --nm-ocean: #0b1220; --nm-land-line: #0b1220; }

.nm-page .nm-sec { margin-top: 34px; }
.nm-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-top: 14px; min-width: 0; }
.nm-h3 { font-size: .98rem; margin: 0 0 10px; }
.nm-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.nm-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.nm-grid2 > .nm-card, .nm-grid3 > .nm-card { margin-top: 14px; }
@media (max-width: 980px) { .nm-grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .nm-grid2, .nm-grid3 { grid-template-columns: minmax(0, 1fr); } }
.nm-explain { max-width: 900px; color: var(--muted); }

/* status band + KPIs */
.nm-status { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: stretch; margin-top: 18px; }
@media (max-width: 860px) { .nm-status { grid-template-columns: minmax(0, 1fr); } }
.nm-status-main { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; --sc: #16a34a; }
.nm-st-minor .nm-status-main { --sc: #d9a706; }
.nm-st-issues .nm-status-main { --sc: #ea580c; }
.nm-st-major .nm-status-main { --sc: #dc2626; }
.nm-status-ring { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 50%; border: 6px solid var(--sc); box-shadow: 0 0 0 6px color-mix(in srgb, var(--sc) 18%, transparent); position: relative; }
.nm-status-ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--sc); animation: nm-pulse 2.4s ease-in-out infinite; }
@keyframes nm-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .nm-status-ring::after { animation: none; opacity: .8; } }
.nm-status-k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nm-status-v { font-size: 1.45rem; font-weight: 800; color: var(--sc); line-height: 1.15; }
.nm-status-s { color: var(--muted); margin-top: 2px; }
.nm-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1100px) { .nm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nm-kpi { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 30px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--kc); border-radius: 12px; color: var(--text); text-decoration: none; overflow: hidden; min-width: 0; }
.nm-kpi:hover { border-color: var(--kc); }
.nm-kpi-k { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-kpi-v { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.nm-kpi-s { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-spark { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 26px; }

.nm-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.nm-toc a { font-size: .84rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.nm-toc a:hover { border-color: var(--link); color: var(--link); }

/* world map */
.nm-modes { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.nm-mode { font: inherit; font-size: .84rem; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.nm-mode::before { content: ''; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mc); margin-right: 6px; vertical-align: 0; }
.nm-mode.on { background: var(--mc); border-color: var(--mc); color: #fff; }
.nm-mode.on::before { background: #fff; }
.nm-mapwrap { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 8px; overflow: hidden; }
.nm-world { display: block; }
.nm-ocean { fill: var(--nm-ocean); }
.nm-land { stroke: var(--nm-land-line); stroke-width: .5; transition: fill .35s; cursor: default; }
.nm-land:hover { stroke: var(--text); stroke-width: 1.2; }
.nm-land.now { stroke-width: 2.2; }
.nm-arc { fill: none; stroke: #f97316; opacity: .75; stroke-linecap: round; stroke-dasharray: 6 7; animation: nm-flow 1.6s linear infinite; }
.nm-arc-end { fill: #f97316; }
@keyframes nm-flow { to { stroke-dashoffset: -26; } }
@media (prefers-reduced-motion: reduce) { .nm-arc { animation: none; stroke-dasharray: none; } }
.nm-maplegend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.nm-lg-ramp { display: inline-block; width: 160px; height: 10px; border-radius: 6px; }
.nm-lg-nd { display: inline-block; width: 14px; height: 10px; border-radius: 3px; border: 1px solid var(--border); margin-left: 10px; }

/* chart bits */
.nm-svg { display: block; overflow: visible; }
.nm-grid { stroke: var(--border); stroke-width: 1; }
.nm-grid-v { stroke-dasharray: 2 4; opacity: .7; }
.nm-ax { font: 10.5px system-ui, sans-serif; fill: var(--muted); }
.nm-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.nm-dot { stroke: var(--surface); stroke-width: 2; }
.nm-cnote { margin: 6px 0 0; }
.nm-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; font-size: .82rem; }
.nm-lg-i { display: inline-flex; align-items: center; gap: 6px; }
.nm-lg-sw { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.nm-lg-sw.dash { background: none !important; border-top: 2px dashed; height: 0; }
.nm-lg-sw.band { height: 10px; opacity: .3; }
.nm-ctip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-size: .8rem; max-width: 340px; }
.nm-ctip-h { font-weight: 700; margin-bottom: 3px; }
.nm-ctip-r { display: flex; align-items: flex-start; gap: 6px; color: var(--muted); }
.nm-ctip-d { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; }

.nm-bars { display: flex; flex-direction: column; gap: 5px; }
.nm-bar { display: grid; grid-template-columns: minmax(90px, 40%) minmax(0, 1fr) 56px; gap: 8px; align-items: center; font-size: .84rem; }
.nm-bar.hl .nm-bar-n { font-weight: 800; color: var(--link); }
.nm-bar-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-bar-t { display: block; height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.nm-bar-f { display: block; height: 100%; border-radius: 5px; transition: width .5s; }
.nm-bar-v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.nm-donuts { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.nm-donuts.one { grid-template-columns: minmax(0, 1fr); }
.nm-donut { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; }
.nm-donuts.one .nm-donut { border: 0; padding: 0; }
.nm-donut svg { flex: 0 0 120px; }
.nm-donut-bg { stroke: var(--bg-2); }
.nm-donut-v { font: 800 19px system-ui, sans-serif; fill: var(--text); }
.nm-donut-s { font: 10px system-ui, sans-serif; fill: var(--muted); }
.nm-donut-t { font-weight: 700; font-size: .9rem; margin-bottom: 4px; }
.nm-donut-l { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.nm-donut-l .nm-lg-sw { height: 9px; width: 9px; border-radius: 50%; }

.nm-tw { overflow-x: auto; }
.nm-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.nm-table th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--border); padding: 6px 8px; white-space: nowrap; }
.nm-table td { border-bottom: 1px solid var(--border); padding: 6px 8px; vertical-align: middle; }
.nm-table tr.uk td { background: color-mix(in srgb, #2563eb 8%, transparent); }
.nm-table tr:hover td { background: var(--bg-2); }
.nm-cc { display: inline-block; font: 700 .7rem/1 ui-monospace, monospace; padding: 3px 5px; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); vertical-align: 1px; }
.nm-cc.uk { background: #1e3a8a; border-color: #facc15; color: #fff; }
.nm-ccs .nm-cc { margin-right: 3px; }
.nm-conf { display: inline-block; min-width: 26px; text-align: center; font-weight: 800; font-size: .78rem; padding: 2px 6px; border-radius: 999px; color: #fff; }
.nm-conf.hi { background: #dc2626; }
.nm-conf.md { background: #ea580c; }
.nm-conf.lo { background: #94a3b8; }
.nm-inbar { position: relative; display: block; min-width: 110px; height: 20px; border-radius: 6px; background: var(--bg-2); overflow: hidden; }
.nm-inbar span { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, #2563eb 35%, transparent); }
.nm-inbar.on span { background: color-mix(in srgb, #2563eb 55%, transparent); }
.nm-inbar b { position: relative; padding: 0 6px; font-weight: 600; font-size: .8rem; line-height: 20px; font-variant-numeric: tabular-nums; }

.nm-callouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (max-width: 860px) { .nm-callouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nm-call { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.nm-call-k { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.nm-call-v { font-size: 1.3rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nm-call-s { font-size: .76rem; color: var(--muted); }

/* outages */
.nm-live { display: flex; flex-direction: column; gap: 8px; }
.nm-out { border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 10px; padding: 8px 10px; }
.nm-out-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.nm-out-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.nm-out p { margin: 4px 0 2px; }
.nm-pill { font-size: .72rem; font-weight: 700; text-transform: uppercase; color: #fff; background: var(--c); border-radius: 999px; padding: 1px 8px; }
.nm-typechips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nm-typechip { font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--border); }
.nm-tl-bar { opacity: .9; }
.nm-tl-bar:hover { opacity: 1; stroke: var(--text); stroke-width: 1; }
.nm-tl-bar.live { stroke: var(--text); stroke-width: 1.4; stroke-dasharray: 3 2; }

/* quality */
.nm-vs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (max-width: 860px) { .nm-vs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .nm-vs { grid-template-columns: minmax(0, 1fr); } }
.nm-vsc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; border-top: 4px solid var(--border); }
.nm-vsc.good { border-top-color: #16a34a; }
.nm-vsc.bad { border-top-color: #ea580c; }
.nm-vsc-k { display: block; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.nm-vsc-v { display: block; font-size: 1.35rem; font-weight: 800; }
.nm-vsc-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.nm-vsc-b { display: grid; grid-template-columns: 44px minmax(0, 1fr) 54px; gap: 6px; align-items: center; font-size: .78rem; color: var(--muted); }
.nm-vsc-b b { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.nm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.nm-tab { font: inherit; font-size: .82rem; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.nm-tab.on { background: #2563eb; border-color: #2563eb; color: #fff; }
@media (max-width: 520px) { .nm-bar { grid-template-columns: minmax(70px, 38%) minmax(0, 1fr) 48px; } }
.nm-long-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.nm-long-head .nm-tabs { margin: 0; }
.nm-h4 { font-size: .88rem; margin: 14px 0 6px; color: var(--muted); font-weight: 600; }

/* routing risk card (internet-monitor #routing) */
.nm-rrisk { border-left: 4px solid var(--rc); }
.nm-rrisk-top { display: flex; gap: 14px; align-items: center; }
.nm-rrisk-score { flex: 0 0 auto; font-size: 2rem; font-weight: 800; color: var(--rc); line-height: 1; font-variant-numeric: tabular-nums; }
.nm-rrisk-score small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.nm-rrisk-list { margin: 10px 0 6px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: .86rem; }

/* Reported problems now (Downdetector-style list, includes/outreports.php) */
.nm-rep-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.nm-rep-i { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; border-left: 4px solid #d97706; }
.nm-rep-i.is-sig { border-left-color: #dc2626; }
.nm-rep-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: #d97706; }
.nm-rep-dot.is-sig { background: #dc2626; box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); animation: nmRepPulse 2s infinite; }
.nm-rep-dot.is-ok { background: #16a34a; display: inline-block; margin: 0 8px 0 0; }
@keyframes nmRepPulse { 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.nm-rep-body { min-width: 0; flex: 1; }
.nm-rep-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 1.02rem; }
.nm-rep-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; background: #fef3c7; color: #854d0e; }
.is-sig .nm-rep-tag { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .nm-rep-tag { background: rgba(217, 119, 6, .2); color: #fcd34d; }
[data-theme="dark"] .is-sig .nm-rep-tag { background: rgba(220, 38, 38, .22); color: #fca5a5; }
.nm-rep-d { margin-top: 3px; overflow-wrap: anywhere; }
.nm-rep-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; }
.nm-rep-links a, .nm-rep-minor a { color: var(--link); }
.nm-rep-calm { margin: 0; display: flex; align-items: center; font-weight: 600; }
.nm-rep-minor { margin: 12px 0 0; }
.nm-rep-earlier { margin-top: 12px; }
.nm-rep-earlier summary { cursor: pointer; color: var(--link); }
.nm-rep-earlier ul { margin: 6px 0 0; padding-left: 18px; }
.nm-rep-foot { margin: 12px 0 0; }
@media (prefers-reduced-motion: reduce) { .nm-rep-dot.is-sig { animation: none; } }
