:root {
  --paper: #F1F3EF;
  --sheet: #FAFBF8;
  --ink: #17222E;
  --ink-2: #4B5866;
  --grid: #D6DCD2;
  --grid-2: #E6EAE3;
  --grid-bg: #E6EAE3;
  --cobalt: #2747C4;
  --cobalt-ink: #FFFFFF;
  --amber: #B87A06;
  --amber-bg: #FBF1DC;

  /* record type swatches — muted, distinguishable without relying on hue alone */
  --t-A: #2747C4; --t-AAAA: #5466B8; --t-CNAME: #7A4FB0; --t-MX: #0E7C66;
  --t-NS: #6B6B1E; --t-TXT: #9A4A1C; --t-SOA: #4B5866; --t-SRV: #1F6E8C;
  --t-CAA: #A23A54; --t-HTTPS: #3D7A2A;

  --sans: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Spline Sans Mono", ui-monospace, Menlo, monospace;
  --r-sm: 4px;
  --r-md: 8px;
  --measure: 68ch;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131A21; --sheet: #18212A; --ink: #DCE3EA; --ink-2: #93A1AF;
    --grid: #2B3743; --grid-2: #222C36; --grid-bg: #18202A; --cobalt: #7B93F5; --cobalt-ink: #0F1520;
    --amber: #E3A93A; --amber-bg: #2E2410;
    --t-A: #8FA4FA; --t-AAAA: #A2AEE6; --t-CNAME: #BE9BEA; --t-MX: #5BC9AE;
    --t-NS: #C9C86A; --t-TXT: #E89C6E; --t-SOA: #A9B5C2; --t-SRV: #6CC0DE;
    --t-CAA: #EC8DA4; --t-HTTPS: #8FD078;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  /* faint graph-paper grid — the sheet the tool writes on */
  background-image:
    linear-gradient(var(--grid-bg) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-bg) 1px, transparent 1px);
  background-size: 24px 24px;
  background-attachment: fixed;
}
a { color: var(--cobalt); text-underline-offset: 3px; }
code { font: 0.9em var(--mono); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

header.site, footer.site, main > section { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { header.site, footer.site, main > section { padding-inline: 32px; } }

header.site { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding-block: 18px; }
.brand { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
header nav { display: flex; gap: 20px; align-items: center; font-weight: 500; }
header nav a { color: var(--ink); text-decoration: none; }
header nav a:hover { color: var(--cobalt); }
.quota { font-size: 0.875rem; color: var(--ink-2); }
.quota.out { color: var(--amber); }
.quota .short { display: none; }
@media (max-width: 520px) { .quota .long { display: none; } .quota .short { display: inline; } header nav { gap: 14px; } }

/* ---------- Tool / hero ---------- */
.tool { padding-block: 48px 32px; }
@media (min-width: 720px) { .tool { padding-block: 88px 40px; } }
h1 {
  font-weight: 800; font-size: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  line-height: 1.02; letter-spacing: -0.035em; margin: 0 0 20px; max-width: 14ch;
}
.lede { color: var(--ink-2); max-width: var(--measure); margin: 0 0 28px; font-size: 1.0625rem; }

.domain-row { display: flex; max-width: 720px; background: var(--sheet); border: 1.5px solid var(--ink); border-radius: var(--r-md); }
.domain-row:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 30%, transparent); border-color: var(--cobalt); }
#domain {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink);
  font: 500 1.25rem var(--mono); padding: 16px 18px; outline: none;
}
#domain::placeholder { color: color-mix(in srgb, var(--ink-2) 60%, transparent); }
#go {
  border: 0; background: var(--cobalt); color: var(--cobalt-ink);
  font: 700 1rem var(--sans); padding: 0 24px; margin: 6px; border-radius: 5px; cursor: pointer;
}
#go:hover { filter: brightness(1.08); }
#go[disabled] { opacity: 0.6; cursor: progress; }

.ts-box:not(:empty) { margin-top: 12px; }
#custom { max-width: 720px; margin-top: 14px; }
#custom summary { cursor: pointer; color: var(--ink-2); font-weight: 500; width: fit-content; }
#custom summary:hover { color: var(--ink); }
#custom label { display: block; font-size: 0.875rem; color: var(--ink-2); margin: 10px 0 8px; max-width: var(--measure); }
#hosts {
  width: 100%; resize: vertical; font: 0.9375rem/1.5 var(--mono); color: var(--ink);
  background: var(--sheet); border: 1px solid var(--grid); border-radius: var(--r-sm); padding: 10px 12px;
}
.hint { font-size: 0.8125rem; color: var(--ink-2); margin: 6px 0 0; }
.form-msg { min-height: 1.5em; margin: 12px 0 0; color: var(--amber); font-weight: 500; }
.form-msg a { color: inherit; }

