:root {
  --bg: #f5f7fb; --surface: #ffffff; --surface-2: #f0f3f9; --text: #0f172a; --muted: #5b6b82;
  --border: #e1e7f0; --accent: #2563eb; --accent-text: #ffffff; --good: #15803d; --bad: #b91c1c; --warn: #b45309;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220; --surface: #111a2e; --surface-2: #17223a; --text: #e6edf7; --muted: #92a3bd;
    --border: #22304a; --accent: #5b9dff; --accent-text: #08111f; --good: #4ade80; --bad: #f87171; --warn: #fbbf24;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.05rem; }
code, .mono { font-family: var(--mono); font-size: .88em; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.container { max-width: 1180px; margin: 0 auto; padding: 20px 20px 64px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); position: relative; display: inline-block; }
.logo::after { content: ""; position: absolute; left: 6px; top: 6px; width: 14px; height: 14px;
  background: linear-gradient(#fff 0 0) 0 0/6px 2px no-repeat, linear-gradient(#fff 0 0) 0 6px/10px 2px no-repeat, linear-gradient(#fff 0 0) 0 12px/14px 2px no-repeat; }
.header-search { flex: 1; max-width: 640px; }
.topnav { margin-left: auto; display: flex; gap: 14px; }
.topnav a { color: var(--muted); font-weight: 500; }
.topnav a:hover { color: var(--text); text-decoration: none; }

/* search box */
.searchbox { position: relative; display: flex; gap: 8px; }
.searchbox input { flex: 1; min-width: 0; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; outline: none; }
.searchbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); background: var(--surface); }
.searchbox button { padding: 0 18px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-text); font-weight: 600; }
.searchbox.big input { padding: 16px 20px; font-size: 1.15rem; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.searchbox.big button { padding: 0 28px; border-radius: 14px; font-size: 1.05rem; }
.header-search .searchbox button { display: none; }
.suggest { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.suggest a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; color: var(--text); }
.suggest a:hover, .suggest a.active { background: var(--surface-2); text-decoration: none; }
.suggest .meta { color: var(--muted); font-size: .82rem; }
.suggest .sep { padding: 6px 14px; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }

/* generic */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card .body { padding: 14px 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols-2, .grid.cols-3 { align-items: start; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.loading, .empty { padding: 48px 0; text-align: center; color: var(--muted); }
.error { border: 1px solid color-mix(in srgb, var(--bad) 50%, var(--border)); background: color-mix(in srgb, var(--bad) 8%, var(--surface));
  color: var(--text); padding: 14px 16px; border-radius: 12px; margin: 16px 0; }
.error strong { color: var(--bad); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-weight: 500; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: default; }
.copy { border: 1px solid var(--border); background: transparent; color: var(--muted); padding: 1px 9px; border-radius: 7px; font-size: .74rem; }
.copy:hover { color: var(--accent); background: var(--surface-2); }

/* record type badges */
.badge { display: inline-block; min-width: 3.1em; text-align: center; padding: 1px 8px; border-radius: 999px; font: 600 .74rem/1.6 var(--mono);
  color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c, var(--muted)) 15%, transparent); }
.t-A { --c: #3b82f6; } .t-AAAA { --c: #6366f1; } .t-NS { --c: #16a34a; } .t-MX { --c: #ea580c; } .t-TXT { --c: #9333ea; }
.t-CNAME { --c: #0d9488; } .t-SOA { --c: #64748b; } .t-CAA { --c: #dc2626; } .t-HTTPS { --c: #db2777; } .t-DNSKEY { --c: #ca8a04; } .t-SRV { --c: #0891b2; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill.good { color: var(--good); } .pill.bad { color: var(--bad); } .pill.warn { color: var(--warn); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600; }
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.change-add { color: var(--good); font-weight: 700; } .change-del { color: var(--bad); font-weight: 700; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.value { font-family: var(--mono); font-size: .86rem; word-break: break-all; }
td.nowrap, th.nowrap { white-space: nowrap; }
.ended { opacity: .6; }

/* home */
.hero { text-align: center; padding: 44px 0 30px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 10px auto 24px; max-width: 620px; }
.hero .searchbox { max-width: 720px; margin: 0 auto; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin: 26px 0; }
.stat { padding: 16px 18px; }
.stat .n { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--muted); font-size: .85rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }

/* domain page */
.domain-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 8px 0 18px; }
.domain-head h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); letter-spacing: -.02em; word-break: break-all; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { margin-left: 6px; font-size: .78rem; color: var(--muted); font-weight: 500; }
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; margin-bottom: 18px; }
.insight { padding: 12px 14px; }
.insight .l { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.insight .v { font-weight: 650; margin-top: 2px; word-break: break-word; }
.insight.clickable { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.insight.clickable:hover, .insight.clickable[aria-expanded="true"] { border-color: var(--accent); }
.insight.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dmarc-panel { padding: 14px 16px; margin: -6px 0 18px; }
.dmarc-panel[hidden] { display: none; }
.dmarc-panel h2 { margin: 0; font-size: 1rem; }
.dmarc-raw { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font: .85rem/1.5 var(--mono); }
.rec { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.rec:last-child { border-bottom: 0; }
.rec .val { font-family: var(--mono); font-size: .86rem; word-break: break-all; }
.rec .since { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.rec.txt .val { font-size: .8rem; color: var(--text); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search], .toolbar select { padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; min-width: 220px; }
.notice { padding: 14px 16px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); margin-bottom: 16px; }

/* timeline */
.tl-group { margin-bottom: 18px; }
.tl-group h3 { font-size: .95rem; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.tl-axis { display: grid; grid-template-columns: minmax(150px, 280px) 1fr 150px; gap: 14px; color: var(--muted); font-size: .75rem; padding: 0 0 4px; }
.tl-axis .span { display: flex; justify-content: space-between; }
.tl-row { display: grid; grid-template-columns: minmax(150px, 280px) 1fr 150px; gap: 14px; align-items: center; padding: 5px 0; border-top: 1px solid var(--border); }
.tl-row .val { font-family: var(--mono); font-size: .84rem; word-break: break-all; }
.tl-track { position: relative; height: 18px; background: var(--surface-2); border-radius: 9px; }
.tl-bar { position: absolute; top: 3px; height: 12px; border-radius: 6px; background: var(--accent); min-width: 6px; }
.tl-bar.ended { background: color-mix(in srgb, var(--muted) 55%, transparent); }
.tl-row .when { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.legend { margin-bottom: 14px; display: flex; gap: 16px; color: var(--muted); font-size: .82rem; }
.legend i { display: inline-block; width: 22px; height: 8px; border-radius: 4px; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.legend i.ended { background: color-mix(in srgb, var(--muted) 55%, transparent); }
@media (max-width: 760px) {
  .tl-axis, .tl-row { grid-template-columns: 1fr; gap: 4px; }
  .topbar { flex-wrap: wrap; } .header-search { order: 3; flex-basis: 100%; max-width: none; }
}

/* toasts */
.toasts { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 500; }

/* compact change feed */
.list.changes li { align-items: flex-start; }
.list.changes .sign { width: 14px; font-size: 1.15rem; line-height: 1.2; flex: none; text-align: center; }
.chg-main { flex: 1; min-width: 0; }
.chg-val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: .82rem; margin-top: 1px; }
.nowrap { white-space: nowrap; }
td.ips { min-width: 230px; white-space: nowrap; }
.more { margin-top: 8px; }

.col-sign { width: 1%; text-align: center; }
.col-host { min-width: 220px; }

/* records tab: sidebar + one section per record type */
.rec-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.rec-side { position: sticky; top: 76px; display: grid; gap: 2px; }
.rec-side .side-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 12px 6px; }
.side-link { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 12px;
  border: 0; border-radius: 9px; background: transparent; color: var(--text); font-weight: 600; text-decoration: none; }
.side-link:hover { background: var(--surface-2); text-decoration: none; }
.side-link .count { color: var(--muted); font-weight: 500; font-size: .82rem; }
.side-link.sub { margin-top: 10px; border-top: 1px solid var(--border); border-radius: 0 0 9px 9px; color: var(--accent); }
.rec-main { display: grid; gap: 16px; }
.rec-section { scroll-margin-top: 80px; }
.rec-section > header { align-items: flex-start; }
.rec-section table td, .rec-section table th { padding-left: 16px; padding-right: 16px; }
.more-link { display: inline-block; margin-top: 8px; }
@media (max-width: 900px) {
  .rec-layout { grid-template-columns: 1fr; }
  .rec-side { position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .rec-side .side-title { width: 100%; }
  .side-link { width: auto; border: 1px solid var(--border); background: var(--surface); }
  .side-link.sub { margin-top: 0; border-radius: 9px; }
}

.rec-main { grid-template-columns: minmax(0, 1fr); }
.rec-section table { table-layout: fixed; }
.rec-section th.col-seen { width: 150px; }
.rec-section th.col-narrow { width: 92px; }
.rec-section th.col-serial { width: 128px; }
.rec-section td { overflow-wrap: anywhere; }
.rec-section td.value { word-break: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) { .rec-section table { table-layout: auto; } }

.rec-section th.col-kind { width: 210px; }
.rec-section table.kv { table-layout: auto; }
.rec-section table.kv th { width: 220px; text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.rec-section table.kv tr:last-child th, .rec-section table.kv tr:last-child td { border-bottom: 0; }

/* cards of different heights flow into columns without empty bands */
.masonry { column-width: 330px; column-gap: 16px; }
.masonry > .card { break-inside: avoid; margin-bottom: 16px; display: block; }

/* domain page: sidebar + one section (the structure, not the look, borrowed from SecurityTrails) */
.domain-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.side-nav { position: sticky; top: 76px; display: grid; gap: 4px; }
.side-nav .side-title { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 14px 6px; }
.side-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; text-decoration: none; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.side-nav .count { font-size: .78rem; font-weight: 600; min-width: 26px; text-align: center; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--accent); }
.page-title { font-size: 1.3rem; letter-spacing: -.01em; margin: 0 0 16px; word-break: break-all; }
.page-title .muted { font-weight: 500; }

/* record cards */
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.rcard header h2 { font-size: 1rem; }
.rbody { padding: 14px 16px; }
.ritems { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border)); border-radius: 12px; overflow: hidden; }
.ritem { padding: 12px 14px; }
.ritem + .ritem { border-top: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border)); }
.ritem-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ritem-main { font-family: var(--mono); font-size: .88rem; overflow-wrap: anywhere; min-width: 0; }
.ritem-main .wrap { white-space: normal; }
.ritem-sub { color: var(--muted); font-size: .8rem; margin-top: 3px; overflow-wrap: anywhere; }
.pivot { flex: none; min-width: 26px; height: 26px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); font-size: .76rem; font-weight: 700; text-decoration: none; }
.pivot:hover { background: var(--accent); color: var(--accent-text); text-decoration: none; }
.pivot.zero { border-color: var(--border); color: var(--muted); font-weight: 600; }
.norec { text-align: center; padding: 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--muted); letter-spacing: .05em; font-size: .85rem; }
.rbody .more { margin-top: 10px; }

