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

body {
  margin: 0;
  background: #f5f7fb;
  color: #152033;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px;
}

header {
  margin-bottom: 24px;
}

h1 {
  margin-bottom: 8px;
}

.panel {
  background: #fff;
  border: 1px solid #dde3ee;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgb(20 35 60 / 8%);
  margin-bottom: 20px;
  padding: 20px;
}

form {
  display: block;
}

label {
  font-weight: 700;
}

button {
  background: #1769aa;
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  padding: 10px 16px;
}

button:hover {
  background: #0f578d;
}

.hint {
  color: #53627a;
  font-size: 0.92rem;
}

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

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  border-bottom: 1px solid #dde3ee;
  padding: 10px;
  text-align: left;
}

th {
  background: #eef3fa;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #0b1220;
    color: #e6edf7;
  }

  .panel {
    background: #121a2a;
    border-color: #263247;
  }

  .hint {
    color: #a9b7ce;
  }

  th {
    background: #182235;
  }

  th,
  td {
    border-bottom-color: #263247;
  }
}

.mode-picker {
  border: 0;
  display: flex;
  gap: 20px;
  margin: 0 0 16px;
  padding: 0;
}

.mode-picker legend {
  font-weight: 700;
  margin-bottom: 8px;
}

.mode-picker label {
  align-items: center;
  display: flex;
  gap: 6px;
}

.mode-panel {
  margin-bottom: 16px;
}

.field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input[type="text"],
input:not([type]) {
  border: 1px solid #b8c4d6;
  border-radius: 6px;
  font: inherit;
  padding: 9px 10px;
}

.hidden {
  display: none;
}

.job-log {
  background: #101828;
  border-radius: 6px;
  color: #e6edf7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  list-style: none;
  margin: 0;
  min-height: 48px;
  overflow: auto;
  padding: 12px;
}

.job-log li {
  margin-bottom: 6px;
}

.job-log .log-error {
  color: #ffb4b4;
}

.job-log .log-warn {
  color: #ffd98a;
}


.amount-row {
  margin-bottom: 16px;
  max-width: 240px;
}

.amount-row label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}


.results-header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

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

.result-valid td:nth-child(4) {
  color: #117a37;
  font-weight: 700;
}

.result-invalid td:nth-child(4),
.result-invalid td:nth-child(6),
.result-invalid td:nth-child(7) {
  color: #b42318;
  font-weight: 700;
}


.button-link {
  background: #1769aa;
  border-radius: 6px;
  color: #fff;
  display: inline-block;
  font-weight: 700;
  padding: 10px 16px;
  text-decoration: none;
}

.button-link:hover {
  background: #0f578d;
}


.client-error {
  background: #fee4e2;
  border: 1px solid #f97066;
  border-radius: 6px;
  color: #7a271a;
  margin: 12px;
  padding: 12px;
  white-space: pre-wrap;
}


.optional {
  color: #667085;
  font-size: 0.85em;
  font-weight: 400;
}


.avs-picker {
  border: 1px solid #dde3ee;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
}

.avs-picker legend {
  font-weight: 700;
  padding: 0 6px;
}

.avs-picker label {
  align-items: center;
  display: flex;
  gap: 6px;
}


.result-review {
  background: #7a5b00;
  color: #fff7d6;
}

.result-review td:nth-child(4),
.result-review td:nth-child(8),
.result-review td:nth-child(9),
.result-review td:nth-child(10) {
  font-weight: 700;
}

.result-declined {
  background: #7f1d1d;
  color: #fff1f2;
}

.result-declined td:nth-child(4),
.result-declined td:nth-child(8),
.result-declined td:nth-child(9),
.result-declined td:nth-child(10) {
  font-weight: 700;
}


.connection-status {
  border-radius: 6px;
  padding: 10px 12px;
}

.status-checking {
  background: #eef3fa;
  color: #344054;
}

.status-connected {
  background: #dcfae6;
  color: #05603a;
  font-weight: 700;
}

.status-not-connected {
  background: #fff4e5;
  color: #93370d;
  font-weight: 700;
}
