/* cf-workers-status-page v2 — UptimeFlare-faithful UI, hand-written, no build step */
:root {
  --bg: #ecebe5;
  --card-bg: #f6f5f0;
  --card-border: #dedcd5;
  --divider: #dedcd5;
  --text: #3f3e3a;
  --muted: #78756d;
  --shadow: 0 1px 2px rgba(63, 62, 58, 0.08);
  --green: #047857;
  --red: #df484a;
  --red-dark: #b91c1c;
  --orange: #ff8533;
  --chart-line: #78756d;
  --bar-nodata: #e0ddd2;
  --input-bg: #ecebe5;
  --input-border: #dedcd5;
  --link: #d96f1e;
  --tooltip-bg: #3f3e3a;
  --tooltip-text: #f6f5f0;
  --group-open-bg: #ecebe5;
  --group-hover-bg: #ecebe5;
  --logo-fill: #ff8533;
  --map-land: #cfccc0;
}
[data-theme="dark"] {
  --bg: #1a1b1e;
  --card-bg: #1a1b1e;
  --card-border: #373a40;
  --divider: #373a40;
  --text: #c1c2c5;
  --muted: #70778c;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  --green: #059669;
  --red: #df484a;
  --red-dark: #df484a;
  --orange: #f29030;
  --chart-line: #70778c;
  --bar-nodata: #373a40;
  --input-bg: #25262b;
  --input-border: #373a40;
  --link: #4dabf7;
  --tooltip-bg: #f8f9fa;
  --tooltip-text: #1a1b1e;
  --group-open-bg: #25262b;
  --group-hover-bg: #25262b;
  --logo-fill: #1a8cff; /* NextDNS blue in dark mode */
  --map-land: #3a3f4b;
}

