* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #17202a;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 18px 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: -0.04em;
}

h2 {
  margin: 0 0 14px;
  font-size: 1.25rem;
}

h3 {
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: #5b6b7a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.lede {
  max-width: 760px;
  color: #44515f;
  line-height: 1.55;
  font-size: 1.05rem;
}

.badge {
  padding: 10px 14px;
  border-radius: 999px;
  background: #17202a;
  color: white;
  font-weight: 700;
  white-space: nowrap;
}

.card {
  background: white;
  border: 1px solid #e0e5eb;
  border-radius: 18px;
  padding: 22px;
  margin: 18px 0;
  box-shadow: 0 12px 32px rgba(23, 32, 42, 0.06);
}

.grid,
.mapping-grid,
.tx-grid,
.decision-grid {
  display: grid;
  gap: 14px;
}

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

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

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

.decision-grid {
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.file-box,
.mapping-grid label,
.decision-grid label {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d8dee6;
  border-radius: 14px;
  background: #fbfcfd;
  font-weight: 700;
}

input,
select {
  font: inherit;
}

input[type="file"],
input[type="text"],
select {
  width: 100%;
  padding: 10px;
  border: 1px solid #cdd5df;
  border-radius: 10px;
  background: white;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  background: #1f6feb;
  color: white;
}

.button-link {
  display: inline-block;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  background: #198754;
  color: white;
}

.button-link:hover {
  background: #157347;
  color: white;
  text-decoration: none;
}

button.secondary {
  background: #e7edf5;
  color: #17202a;
}

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

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

button.green {
  background: #198754;
  color: white;
}

.status {
  margin: 14px 0 0;
  color: #44515f;
  font-weight: 700;
}

.muted {
  color: #5b6b7a;
  line-height: 1.5;
}

.small {
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

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

.transaction-card {
  border: 1px solid #d8dee6;
  background: #fbfcfd;
  border-radius: 18px;
  padding: 18px;
}

.tx-grid>div,
.details>div {
  background: white;
  border: 1px solid #e0e5eb;
  border-radius: 14px;
  padding: 12px;
}

.label {
  display: block;
  color: #5b6b7a;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  margin-bottom: 6px;
}

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

.details p {
  margin: 0;
  min-height: 1.5em;
}

.checkbox-line {
  grid-column: 1 / -1;
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px !important;
  font-weight: 700;
}

.checkbox-line input {
  width: auto;
}

.rule-hint {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #eef4ff;
  color: #26364a;
  font-weight: 700;
}

.done-box {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 18px;
  padding: 18px;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px;
}

.summary span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef4ff;
  font-weight: 800;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e0e5eb;
  border-radius: 14px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 980px;
  font-size: 0.92rem;
}

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

th {
  background: #f1f4f8;
  position: sticky;
  top: 0;
  z-index: 1;
}

td.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.duplicate,
.ignored {
  color: #9a3412;
  font-weight: 800;
}

.imported {
  color: #067647;
  font-weight: 800;
}

.skipped {
  color: #475467;
  font-weight: 800;
}

ul {
  margin-bottom: 0;
  line-height: 1.6;
}

@media (max-width: 800px) {

  .hero,
  .grid,
  .mapping-grid,
  .tx-grid,
  .details,
  .decision-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .badge {
    justify-self: start;
  }

  .review-header {
    display: grid;
  }
}

.profile-row {
  margin-top: 14px;
  max-width: 520px;
}

.csv-preview-wrap {
  margin-top: 16px;
  max-height: 260px;
}

#rawCsvPreview {
  min-width: 720px;
}

#csvProfileSummary {
  margin-top: 16px;
}


button.undo {
  background: #f59e0b;
  color: #17202a;
}
