:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --border: #e2e0db;
  --text: #1c1b19;
  --text-dim: #6b6a66;
  --accent: #2f6f4f;
  --supercell: #b8452f;
  --hail: #2f6f9f;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17161a;
    --surface: #211f24;
    --border: #34323a;
    --text: #e9e7e2;
    --text-dim: #9a988f;
    --accent: #6fbf8f;
    --supercell: #e28065;
    --hail: #7ab6e0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

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

.topbar {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}
.topbar h1 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.subtitle { margin: 0; color: var(--text-dim); font-size: 0.9rem; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.controls input[type="search"],
.controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}
.unmatched-toggle {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

main { padding: 1rem 1.5rem 3rem; max-width: 1100px; margin: 0 auto; }

.day-group { margin-bottom: 1.75rem; }
.day-heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  color: var(--text);
}
.day-heading .count { color: var(--text-dim); font-weight: 400; }

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}
.report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.report-time { font-weight: 600; }
.report-loc { color: var(--text); }
.report-coords { color: var(--text-dim); font-size: 0.82rem; }
.hail-badge {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.match {
  border-top: 1px dashed var(--border);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}
.match:first-of-type { border-top: none; margin-top: 0; }

.match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}
.type-badge {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  color: #fff;
}
.type-badge.SUPERCELL { background: var(--supercell); }
.type-badge.HAIL { background: var(--hail); }

.plot-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.plot-thumb {
  width: 180px;
  height: 135px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  background: var(--bg);
}
.plot-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.15rem;
}
.plot-col { display: flex; flex-direction: column; align-items: center; }

.unmatched-list { list-style: none; padding: 0; margin: 0; }
.unmatched-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-dim);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: 6px; }
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2rem;
  line-height: 1;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

.empty-state { color: var(--text-dim); padding: 2rem 0; text-align: center; }
