:root {
  --bg: #141210;
  --raise: #1d1a16;
  --raise-2: #26221c;
  --sunken: #0e0d0b;
  --line: rgba(244, 239, 230, 0.08);
  --line-strong: rgba(244, 239, 230, 0.16);
  --text: #f4efe6;
  --muted: #b3a598;
  --faint: #7c7268;
  --accent: #e08a3c;
  --accent-ink: #2a1608;
  --accent-soft: rgba(224, 138, 60, 0.16);
  --ok: #9dcb86;
  --ok-soft: rgba(157, 203, 134, 0.14);
  --warn: #e6c074;
  --warn-soft: rgba(230, 192, 116, 0.14);
  --bad: #ef7d6d;
  --bad-soft: rgba(239, 125, 109, 0.14);
  --info: #8eb4d4;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(224, 138, 60, 0.14), transparent 55%),
    var(--bg);
  color: var(--text);
  letter-spacing: 0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.boot {
  padding: 48px 24px;
  color: var(--muted);
}

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(14, 13, 11, 0.72);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}
.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    linear-gradient(160deg, transparent 0 46%, var(--accent) 46% 100%),
    var(--raise-2);
  border: 1px solid var(--line-strong);
}
.brand h1 {
  font-family: var(--display);
  font-weight: 560;
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand p {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
}
.nav a.active, .nav a:hover {
  background: var(--raise);
  color: var(--text);
}
.nav a.active { box-shadow: inset 2px 0 0 var(--accent); }
.side-foot {
  margin-top: auto;
  font-size: 13px;
  color: var(--faint);
  line-height: 1.45;
}
.side-foot strong { color: var(--text); font-weight: 560; display: block; }

.main { padding: 32px 36px 64px; max-width: 1180px; }
.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 22px;
}
.top h2 {
  font-family: var(--display);
  font-size: 42px;
  font-weight: 560;
  letter-spacing: -0.03em;
  margin: 0;
  line-height: 1;
}
.lede { margin: 8px 0 0; color: var(--muted); max-width: 52ch; }

.row-actions, .filters, .pager, .inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.btn, .icon-btn {
  border: 1px solid var(--line-strong);
  background: var(--raise);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  text-decoration: none;
}
.btn:hover, .icon-btn:hover { border-color: var(--muted); }
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.btn.ghost { background: transparent; }
.btn:disabled, .icon-btn:disabled { opacity: 0.5; cursor: progress; }
.btn.small { padding: 6px 10px; font-size: 13px; }

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 12px;
}
.chip.on { background: var(--accent-soft); border-color: transparent; color: #f3c08a; }

.search, .field input, .field select, .field textarea, .cell input, .cell select {
  background: var(--sunken);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
}
.search { width: 240px; }
.search:focus, .field input:focus, .field select:focus, .field textarea:focus, .cell input:focus, .cell select:focus {
  border-color: var(--accent);
}

.banner {
  border: 1px solid var(--line-strong);
  background: var(--warn-soft);
  color: var(--warn);
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.banner.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.banner.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }

.table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(29, 26, 22, 0.65);
}
.thead, .drow {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr 0.55fr 0.6fr 0.7fr 0.6fr;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
}
.thead {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.drow {
  text-decoration: none;
  border-top: 1px solid var(--line);
  color: var(--text);
}
.drow:hover { background: rgba(255, 255, 255, 0.03); }
.domain-name {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: -0.02em;
}
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: var(--raise-2);
  color: var(--muted);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: rgba(142, 180, 212, 0.14); color: var(--info); }

.pager { margin-top: 14px; color: var(--muted); font-size: 14px; }

.back {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--muted);
  text-decoration: none;
}
.back:hover { color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.grid {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr;
  gap: 16px;
  margin-top: 22px;
}
.card {
  background: rgba(29, 26, 22, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.card .hint { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.45; }

.hosts { width: 100%; border-collapse: collapse; }
.hosts th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 500;
  padding: 0 6px 8px;
}
.hosts td { padding: 4px; vertical-align: top; }
.hosts .host { width: 18%; }
.hosts .type { width: 16%; }
.hosts .mx, .hosts .ttl { width: 12%; }

.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.stat:last-child { border-bottom: 0; }
.ns-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.grid > .stack { margin-top: 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.money {
  background: var(--raise);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.money span { color: var(--faint); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; }
.money strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 560;
  letter-spacing: -0.03em;
}

.setup-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}
.setup {
  width: min(560px, 100%);
  background: rgba(29, 26, 22, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.setup h2 {
  font-family: var(--display);
  font-size: 40px;
  margin: 8px 0;
  letter-spacing: -0.03em;
}
.kicker {
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
  margin: 0;
}
.fields { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field .help { margin: 6px 0 0; color: var(--faint); font-size: 12px; }
.checkline {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.ip-row { display: flex; gap: 8px; }
.ip-row input { flex: 1; }

.check-box { width: 100%; min-height: 140px; resize: vertical; }
.results { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.result {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--raise);
  border: 1px solid var(--line);
}
.result b { font-family: var(--display); font-size: 20px; font-weight: 560; }

.empty {
  padding: 42px 16px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); font-family: var(--display); font-size: 28px; font-weight: 560; margin-bottom: 6px; }

.toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: var(--text);
  color: var(--bg);
  padding: 12px 14px;
  border-radius: 12px;
  max-width: min(360px, calc(100% - 36px));
  box-shadow: var(--shadow);
  z-index: 20;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 6, 0.62);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 30;
}
.modal[hidden], .toast[hidden] { display: none; }
.dialog {
  width: min(440px, 100%);
  background: var(--raise);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}
.dialog h3 { font-family: var(--display); font-size: 28px; margin: 0 0 8px; font-weight: 560; }
.dialog p { color: var(--muted); line-height: 1.5; margin: 0 0 16px; }
.dialog .row-actions { justify-content: flex-end; }

.mono { font-family: var(--mono); font-size: 13px; }

@media (max-width: 980px) {
  .grid, .cards, .thead, .drow { grid-template-columns: 1fr; }
  .thead { display: none; }
  .drow { gap: 4px; }
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    z-index: 5;
  }
  .nav { flex-direction: row; }
  .side-foot { display: none; }
  .main { padding: 22px 16px 48px; }
  .top { flex-direction: column; align-items: stretch; }
  .top h2 { font-size: 34px; }
  .search { width: 100%; }
  .hosts { display: block; overflow-x: auto; }
}