* { box-sizing: border-box; }
.monitors-card, .dns-card, .conn-card, .btn, input, select,
.search-dropdown, .pill, .modal, .ipinfo-pill { border-radius: 0 !important; }
.site-title, .nav a, h1, h2, h3, .blat-title, .hero-title,
.monitor-name, .search-head {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase; letter-spacing: .5px;
}
h1, h2, .hero-title { font-weight: 900; }
::selection { background: var(--orange); color: #fff; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- slim top header bar (56px, UptimeFlare) ---- */
.site-header {
  height: 56px;
  background: rgba(246, 245, 240, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--card-border);
}
[data-theme="dark"] .site-header { background: var(--card-bg); backdrop-filter: none; }
.header-inner {
  max-width: 960px;
  height: 56px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { height: 32px; width: auto; }
.logo-wrap { display: inline-flex; align-items: center; cursor: pointer; }
.logo-shield { fill: var(--logo-fill); }
.site-title { font-size: 1.05rem; font-weight: 700; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { flex-shrink: 0; }

/* ---- header nav (UptimeFlare: 14px/500, hover pill) ---- */
.nav { display: flex; gap: 5px; align-items: center; flex-shrink: 0; }
.nav a {
  font-size: 14px; font-weight: 500; color: var(--text);
  padding: 8px 12px; border-radius: 4px; line-height: 1;
  cursor: pointer; white-space: nowrap;
}
.nav a:hover { background: var(--group-hover-bg); text-decoration: none; }
.nav a.active { background: #3f3e3a; color: #fff; }
[data-theme="dark"] .nav a { color: #c1c2c5; }
[data-theme="dark"] .nav a:hover { background: #25262b; }
[data-theme="dark"] .nav a.active { background: #1849a9; color: #fff; }

.icon-btn {
  width: 2rem; height: 2rem; border-radius: 4px; border: none;
  background: transparent; color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  font-size: 14px; font-weight: 500;
}
.icon-btn:hover { background: var(--input-border); }
[data-theme="dark"] .icon-btn:hover { background: #25262b; }
.icon-btn svg { width: 1.15rem; height: 1.15rem; }
.icon-btn:focus { outline: 2px solid var(--link); outline-offset: 2px; }
.lang-btn { width: auto; min-width: 2rem; padding: 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.03em; }

.filter-wrap { position: relative; }
.filter-wrap input {
  display: block; width: 220px; padding: 0.45rem 2.1rem 0.45rem 0.8rem;
  border: 1px solid var(--input-border); border-radius: 4px;
  background: var(--input-bg); color: var(--text); font-size: 14px;
  font-family: inherit;
}
.filter-wrap input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 1px var(--link); }
.filter-icon {
  position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; display: inline-flex;
}
.filter-icon svg { width: 1.15rem; height: 1.15rem; }

/* ---- centered hero (UptimeFlare OverallStatus) ---- */
.page { padding-bottom: 48px; }
.hero { text-align: center; padding: 100px 16px 0; }
.hero-icon svg { display: block; margin: 0 auto; width: 64px; height: 64px; }
.hero-title { font-size: 34px; font-weight: 700; margin: 16px 0 0; letter-spacing: -0.01em; }
.hero-sub { color: var(--muted); font-size: 16px; font-weight: 700; margin: 10px 0 0; }

/* ---- the one centered card (897px like UptimeFlare with groups; fits the 90-bar strip) ---- */
.monitors-card {
  width: 897px;
  max-width: calc(100% - 32px);
  margin: 32px auto 0;
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 20px;
}
.monitor { padding: 18px 4px; }
.monitor + .monitor { border-top: 1px solid var(--divider); }
.monitor:first-child { padding-top: 4px; }
.monitor:last-child { padding-bottom: 4px; }

/* ---- monitor groups: UptimeFlare-style contained accordion ---- */
.mgroup {
  border: 1px solid var(--card-border);
  border-radius: 4px;
  margin-bottom: 14px;
}
.mgroup:last-child { margin-bottom: 0; }
.mgroup.open { background: var(--group-open-bg); }
.mgroup-head {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  background: none; border: none; cursor: pointer;
  font: inherit; color: var(--text); text-align: left;
}
.mgroup-head:hover { background: var(--group-hover-bg); }
.mgroup-name { font-size: 16px; }
.mgroup-right { display: inline-flex; align-items: center; gap: 6px; }
.mgroup-count { font-weight: 500; padding-right: 5px; font-size: 15px; }
.mgroup-chev { transition: transform 0.18s ease; color: var(--muted); flex: none; }
.mgroup.open .mgroup-chev { transform: rotate(180deg); }
.mgroup-panel { display: none; padding: 5px 16px 16px; }
.mgroup.open .mgroup-panel { display: block; }
.mgroup-panel .monitor:first-child { padding-top: 8px; }

.monitor-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px;
}
.monitor-name {
  display: flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: 16px; min-width: 0;
}
.monitor-name a, .monitor-name span.name-text { color: var(--text); }
.monitor-name a.name-text { text-decoration: underline; }
.monitor-name .micon { flex: none; }
.overall { font-weight: 700; font-size: 16px; white-space: nowrap; }

/* ---- 90-day uptime bar strip (UptimeFlare DetailBar) ---- */
.ustrip-wrap { position: relative; margin: 10px 0 5px; }
.ustrip { display: flex; flex-wrap: nowrap; align-items: flex-end; justify-content: flex-start; width: max-content; max-width: 100%; }
.ubar {
  width: 7px; height: 20px; border-radius: 2px;
  margin: 0 1px; flex: none;
}
/* UptimeFlare: hovered bar brightens; cursor stays default even when clickable */
.ubar:hover { background: #9DEAB8 !important; }
.strip-tip {
  position: absolute; z-index: 25; pointer-events: none;
  background: var(--tooltip-bg); color: var(--tooltip-text);
  border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  padding: 0.35rem 0.6rem; font-size: 0.75rem; line-height: 1.4;
  width: max-content; max-width: 16rem; white-space: normal; text-align: center;
}

/* ---- latency chart (UptimeFlare DetailChart style) ---- */
.chart-title {
  font-size: 12px; font-weight: 700; color: #666;
  margin: 14px 0 2px; text-align: left;
}
.chart-nodata {
  color: var(--muted); font-size: 0.85rem; text-align: center;
  padding: 1.75rem 0 1.25rem;
}
.chart-wrap { position: relative; margin: 0; }
.chart { display: block; width: 100%; height: auto; cursor: crosshair; }
.cline { fill: none; stroke: #64748b; stroke-width: 2; }
.cdot { fill: #64748b; }
.ctick { font-size: 10px; fill: var(--muted); }
.cgrid { stroke: var(--card-border); stroke-width: 1; }
/* Phase 6: latency threshold line + degraded pill (orange #FD7E14, distinct
   from the maintenance yellow #FAB005). Readable in light and dark mode. */
.cthresh {
  stroke: #FD7E14;
  stroke-opacity: 0.55;
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.cthresh-label { font-size: 10px; fill: #FD7E14; opacity: 0.9; }
.lat-pill {
  display: inline-block;
  margin-left: 2px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  color: #FD7E14;
  background: rgba(253, 126, 20, 0.12);
  border: 1px solid rgba(253, 126, 20, 0.45);
  border-radius: 999px;
}
.tip-ts { font-weight: 700; }
@media (max-width: 640px) {
  .xticks text:nth-of-type(even) { display: none; }
}
.cdot.bad { fill: #df484a; }
.hov { fill: transparent; }
.caxis { stroke: var(--card-border); stroke-width: 1; }
.cmax { font-size: 11px; fill: var(--muted); font-family: inherit; }
.chart-tip {
  position: absolute; z-index: 20; pointer-events: none;
  background: var(--tooltip-bg); color: var(--tooltip-text);
  border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  padding: 0.4rem 0.65rem; font-size: 0.75rem; line-height: 1.45;
  width: max-content; max-width: 15rem; white-space: normal;
}
.hist-legend { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }

/* ---- tooltips ---- */
.tooltip { position: relative; }
.tooltip .tip {
  display: none; position: absolute; z-index: 20;
  background: var(--tooltip-bg); color: var(--tooltip-text);
  border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  padding: 0.35rem 0.6rem; font-size: 0.75rem; line-height: 1.4;
  width: max-content; max-width: 16rem; white-space: normal; text-align: center;
}
.monitor-name .tooltip .tip { left: 0; top: calc(100% + 6px); text-align: left; }
.tooltip:hover .tip, .tooltip:focus-within .tip { display: block; }
.tip .tip-date { opacity: 0.75; }
.tip .tip-label { font-weight: 700; display: block; margin: 0.15rem 0; }
.tip .tip-label2 { font-weight: 700; display: block; margin: 0.15rem 0; }
.tip .tip-avg { display: block; font-size: 0.7rem; opacity: 0.85; }

/* ---- incident modal ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card-bg); color: var(--text);
  border-radius: 8px; width: 100%; max-width: 640px;
  max-height: 80vh; overflow: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--divider);
  font-weight: 700; font-size: 1rem;
}
.modal-x {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.4rem; line-height: 1; padding: 0 0 0 12px;
}
.modal-body { padding: 16px 18px; font-size: 0.9rem; line-height: 1.7; }

/* ---- minimal footer (UptimeFlare) ---- */
.footer {
  margin: 20px 0 0;
  padding: 18px 16px 8px;
  border-top: 1px solid var(--card-border);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}

.empty { text-align: center; color: var(--muted); padding: 2rem 0; }

/* ---- incidents view (UptimeFlare incidents page, same visual language) ---- */
.inc-controls { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.inc-controls select {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 4px; padding: 8px 12px; max-width: 300px; cursor: pointer;
}
.incident {
  border: 1px solid var(--card-border); border-radius: 4px;
  padding: 12px 16px; margin-bottom: 10px;
}
.incident-head { display: flex; align-items: center; gap: 8px; }
.incident-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); flex: none;
}
.incident-head strong { font-size: 15px; }
.incident-date { margin-left: auto; color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.incident-body { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }
.no-incidents {
  text-align: center; color: var(--muted); padding: 2.5rem 1rem;
  border: 1px dashed var(--card-border); border-radius: 4px;
}
.inc-pager {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
}
.month-label { font-weight: 500; font-size: 18px; }
.btn {
  font: inherit; font-size: 14px; font-weight: 500;
  color: #fff; background: var(--orange);
  border: 1px solid var(--orange); border-radius: 0;
  padding: 8px 14px; cursor: pointer;
}
.btn:hover { background: #f07422; border-color: #f07422; }
.btn:disabled { background: #c8c4b8; border-color: #c8c4b8; }
.btn:disabled { opacity: 0.7; cursor: not-allowed; }
.inc-note { text-align: center; color: var(--muted); font-size: 0.8rem; margin-top: 10px; }

/* ---- Speedtest view ---- */
.st-head h2 { margin: 0 0 6px; font-size: 1.25rem; }
.st-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 4px; max-width: 640px; }
.st-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin: 18px 0;
}
.st-metric {
  border: 1px solid var(--divider); border-radius: 8px;
  padding: 16px 12px; text-align: center;
  background: var(--group-open-bg);
}
.st-label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.st-value { font-size: 1.7rem; font-weight: 650; font-variant-numeric: tabular-nums; min-height: 2.6rem; }
.st-unit { font-size: 1rem; font-weight: 500; color: var(--muted); }
.st-sub2 { font-size: 0.85rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.st-controls { display: flex; align-items: center; gap: 14px; margin-top: 6px; flex-wrap: wrap; }
.st-status { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 640px) {
  .st-metrics { grid-template-columns: 1fr; }
  .st-value { min-height: 0; }
}

/* Phase 8b/8c: vietcdn-style detailed speedtest rows.
   Row anatomy mirrors vietcdn.net: [flag] [name + pin + Multi badge] [speed]. */
.st-detail { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--divider); }
.st-detail h3 { margin: 0 0 6px; font-size: 1.1rem; }
.st-note { color: var(--muted); font-size: 0.8rem; margin: 0 0 4px; max-width: 640px; }
.st-progress { height: 6px; border-radius: 3px; background: var(--bar-nodata); overflow: hidden; margin: 10px 0 4px; }
.st-progress-fill { height: 100%; width: 0%; border-radius: 3px; background: var(--link); transition: width 0.3s; }
.st-drow {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--divider);
}
.st-drow.closest { background: var(--group-open-bg); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.st-dflag { flex: none; width: 28px; display: flex; align-items: center; }
.st-flag { width: 28px; height: auto; border-radius: 3px; display: block; box-shadow: var(--shadow); }
.st-cf {
  width: 28px; height: 21px; display: flex; align-items: center; justify-content: center;
  background: #f6821f; color: #fff; border-radius: 3px; font-size: 14px;
}
.st-dname { flex: 1; min-width: 0; font-size: 0.9rem; font-weight: 500; }
.st-pin { margin-right: 4px; }
.st-multi {
  display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  color: var(--link); background: color-mix(in srgb, var(--link) 12%, transparent);
  border-radius: 6px; padding: 1px 6px; margin-left: 6px; vertical-align: middle;
}
.st-dspeed { text-align: right; flex: none; }
.st-mbps { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.st-mbs { font-size: 0.75rem; color: var(--muted); }
.st-summary { margin-top: 12px; font-size: 0.9rem; color: var(--muted); }
.st-summary strong { color: var(--text); }
@media (max-width: 640px) {
  .st-drow { gap: 8px; }
  .st-mbps { font-size: 0.9rem; }
}

/* Phase 7: browser-based latency measurement */
.blat { padding: 20px 24px; }
.blat-title { margin: 0 0 6px; font-size: 1.05rem; font-weight: 600; }
.blat-sub { margin: 0 0 14px; color: var(--muted); font-size: 0.85rem; }
.blat-progress { margin: 12px 0 4px; color: var(--muted); font-size: 0.85rem; }
.blat-results { margin-top: 12px; }
.blat-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 2px; border-top: 1px solid var(--divider); font-size: 0.92rem;
}
.blat-row:first-child { border-top: none; }
.blat-name { color: var(--text); }
.blat-fastest .blat-name { font-weight: 700; }
.blat-ms { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.blat-server { color: var(--muted); font-size: 0.78rem; margin-left: 8px; }
.blat-failed .blat-ms { color: var(--muted); font-style: italic; }
@media (max-width: 640px) {
  .blat { padding: 16px; }
}

/* ---- maintenance alerts (UptimeFlare MaintenanceAlert style) ---- */
:root {
  --maint-bg: #fff9db;
  --maint-border: #e8c547;
}
[data-theme="dark"] {
  --maint-bg: #3a2f08;
  --maint-border: #8a6d1a;
}
.maint {
  background: var(--maint-bg);
  border: 1px solid var(--maint-border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.maint-head { display: flex; align-items: center; gap: 10px; }
.maint-head svg { flex: none; }
.maint-head strong { font-size: 1rem; }
.maint-dates {
  margin-left: auto; text-align: right; font-size: 0.85rem;
  display: grid; gap: 2px; white-space: nowrap;
}
.maint-body { margin-top: 8px; white-space: pre-line; }
.maint-aff { margin-top: 8px; }
.maint-aff ul { margin: 4px 0 0; padding-left: 1.25rem; }

@media (max-width: 640px) {
  .header-inner { padding: 0 12px; gap: 8px; }
  .site-title { font-size: 0.95rem; }
  .filter-wrap { display: none; } /* nav takes priority on small screens */
  .nav a { padding: 8px 8px; }
  .hero { padding-top: 56px; }
  .hero-icon svg { width: 48px; height: 48px; }
  .hero-title { font-size: 1.5rem; }
  .hero-sub { font-size: 0.85rem; }
  .monitors-card { margin: 24px 16px 0; padding: 16px; }
  .monitor-name { font-size: 0.92rem; }
  .overall { font-size: 0.85rem; }
}

/* UptimeFlare hides the 90-day bar strip on small screens */
@media (max-width: 540px) {
  .ustrip-wrap { display: none; }
}

/* DNS Tools (Phase 9) */
.dns-card { margin-bottom: 28px; }
.dns-card:last-child { margin-bottom: 0; }
.dns-form { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.dns-form input {
  flex: 1 1 220px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 4px; padding: 8px 12px;
}
.dns-form input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 1px var(--link); }
.dns-form select {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 4px; padding: 8px 10px;
}
.dns-status { min-height: 26px; margin: 6px 0; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.dns-err { color: var(--red); }
.dns-note { color: var(--muted); font-size: 0.85em; }
.dns-meta { color: var(--muted); font-size: 13px; margin: 8px 0; }
.dns-meta b { color: var(--text); }
.dns-empty { color: var(--muted); padding: 14px 4px; }
.dns-table-wrap { overflow-x: auto; }
.dns-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dns-table th, .dns-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.dns-table th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.dns-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; }
.dns-num { text-align: right; font-variant-numeric: tabular-nums; }
.dns-data { word-break: break-all; }
.spinner {
  display: inline-block; width: 14px; height: 14px; flex: none;
  border: 2px solid var(--input-border); border-top-color: var(--link);
  border-radius: 50%; animation: dns-spin 0.7s linear infinite; vertical-align: -2px;
}
@keyframes dns-spin { to { transform: rotate(360deg); } }
/* Phase 9b: leak-test status pills + DNSSEC matrix (mirrors dnscheck.tools) */
.leak-pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
.leak-pills:empty { display: none; }
.leak-pill {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--divider); color: var(--muted); white-space: nowrap;
}
.leak-green { background: rgba(5,150,105,.12); border-color: var(--green); color: var(--green); }
.leak-red { background: rgba(223,72,74,.12); border-color: var(--red); color: var(--red); }
.leak-yellow { background: rgba(242,144,48,.16); border-color: var(--orange); color: var(--orange); }
.leak-blue { background: rgba(28,126,214,.12); border-color: var(--link); color: var(--link); }
.leak-na { opacity: .55; border-style: dashed; }
/* Phase 9c: full info parity — registrant/geo, status bar, grouped resolvers */
.leak-reg { font-size: 12px; color: var(--muted); margin: 6px 0 1px; }
.leak-geo { color: var(--link); font-size: 13px; margin-left: 10px; }
.link { color: var(--link); cursor: pointer; text-decoration: underline; font-weight: 400; font-size: 13px; }
.leak-regrow td { font-weight: 700; color: var(--muted); font-size: 12px; background: none; border-bottom: 1px solid var(--divider); }
.leak-statusbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 16px 0 4px; padding: 8px 12px; border: 1px solid var(--divider);
  border-radius: 8px; font-size: 12px; flex-wrap: wrap;
}
.leak-sb-pills { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.leak-sb-pills .leak-pill { border: none; padding: 0; background: none; }
.leak-sb-dns { color: var(--muted); }
.leak-sec-title { font-weight: 700; margin: 18px 0 6px; font-size: 14px; }
.leak-ips { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.dsec-table { min-width: 460px; }
.dsec-table caption { text-align: left; font-weight: 700; padding: 4px 0 8px; color: var(--text); caption-side: top; }
.dsec-table td { text-align: center; font-weight: 700; }
.dsec-table td.dsec-pending { color: var(--muted); font-weight: 400; }
.dsec-pass { color: var(--green); }
.dsec-fail { color: var(--red); }
.dsec-warn { color: var(--orange); }
.dsec-footnote { margin-top: 6px; }
@media (max-width: 640px) {
  .dns-form .btn { flex: 1 1 100%; }
}

/* ---- Phase 13: World Ping ---- */
.wping-map { width: 100%; height: auto; display: block; margin: 8px 0 4px; color: var(--text); }
.wping-sec { margin: 20px 0 8px; font-size: 15px; }
.wping-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.wping-table th, .wping-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.wping-table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.wping-table td:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }
/* Connection info card (speed.cloudflare.com-style server location) */
.conn-card { margin: 18px 0; padding: 16px; border: 1px solid var(--border); border-radius: 12px; }
.conn-card .blat-title { margin: 0 0 12px; }
.conn-map { border-radius: 0; overflow: hidden; background: transparent; }
.map-land { fill: var(--map-land); }
.conn-map svg { display: block; width: 100%; height: auto; }
.conn-rows { margin-top: 12px; display: grid; gap: 8px; }
.conn-row { display: flex; align-items: baseline; gap: 10px; font-size: 14px; }
.conn-label { color: var(--muted); min-width: 150px; }
.conn-val { font-weight: 600; word-break: break-all; }
/* Setup page */
.setup-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.setup-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.setup-step-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-soft, #f4f4f5); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
.setup-steps code { background: var(--bg-soft, #f4f4f5); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.setup-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.btn-sm { padding: 4px 12px; font-size: 13px; }
/* Universal search dropdown */
.search-dropdown { position: absolute; top: 100%; left: 0; right: 0; margin-top: 6px; background: var(--bg, #fff); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 100; overflow: hidden; max-height: 320px; overflow-y: auto; }
.search-head { padding: 8px 14px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.search-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; cursor: pointer; font-size: 14px; }
.search-item:hover, .search-item.active { background: var(--bg-soft, #f4f4f5); }
.search-item-t { font-weight: 500; }
.search-go { font-size: 12px; color: var(--muted); white-space: nowrap; }
.search-empty { padding: 14px; font-size: 14px; color: var(--muted); text-align: center; }
@keyframes searchFlash { 0%, 100% { box-shadow: none; } 30%, 70% { box-shadow: 0 0 0 3px var(--primary, #1d4ed8); } }
.search-flash { animation: searchFlash 1.8s ease; border-radius: 12px; }

/* Responsive header: nav scrolls horizontally when tight, no hamburger */
@media (max-width: 1100px) {
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .filter-wrap { flex: 1 1 auto; min-width: 0; }
  .filter-wrap input { min-width: 0; width: 100%; }
}
@media (max-width: 640px) {
  .filter-wrap { display: none; }
}
