:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #65758b;
  --line: #d8dee8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --code-bg: #111827;
  --code-text: #e5e7eb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent-strong);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 1.34rem;
  font-weight: 900;
}

.site-logo:hover {
  text-decoration: none;
}

.site-mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.site-nav,
.site-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.site-nav a,
.site-footer a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.site-nav a:hover,
.site-footer a:hover {
  color: var(--accent-strong);
  text-decoration: none;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

.intro-panel,
.lookup-panel,
.results-panel,
.content-page {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.intro-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
}

.lookup-panel {
  padding: 16px;
  align-self: start;
}

.content-page {
  width: 100%;
  padding: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: 1.85rem;
  line-height: 1.2;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.intro-copy,
.content-page p,
.content-page li {
  color: var(--muted);
  line-height: 1.65;
}

.content-page h1 {
  margin-bottom: 16px;
}

.content-page h2 {
  margin: 26px 0 10px;
  font-size: 1.12rem;
}

.content-page ul {
  padding-left: 20px;
}

.status-pill {
  min-width: 72px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
  white-space: nowrap;
}

.status-pill.busy {
  color: #854d0e;
  background: #fffbeb;
  border-color: #fde68a;
}

.lookup-form {
  display: grid;
  gap: 14px;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 140px;
  gap: 12px;
  align-items: end;
}

label span,
legend {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input,
select {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 160px;
  padding: 12px;
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  outline-offset: 2px;
  border-color: var(--accent);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.resolver-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
  align-items: end;
}

.resolver-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.resolver-options label {
  display: block;
}

.resolver-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.resolver-options span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}

.resolver-options input:checked + span {
  border-color: var(--accent);
  background: #e6fffb;
  color: var(--accent-strong);
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

#submit-button {
  width: 100%;
}

.results-panel {
  min-height: 420px;
  padding: 18px;
  overflow: hidden;
}

.results-head,
.result-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

#copy-button,
#copy-records-button,
#copy-link-button {
  min-height: 34px;
  padding: 0 12px;
  background: #27364a;
  font-size: 0.88rem;
}

#copy-records-button {
  background: #3f4754;
}

#copy-link-button {
  background: #0f766e;
}

.query-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.summary-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.summary-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.93rem;
}

.empty-state,
.error-box {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state-compact {
  margin: 12px;
  padding: 16px;
}

.error-box {
  border-style: solid;
  border-color: #fecdca;
  background: var(--danger-bg);
  color: var(--danger);
  text-align: left;
}

.answer-overview {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.overview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.overview-title h3 {
  margin: 0;
  font-size: 0.98rem;
}

.overview-title span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.server-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.server-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.server-title h3 {
  margin: 0;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.server-title-text {
  min-width: 0;
}

.server-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.rcode {
  align-self: flex-start;
  border-radius: 999px;
  background: #edfdf7;
  color: #087443;
  padding: 4px 9px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rcode.error {
  background: var(--danger-bg);
  color: var(--danger);
}

.record-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.record-table th,
.record-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.record-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.record-table tr:last-child td {
  border-bottom: 0;
}

.record-name,
.record-value {
  overflow-wrap: anywhere;
}

.record-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

.record-value-long {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
}

.overview-table th:nth-child(1),
.overview-table td:nth-child(1) {
  width: 86px;
}

.overview-table th:nth-child(2),
.overview-table td:nth-child(2) {
  width: 72px;
}

.overview-table th:nth-child(4),
.overview-table td:nth-child(4) {
  width: 72px;
}

.raw-details {
  margin: 12px 0 0;
}

.raw-details summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
}

.raw-json {
  margin: 10px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-text);
  overflow: auto;
  font-size: 0.82rem;
}

.contact-form-shell {
  margin-top: 20px;
}

.contact-form {
  display: grid;
  gap: 14px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.contact-status {
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  line-height: 1.45;
}

.contact-status-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}

.contact-status-error {
  border-color: #fecdca;
  background: var(--danger-bg);
  color: var(--danger);
}

.contact-status-warning {
  border-color: #fde68a;
  background: #fffbeb;
  color: #854d0e;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: 1fr;
    width: min(100% - 20px, 680px);
    padding: 10px 0;
  }

  .site-header,
  .site-footer,
  .intro-panel,
  .results-head,
  .server-title {
    align-items: stretch;
    flex-direction: column;
  }

  .field-grid,
  .resolver-row,
  .query-summary,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .resolver-options {
    grid-template-columns: 1fr 1fr;
  }

  .site-header {
    padding: 14px 0;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .record-table,
  .record-table tbody,
  .record-table tr,
  .record-table td {
    display: block;
    width: 100%;
  }

  .record-table thead {
    display: none;
  }

  .record-table td {
    border-bottom: 0;
    padding: 8px 14px;
  }

  .record-table td::before {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .record-table td:nth-child(1)::before {
    content: "Name";
  }

  .record-table td:nth-child(2)::before {
    content: "Type";
  }

  .record-table td:nth-child(3)::before {
    content: "TTL";
  }

  .record-table td:nth-child(4)::before {
    content: "Value";
  }
}