/* historical data */
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.seg button { padding: 9px 18px; border: 0; background: transparent; color: var(--accent); font-weight: 600; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--surface-2); color: var(--text); }
.seg button.empty { opacity: .45; }
.cur { margin-left: 8px; padding: 0 8px; font-size: .7rem; }
td.tlcell { width: 190px; min-width: 150px; }
.pager { display: flex; align-items: center; gap: 6px; padding: 10px 14px; }
.pg { min-width: 32px; padding: 4px 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 7px; color: var(--accent); }
.pg.on { background: var(--surface-2); color: var(--text); font-weight: 700; }
.pg:disabled { opacity: .4; cursor: default; }

@media (max-width: 900px) {
  .domain-layout { grid-template-columns: 1fr; }
  .side-nav { position: static; display: flex; gap: 6px; overflow-x: auto; }
  .side-nav .side-title { display: none; }
  .side-nav a { white-space: nowrap; }
  .rgrid { grid-template-columns: 1fr; }
}

.insights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.insight .v { word-break: normal; overflow-wrap: break-word; }
@media (max-width: 560px) { .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.durcell { min-width: 150px; }
.tl-track.thin { height: 8px; margin-top: 6px; border-radius: 4px; }
.tl-track.thin .tl-bar { top: 1px; height: 6px; border-radius: 3px; }
