:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #182026;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: #1f6feb;
  color: white;
  padding: 0 14px;
  cursor: pointer;
}

button.secondary {
  background: #e7ebef;
  color: #182026;
}

button.danger {
  background: #b42318;
  color: white;
}

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

button.compact {
  max-width: 460px;
  min-height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

fieldset {
  border: 1px solid #d7dde3;
  border-radius: 6px;
  margin: 0;
  padding: 10px;
}

legend {
  color: #59636e;
  font-size: 13px;
  padding: 0 4px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #c9d1d9;
  border-radius: 6px;
  padding: 0 10px;
  background: white;
  color: #182026;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

pre {
  overflow: auto;
  border-radius: 6px;
  background: #101418;
  color: #d8dee9;
  padding: 12px;
}

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

.hidden {
  display: none !important;
}

.login-panel {
  max-width: 400px;
  margin: 10vh auto 0;
  display: grid;
  gap: 22px;
  border: 1px solid #d7dde3;
  border-radius: 8px;
  padding: 24px;
  background: white;
}

.app-view {
  display: grid;
  gap: 20px;
}

.topbar,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar p {
  color: #59636e;
  margin-top: 4px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.status-strip div {
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: white;
  padding: 14px 16px;
  min-width: 0;
}

.status-strip span {
  display: block;
  color: #59636e;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.status-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.panel {
  border: 1px solid #d7dde3;
  border-radius: 8px;
  background: white;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row input {
  width: auto;
  min-height: auto;
}

.check-list {
  display: grid;
  gap: 6px;
}

.check-row {
  font-size: 13px;
  white-space: nowrap;
}

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

.toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.filter-label,
.filter-control {
  color: #59636e;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.filter-control {
  display: grid;
  gap: 6px;
  min-width: 220px;
}

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
}

.muted {
  color: #7a8591;
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: #59636e;
  font-size: 13px;
}

.dns-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

.dns-cell button {
  width: fit-content;
  min-width: 92px;
  padding: 0 10px;
}

.dns-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.dns-unknown {
  background: #eef2f6;
  color: #59636e;
}

.dns-ok {
  background: #dcfce7;
  color: #166534;
}

.dns-warn {
  background: #fef3c7;
  color: #92400e;
}

.dns-note {
  flex-basis: 100%;
  color: #59636e;
  font-size: 12px;
  text-align: right;
  white-space: normal;
}

.right-col {
  text-align: right !important;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.table {
  overflow-x: auto;
}

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

.table th,
.table td {
  border-bottom: 1px solid #e2e7ec;
  padding: 10px 8px;
  text-align: left;
  white-space: nowrap;
}

.table th {
  font-size: 12px;
  color: #59636e;
  text-transform: uppercase;
}

.error {
  min-height: 20px;
  color: #b42318;
  font-size: 14px;
}

.modal {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid #c9d1d9;
  border-radius: 8px;
  padding: 0;
}

.modal::backdrop {
  background: rgb(16 20 24 / 0.45);
}

.modal form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.confirm-message {
  color: #374151;
  line-height: 1.5;
}

.confirm-modal {
  width: min(480px, calc(100vw - 32px));
}

.detail-list {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 16px;
  margin: 0;
}

.detail-list dt {
  color: #59636e;
  font-size: 13px;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.detail-list pre {
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 760px) {
  .grid,
  .status-strip,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head,
  .toolbar,
  .pagination {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-list {
    grid-template-columns: 1fr;
  }
}
