:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #162033;
  --muted: #657188;
  --line: #dce3ee;
  --accent: #1769e0;
  --accent-dark: #0c4ea8;
  --risk: #c53333;
  --warn: #b56b00;
  --good: #1f7a43;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: stretch;
  padding: 28px 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 42px;
  line-height: 1.08;
}

.subtitle {
  max-width: 680px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.upload-panel,
.card,
.table-section,
.sources {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upload-panel {
  padding: 18px;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 170px;
  border: 1px dashed #9fb1cc;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: #f8fbff;
}

.drop-zone input {
  width: 1px;
  height: 1px;
  opacity: 0;
  position: absolute;
}

.drop-zone span {
  display: block;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 18px;
}

.drop-zone small {
  color: var(--muted);
}

button {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 16px;
  padding: 13px 16px;
  cursor: pointer;
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.status {
  min-height: 22px;
  color: var(--muted);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 8px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.table-section {
  margin: 18px 0;
  overflow: auto;
}

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

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  background: #fbfcff;
}

.documents {
  display: grid;
  gap: 16px;
}

.card {
  padding: 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.card h2,
.sources h2 {
  margin: 0;
  font-size: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-width: 78px;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  background: #e8f1ff;
  color: var(--accent-dark);
}

.fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.field {
  background: #f8fafd;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.field strong {
  display: block;
  margin-top: 4px;
}

.finding {
  border-left: 4px solid var(--line);
  padding: 10px 12px;
  margin: 10px 0;
  background: #fbfcff;
}

.finding.high {
  border-left-color: var(--risk);
}

.finding.medium,
.finding.low {
  border-left-color: var(--warn);
}

.finding.positive {
  border-left-color: var(--good);
}

.finding h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.finding p,
.missing,
.extracts {
  color: var(--muted);
  line-height: 1.55;
}

.sources {
  margin-top: 18px;
  padding: 18px;
}

.sources a {
  color: var(--accent-dark);
}

@media (max-width: 860px) {
  .hero,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 34px;
  }

  .fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .fields {
    grid-template-columns: 1fr;
  }
}