/* ---------- Results ---------- */
.results { padding-block: 8px 64px; }
.results-head { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: end; justify-content: space-between; border-bottom: 1.5px solid var(--ink); padding-bottom: 14px; }
.results h2 { font: 600 1.75rem/1.1 var(--mono); letter-spacing: -0.02em; margin: 0 0 6px; overflow-wrap: anywhere; }
.meta { margin: 0; color: var(--ink-2); font-size: 0.875rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.seg, .export, .billing { display: inline-flex; border: 1px solid var(--grid); border-radius: var(--r-sm); background: var(--sheet); overflow: hidden; }
.seg button, .export button, .billing button {
  border: 0; background: transparent; color: var(--ink); font: 500 0.875rem var(--sans);
  padding: 8px 14px; cursor: pointer;
}
.seg button + button, .export button + button, .billing button + button { border-left: 1px solid var(--grid); }
.seg button[aria-selected="true"], .billing button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.export button:hover, .seg button:hover:not([aria-selected="true"]) { background: var(--grid-2); }
.export .quiet { color: var(--ink-2); }

.types { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 16px 0; }
.types label {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; cursor: pointer;
  border: 1px solid var(--grid); border-radius: 99px; background: var(--sheet); font-size: 0.8125rem; font-weight: 600; user-select: none;
}
.types input { position: absolute; opacity: 0; pointer-events: none; }
.types .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.types .n { color: var(--ink-2); font-weight: 400; }
.types label:has(input:not(:checked)) { opacity: 0.45; }
.types label:has(input:not(:checked)) .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--c); }
.types label:has(input:focus-visible) { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.types label.zero { display: none; }

.group-title { font-size: 0.9375rem; font-weight: 700; margin: 28px 0 0; display: flex; gap: 10px; align-items: baseline; }
.group-title span { font-weight: 400; color: var(--ink-2); font-size: 0.8125rem; }
.sheet { width: 100%; border-collapse: collapse; background: var(--sheet); margin-top: 8px; border: 1px solid var(--grid); }
.sheet th { text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--ink-2); padding: 8px 12px; border-bottom: 1px solid var(--grid); background: var(--grid-2); }
.sheet td { padding: 9px 12px; border-bottom: 1px solid var(--grid-2); vertical-align: top; font-size: 0.875rem; }
.sheet tr:last-child td { border-bottom: 0; }
.sheet td.host, .sheet td.val, .sheet td.ttl { font-family: var(--mono); }
.sheet td.host { white-space: nowrap; }
.sheet td.ttl { color: var(--ink-2); text-align: right; white-space: nowrap; }
.sheet td.val { overflow-wrap: anywhere; width: 100%; }
.chip { display: inline-block; min-width: 4.4em; text-align: center; font: 700 0.6875rem/1 var(--sans); padding: 4px 6px; border-radius: 3px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.via { display: block; font-family: var(--sans); font-size: 0.75rem; color: var(--ink-2); margin-top: 2px; }
.copy { float: right; margin-left: 8px; border: 0; background: none; color: var(--ink-2); cursor: pointer; font: 500 0.75rem var(--sans); padding: 2px 4px; opacity: 0; }
.sheet tr:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }

@media (max-width: 640px) {
  .sheet thead { display: none; }
  .sheet, .sheet tbody, .sheet tr, .sheet td { display: block; width: 100%; }
  .sheet tr { padding: 10px 12px; border-bottom: 1px solid var(--grid-2); display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; }
  .sheet td { padding: 0; border: 0; }
  .sheet td.val { grid-column: 1 / -1; }
}

.zone {
  background: var(--sheet); border: 1px solid var(--grid); border-radius: var(--r-sm); margin: 0;
  padding: 18px 20px; overflow-x: auto; font: 0.8125rem/1.7 var(--mono); color: var(--ink); tab-size: 8;
}
.zone .c { color: var(--ink-2); }

.empty { padding: 24px; border: 1px dashed var(--grid); border-radius: var(--r-sm); color: var(--ink-2); margin-top: 16px; }
.errors { margin-top: 20px; font-size: 0.875rem; color: var(--ink-2); }
.errors summary { cursor: pointer; }
.errors ul { font-family: var(--mono); font-size: 0.8125rem; }

