/* NSvera UI. All colours come from tokens.css. Mobile first. */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; -webkit-text-size-adjust: 100%; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font-ui); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code, pre, .mono { font-family: var(--font-mono); font-size: .92em; }

/* Header */
.site-head { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand svg { width: 32px; height: 32px; flex: none; }
.wordmark { font-size: 24px; letter-spacing: -.01em; line-height: 1; }
.wordmark b { color: var(--primary); }
.mark .fp { fill: var(--primary); } .mark .fo { fill: var(--on-primary); } .mark .fa { fill: var(--mark-accent); } .mark .so { fill: none; stroke: var(--on-primary); }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 15px; }
.site-nav a { color: var(--text-2); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--primary); text-decoration: underline; }
.prefs { display: flex; gap: 6px; align-items: center; }
.prefs button { font: 14px var(--font-ui); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 5px 8px; min-height: 34px; cursor: pointer; }

/* Main */
main { flex: 1; padding: 24px 0 40px; }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; margin: 8px 0 8px; letter-spacing: -.01em; }
h2 { font-size: 21px; margin: 28px 0 8px; }
.lede { color: var(--text-2); font-size: 18px; margin: 0 0 20px; max-width: 60ch; }
.prose { max-width: 68ch; }
.prose p, .prose li { color: var(--text-2); }

/* Search form */
.search { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.search input { flex: 1 1 220px; }
.search .engine { font: 15px var(--font-ui); padding: 0 10px; min-height: 46px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); cursor: pointer; }
@media (max-width: 479px) { .search .engine { flex: 1; } }
.search input { flex: 1; min-width: 0; font: 17px var(--font-mono); padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
.btn { font: 600 16px var(--font-ui); padding: 11px 18px; border: 0; border-radius: var(--radius); background: var(--primary); color: var(--on-primary); cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-plain { font: 14px var(--font-ui); background: none; border: 1px solid var(--border); color: var(--text); border-radius: var(--radius); padding: 6px 10px; cursor: pointer; }
.advanced { margin: 4px 0 20px; font-size: 15px; color: var(--text-2); }
.advanced summary { cursor: pointer; width: max-content; }
.advanced .grid { display: grid; gap: 10px; margin-top: 10px; grid-template-columns: 1fr; }
.advanced label { display: grid; gap: 4px; font-size: 14px; }
.advanced input, .advanced select { font: 15px var(--font-mono); padding: 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); }
@media (min-width: 640px) { .advanced .grid { grid-template-columns: 2fr 2fr 1fr; } }
.form-error { color: var(--fail); font-weight: 600; margin: 4px 0 12px; }

.points { display: grid; gap: 12px; padding: 0; list-style: none; margin: 24px 0; }
.points li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text-2); }
.points b { color: var(--text); display: block; }
@media (min-width: 720px) { .points { grid-template-columns: repeat(3, 1fr); } }

/* Status badges: never colour alone, always icon + word */
.badge { display: inline-flex; align-items: center; gap: 5px; font: 600 13px/1 var(--font-ui); padding: 4px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.s-pass { color: var(--pass); background: var(--pass-bg); }
.s-warn { color: var(--warn); background: var(--warn-bg); }
.s-fail { color: var(--fail); background: var(--fail-bg); }
.s-info { color: var(--info); background: var(--info-bg); }

/* Progress */
.progress { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin: 16px 0; }
.progress > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.progress > summary::-webkit-details-marker { display: none; }
.progress > summary::before { content: "▸"; color: var(--muted); }
.progress[open] > summary::before { content: "▾"; }
.progress[open] > summary { margin-bottom: 8px; }
.progress h2 { margin: 0; font-size: 17px; }
.progress ol { margin: 0; padding: 0; list-style: none; font: 14px/1.7 var(--font-mono); color: var(--text-2); max-height: 260px; overflow: auto; }
.progress li::before { content: "✓ "; color: var(--pass); }
.progress li.now::before { content: "› "; color: var(--primary); }
.progress li .t { color: var(--muted); }

/* Verdict */
.verdict { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--radius); border: 2px solid; margin: 16px 0; }
.verdict .big { font-size: 22px; font-weight: 700; display: block; color: var(--text); line-height: 1.25; }
.verdict small { color: var(--text-2); display: block; margin-top: 2px; }
.verdict.s-pass { border-color: var(--pass); } .verdict.s-warn { border-color: var(--warn); } .verdict.s-fail { border-color: var(--fail); }
.verdict .badge { font-size: 15px; padding: 6px 12px; flex: none; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }

