:root {
  --ink: #1a1f2b;
  --muted: #5b6472;
  --line: #dde1e7;
  --bg: #f7f8fa;
  --card: #ffffff;
  --accent: #635bff;
  --accent-ink: #ffffff;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --warn: #7a5b00;
  --warn-bg: #fff8e1;
  --ok-bg: #ecfdf3;
  --ok-line: #b7ebc6;
  --radius: 10px;
}

* { box-sizing: border-box; }

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

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 96px;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

header h1 {
  font-size: 1.7rem;
  margin: 0 0 8px;
}

header p {
  color: var(--muted);
  margin: 0;
  font-size: 1.02rem;
}

.trust-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 10px;
}

.trust-note svg { vertical-align: -2px; margin-right: 4px; }

#dropzone {
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

#dropzone:hover,
#dropzone.dragover {
  border-color: var(--accent);
  background: #f4f3ff;
}

#dropzone p { margin: 0 0 6px; font-weight: 500; }
#dropzone span { color: var(--muted); font-size: 0.9rem; }

#file-input { display: none; }

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { opacity: 0.92; }

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

#error {
  margin-top: 20px;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-size: 0.95rem;
}

#results {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--ok-line);
  background-color: var(--ok-bg);
  border-radius: var(--radius);
  padding: 24px;
}

#results h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.source-type {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

#summary { margin: 0 0 16px; color: var(--ink); }
#summary strong { font-variant-numeric: tabular-nums; }

.accounts-list {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 20px;
}

.accounts-list code {
  background: rgba(0,0,0,0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

details.warnings {
  margin-bottom: 20px;
  font-size: 0.9rem;
}

details.warnings summary {
  cursor: pointer;
  color: var(--warn);
  font-weight: 600;
}

details.warnings ul {
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 12px 12px 12px 28px;
  margin-top: 8px;
  color: #4a3a00;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.table-actions h3 {
  margin: 0;
  font-size: 1rem;
}

#table-wrap {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  margin-bottom: 16px;
}

#output-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

#output-table th,
#output-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

#output-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#output-table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
}

#donate {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
}

#donate p { margin: 0 0 12px; color: var(--muted); font-size: 0.92rem; }

footer {
  text-align: center;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.82rem;
}

footer a { color: var(--muted); }

[hidden] { display: none !important; }
