:root {
  color-scheme: light dark;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --background: #ffffff;
  --in: #1d7a3a;
  --pending: #8a5a00;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #ececec;
    --muted: #a0a0a0;
    --line: #333333;
    --background: #161616;
    --in: #5cc27e;
    --pending: #e0b35a;
  }
}

/* `hidden` must win over any display rule below. */
[hidden] {
  display: none !important;
}

body {
  margin: 0 auto;
  max-width: 48rem;
  padding: 1rem;
  color: var(--text);
  background: var(--background);
}

header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.5rem;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
}

.title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

button {
  padding: 0.4rem 1rem;
  font: inherit;
}

#linking {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.5rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
}

#linking p {
  margin: 0;
}

#totals {
  color: var(--muted);
  margin: 0.25rem 0 0.75rem;
  font-variant-numeric: tabular-nums;
}

#transactions {
  list-style: none;
  margin: 0;
  padding: 0;
}

.transaction {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.main,
.side {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.side {
  align-items: flex-end;
  text-align: right;
  flex-shrink: 0;
}

.description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account,
.date {
  color: var(--muted);
  font-size: 0.85rem;
}

.amount {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.amount.in {
  color: var(--in);
}

.pending {
  color: var(--pending);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#more {
  display: block;
  margin: 1rem auto;
  padding: 0.5rem 1.25rem;
}

pre {
  overflow-x: auto;
  padding: 0.5rem;
  border: 1px solid var(--line);
}
