:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --ink: #16201d;
  --muted: #62706a;
  --line: #d9e1dd;
  --surface: #ffffff;
  --teal: #147a72;
  --teal-dark: #0f5f59;
  --amber: #b15f12;
  --red: #ad3030;
  --blue: #2f5b9a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.section-head,
.row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
}

.topbar {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 17px;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.segmented a {
  min-width: 72px;
  padding: 9px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--muted);
}

.segmented a.active {
  background: var(--ink);
  color: white;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: 1.2fr 1fr 1fr auto;
  align-items: end;
}

.wide {
  grid-column: 1 / -1;
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(22, 32, 29, 0.06);
}

form.surface,
.surface + .surface,
.grid + .surface {
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
  outline: none;
}

select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font: inherit;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 122, 114, 0.16);
}

.row > label {
  flex: 1 1 0;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.primary {
  margin-top: 14px;
  background: var(--teal);
  color: white;
}

.primary:hover {
  background: var(--teal-dark);
}

.secondary {
  background: #edf1ef;
  color: var(--ink);
}

.danger {
  min-height: 34px;
  background: #fde6e6;
  color: var(--red);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.pill.idle {
  background: #edf1ef;
  color: var(--muted);
}

.pill.busy {
  background: #fff2df;
  color: var(--amber);
}

.pill.ok {
  background: #dff3ef;
  color: var(--teal-dark);
}

.pill.error {
  background: #fde6e6;
  color: var(--red);
}

pre {
  min-height: 250px;
  margin: 14px 0 0;
  overflow: auto;
  border-radius: 8px;
  background: #101916;
  color: #dcebe5;
  padding: 14px;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.mono,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.muted {
  color: var(--muted);
}

.checks {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.checks.inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.inline-toggle {
  min-height: 42px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
}

.mini-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.mini-toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--teal);
}

.table-wrap {
  width: 100%;
  margin-top: 14px;
  overflow-x: auto;
}

.dns-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.dns-table th,
.dns-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 8px;
  text-align: left;
  vertical-align: middle;
}

.dns-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.dns-table td:nth-child(1) {
  width: 68px;
}

.dns-table td:nth-child(2) {
  width: 140px;
}

.dns-table td:nth-child(3) {
  width: 310px;
}

.dns-table td:nth-child(4) {
  width: 120px;
}

.dns-table td:nth-child(5) {
  width: 100px;
}

.dns-table td:nth-child(6),
.dns-table td:nth-child(7) {
  width: 92px;
}

.dns-table td:nth-child(8) {
  width: 220px;
}

.dns-table td:nth-child(9) {
  width: 92px;
}

.dns-table input {
  min-height: 38px;
  padding: 8px 9px;
}

.payload-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

.log {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.log-item {
  display: grid;
  grid-template-columns: 56px 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.log-item span {
  color: var(--blue);
  font-weight: 800;
}

.log-item code {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 18px;
  }

  .topbar,
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .grid.two,
  .grid.four,
  .checks.inline {
    grid-template-columns: 1fr;
  }

  .inline-toggle {
    justify-content: flex-start;
  }

  .payload-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segmented a {
    flex: 1;
  }

  .log-item {
    grid-template-columns: 1fr;
  }
}
