:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-alt: #eef1f4;
  --border: #d7dce1;
  --text: #1a2230;
  --text-muted: #5b6572;
  --accent: #0057a3;
  --accent-2: #00a3a3;
  --green: #1a8c4a;
  --green-bg: #e3f6ea;
  --red: #c0293b;
  --red-bg: #fbe6e9;
  --na-bg: #eceff2;
  --na-text: #8a94a0;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(20, 30, 40, 0.08), 0 1px 2px rgba(20, 30, 40, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10151c;
    --surface: #161d26;
    --surface-alt: #1c2531;
    --border: #2b3543;
    --text: #e6ebf1;
    --text-muted: #92a0b0;
    --accent: #4da3ff;
    --accent-2: #37c9c9;
    --green: #3ddc84;
    --green-bg: #123423;
    --red: #ff6b7f;
    --red-bg: #3a1620;
    --na-bg: #232c38;
    --na-text: #66717e;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.site-header {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  padding: 2rem 1.5rem 1.75rem;
}

.header-inner { max-width: 1200px; margin: 0 auto; }

.brand {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand-mark { color: #fff; }
.brand-mark2 { color: rgba(255, 255, 255, 0.75); }
.brand-sub { font-weight: 400; opacity: 0.7; font-size: 1.2rem; }

.tagline { margin: 0.35rem 0 0; opacity: 0.92; font-size: 1rem; }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.intro p { color: var(--text-muted); max-width: 68ch; }
.intro a { color: var(--accent); }

.status-line {
  font-size: 0.9rem;
  font-family: var(--mono);
  color: var(--text-muted) !important;
}

.legend {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }

.dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}
.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-na { background: var(--na-text); }

.table-scroll {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1050px;
  font-size: 0.88rem;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface-alt);
  color: var(--text);
  text-align: center;
  padding: 0.6rem 0.5rem;
  border-bottom: 2px solid var(--border);
  font-weight: 600;
  white-space: nowrap;
  cursor: help;
}

.col-name, td.col-name {
  text-align: left;
  padding-left: 1rem;
}

th.sticky-col {
  left: 0;
  z-index: 4;
  text-align: left;
  padding-left: 1rem;
}

td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

tbody tr:hover td.sticky-col { background: var(--surface-alt); }

tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }

tbody tr.category-row td {
  background: var(--surface-alt);
  font-weight: 700;
  padding: 0.55rem 1rem;
  color: var(--accent);
  position: static;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

td { padding: 0.45rem 0.5rem; text-align: center; vertical-align: middle; }

.domain-name { font-weight: 600; }
.domain-host { display: block; font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: default;
}
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-fail { background: var(--red-bg); color: var(--red); }
.badge-na { background: var(--na-bg); color: var(--na-text); }

.loading-row, .error-row {
  text-align: left;
  padding: 1.5rem 1rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.error-row { color: var(--red); }

.footer-info {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.footer-info a { color: var(--accent); }

/* Tooltip */
.tooltip {
  position: fixed;
  max-width: 380px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.65rem 0.8rem;
  font-size: 0.8rem;
  z-index: 50;
  line-height: 1.45;
}
.tooltip[hidden] { display: none; }
.tooltip h4 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--text);
}
.tooltip .tt-detail { color: var(--text-muted); margin-bottom: 0.4rem; }
.tooltip ul { margin: 0.2rem 0 0; padding-left: 1.1rem; }
.tooltip li { margin-bottom: 0.25rem; font-family: var(--mono); font-size: 0.76rem; word-break: break-all; }
.tooltip a { color: var(--accent); }
.tooltip .as-info { font-family: var(--sans); color: var(--text-muted); }

@media (max-width: 700px) {
  .site-header { padding: 1.5rem 1rem; }
  main { padding: 1rem; }
  table { min-width: 900px; }
}
