:root {
  color-scheme: light dark;
  --border: #ccc;
  --muted: #666;
  --danger: #b00020;
}

* { box-sizing: border-box; }

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0 1rem 2rem;
  max-width: 60rem;
  margin-inline: auto;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

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

nav { display: flex; gap: 0.75rem; align-items: center; }

table { border-collapse: collapse; width: 100%; margin-top: 1rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

form.inline { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }

.field { display: flex; flex-direction: column; gap: 0.2rem; margin-bottom: 0.6rem; }
.field label { font-size: 0.85rem; color: var(--muted); }

input, select, button {
  font: inherit;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

button { cursor: pointer; background: #eee; }
button:hover { background: #ddd; }

.error { color: var(--danger); margin: 0.5rem 0; }

.roles { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #eef;
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  font-size: 0.85rem;
}
.role-tag button { padding: 0 0.3rem; border: none; background: none; font-size: 0.9rem; }

.status-temporary { color: #888; }
.status-known { color: #a66; }
.status-member { color: #2a7; }
.status-left { color: #999; text-decoration: line-through; }

.login-form {
  max-width: 20rem;
  margin: 1.5rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.entry {
  max-width: 24rem;
  margin: 3rem auto;
  text-align: center;
}

.entry-tagline {
  color: var(--muted);
  line-height: 1.5;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tile {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.tile h3 { margin: 0 0 0.4rem; }
.tile p { margin: 0; color: var(--muted); font-size: 0.9rem; }

.tile-built {
  cursor: pointer;
}
.tile-built:hover { background: #f5f5f5; }

.tile-unbuilt {
  opacity: 0.55;
}

.tile-badge {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
}

.total-in-circulation {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0.75rem 0 1.25rem;
}

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

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

.hidden { display: none; }

table.statement { margin: 0.4rem 0 1rem; }

.postings { margin: 0; padding-left: 1.1rem; }

.entry-form {
  max-width: 34rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem 1rem;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.posting-rows { display: flex; flex-direction: column; gap: 0.4rem; }
.posting-row { display: flex; gap: 0.5rem; }
.posting-row select { flex: 1; }
.posting-row input { width: 12rem; }

.posting-sum { font-weight: 600; }
.posting-sum.balanced { color: #2a7; }
