:root {
  color-scheme: light dark;
  --bg: #f7f7f9;
  --surface: #ffffff;
  --surface-muted: #f0f0f4;
  --border: #d9d9e0;
  --text: #1c1c24;
  --text-muted: #5b5b6b;
  --accent: #2f6df6;
  --accent-text: #ffffff;
  --good: #1f8a3a;
  --bad: #c0322b;
  --warn: #b56b00;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1015;
    --surface: #181a22;
    --surface-muted: #23262f;
    --border: #2c2f3a;
    --text: #f3f3f7;
    --text-muted: #a0a3b1;
    --accent: #6e9bff;
    --accent-text: #0f1015;
    --good: #5fd483;
    --bad: #ff7a72;
    --warn: #ffb454;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 40px rgba(0, 0, 0, 0.5);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue",
    Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

main {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

header h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0 0 24px;
  color: var(--text-muted);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  padding: 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.input-card,
.output-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.options {
  margin: 16px 0 8px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-muted);
}

.options legend {
  padding: 0 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.options label {
  font-weight: 400;
  margin: 4px 16px 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  transition: filter 120ms ease;
}

button:hover {
  filter: brightness(0.96);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.summary .stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}

.summary .stat strong {
  display: block;
  font-size: 22px;
  margin-bottom: 2px;
}

.summary .stat span {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.upload {
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-label {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  margin: 0;
}

.file-label:hover {
  filter: brightness(0.97);
}

#file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-status {
  font-size: 13px;
  color: var(--text-muted);
}

.output-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.output-header h2 {
  margin: 0;
  font-size: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

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

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

td.email {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  word-break: break-all;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface-muted);
  margin: 1px 2px 1px 0;
  color: var(--text-muted);
}

.status-yes {
  color: var(--good);
  font-weight: 600;
}

.status-no {
  color: var(--bad);
  font-weight: 600;
}

.status-unknown {
  color: var(--warn);
  font-weight: 600;
}

details {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

details > summary {
  cursor: pointer;
  font-weight: 600;
}

footer {
  margin-top: 48px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

footer a {
  color: inherit;
}
