:root {
  --bg: #fff; --fg: #1a1d21; --muted: #6b7280; --line: #e5e7eb;
  --accent: #2563eb; --danger: #b91c1c; --ok: #15803d; --warn: #b45309; --panel: #f9fafb;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { overscroll-behavior: none; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); }
a { color: var(--accent); }

header { position: sticky; top: 0; z-index: 20; background: #000; color: #fff; }
header .bar { display: flex; align-items: center; gap: 12px; padding: 12px 24px; }
header a.brand { font-weight: 700; font-size: 20px; text-decoration: none; color: #fff; letter-spacing: -.02em; }
header .ver { color: #a1a1aa; font-size: 12px; margin-left: -4px; }

.wrap { padding: 28px 24px 64px; max-width: 1200px; margin: 0 auto; }

.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
input[type=text] {
  font: inherit; font-size: 15px; color: var(--fg); background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; width: 100%;
}
input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }

.btn {
  display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--fg); text-decoration: none; font: inherit; font-size: 14px;
  cursor: pointer; min-width: 110px; text-align: center; line-height: 1.4;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }

h2 { font-size: 16px; margin: 32px 0 6px; }
h2 .muted { font-weight: 400; }
.summary { color: var(--muted); font-size: 14px; margin: 32px 0 10px; word-break: break-all; }
.summary .ok { color: var(--ok); }
.summary .bad { color: var(--danger); }
.muted { color: var(--muted); }
.error { color: var(--danger); margin: 24px 0 0; }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
table.hops { table-layout: fixed; min-width: 720px; }
table.hops col.c-n { width: 48px; }
table.hops col.c-s { width: 150px; }
table.hops col.c-r { width: 24%; }
table.hops col.c-t { width: 84px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--panel); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 14px; }
th:last-child, td:last-child { padding-right: 14px; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.hop { cursor: pointer; }
tr.hop:hover td { background: var(--panel); }
tr.hop td:first-child::before { content: "▸"; color: var(--muted); display: inline-block; width: 14px; font-size: 12px; }
tr.hop.open td:first-child::before { content: "▾"; }
.code { font-weight: 600; white-space: nowrap; }
.code.s3 { color: var(--accent); }
.code.s2 { color: var(--ok); }
.code.s4, .code.s5, .code.s0 { color: var(--danger); }
.kind { color: var(--muted); font-size: 12px; white-space: nowrap; }
.url { word-break: break-all; }
.url b { font-weight: 600; }
.ref { word-break: break-all; }
.ref.none { color: var(--muted); font-style: italic; }
.flag { color: var(--warn); font-size: 12px; display: block; }
.flag.bad { color: var(--danger); }

tr.detail td { background: var(--panel); padding: 12px 14px 14px; }
tr.detail.hidden { display: none; }
.detail dl { margin: 0 0 10px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; word-break: break-all; }
.detail h4 { margin: 12px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.detail { min-width: 0; }
.detail .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.kv { width: 100%; font-size: 13px; }
.kv { table-layout: fixed; }
.kv td { padding: 2px 8px 2px 0; border-bottom: 1px solid var(--line); background: transparent; word-break: break-all; }
.kv td:first-child { color: var(--muted); width: 34%; padding-left: 0; word-break: normal; }
.kv tr.hl td { color: var(--accent); }
pre { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin: 0; font: 13px/1.5 var(--font); white-space: pre-wrap; word-break: break-all; max-height: 280px; overflow: auto; }

@media (max-width: 720px) {
  .wrap { padding: 20px 16px 48px; }
  .row { flex-direction: column; }
  .btn { width: 100%; }
  .detail .cols { grid-template-columns: 1fr; }
  table.hops { min-width: 560px; }
  table.hops col.c-r { width: 30%; }
}
