:root {
  color-scheme: light;
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 15px;
  color: #20282f;
  background: #f7f8fa;
  accent-color: #254a72;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
}

main {
  width: min(920px, calc(100% - 40px));
  margin: 42px auto;
}

.page-header {
  border-top: 3px solid #254a72;
  border-bottom: 1px solid #cad3dd;
  padding: 15px 20px;
  background: #edf2f7;
}

h1 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  font-weight: 650;
  color: #213d5a;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 22px;
  padding: 20px;
  border: 1px solid #cad3dd;
  border-top: 0;
  background: #fff;
}

.form-grid > * + * {
  border-left: 1px solid #e1e6ed;
  padding-left: 22px;
}

.heading,
legend {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  font-weight: 700;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.nameserver-panel {
  position: relative;
  padding-top: 25px;
}

.nameserver-panel legend {
  position: absolute;
  top: 0;
}

textarea,
select,
input[type="text"] {
  display: block;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #a8b5c2;
  border-radius: 3px;
  background: #fff;
  color: inherit;
  font: inherit;
}

textarea,
pre {
  font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

textarea {
  resize: vertical;
  min-height: 5rem;
}

:disabled {
  opacity: 0.65;
}

textarea:disabled,
select:disabled {
  background: #f1f3f6;
}

.options {
  margin-top: 14px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 23px;
  width: fit-content;
  cursor: pointer;
}

.choice input {
  margin: 0;
  flex: none;
}

.resolver-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.resolver-row select {
  min-width: 0;
  padding-block: 3px;
}

.nameserver-panel textarea {
  margin-top: 5px;
}

.additional-label {
  margin-top: 13px;
}

.help {
  color: #505d69;
  font-size: 0.83rem;
  line-height: 1.4;
  margin: 5px 0 0;
}

.actions {
  display: flex;
  gap: 7px;
  margin-top: 13px;
}

.reset {
  justify-content: flex-end;
}

button {
  min-width: 58px;
  padding: 6px 14px;
  border: 1px solid #a8b5c2;
  border-radius: 3px;
  background: #f5f7f9;
  color: #20282f;
  font: inherit;
  cursor: pointer;
}

button.primary {
  border-color: #254a72;
  background: #254a72;
  color: white;
  font-weight: 700;
}

button:hover:not(:disabled) {
  filter: brightness(0.94);
}

:focus-visible {
  outline: 2px solid #2671b9;
  outline-offset: 2px;
}

#status {
  margin: 16px 0;
}

#status.error,
.record-error {
  color: #a92323;
}

h2 {
  font-size: 1rem;
  margin: 20px 0 8px;
}

pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid #cad3dd;
  background: #fff;
}

.record-header { color: #245c95; }
.record-section { color: #63388a; }
.record-stats { color: #884311; }
.record-comment { color: #516071; }
.record-address { color: #236738; }
.record-domain { color: #175f7f; }
.record-text { color: #14655c; }
.record-security { color: #754075; }

@media (max-width: 700px) {
  main {
    width: calc(100% - 24px);
    margin: 16px auto;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .form-grid > * + * {
    border-left: 0;
    border-top: 1px solid #e1e6ed;
    padding-left: 0;
    padding-top: 14px;
  }

  .form-grid > .nameserver-panel {
    padding-top: 39px;
  }

  .nameserver-panel legend {
    top: 14px;
  }

  #hostnames {
    height: 10rem;
  }
}
