:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --border: #d0d0d0;
  --accent: #0f6e3d;
  --accent-contrast: #ffffff;
  --notice-bg: #eaf6ee;
  --notice-border: #b7e0c4;
  --error-bg: #fdecec;
  --error-border: #f3b4b4;
  --error-fg: #8a1f1f;
  --row-alt: #f7f7f7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --fg: #f0f0f0;
    --muted: #a0a6ab;
    --border: #3a3f44;
    --accent: #35c07a;
    --accent-contrast: #06170e;
    --notice-bg: #142a1d;
    --notice-border: #235a37;
    --error-bg: #2c1414;
    --error-border: #6b2626;
    --error-fg: #f5b5b5;
    --row-alt: #1b1f23;
  }
}

* {
  box-sizing: border-box;
}

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

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

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

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

.privacy-notice {
  background: var(--notice-bg);
  border: 1px solid var(--notice-border);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 1.25rem 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--notice-bg);
}

.dropzone .hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.status {
  min-height: 1.4em;
  color: var(--muted);
}

.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-fg);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.result {
  margin-top: 1rem;
}

.summary {
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1rem;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
  white-space: nowrap;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:nth-child(even) {
  background: var(--row-alt);
}

.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.amount.neg {
  color: #c0392b;
}

.amount.pos {
  color: #1f8a4c;
}

button#download-btn {
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
  cursor: pointer;
}

button#download-btn:hover {
  filter: brightness(1.08);
}

footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.85rem;
}
