/* DNS lookup. Tokens, header and footer come from the site stylesheet. */
.dns { width: 100%; max-width: 1040px; margin: 36px auto; padding: 0 16px; }

/* With a report: an "On this page" list beside it, as on Browser Info (separate from the site's tool sidebar). */
.dns.has-report {
  display: grid; grid-template-columns: 200px minmax(0, 1000px); gap: 40px; justify-content: start;
  max-width: none; margin: 36px 0; padding: 0 32px;
}
.toc[hidden] { display: none; }
.toc { position: sticky; top: calc(var(--top-h, 53px) + 24px); align-self: start; display: flex; flex-direction: column; }
.toc p { margin: 0 0 10px 14px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.toc a {
  padding: 7px 14px; border-left: 3px solid var(--line); color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500;
  transition: color .12s, border-color .12s, background-color .12s;
}
.toc a:hover { color: var(--text); border-left-color: var(--edge); }
.toc a.on { color: var(--text); font-weight: 650; border-left-color: var(--c); background: color-mix(in srgb, var(--c) 8%, transparent); }

/* Not enough room for three columns: the list becomes a row of chips that sticks under the header. */
@media (max-width: 1240px) {
  .dns.has-report { grid-template-columns: minmax(0, 1000px); gap: 0; justify-content: center; padding: 0 24px; }
  .toc {
    top: var(--top-h, 53px); z-index: 5; flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -24px 8px; padding: 10px 24px; background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .toc p { display: none; }
  .toc a { flex: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; background: var(--panel); }
  .toc a.on { border-color: var(--c); }
  .dns.has-report .block { scroll-margin-top: calc(var(--top-h, 53px) + 64px); }
}
@media (max-width: 640px) {
  .dns.has-report { padding: 0 16px; }
  .toc { margin: 0 -16px 8px; padding: 10px 16px; }
}
.dns .intro { max-width: 760px; }
.dns .intro h1 { font-size: 22px; margin: 0 0 12px; }
.dns .mono { font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; }
.dns .small { font-size: 12px; }
.good-text { color: var(--ok); }
.bad-text { color: var(--err); }
.warn-text { color: var(--warn); }

/* The form. */
.q-row { display: flex; gap: 8px; margin-top: 18px; }
.q-row input {
  flex: 1; min-width: 0; font: inherit; font-family: var(--mono); font-size: 16px; padding: 10px 12px;
  border: 1.5px solid var(--edge); border-radius: 10px; background: var(--panel); color: var(--text);
}
.q-row input:focus { outline: 2px solid var(--c); outline-offset: 1px; }
.q-row button {
  background: var(--c); color: #fff; border: 1.5px solid var(--edge); border-radius: 10px; padding: 10px 20px;
  font-weight: 700; box-shadow: 3px 3px 0 var(--edge); transition: transform .1s, box-shadow .1s;
}
.q-row button:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--edge); }
.q-row button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
.q-row button:disabled { opacity: .7; cursor: wait; transform: none; }
.examples { margin: 10px 0 0; font-size: 13px; }
.status { min-height: 1.45em; margin: 12px 0 0; }
.status:empty { margin: 0; min-height: 0; }
.status.error { color: var(--err); white-space: pre-wrap; }
.status.working { color: var(--muted); font-variant-numeric: tabular-nums; }
.status.working::before {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; vertical-align: -1px;
  border: 2px solid var(--c); border-right-color: transparent; border-radius: 50%; animation: dns-spin .7s linear infinite;
}
@keyframes dns-spin { to { transform: rotate(360deg); } }
form.busy + * { opacity: .5; }
#result { scroll-margin-top: calc(var(--top-h, 53px) + 12px); }
.dns:has(form.busy) #result { opacity: .45; transition: opacity .2s; }

/* What it checks (before a lookup). */
.about { margin-top: 40px; max-width: 760px; }
.about h2 { font-size: 18px; }
.about dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 16px; margin: 0; }
.about dt { font-weight: 700; }
.about dd { margin: 0; color: var(--muted); }

/* Report header. */
.report { margin-top: 28px; }
.dns-body { min-width: 0; }
.summary {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 20px; flex-wrap: wrap;
  padding: 16px 18px; background: var(--panel); border: 1.5px solid var(--edge); border-radius: 14px; box-shadow: 4px 4px 0 var(--c);
}
.summary-main { min-width: 0; }
.qname { margin: 0; font-size: 26px; line-height: 1.15; overflow-wrap: anywhere; }
.summary p { margin: 4px 0 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; color: var(--muted); font-size: 13px; }
.facts b { color: var(--text); }
.summary-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.summary-actions .btn, .summary-actions button {
  font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 8px; border: 1.5px solid var(--edge);
  background: var(--panel); color: var(--text); text-decoration: none; box-shadow: 2px 2px 0 var(--edge);
}
.summary-actions .btn:active, .summary-actions button:active { transform: translate(2px, 2px); box-shadow: none; }
/* The way on to WHOIS: the one filled button, so it reads as the next step. */
.summary-actions .btn-whois {
  background: var(--c); color: #fff; font-weight: 700; box-shadow: 3px 3px 0 var(--edge); overflow-wrap: anywhere;
  transition: transform .1s, box-shadow .1s;
}
.summary-actions .btn-whois:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--edge); }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--head); color: var(--muted); border: 1px solid var(--line);
}
.badge.good { background: color-mix(in srgb, var(--ok) 14%, var(--panel)); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--err-bg); color: var(--err); border-color: transparent; }

