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

* {
  box-sizing: border-box;
}

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

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: #5f6b85;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.25;
}

.badge {
  flex: 0 0 auto;
  border: 1px solid #c9d5e8;
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  color: #42526e;
  font-size: 13px;
  font-weight: 700;
}

.panel {
  border: 1px solid #dfe5f0;
  border-radius: 8px;
  margin-bottom: 12px;
  padding: 16px;
  background: #ffffff;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #4c5870;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
  color: #20242f;
  font: inherit;
}

input:focus,
select:focus {
  border-color: #315bff;
  outline: 3px solid rgba(49, 91, 255, 0.16);
}

input[readonly] {
  background: #f8fafc;
  color: #42526e;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  background: #315bff;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #2349dd;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

button.secondary {
  border: 1px solid #cbd5e1;
  background: #eef3fb;
  color: #2349dd;
}

button.secondary:hover {
  background: #e3ebf8;
}

button.warning {
  color: #8a5a00;
}

.last-check {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #dfe5f0;
  border-radius: 8px;
  padding: 0 10px;
  background: #f8fafc;
  color: #4c5870;
  font-size: 13px;
  font-weight: 700;
}

.status-line {
  min-height: 22px;
  margin: 12px 0 0;
  color: #59657a;
  line-height: 1.45;
}

.status-line.success {
  color: #1f6b43;
  font-weight: 700;
}

.status-line.error {
  color: #a83232;
  font-weight: 700;
}

.status-line.info {
  color: #42526e;
}

.status-line.muted {
  min-height: 0;
  color: #6b7280;
  font-size: 13px;
}

.result-panel {
  border-left: 4px solid #315bff;
}

.decision-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.decision-badge {
  flex: 0 0 auto;
  border-radius: 8px;
  padding: 8px 10px;
  background: #edf2f7;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.decision-badge.standard {
  background: #e6f6ee;
  color: #17633c;
}

.decision-badge.review {
  background: #fff4df;
  color: #8a5a00;
}

.decision-badge.decline {
  background: #ffe8e8;
  color: #a83232;
}

.summary-text {
  margin-bottom: 14px;
  color: #445168;
  line-height: 1.5;
}

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

.details-grid .panel {
  margin-bottom: 0;
}

.reason-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #364257;
  line-height: 1.45;
}

.reason-list.compact {
  max-height: 280px;
  overflow: auto;
}

.reason-list strong {
  color: #20242f;
}

.data-list,
.context-list {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

dt {
  color: #5f6b85;
  font-weight: 700;
}

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

.diagnostics {
  margin-top: 12px;
  color: #4c5870;
}

.diagnostics summary {
  cursor: pointer;
  font-weight: 700;
}

pre {
  overflow: auto;
  margin: 14px 0 0;
  border-radius: 8px;
  padding: 12px;
  background: #111827;
  color: #e5e7eb;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .shell {
    padding: 14px;
  }

  .topbar,
  .decision-row {
    display: block;
  }

  .badge,
  .decision-badge {
    display: inline-block;
    margin-top: 10px;
  }

  .form-grid,
  .columns,
  .details-grid,
  .data-list,
  .context-list {
    grid-template-columns: 1fr;
  }
}