/* Section cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 12px; }
.card > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; font-weight: 700; font-size: 18px; }
.card > summary::-webkit-details-marker { display: none; }
.card > summary::after { content: "▾"; color: var(--muted); margin-left: 4px; }
.card:not([open]) > summary::after { content: "▸"; }
.card > summary .badge { margin-left: auto; }
.checks { list-style: none; margin: 0; padding: 0 16px 8px; }
.check { border-top: 1px solid var(--border); padding: 12px 0; }
.check-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.check-head .title { font-weight: 600; }
.check p { margin: 6px 0 0; color: var(--text-2); overflow-wrap: anywhere; }
.check .why b { color: var(--text); }
.check.is-fail { box-shadow: inset 3px 0 0 var(--fail); padding-left: 12px; margin-left: -16px; padding-right: 0; }
.check.is-warn { box-shadow: inset 3px 0 0 var(--warn); padding-left: 12px; margin-left: -16px; }

/* Tables */
.tbl { overflow-x: auto; margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.tbl table { border-collapse: collapse; width: 100%; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 7px 10px; white-space: nowrap; }
.tbl td { padding: 7px 10px; border-top: 1px solid var(--border); vertical-align: top; font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; }
.tbl td:first-child { white-space: nowrap; }
.tbl tr.bad td { background: var(--fail-bg); }
.tbl tr.bad td:first-child { box-shadow: inset 4px 0 0 var(--fail); font-weight: 700; }
.tbl tr.bad td:first-child::before { content: "✕ "; color: var(--fail); }

/* Raw output */
.raw { margin-top: 12px; }
.raw h3 { font-size: 15px; margin: 14px 0 6px; font-family: var(--font-mono); }
.raw pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; margin: 0; white-space: pre; }

/* Footer */
.site-foot { border-top: 1px solid var(--border); padding: 18px 0 24px; color: var(--muted); font-size: 14px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }
.site-foot a { color: var(--text-2); }
.notice { background: var(--info-bg); color: var(--text); border: 1px solid var(--info); border-radius: var(--radius); padding: 12px 14px; }
.notice.s-fail { background: var(--fail-bg); border-color: var(--fail); }

@media (prefers-reduced-motion: no-preference) { .progress li.now { animation: pulse 1.2s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .55; } }
@media print { .site-head, .search, .advanced, .toolbar, .site-foot .prefs { display: none; } .card { break-inside: avoid; } }
.advanced .wide { grid-column: 1 / -1; }

/* Live loader: the DNS path Root -> Registry -> Nameservers -> Records -> Email */
.loader { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 16px 0 8px; }
.loader-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.loader-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.loader-time { color: var(--muted); font-size: 14px; flex: none; }
.stages { list-style: none; display: flex; padding: 0; margin: 16px 0 12px; }
.stages li { flex: 1; position: relative; text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 22px; min-width: 0; }
.stages li::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.stages li:first-child::before { display: none; }
.stages .dot { position: absolute; top: 0; left: 50%; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); z-index: 1; }
.stages li.done { color: var(--text-2); }
.stages li.done::before, .stages li.now::before { background: var(--primary); }
.stages li.done .dot { background: var(--primary); border-color: var(--primary); }
.stages li.now { color: var(--text); font-weight: 600; }
.stages li.now .dot { border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 22%, transparent); }
.bar { height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 30%; background: var(--primary); border-radius: 2px; }
.loader.is-done .bar span { width: 100%; }
.loader.is-done .loader-head h2 { color: var(--pass); }
@media (min-width: 560px) { .stages li { font-size: 14px; } }
@media (prefers-reduced-motion: no-preference) {
  .loader:not(.is-done) .bar span { animation: sweep 1.1s ease-in-out infinite; }
  .stages li.now .dot::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--primary); animation: blink 1s ease-in-out infinite; }
  .loader.is-done .bar span { transition: width .3s; }
}
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@keyframes blink { 50% { opacity: .25; } }
.btn.is-busy { opacity: .85; cursor: progress; }
.btn.is-busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; }
@media (prefers-reduced-motion: no-preference) { .btn.is-busy::before { animation: spin .8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
[tabindex="-1"]:focus { outline: none; }
@media (max-width: 599px) { .search input { flex-basis: 100%; } .search .engine { flex: 1; } }
@media (max-width: 479px) { .stages li { font-size: 11.5px; hyphens: manual; } }