/* Findings. */
.findings { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.findings li { padding: 8px 12px; border-radius: 8px; border-left: 4px solid; background: var(--panel); overflow-wrap: anywhere; }
.f-level { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; }
.f-error { border-color: var(--err) !important; background: var(--err-bg) !important; }
.f-error .f-level { color: var(--err); }
.f-warn { border-color: var(--amber) !important; background: var(--warn-bg) !important; }
.f-warn .f-level { color: var(--warn); }
.f-info { border-color: var(--line) !important; }
.f-info .f-level { color: var(--muted); }
.findings-none { margin: 18px 0 0; padding: 8px 12px; border-left: 4px solid var(--ok); border-radius: 8px; background: var(--panel); color: var(--ok); font-weight: 600; }

.block { margin-top: 32px; scroll-margin-top: calc(var(--top-h, 53px) + 20px); }
.block-overview { margin-top: 0; }
.block h2 { font-size: 20px; margin: 0 0 8px; }
.block h3 { font-size: 14px; margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.block > p:first-of-type { margin-top: 0; }

/* Record tables: zone-file columns. */
.rr-wrap, .tbl-wrap { overflow-x: auto; max-width: 100%; }
.rr { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 12.5px; }
.rr td { padding: 3px 10px 3px 0; vertical-align: top; }
.rr-name { white-space: nowrap; color: var(--muted); }
.rr-ttl { color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; width: 1%; }
.rr-type { width: 1%; white-space: nowrap; }
.rr-data { overflow-wrap: anywhere; word-break: break-word; }
.rrset { padding: 2px 0 6px; border-bottom: 1px dashed var(--line); }
.rrset:last-of-type { border-bottom: 0; }
details.rrset summary { cursor: pointer; padding: 10px 0 4px; font-size: 14px; font-weight: 600; }
.t {
  display: inline-block; min-width: 42px; padding: 0 6px; border-radius: 5px; text-align: center;
  font: 700 11.5px/1.7 var(--mono); background: color-mix(in srgb, var(--c) 14%, var(--panel)); color: var(--text);
}
.t-rrsig, .t-nsec, .t-nsec3 { opacity: .7; }

/* Generic grids. */
.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid th, .grid td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid thead th { background: var(--head); font-size: 12px; font-weight: 700; white-space: nowrap; }
.grid td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.grid td.differs { background: var(--warn-bg); }
.grid .rr td { border: 0; padding-top: 0; }
.related td:first-child { width: 22%; }
.related td:nth-child(2) { width: 28%; }
.hosts td:first-child { width: 40%; }
.kv { border-collapse: collapse; font-size: 13px; }
.kv th { text-align: left; font-weight: 600; padding: 3px 16px 3px 0; color: var(--muted); white-space: nowrap; vertical-align: top; }
.kv td { padding: 3px 0; overflow-wrap: anywhere; }
.spf-raw { padding: 8px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 3px 0; overflow-wrap: anywhere; }

/* Trace: a timeline, one hop per zone. */
.trace { list-style: none; margin: 0; padding: 0; position: relative; }
.hop { position: relative; padding: 0 0 14px 26px; }
.hop::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.hop:last-child::before { display: none; }
.hop::after {
  content: ""; position: absolute; left: 1px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--c);
}
.hop-answer::after, .hop-cname::after { background: var(--c); }
.hop-nxdomain::after, .hop-error::after { border-color: var(--err); background: var(--err); }
.hop-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.hop-zone { font-weight: 700; font-size: 14px; }
.hop-server { font-size: 13px; }
.hop-ms { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.hop-body p { margin: 4px 0; }
.ns-list { list-style: none; margin: 2px 0 0; padding: 0; columns: 2; column-gap: 24px; }
.ns-list li { break-inside: avoid; padding: 1px 0; }
.chain-next { margin: 4px 0 12px; font-weight: 600; }

/* SPF tree. */
.spf, .spf ul { list-style: none; margin: 0; padding: 0; }
.spf ul { margin-left: 8px; padding-left: 14px; border-left: 2px solid var(--line); }
.spf li { padding: 2px 0; }
.spf li.lookup > .mono::after { content: " ·"; color: var(--c); font-weight: 700; }

/* Text dump. */
.dump pre {
  margin: 0; padding: 12px 14px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; font: 12px/1.5 var(--mono); white-space: pre;
}

@media (max-width: 640px) {
  .dns { margin-top: 24px; }
  .q-row button { padding: 10px 14px; }
  .about dl { grid-template-columns: 1fr; gap: 2px; }
  .about dd { margin-bottom: 10px; }
  .ns-list { columns: 1; }
  .qname { font-size: 21px; }
  .rr-name { white-space: normal; overflow-wrap: anywhere; }
  .related td:first-child, .related td:nth-child(2), .hosts td:first-child { width: auto; }
}
