:root {
  --bg: #f4f6f8;
  --card: #fff;
  --ink: #1f2933;
  --muted: #6b7785;
  --accent: #2f7d4f;
  --accent-ink: #fff;
  --line: #e2e8ee;
  --error: #c0392b;
  --warn: #b9770e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.stickytop { position: sticky; top: 0; z-index: 10; background: var(--card); }
.topbar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 10px 14px;
}
.topnav {
  display: flex; border-bottom: 1px solid var(--line); background: var(--card);
}
.topnav a {
  flex: 1; min-width: 0; text-align: center; text-decoration: none;
  color: var(--muted); font-size: 11px; line-height: 1.2; font-weight: 600;
  padding: 7px 4px; border-bottom: 3px solid transparent;
}
.topnav a .ico { display: block; font-size: 18px; font-style: normal; margin-bottom: 2px; }
.topnav a span { display: block; }
.topnav a.active { color: var(--accent); border-bottom-color: var(--accent); }
.topbar h1 { font-size: 18px; margin: 0; flex: 1; text-align: center; }
.topbar .back { font-size: 26px; text-decoration: none; color: var(--accent); width: 28px; }
.topbar .spacer { min-width: 28px; text-align: right; }
.container { max-width: 720px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
}
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--error); font-weight: 600; }
.ok-msg { color: var(--accent); font-weight: 600; }
.warn { color: var(--warn); }

label { display: block; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
input, select, button {
  font: inherit; width: 100%; padding: 10px; margin-top: 4px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
button {
  background: var(--accent); color: var(--accent-ink); border: 0;
  font-weight: 600; cursor: pointer; width: 100%; margin-top: 8px;
}
button.danger { background: var(--error); }
button.link, .link {
  background: none; color: var(--accent); width: auto; padding: 6px 0;
  text-decoration: underline; border: 0; display: inline-block;
}
form.inline { display: inline; }

.tiles { display: grid; gap: 12px; }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; text-decoration: none; color: var(--ink);
  font-size: 18px; font-weight: 600;
}
.tile:active { background: #eef3ef; }

.filter.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.filter.grid label:nth-child(2), .filter.grid label:nth-child(3) { grid-column: 1 / -1; }
.filter.grid button { grid-column: 1 / -1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--card);
  border: 1px solid var(--accent); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 14px; }
.chip.exclude { border-color: var(--error); }
.chip-sign { font-weight: 700; color: var(--accent); }
.chip.exclude .chip-sign { color: var(--error); }
.chip-label { color: var(--ink); }
.chip-x { text-decoration: none; color: var(--muted); font-size: 17px; line-height: 1; padding: 0 4px; }
.chip-x:hover { color: var(--ink); }

.btn-wide { display: block; text-align: center; text-decoration: none;
  background: var(--card); color: var(--accent); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin: 8px 0; font-weight: 600; }
.row.past { opacity: .55; }

.list { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 8px;
}
.row-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.row-btn:active { background: #eef3ef; }
.row .when, .row-btn .when { min-width: 56px; text-align: center; }
.row-btn .what { flex: 1; font-size: 14px; }
.row-btn .chev { color: var(--muted); font-size: 20px; }
.row .what { flex: 1; font-size: 14px; }
.row .chev { color: var(--muted); font-size: 20px; }
.enrolled { display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600;
  color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.enrolled-row { background: #e9f6ee; border-color: var(--accent); }
.enrolled-row:active { background: #ddeee2; }
.flag { margin-left: 6px; }
.flag-white { color: #999; } .flag-red { color: #c0392b; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--ink); border-radius: 10px; padding: 10px;
  border: 1px solid var(--line); background: var(--card);
}
.slot.ok { border-color: var(--accent); }
.slot.full { opacity: .5; }
.slot-time { font-size: 18px; font-weight: 700; }
.slot-holes { font-size: 12px; color: var(--muted); }
.slot-cap { font-size: 11px; color: var(--muted); }

.match-title { font-size: 18px; margin: 0 0 4px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; text-align: center; text-decoration: none; padding: 8px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
  background: var(--card); font-size: 14px;
}
.tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data thead th { color: var(--muted); font-weight: 600; }
.inline-action { margin-bottom: 8px; }
.inline-check { display: flex; align-items: center; gap: 8px; }
.inline-check input { width: auto; }

button.secondary { background: var(--card); color: var(--accent); border: 1px solid var(--accent); }
.player-search { margin-bottom: 12px; }
.search-results { margin-top: 6px; }
.search-result { display: block; padding: 8px 10px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--card); }
.search-result:active { background: #eef3ef; }

.summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.sub { font-size: 15px; color: var(--muted); margin: 18px 0 8px; }
.raw { white-space: pre-wrap; font-size: 11px; max-height: 320px; overflow: auto; }
