:root {
  --bg: #ffffff;
  --fg: #1c1f23;
  --muted: #5f6b76;
  --line: #d9dee3;
  --accent: #0b5cad;
  --head: #f3f5f7;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181c;
    --fg: #e8eaed;
    --muted: #9aa5b1;
    --line: #2d343b;
    --accent: #7db7f0;
    --head: #1c2228;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap { max-width: 52rem; margin: 0 auto; padding: 0 1rem; }

.site-header { background: var(--head); border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: .75rem; padding-bottom: .75rem; }
.site-title { font-weight: 600; color: var(--fg); text-decoration: none; }

a { color: var(--accent); }

h1 { font-size: 1.6rem; margin: 1.5rem 0 .25rem; }
h2 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .25rem; color: var(--muted); }

.round { color: var(--muted); margin-top: 0; }
.back { margin: 1rem 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.chips a {
  padding: .25rem .75rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; background: var(--head);
}

.rounds { margin: .25rem 0 0; padding-left: 1.25rem; }

.division { padding-top: .5rem; }

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .35rem .5rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-size: .85rem; color: var(--muted); border-bottom-color: var(--fg); }
tbody th { font-weight: 400; white-space: nowrap; width: 5.5rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }

tr.team th { font-weight: 600; }
tr.team td, tr.team th { border-bottom: 0; }
tr.members td { color: var(--muted); font-size: .9rem; padding-top: 0; }

.note { color: var(--muted); margin-top: 1.5rem; }

.site-footer { color: var(--muted); font-size: .9rem; margin-top: 3rem; padding-bottom: 2rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- admin sides ---- */
body.admin .site-header .bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; }
body.admin nav { display: flex; flex-wrap: wrap; gap: .25rem 1rem; flex: 1; }
body.admin nav a { text-decoration: none; }
.site-header.adminbar { background: #fdf3e1; }
.site-header.editor { background: #e8f1fb; }
@media (prefers-color-scheme: dark) {
  .site-header.adminbar { background: #2b2417; }
  .site-header.editor { background: #162231; }
}
.logout { display: flex; align-items: center; gap: .5rem; margin: 0; }
.who { color: var(--muted); font-size: .9rem; }

.notice { padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 6px; background: var(--head); }
.notice.ok { border-color: #2e7d32; }
.notice.error { border-color: #c62828; }

.form { display: flex; flex-direction: column; gap: .75rem; max-width: 28rem; margin: 1rem 0; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; max-width: none; }
.form label { display: flex; flex-direction: column; gap: .2rem; font-size: .9rem; }
.form label.check, .rowform label.check { flex-direction: row; align-items: center; gap: .4rem; }
input[type=text], input[type=number], input[type=date], select {
  font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 4px;
  background: var(--bg); color: var(--fg);
}
button {
  font: inherit; padding: .4rem .9rem; border: 1px solid var(--accent); border-radius: 4px;
  background: var(--accent); color: var(--bg); cursor: pointer;
}
button.danger { background: #c62828; border-color: #c62828; color: #fff; }
.rowform { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .15rem 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: .15rem 1rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.actions { white-space: nowrap; }
.actions a { margin-right: .6rem; }
.nowrap { white-space: nowrap; }
.pager a { margin-right: 1rem; }
