* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: #172033;
  background: #f4f6f8;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: #244e83;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #536172;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 32px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  color: #243447;
  background: #fff;
  border: 1px solid #d9e0e8;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 650;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  padding: 14px;
  background: #fff;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
}

.metric span {
  display: block;
  color: #647386;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.notice,
.error {
  border-radius: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  font-weight: 650;
}

.notice {
  color: #104b2c;
  background: #e6f4ec;
}

.error {
  color: #7a231e;
  background: #fdeceb;
}

.panel {
  margin: 18px 0 24px;
  padding: 16px;
  background: #fff;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1.2fr .55fr .55fr .75fr;
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
}

.form-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.form-label {
  color: #344054;
  font-size: 14px;
  font-weight: 650;
}

.readonly-field {
  min-height: 40px;
  padding: 9px 10px;
  color: #344054;
  background: #eef2f6;
  border: 1px solid #c9d3df;
  border-radius: 6px;
}

.proxy-toggle {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 40px;
  cursor: pointer;
}

.proxy-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.proxy-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  background: #9aa7b5;
  border-radius: 999px;
  transition: background .15s ease;
}

.proxy-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .15s ease;
}

.proxy-toggle input:checked + .proxy-switch {
  background: #d97706;
}

.proxy-toggle input:checked + .proxy-switch::after {
  transform: translateX(16px);
}

.proxy-toggle input:focus-visible + .proxy-switch {
  outline: 3px solid #93b4dd;
  outline-offset: 2px;
}

.proxy-toggle input:disabled + .proxy-switch {
  opacity: .45;
}

.proxy-field.is-disabled .proxy-toggle {
  color: #697586;
  cursor: not-allowed;
}

.proxy-toggle.compact {
  min-height: 28px;
}

.status-mixed {
  display: block;
  color: #9a3412;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  color: #172033;
  background: #fff;
  border: 1px solid #c9d3df;
  border-radius: 6px;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

button {
  width: fit-content;
  padding: 9px 13px;
  color: #fff;
  background: #244e83;
  border: 1px solid #244e83;
  border-radius: 6px;
  font-weight: 750;
  cursor: pointer;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid #d9e0e8;
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e6ebf1;
  text-align: left;
  vertical-align: top;
}

th {
  color: #536172;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

td pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

code {
  color: #172033;
  background: #eef2f6;
  border-radius: 4px;
  padding: 2px 5px;
}

.actions {
  width: 170px;
}

.actions input {
  margin-bottom: 8px;
}

.empty {
  color: #697586;
  text-align: center;
}

.status-success {
  color: #116149;
  font-weight: 750;
}

.status-failed {
  color: #9a3412;
  font-weight: 750;
}

.small {
  color: #697586;
  font-size: 13px;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1180px);
    margin-top: 18px;
  }

  .topbar,
  .summary,
  .form-grid {
    display: block;
  }

  .nav,
  label,
  button {
    margin-top: 10px;
  }
}

.danger-panel {
  border-color: #f1b8b3;
  background: #fffafa;
}

.record-detail {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 14px;
  margin: 18px 0;
}

.record-detail dt {
  color: #536172;
  font-weight: 750;
}

.record-detail dd {
  margin: 0;
}

.confirm-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.danger-button {
  background: #a83f39;
  border-color: #a83f39;
}

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

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  color: #7a231e;
  background: #fdeceb;
  border: 1px solid #f1b8b3;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 750;
}


.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.filter-bar {
  margin: 0 0 12px;
}

.filter-bar input {
  max-width: 460px;
}

.form-button-cell {
  display: flex;
  align-items: end;
}

.dns-note {
  margin: 12px 0 0;
}

.test-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  color: #244e83;
  background: #edf4ff;
  border: 1px solid #c7dbf7;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 750;
}

.records-table {
  table-layout: fixed;
  min-width: 900px;
}

.records-name-col {
  width: 190px;
}

.records-type-col {
  width: 64px;
}

.records-ttl-col {
  width: 68px;
}

.records-proxy-col {
  width: 142px;
}

.records-values-col {
  width: auto;
}

.records-edit-col {
  width: 144px;
}

.records-table td:nth-child(2),
.records-table td:nth-child(3) {
  white-space: nowrap;
}

.record-name-cell code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.record-values-cell textarea {
  display: block;
  width: 100%;
  min-height: 112px;
  max-height: 480px;
  resize: vertical;
  field-sizing: content;
}

.records-table .inline-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
  align-items: stretch;
}

.records-table .inline-actions .update-button,
.records-table .inline-actions .test-link,
.records-table .inline-actions .link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  margin: 0;
  white-space: nowrap;
}

.records-table .inline-actions .delete-action {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .table-wrap {
    overflow-x: visible;
    background: transparent;
    border: 0;
  }

  .records-table {
    display: block;
    min-width: 0;
  }

  .records-table colgroup,
  .records-table thead {
    display: none;
  }

  .records-table tbody {
    display: grid;
    gap: 12px;
  }

  .records-table tr[data-record-row] {
    display: grid;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #d9e0e8;
    border-radius: 8px;
  }

  .records-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    width: auto;
    padding: 8px 0;
    border-bottom: 1px solid #e6ebf1;
  }

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

  .records-table td::before {
    color: #536172;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

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

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

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

  .records-table td:nth-child(4)::before {
    content: "Proxy status";
  }

  .records-table td:nth-child(5)::before {
    content: "Value(s)";
  }

  .records-table td:nth-child(6)::before {
    content: "Edit";
  }

  .records-table .empty {
    display: block;
    padding: 14px;
    background: #fff;
    border: 1px solid #d9e0e8;
    border-radius: 8px;
  }

  .record-values-cell textarea {
    min-height: 140px;
  }

  .records-table .inline-actions {
    grid-template-columns: 1fr;
  }

  .records-table .inline-actions .delete-action {
    grid-column: auto;
  }

  .records-table .inline-actions .update-button,
  .records-table .inline-actions .test-link,
  .records-table .inline-actions .link-button {
    margin: 0;
  }
}
