*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #111110;
  --surface:  #1a1a18;
  --border:   #2c2c2a;
  --text:     #e8e6e3;
  --muted:    #898781;
  --green:    #0ca30c;
  --yellow:   #fab219;
  --orange:   #eb6834;
  --red:      #e34948;
  --blue:     #2a78d6;
  --purple:   #6250d6;
  --gray:     #898781;
  --sans:     -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:     "SF Mono", "Fira Code", "Cascadia Code", monospace;
  --radius:   6px;
}

body { background: var(--bg); color: var(--text); font-family: var(--sans); line-height: 1.5; min-height: 100vh; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px 48px; }

/* ── Header ── */
.at-header { padding: 28px 0 20px; }
.at-title { font-size: 20px; font-weight: 500; letter-spacing: -0.2px; margin-bottom: 3px; }
.at-sub { font-size: 14px; color: var(--muted); }

/* ── Stat cards ── */
.at-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.at-stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.at-stat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.at-stat-val { font-family: var(--mono); font-size: 28px; font-weight: 500; line-height: 1; }
.at-stat-val.green { color: var(--green); }
.at-stat-val.red   { color: var(--red); }

/* ── Pulse bar ── */
.at-pulse-section { margin-bottom: 28px; }
.at-pulse-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--border);
}
.at-pulse-seg { height: 100%; }
.at-pulse-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.at-pulse-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; vertical-align: middle; }
.at-updated { font-size: 12px; color: var(--muted); }

/* ── Trend chart ── */
.at-section-label { font-size: 13px; font-weight: 500; color: var(--muted); margin: 8px 0 10px; }
.trend-wrap { position: relative; height: 110px; margin-bottom: 28px; }

/* ── Tabs ── */
.at-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1px;
  border-bottom: 1px solid var(--border);
}
.at-tab {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}
.at-tab:hover { color: var(--text); }
.at-tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ── Table ── */
.table-scroll { overflow-x: auto; }
.at-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.at-table th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 8px 10px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.at-table td {
  padding: 10px 8px 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.at-table tr:last-child td { border-bottom: none; }
.at-table tr:hover td { background: var(--surface); }

.cell-name { font-weight: 500; }
.cell-url {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  display: block;
}
.cell-url a { color: var(--muted); }
.cell-url a:hover { color: var(--blue); text-decoration: none; }

.cell-mono { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.cell-uptime-good { color: var(--green); }
.cell-uptime-warn { color: var(--yellow); }
.cell-uptime-bad  { color: var(--red); }

/* ── 3D classification badges ── */
.at-3d { display: flex; gap: 5px; flex-wrap: wrap; }
.at-3d span {
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-family: var(--mono);
  white-space: nowrap;
}
.badge-op         { background: rgba(12,163,12,0.12);  color: var(--green); }
.badge-unreachable{ background: rgba(227,73,72,0.12);  color: var(--red); }
.badge-mcp        { background: rgba(42,120,214,0.12); color: var(--blue); }
.badge-nonmcp     { background: rgba(235,104,52,0.12); color: var(--orange); }
.badge-open       { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.badge-auth       { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.badge-paid       { background: rgba(98,80,214,0.12);  color: var(--purple); }

/* ── Quality score bar ── */
.at-quality { display: flex; align-items: center; gap: 6px; }
.at-quality-bar { width: 44px; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.at-quality-fill { height: 100%; border-radius: 3px; }
.at-quality-num { font-size: 11px; font-family: var(--mono); color: var(--muted); min-width: 20px; }

/* ── Footer ── */
.at-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.loading { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .at-stat-val { font-size: 22px; }
  .at-table th:nth-child(3),
  .at-table td:nth-child(3),
  .at-table th:nth-child(5),
  .at-table td:nth-child(5),
  .at-table th:nth-child(6),
  .at-table td:nth-child(6) { display: none; }
}

@media (max-width: 420px) {
  .at-stats { grid-template-columns: 1fr; }
  .at-table th:nth-child(4),
  .at-table td:nth-child(4) { display: none; }
}
