:root {
  --brand: #6b4b35;
  --brand-ink: #ffffff;
  --bg: #faf7f3;
  --surface: #ffffff;
  --ink: #2b211b;
  --muted: #6f6259;
  --line: #e4dbd2;
  --danger: #a3302a;
  --ok: #2f6b3a;
  --radius: 10px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #c9a184;
    --brand-ink: #1d1612;
    --bg: #17120f;
    --surface: #221b17;
    --ink: #f1e9e2;
    --muted: #b3a59a;
    --line: #3a2f28;
    --danger: #ef8a83;
    --ok: #8fd19e;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
main a { color: var(--brand); }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand img { border-radius: 6px; }
.brand small { font-weight: 400; color: var(--muted); }
nav { display: flex; gap: 16px; align-items: center; }
nav a, .link { color: var(--brand); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 0; }
nav a:hover, .link:hover { text-decoration: underline; }
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; outline: none; }
h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.muted { color: var(--muted); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin: 12px 0;
}
.narrow { max-width: 420px; margin: 32px auto; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 0.95rem; }
input, select {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; width: 100%;
}
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: auto; min-height: 0; }
button.primary, button.secondary, button.danger, a.button {
  font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 16px; min-height: 44px; cursor: pointer;
  border: 1px solid transparent;
}
button.primary { background: var(--brand); color: var(--brand-ink); }
button.secondary { background: transparent; color: var(--brand); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
button:disabled { opacity: 0.6; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.notice {
  max-width: 860px; margin: 12px auto 0; padding: 10px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line);
}
.notice.error { border-color: var(--danger); color: var(--danger); }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.org-link { display: block; color: var(--ink); text-decoration: none; }
.org-link strong { color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 1.4rem; color: var(--brand); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }
td select { min-height: 36px; padding: 4px 8px; width: auto; }
.pill { display: inline-block; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.copy { word-break: break-all; font-family: ui-monospace, monospace; font-size: 0.85rem; background: var(--bg); padding: 8px; border-radius: 6px; }
@media (max-width: 560px) {
  .hide-narrow { display: none !important; }
  /* The people table becomes one card per person. */
  .stack thead { display: none; }
  .stack, .stack tbody, .stack tr, .stack td { display: block; width: 100%; }
  .stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .stack tr:last-child { border-bottom: 0; }
  .stack td { border: 0; padding: 4px 0; display: flex; gap: 12px; align-items: center; }
  .stack td[data-label]::before { content: attr(data-label); min-width: 110px; color: var(--muted); font-size: 0.85rem; }
  .stack td .row { gap: 20px; }
  .stack td.empty { display: none; }
}
details { margin-top: 12px; }
summary { cursor: pointer; color: var(--brand); font-weight: 600; }
main .notice { margin: 0 0 12px; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
a.button.primary { background: var(--brand); color: var(--brand-ink); }
.row.between:has(> h2) { margin: 28px 0 8px; align-items: center; }
.row.between > h2 { margin: 0; }
.pill.open { color: var(--ok); border-color: var(--ok); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
textarea { font: inherit; }
.fields { display: grid; gap: 8px; margin: 8px 0; }
.field-row { display: grid; grid-template-columns: 2fr 1.3fr auto; gap: 8px; align-items: center; }
.field-row [name=fopts] { grid-column: 1 / -1; }
.join-sheet { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.join-sheet img { background: #fff; border-radius: 8px; padding: 4px; }
.code { font: 700 2rem/1.2 ui-monospace, monospace; letter-spacing: 0.08em; color: var(--brand); margin: 4px 0; }
td.notes { max-width: 280px; white-space: pre-wrap; }
td input { min-height: 36px; padding: 4px 8px; }
.print-only { display: none; }
.big { font-size: 1.5rem; font-weight: 700; }
@media (max-width: 560px) {
  .grid2 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .field-row .link { grid-column: 1 / -1; justify-self: start; }
}
@media print {
  .top, #notice, .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  main > h1, main > p.muted { display: none; }
  .join-sheet { border: 0; flex-direction: column; text-align: center; margin-top: 15vh; }
  .join-sheet img { width: 320px; height: 320px; }
  .code { font-size: 3rem; color: #000; }
}
a.button.secondary { background: transparent; color: var(--brand); border-color: var(--line); }
.downloads { margin: 8px 0; }
.card.warn { border-color: var(--brand); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Ten bars, one per rating 1–10; single hue, rounded ends on the baseline. */
.histo { display: grid; grid-template-columns: repeat(10, 6px); gap: 2px; align-items: end; height: 28px; }
.histo span { display: block; height: max(var(--h), 2px); background: var(--brand); border-radius: 2px 2px 0 0; }
.histo span.zero { background: var(--line); height: 2px; }
table.results td input { min-width: 140px; }
.show-narrow { display: none; }
@media (max-width: 560px) {
  .show-narrow { display: inline; }
  table.results td input { min-width: 0; width: 100%; }
  table.results th, table.results td { padding: 8px 4px; }
  .stack td.num { text-align: left; }
}
.filters { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.small { font-size: 0.85rem; }
.pager { justify-content: center; margin-top: 12px; }
@media (max-width: 560px) { .stack td:first-child { display: block; } .stack td:first-child .muted { margin-top: 2px; } }
table.kv th { width: 40%; color: var(--muted); font-weight: 600; }
.tabs { display: flex; gap: 8px; margin: 8px 0 4px; }
.tabs a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: var(--brand); }
.tabs a.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.list.card { padding: 4px 16px; }
.tabs.wrap { flex-wrap: wrap; }
.field-edit { padding: 12px; margin: 8px 0; }
.field-edit .field-row { grid-template-columns: 2fr 1.4fr auto; }
.field-edit input[hidden] { display: none; }
.field-edit > input { margin-top: 8px; }
h3 { font-size: 1rem; margin: 20px 0 4px; }