.loading .sheet, .loading .zone { opacity: 0.35; transition: opacity .2s; }

/* ---------- Pricing ---------- */
.pricing { padding-block: 56px 80px; border-top: 1.5px solid var(--ink); }
.pricing h2 { font-weight: 800; font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); letter-spacing: -0.03em; margin: 0 0 12px; }
.billing { margin-bottom: 16px; }
.plan-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.015em; margin: 36px 0 4px; }
.plan-sub { color: var(--ink-2); margin: 0 0 16px; max-width: var(--measure); }
.matrix tbody th .note { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--ink-2); opacity: 0.85; }
.fine { font-size: 0.875rem; color: var(--ink-2); margin: 12px 0 0; max-width: var(--measure); }
.credits { display: grid; gap: 8px 48px; margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--grid); }
@media (min-width: 900px) { .credits { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; } }
.packs { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1px solid var(--grid); margin-top: 36px; }
.packs th { text-align: left; font-size: 0.75rem; font-weight: 600; color: var(--ink-2); padding: 8px 16px; background: var(--grid-2); border-bottom: 1px solid var(--grid); }
.packs td { padding: 12px 16px; border-bottom: 1px solid var(--grid-2); font-size: 0.9375rem; }
.packs tr:last-child td { border-bottom: 0; }
.packs td:first-child { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.02em; }
.packs td:nth-child(3) { color: var(--ink-2); }
.packs td:last-child { text-align: right; }
@media (max-width: 899px) { .packs { margin-top: 8px; } }
.billing span { font-weight: 700; color: var(--t-HTTPS); margin-left: 4px; }
.billing button[aria-pressed="true"] span { color: inherit; }
.matrix-wrap { overflow-x: auto; border: 1px solid var(--grid); border-radius: var(--r-sm); background: var(--sheet); }
.matrix { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 0.9375rem; }
.matrix th, .matrix td { padding: 12px 16px; border-bottom: 1px solid var(--grid-2); text-align: left; }
.matrix tbody th { font-weight: 500; color: var(--ink-2); }
.matrix thead th { vertical-align: bottom; padding-top: 20px; border-bottom: 1.5px solid var(--ink); }
.matrix thead b { display: block; font-size: 1rem; }
.matrix .price { display: block; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.03em; }
.matrix .price small { font-size: 0.8125rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.matrix thead em { display: block; font-style: normal; font-size: 0.75rem; color: var(--cobalt); font-weight: 600; margin-top: 4px; }
.matrix .pick { background: color-mix(in srgb, var(--cobalt) 6%, transparent); }
.matrix tfoot td, .matrix tfoot th { border-bottom: 0; padding-block: 16px 20px; }
.btn, .btn-ghost { display: inline-block; font: 600 0.875rem var(--sans); padding: 9px 14px; border-radius: var(--r-sm); text-decoration: none; }
.btn { background: var(--ink); color: var(--paper); border: 0; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-ghost { border: 1px solid var(--ink); color: var(--ink); }

footer.site { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; padding-block: 24px 40px; color: var(--ink-2); font-size: 0.875rem; border-top: 1px solid var(--grid); }
footer.site a { color: var(--ink-2); margin-left: 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* pricing on small screens: keep feature names pinned while the plans scroll */
.btn { white-space: nowrap; }
@media (max-width: 720px) {
  .matrix { min-width: 600px; font-size: 0.875rem; }
  .matrix th, .matrix td { padding: 10px 12px; }
  .matrix th:first-child { position: sticky; left: 0; z-index: 1; background: var(--sheet); min-width: 136px; box-shadow: 1px 0 0 var(--grid); }
  .matrix .price { font-size: 1.375rem; }
  .packs th, .packs td { padding: 10px 12px; }
  .packs .btn { padding: 8px 10px; font-size: 0.8125rem; }
}

/* API key handed over after a credit-pack purchase */
.key-panel { margin-top: 24px; padding: 20px 24px; background: var(--sheet); border: 1.5px solid var(--cobalt); border-radius: var(--r-md); }
.key-panel h3 { margin: 0 0 8px; }
.key-panel p { margin: 0 0 10px; max-width: none; }
.key-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.key-row code { font: 0.9375rem var(--mono); word-break: break-all; padding: 8px 10px; background: var(--grid-2); border-radius: var(--r-sm); }
