:root {
  color-scheme: light;
}

body {
  background: #f7f9fa;
}

.app-shell {
  padding-top: 2rem;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(5.25rem, 1fr));
  gap: 0.75rem;
  min-width: min(26rem, 100%);
}

.metric-box {
  margin: 0;
}

.metric-box .usa-summary-box__body {
  padding: 0.75rem 1rem;
}

.metric-number,
.metric-label {
  margin: 0;
}

.metric-number {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
}

.metric-label {
  color: #565c65;
  font-size: 0.82rem;
  line-height: 1.3;
  margin-top: 0.25rem;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.app-card,
.review-surface {
  margin-bottom: 0;
}

.app-card .usa-card__container,
.review-surface .usa-card__container {
  margin-left: 0;
  margin-right: 0;
  border-color: #dfe1e2;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-form {
  max-width: none;
}

.upload-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 8.5rem;
  border: 2px dashed #8d9297;
  border-radius: 0.25rem;
  background: #f9fbfc;
  text-align: center;
}

.upload-zone.is-dragging {
  border-color: #005ea8;
  background: #eef7ff;
}

.upload-zone .usa-file-input {
  position: absolute;
  inset: 0;
  max-width: none;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-copy {
  pointer-events: none;
  padding: 1rem;
}

.upload-copy strong,
.upload-copy span {
  display: block;
}

.upload-copy span {
  color: #565c65;
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.review-surface .usa-card__container {
  min-height: 42rem;
}

.results-grid {
  display: grid;
  gap: 0.75rem;
}

.result-card {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1rem;
  border: 1px solid #dfe1e2;
  border-radius: 0.25rem;
  background: #ffffff;
  padding: 0.75rem;
}

.label-preview {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  border: 1px solid #dfe1e2;
  border-radius: 0.25rem;
  object-fit: cover;
  background: #f0f0f0;
}

.result-body {
  min-width: 0;
}

.result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.result-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.checks {
  display: grid;
  gap: 0.5rem;
}

.check-row {
  display: grid;
  grid-template-columns: 6.25rem minmax(0, 1fr);
  gap: 0.75rem;
  border: 1px solid #dfe1e2;
  border-left-width: 0.35rem;
  border-radius: 0.25rem;
  background: #ffffff;
  padding: 0.55rem 0.65rem;
}

.check-row strong {
  font-size: 0.84rem;
}

.check-row span {
  color: #565c65;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.check-row.pass {
  border-left-color: #008817;
}

.check-row.warn {
  border-left-color: #ffbe2e;
}

.check-row.fail {
  border-left-color: #d54309;
}

.ocr-text {
  max-height: 9rem;
  overflow: auto;
  margin-top: 0.75rem;
  border-top: 1px solid #dfe1e2;
  color: #565c65;
  font-size: 0.84rem;
  line-height: 1.45;
  padding-top: 0.75rem;
  white-space: pre-wrap;
}

@media (max-width: 64em) {
  .app-header,
  .app-layout {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 40em) {
  .metric-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .metric-box .usa-summary-box__body {
    padding: 0.65rem;
  }

  .result-card {
    grid-template-columns: 1fr;
  }

  .label-preview {
    max-height: 16rem;
  }

  .check-row {
    grid-template-columns: 1fr;
  }
}
