:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --ink: #1f2520;
  --muted: #667066;
  --line: #ddd6ca;
  --panel: #fffdf8;
  --panel-2: #ebe4d8;
  --accent: #b2342a;
  --accent-2: #1f6f64;
  --warning: #8a5a00;
  --shadow: 0 16px 36px rgba(37, 30, 20, 0.12);
}

* {
  box-sizing: border-box;
}

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

.page-header,
main {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.45rem;
}

.summary,
.count {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.list-section {
  margin: 0 0 28px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0 12px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #2f3933;
  color: #fffdf8;
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

td:nth-child(1) {
  width: 20%;
}

td:nth-child(2) {
  width: 20%;
}

td:nth-child(3) {
  width: 24%;
}

td:nth-child(4) {
  width: 24%;
}

td:nth-child(5) {
  width: 12%;
}

.merchant-name {
  margin-bottom: 6px;
  font-size: 1.02rem;
  font-weight: 850;
}

.meta,
.recorded {
  color: var(--muted);
  font-size: 0.86rem;
}

.recorded {
  margin-top: 10px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--panel-2);
  color: #3c4039;
  font-size: 0.78rem;
  font-weight: 750;
}

.pill.high {
  background: #f6d7d3;
  color: #7a1f18;
}

.pill.medium {
  background: #f5e2bd;
  color: var(--warning);
}

.pill.cards {
  background: #dfe8ff;
  color: #254078;
}

.pill.images {
  background: #dff0e6;
  color: #1f6040;
}

.contacts {
  display: grid;
  gap: 8px;
}

.contact-link,
.contact-value {
  display: block;
  width: fit-content;
  max-width: 100%;
  color: var(--accent-2);
  overflow-wrap: anywhere;
  font-weight: 800;
  text-decoration: none;
}

.contact-link:hover {
  text-decoration: underline;
}

.contact-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.empty-contacts {
  color: var(--muted);
  font-style: italic;
}

.follow-goal {
  margin-bottom: 8px;
  font-weight: 850;
}

.follow-action,
.notes-list {
  color: #323832;
  font-size: 0.95rem;
}

.notes-list {
  display: grid;
  gap: 8px;
}

.note-label {
  color: var(--muted);
  display: block;
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.72);
  padding: 28px;
  color: var(--muted);
  font-weight: 750;
}

@media (max-width: 760px) {
  .page-header,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .summary,
  .count {
    width: 100%;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(84px, 1fr));
  }
}
