:root {
  color-scheme: light dark;
  --fg: #1b1b1f;
  --bg: #ffffff;
  --muted: #666;
  --border: #d8d8dc;
  --accent: #2b5fd9;
  --exact: #c0392b;
  --near: #d68910;
  --semantic: #2471a3;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #eaeaf0;
    --bg: #17171b;
    --muted: #9a9aa2;
    --border: #33333a;
    --accent: #6f9bff;
    --exact: #e6746a;
    --near: #eab659;
    --semantic: #6fb3e0;
  }
}

* {
  box-sizing: border-box;
}

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

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 0.25rem;
}

.lede {
  color: var(--muted);
  margin-top: 0;
}

.input-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tab-button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
}

.tab-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.tab-panel.hidden {
  display: none;
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 8rem;
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}

.dropzone.dragover {
  border-color: var(--accent);
  color: var(--fg);
}

textarea {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--fg);
  resize: vertical;
}

#submit-button {
  margin-top: 1rem;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
}

#submit-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.error {
  color: var(--exact);
  font-weight: 600;
}

.loading {
  color: var(--muted);
}

.hidden {
  display: none;
}

#report h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.pairs-list,
.groups-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.pair-item,
.group-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  color: #fff;
  margin-right: 0.5rem;
}

.badge.exact {
  background: var(--exact);
}

.badge.near_verbatim {
  background: var(--near);
}

.badge.semantic {
  background: var(--semantic);
}

.score {
  color: var(--muted);
  font-size: 0.85rem;
}

.pair-excerpts {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

.pair-excerpts > div {
  flex: 1;
  min-width: 0;
}

.excerpt-id {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 0.25rem;
}

.excerpt-text {
  white-space: pre-wrap;
  font-size: 0.9rem;
  max-height: 8rem;
  overflow-y: auto;
  border-left: 2px solid var(--border);
  padding-left: 0.5rem;
}

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