@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* Same palette and type as samuelwiseman.com and Spendly */
:root {
  --bg: #f2f3f5;
  --surface: #fff;
  --field: #f7f8f9;
  --line: #e3e5e9;
  --line-strong: #d2d5db;
  --text: #17181a;
  --muted: #62656c;
  --faint: #6b6e75; /* 4.6:1 on the page background, 5.1:1 on white */
  --dark: #141517;
  --accent: #1d6b45;        /* fairway green: the next thing to do, and good outcomes. 6.5:1 with white */
  --accent-strong: #17603d;
  --accent-soft: #e7f2eb;
  --critical: #c42b2b;
  --hover: rgba(20, 21, 23, .05);

  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* The footer sits at the bottom of the screen on short pages. */
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; width: 100%; }
body > .site-footer { width: 100%; }

.mono, .fig {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

:focus-visible { outline: 2px solid var(--dark); outline-offset: 3px; border-radius: 8px; }

.col { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 16px; padding-bottom: 64px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
[hidden] { display: none !important; }

.label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.title {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 6px 0 6px;
  overflow-wrap: anywhere;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}

/* ---- pills and buttons ---- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .55);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
}
a.pill:hover { background: var(--surface); }
.pill.brand { font-weight: 500; padding-left: 14px; }
.pill.brand img { width: 17px; height: 24px; object-fit: contain; }
.back-label { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .5);
  color: var(--text);
  border-radius: 13px;
  cursor: pointer;
}
.btn:hover { background: var(--surface); }
.btn:disabled { opacity: 0.6; cursor: default; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn-danger { color: var(--critical); border-color: #ecc4c4; }
.btn-danger:hover { background: #fdf3f3; }

.btn-ghost { border-color: transparent; background: transparent; font-weight: 400; }
.btn-ghost:hover { background: var(--hover); }
.btn-ghost.btn-danger:hover { background: #fdf3f3; }

.btn-small { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 11px; }

.icon-btn {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 11px;
  border: 0; background: transparent; color: var(--faint);
  font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

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

/* ---- page furniture ---- */
.top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 40px; }
.top-links { display: flex; gap: 8px; flex: none; }
.page-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.section { margin-top: 40px; }
.quiet-actions { margin-top: 40px; }
.lead { margin-bottom: 24px; }
.block { margin: 32px 0 40px; }
.page-title { font-size: 22px; font-weight: 500; margin-bottom: 8px; }
.section-title { font-size: 17px; font-weight: 500; margin-bottom: 8px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.text-input {
  height: 42px; font: inherit; background: var(--surface); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px;
}
.form-error { color: var(--critical); font-size: 14px; margin: 14px 0; }
.form-note { font-size: 13px; margin-top: 10px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 12px; }
.section-note { margin-bottom: 14px; }
.text-actions { display: flex; flex-wrap: wrap; gap: 0 20px; margin-top: 4px; }
.text-actions.form-gap { margin: 4px 0 0; }
.text-btn {
  min-height: 40px; padding: 0; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 500;
  color: var(--accent); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center;
}
.text-btn:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 4px; }
.text-btn:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; border-radius: 4px; }
.saved-note { color: var(--accent); font-size: 14px; font-weight: 500; margin-left: 8px; }
.saved-note::before { content: "✓ "; }
.page-foot { margin-top: 48px; display: grid; gap: 14px; justify-items: start; }
/* Home: the course library (and Pro, for those without it) sits at the bottom, just above the footer. */
main.home { display: flex; flex-direction: column; }
main.home > .page-foot { margin-top: auto; padding-top: 48px; }
.pro-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); text-decoration: none; }
.pro-line:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.pro-line .badge { margin-left: 0; vertical-align: 0; }
.badge.badge-pro { background: var(--accent); border-color: var(--accent); color: #fff; }
/* Sits up by the end of the name, like a power: Sam^PRO */
.badge.title-badge { margin-left: 0; vertical-align: text-top; position: relative; top: -0.3em; font-size: 9.5px; line-height: 1.5; padding: 1px 6px; text-decoration: none; letter-spacing: 0.06em; }
.badge.title-badge:hover { background: var(--accent-strong); }

.group-title {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 0 0 10px; font-size: 15px; font-weight: 500;
}
.group-sum { font-size: 13px; font-weight: 400; color: var(--muted); text-align: right; }

.title + .list, .title + .empty, .form-error + .list { margin-top: 20px; }
.empty { color: var(--muted); padding: 40px 24px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
.empty p + p { margin-top: 6px; }
.page-actions + .section, .title + .muted + .page-actions { margin-top: 24px; }

/* ---- login ---- */
.login { min-height: calc(100dvh - 90px); display: grid; place-content: center; justify-items: center; text-align: center; }
.login .crest { width: 110px; height: auto; margin-bottom: 20px; }
.login .label + .page-title { margin-top: 6px; }
.login-title { font-size: 36px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.login .muted { margin: 10px 0 28px; max-width: 34ch; }
.login .form-error { margin: -12px 0 16px; }
.center-actions { display: flex; gap: 10px; justify-content: center; }

/* ---- lists of rows (groups, games, members, courses) ---- */
.list { list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 6px; }
.list > li + li { border-top: 1px solid var(--line); }

.row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  text-decoration: none;
  transition: background 0.15s;
}
a.row:hover { background: var(--field); }
.row.static { grid-template-columns: auto minmax(0, 1fr) auto; border-radius: 0; }

.tile {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 600; font-size: 15px; color: var(--muted);
}
.tile.mono { font-size: 13px; font-weight: 500; }
.date-tile { line-height: 1.05; font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; align-content: center; gap: 1px; }
.date-tile b { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--text); font-family: var(--mono); }

.row-text { display: grid; gap: 1px; min-width: 0; }
.row-name { font-weight: 500; overflow-wrap: anywhere; }
.row-meta { font-size: 13px; color: var(--muted); }
.row-fig { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); text-align: right; }
.row-fig b { color: var(--text); font-weight: 500; margin-left: 4px; }
.row-lead { display: grid; justify-items: end; line-height: 1.2; }
.row-lead span { font-size: 12px; color: var(--muted); }
.row-lead b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 500; }
.chev { color: var(--faint); font-size: 20px; line-height: 1; margin-left: -4px; }

/* ---- forms ---- */
.stack .card + .group-title, .stack .form-note + .group-title, .stack .text-actions + .group-title { margin-top: 28px; }
.form-card { padding: 18px 18px 6px; }

.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field-row label { min-width: 0; }

:is(dialog, .form-card) label:not(.check) { display: block; margin-bottom: 14px; font-size: 13px; color: var(--muted); }
:is(dialog, .form-card) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  display: block; width: 100%; min-width: 0; margin-top: 6px;
  font: inherit; line-height: 24px; color: var(--text);
  background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
:is(dialog, .form-card) :is(input, select, textarea):focus { background: var(--surface); border-color: var(--line-strong); }
/* iOS Safari draws date inputs natively (own width, height and centring) unless
   appearance is reset; after that it sizes like any other field. */
:is(dialog, .form-card) input[type="date"] { -webkit-appearance: none; appearance: none; height: 46px; text-align: left; }
:is(dialog, .form-card) input[type="date"]::-webkit-date-and-time-value { text-align: left; }
:is(dialog, .form-card) select {
  -webkit-appearance: none; appearance: none; height: 46px; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2362656c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.narrow { max-width: 180px; }
/* A sentence with drop-downs in it ("Count each player's best [3] rounds"). */
.inline-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text); margin-top: 10px; }
.inline-sel select { display: inline-block !important; width: auto !important; margin-top: 0 !important; }
/* Fields show focus with their own border, not the page-wide outline ring. */
:is(dialog, .form-card) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible { outline: none; border-color: var(--dark); }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); cursor: pointer; min-width: 0; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; flex: none; accent-color: var(--dark); }
.code-input { text-transform: uppercase; letter-spacing: 0.2em; font-family: var(--mono) !important; }

.rounds { list-style: none; display: grid; gap: 10px; margin-bottom: 14px; }
.round-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 36px; gap: 8px; align-items: center; }
.round-row select { margin-top: 0 !important; }
.round-num { color: var(--muted); font-size: 13px; }
.rounds .round-row:only-child { grid-template-columns: 28px minmax(0, 1fr); }
.rounds .round-row:only-child [data-remove-round] { display: none; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 12px; }
.list + .row-actions { margin: 12px 0 0; }
.faint-link { color: var(--muted); font-size: 14px; text-underline-offset: 3px; }

.players { list-style: none; }
.player-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 12px; align-items: center; padding: 8px 0; }
.players .player-row + .player-row { border-top: 1px solid var(--line); }
.player-row input { margin-top: 0 !important; }
.hi-input { text-align: right; font-family: var(--mono) !important; }
.sub-label { font-size: 13px; color: var(--muted); margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--line); }

.segmented { border: 0; display: flex; align-items: center; gap: 18px; margin: 2px 0 6px; }
.segmented legend { float: left; margin-right: 6px; font-size: 13px; color: var(--muted); }
.segmented label { display: inline-flex !important; align-items: center; gap: 8px; margin: 0 !important; font-size: 15px !important; color: var(--text) !important; cursor: pointer; }

.holes-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding-bottom: 16px; }
.holes-table { width: 100%; border-collapse: collapse; }
.holes-table th { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--faint); text-align: center; padding: 0 0 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.holes-table tbody th { font-size: 13px; color: var(--muted); width: 34px; }
.holes-table td { padding: 3px; }
.holes-table input { margin-top: 0 !important; height: 40px; padding: 0 !important; text-align: center; font-family: var(--mono) !important; }

/* ---- tabs ---- */
.tabs {
  display: flex; gap: 4px; width: max-content; max-width: 100%;
  margin: 20px 0 16px; padding: 4px;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .55);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px; flex: none;
  border-radius: 12px; font-size: 14px; text-decoration: none; color: var(--muted);
}
.tab:hover { color: var(--text); background: var(--hover); }
.tab.is-active { background: var(--dark); color: #fff; }

/* ---- leaderboard ---- */
.board-card { padding: 6px; }
.board { list-style: none; }
.board-head, .board-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) repeat(var(--rounds), 40px) 56px;
  align-items: center; gap: 12px; padding: 12px;
}
.board-head { padding: 10px 12px 2px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.board-row + .board-row { border-top: 1px solid var(--line); }
.board .num { text-align: right; }
.board .rcol { color: var(--muted); font-size: 14px; }
.board .total { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.rank {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  background: var(--field); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px; font-weight: 500; color: var(--muted);
}
.is-leader .rank { background: var(--dark); color: #fff; box-shadow: none; }
.rmeta { display: none; }

/* ---- scorecard: one hole at a time ---- */
.hole-card { padding: 16px 18px 18px; }
.hole-nav { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; }
.nav-btn {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--field);
  font-size: 30px; line-height: 1; text-decoration: none; color: var(--text);
}
.nav-btn:hover { background: var(--surface); border-color: var(--line-strong); }
.nav-btn[aria-disabled="true"] { opacity: .3; pointer-events: none; }
.hole-info { text-align: center; }
.hole-num { font-size: 52px; font-weight: 500; line-height: 1.05; letter-spacing: -0.04em; }
.hole-meta { font-size: 14px; color: var(--muted); }

.hole-players { list-style: none; margin-top: 14px; border-top: 1px solid var(--line); }
.hp { display: grid; grid-template-columns: minmax(0, 1fr) auto 46px; gap: 12px; align-items: center; padding: 12px 0; }
.hp + .hp { border-top: 1px solid var(--line); }
.hp-who { display: grid; min-width: 0; }
.hp-who .row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 22px; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.stepper button:hover { background: var(--field); }
.stepper button:active { transform: scale(.96); }
.stepper input {
  width: 50px; height: 50px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--field); color: var(--text);
  font-family: var(--mono); font-size: 22px; font-weight: 500; text-align: center;
  -webkit-appearance: none; appearance: none; transition: border-radius 0.15s;
}
.stepper input::placeholder { color: var(--line-strong); }
.stepper input:focus { outline: none; border-color: var(--dark); background: var(--surface); }
.stepper input.is-saving { border-style: dashed; }
.stepper input.is-error { border-color: var(--critical); }
/* Scorecard marks on the entry box itself: circles under par, squares over. */
.mk-input.birdie, .mk-input.eagle { border-radius: 50%; border-color: var(--text); }
.mk-input.eagle { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }
.mk-input.bogey, .mk-input.double { border-radius: 6px; border-color: var(--text); }
.mk-input.double { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }

.hp-pts { display: grid; justify-items: end; line-height: 1.1; }
.hp-pts b { font-size: 20px; font-weight: 500; }
.hp-pts small { font-size: 11px; color: var(--faint); font-family: var(--mono); }

.hole-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.save-state { font-size: 13px; color: var(--faint); }
.save-state.is-error { color: var(--critical); }

/* ---- scorecard: you first, then your playing partners live ---- */
.hp.is-me { margin: 0 -10px; padding: 12px 10px 14px; border-radius: 16px; background: var(--field); }
.hp.is-me + .hp { border-top: 0; }
.score-box {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface);
  font-family: var(--mono); font-size: 22px; font-weight: 500; color: var(--text);
}
.score-box:empty::after { content: "–"; color: var(--line-strong); }
.partners-label {
  display: flex; align-items: center; gap: 8px; margin: 16px 0 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2f9e5b; box-shadow: 0 0 0 3px rgba(47, 158, 91, .15); }
.partners-label .live-dot { animation: live-pulse 2s ease-in-out infinite; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 5px rgba(47, 158, 91, .06); } }
@media (prefers-reduced-motion: reduce) { .partners-label .live-dot { animation: none; } }
.partners { margin-top: 4px; border-top: 0; }

.my-stats { grid-column: 1 / -1; display: grid; margin-top: 6px; }
.stat-group { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.stat-group:last-child { padding-bottom: 2px; }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stat-subhead { min-height: 0; margin-top: 4px; }
.stat-hint { font-size: 12px; color: var(--muted); }
.counter-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.tee-options { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 6px; }
.tee-option { position: relative; min-width: 0; }
.tee-option input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tee-option > span {
  display: grid; place-items: center; height: 44px; padding: 0 2px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: 500;
  white-space: nowrap; font-variant-numeric: tabular-nums; user-select: none; -webkit-user-select: none;
}

.band-row .tee-option > span { font-size: 13.5px; letter-spacing: -0.01em; }
.tee-option input:checked + span { background: var(--dark); border-color: var(--dark); color: #fff; }
.tee-option.is-good input:checked + span { background: var(--accent); border-color: var(--accent); }
.tee-option input:focus-visible + span { outline: 2px solid var(--dark); outline-offset: 2px; }
.tee-option input:disabled + span { opacity: .5; }
.club-select {
  width: 100%; height: 44px; padding: 0 36px 0 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background-color: var(--surface); color: var(--muted);
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2362656c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.club-select.is-set { color: var(--text); border-color: var(--dark); }
.club-select:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }
.counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px 0 2px; border-top: 1px solid var(--line); }
.counter { display: grid; gap: 8px; min-width: 0; }
.counter-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px; }
.counter-row button {
  display: grid; place-items: center; width: 100%; height: 44px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 18px; line-height: 1; cursor: pointer; touch-action: manipulation;
}
.counter-row button:active { transform: scale(.96); }
.counter-row input {
  width: 100%; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  font-family: var(--mono); font-size: 17px; font-weight: 500; text-align: center; color: var(--text);
  -webkit-appearance: none; appearance: none;
}
.counter-row input::placeholder { color: var(--line-strong); }
.counter-row input:focus { outline: none; border-color: var(--dark); }
.counter-row input.is-saving { border-style: dashed; }

/* ---- settings ---- */
.setting-card { padding: 16px 18px; display: grid; gap: 12px; justify-items: start; }
.setting-card p { color: var(--muted); font-size: 15px; }
.setting-row { padding: 12px 0 10px; border-top: 1px solid var(--line); margin-top: 6px; }
.setting-row .form-note { margin-top: 4px; }
.quiet-links { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---- group stats ---- */
.part-title { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); }
.part-title + .section, .part-title + .empty { margin-top: 16px; }
.bar-row.is-you .bar-fill { background: var(--accent); }
.bar-row.is-you .bar-label, .bar-row.is-you .bar-value { font-weight: 600; }
.group-stats-foot { margin-top: 32px; text-align: center; }

/* ---- stats ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 20px; }
.section .tiles { margin-top: 0; }
.tiles.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile-stat { display: grid; gap: 2px; align-content: start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.tile-label { font-size: 13px; color: var(--muted); }
.tile-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.tile-sub { font-size: 12.5px; color: var(--faint); }
.stats-empty { margin-top: 20px; }

.tips { list-style: none; display: grid; gap: 10px; }
.tip { display: grid; gap: 3px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.tip b { font-weight: 600; }
.tip span { color: var(--muted); font-size: 15px; }

.badge {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; vertical-align: 2px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  background: var(--dark); color: #fff;
}
.coach-card { padding: 18px; display: grid; gap: 10px; }
.coach-headline { font-size: 18px; font-weight: 500; line-height: 1.4; }
.coach-card .sub-label { margin: 6px 0 0; padding-top: 10px; }
.coach-strengths, .coach-focus { padding-left: 20px; display: grid; gap: 10px; }
.coach-strengths li { color: var(--muted); }
.coach-focus li { padding-left: 2px; }
.coach-focus li::marker { font-family: var(--mono); color: var(--muted); }
.coach-focus b { display: block; font-weight: 600; }
.coach-focus span { display: block; color: var(--muted); font-size: 15px; }
.coach-practice { margin-top: 4px; color: var(--text) !important; }
.coach-practice em { font-style: normal; font-weight: 600; }
.coach-note, .coach-meta, .coach-privacy, .coach-limit { font-size: 13px; }
.coach-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 4px; }
.coach-form .btn[aria-busy="true"] { opacity: .7; }
.coach-privacy { border-top: 1px solid var(--line); padding-top: 10px; }

.chart-card { padding: 14px 18px; }
.bars { list-style: none; display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 56px; align-items: center; gap: 12px; min-height: 40px; }
.bar-label { font-size: 15px; line-height: 1.25; }
.bar-label small { display: block; font-size: 12px; color: var(--faint); }
.bar-track { position: relative; height: 12px; background: var(--field); border-radius: 4px; }
.bar-zero { position: absolute; top: -6px; bottom: -6px; width: 1px; background: var(--line-strong); }
.bar-fill { position: absolute; top: 0; bottom: 0; background: #2c2e33; border-radius: 0 4px 4px 0; transition: opacity .15s; }
.bar-fill.is-neg { border-radius: 4px 0 0 4px; }
.bar-row:hover .bar-fill { opacity: .8; }
.bar-value { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.stat-empty { font-size: 14px; padding: 8px 0; }

.grid .stat-row th, .grid .stat-row td { color: var(--muted); font-size: 12px; padding-top: 5px; padding-bottom: 5px; }
.grid .stat-row th:first-child { font-family: var(--mono); font-weight: 400; font-size: 11px; color: var(--muted); padding-left: 24px; }

/* ---- home ---- */
.home-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.tile-link { text-decoration: none; transition: border-color .15s; }
a.group-sum { text-decoration: none; color: var(--muted); }
a.group-sum:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.page-actions + .list, .page-actions + .empty, .page-actions + .card { margin-top: 20px; }
.tile-link:hover { border-color: var(--line-strong); }
.section-gap { margin-top: 32px; }

/* ---- your card, on your own ---- */
.round-sum { font-size: 15px; margin: 0 0 10px; color: var(--text); }
.section-tight + .section-tight { margin-top: 24px; }

/* ---- coach ---- */
.coach-writing { display: flex; align-items: flex-start; gap: 10px; color: var(--muted); font-size: 15px; }
.coach-writing .spinner { margin-top: 3px; }
.pro-writing { margin-top: 12px; }
.spinner { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Cavemen Pro ---- */
.paywall { display: grid; gap: 12px; justify-items: start; margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); }
.paywall p { font-size: 15px; color: var(--text); }
.pro-card { padding: 6px 18px; }
.pro-list { list-style: none; }
.pro-list li { display: grid; gap: 2px; padding: 12px 0; }
.pro-list li + li { border-top: 1px solid var(--line); }
.pro-list b { font-weight: 500; }
.pro-list span { color: var(--muted); font-size: 14px; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan { display: grid; gap: 4px; align-content: start; padding: 16px; }
.plan.is-best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-price b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.plan-price span { color: var(--muted); font-size: 14px; }
.plan-note { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.plan .btn { width: 100%; }
.notice { color: var(--accent); font-weight: 500; margin: -4px 0 10px; }
.code-input { text-transform: uppercase; letter-spacing: 0.04em; flex: 1 1 160px; max-width: 260px; }
.tile-pro { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-size: 12px; font-weight: 600; }

/* ---- swipe a row to delete ---- */
.swipe { position: relative; overflow: hidden; border-radius: 14px; }
.swipe > .row, .swipe > .swipe-row { position: relative; z-index: 1; background: var(--surface); touch-action: pan-y; transition: transform .22s ease; }
.swipe.is-dragging > .row, .swipe.is-dragging > .swipe-row { transition: none; }
.swipe-action { position: absolute; top: 0; right: 0; bottom: 0; display: flex; opacity: 0; }
.swipe.is-dragging .swipe-action, .swipe.is-open .swipe-action, .swipe:has(.swipe-delete:focus-visible) .swipe-action { opacity: 1; }
.swipe-delete {
  width: 88px; border: 0; background: var(--critical); color: #fff;
  font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.swipe:has(.swipe-delete:focus-visible) > .row { transform: translateX(-88px); }
.swipe-delete:focus-visible { outline: 2px solid var(--dark); outline-offset: -4px; }
.swipe-hint { margin-top: 10px; }
@media (hover: hover) and (pointer: fine) { .swipe-hint { display: none; } }

/* ---- account: which stats ---- */
.stat-picker fieldset { border: 0; min-width: 0; display: grid; gap: 2px; }
.stat-picker legend { margin: 0 0 6px; padding: 0; }
.stats-level { display: grid; gap: 4px; padding-bottom: 14px; }
.choice { display: flex !important; gap: 12px; align-items: flex-start; padding: 8px 0; margin: 0 !important; cursor: pointer; color: var(--text) !important; font-size: 15px !important; }
.choice input { margin-top: 3px; }
.choice span { display: grid; gap: 1px; }
.choice small { font-size: 13px; color: var(--muted); }
.stats-level p { margin-top: 6px; }

/* ---- handicap chart ---- */
.index-chart { margin: 0; padding: 14px 14px 10px; }
.index-chart svg { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; overflow: visible; }
.index-chart .era text.end { text-anchor: end; }
.counting-key { font-weight: 600; color: var(--text); }
.diff-chip {
  display: inline-grid; place-items: center; min-width: 48px; height: 30px; padding: 0 8px; border-radius: 9px;
  font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums;
  background: var(--field); border: 1px solid var(--line); color: var(--text);
}
.diff-chip.is-counting { background: #2c2e33; border-color: #2c2e33; color: #fff; }
.imported-card { padding: 14px 16px; margin-top: 10px; }
.imported-title { font-size: 15px; font-weight: 500; margin-bottom: 10px; }
.diff-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.index-chart .tick line { stroke: var(--line); stroke-width: 1; }
.index-chart .tick text, .index-chart .era text { font-family: var(--mono); font-size: 10.5px; fill: var(--muted); text-anchor: end; }
.index-chart .era text { text-anchor: start; }
.index-chart .era line { stroke: var(--line-strong); stroke-width: 1; }
.index-line { fill: none; stroke: #2c2e33; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dot .hit { fill: transparent; }
.dot .mark { fill: #c3c6cd; stroke: var(--surface); stroke-width: 2; }
.dot.is-counting .mark { fill: #2c2e33; }
.dot:hover .mark, .dot:focus .mark { r: 6; }
.dot:focus { outline: none; }
.dot:focus-visible .hit { stroke: var(--dark); stroke-width: 1.5; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key-line { display: inline-block; width: 16px; height: 2px; border-radius: 2px; background: #2c2e33; }
.key-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #c3c6cd; }
.key-dot.is-counting { background: #2c2e33; }
.fine-print { margin-top: 32px; }

/* ---- course hole averages ---- */
.course-avg + .course-avg { margin-top: 10px; }
.course-avg summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.course-avg summary::-webkit-details-marker { display: none; }
.course-avg[open] summary .chev { transform: rotate(90deg); }
.course-avg .form-note { padding: 0 16px 14px; }
.avg-table { width: calc(100% - 32px); margin: 0 16px; border-collapse: collapse; font-size: 14px; }
.avg-table th, .avg-table td { padding: 7px 4px; text-align: left; border-top: 1px solid var(--line); }
.avg-table thead th { font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-top: 0; }
.avg-table tbody th { font-family: var(--mono); font-weight: 500; }
.avg-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.avg-table .is-worst { background: var(--field); }
.avg-table .is-worst td.num:nth-child(5) { font-weight: 600; }

/* ---- scorecard: the whole card ---- */
.grid-card { margin-top: 16px; overflow: hidden; }
.grid-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.grid { border-collapse: collapse; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; min-width: 100%; }
.grid th, .grid td { text-align: center; padding: 7px 1px; min-width: 28px; border-bottom: 1px solid var(--line); }
.grid tbody tr:last-child > * { border-bottom: 0; }
.grid thead th { color: var(--faint); font-weight: 400; font-size: 12px; }
.grid .par-row td, .grid .par-row th { color: var(--faint); font-size: 12px; }
.grid th:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface);
  text-align: left; padding-left: 14px; padding-right: 10px;
  font-family: var(--sans); font-size: 14px; font-weight: 500; color: var(--text);
  max-width: 104px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grid thead th:first-child, .grid .par-row th { color: var(--faint); font-weight: 400; font-size: 12px; font-family: var(--mono); }
.grid .sub { background: var(--field); font-weight: 500; color: var(--text); min-width: 34px; }
.grid thead .sub, .grid .par-row .sub { color: var(--muted); }
.grid .pts { font-weight: 600; min-width: 36px; padding-right: 10px; }
.grid .is-current { background: var(--hover); }
.grid td a { display: block; text-decoration: none; border-radius: 8px; }
.grid td a:hover { background: var(--hover); }

.mk { display: inline-grid; place-items: center; width: 24px; height: 24px; }
.mk.birdie, .mk.eagle { border: 1px solid var(--text); border-radius: 50%; }
.mk.eagle { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }
.mk.bogey, .mk.double { border: 1px solid var(--text); border-radius: 4px; }
.mk.double { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--text); }
.legend-note { font-size: 12px; margin: 12px 4px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.legend-note .mk { width: 20px; height: 20px; font-family: var(--mono); font-size: 11px; color: var(--text); }

/* ---- dialog ---- */
dialog {
  margin: auto;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 24px 60px -24px rgba(20, 21, 23, .35);
  padding: 24px; width: min(480px, 92vw);
}
dialog::backdrop { background: rgb(20 21 23 / 0.25); backdrop-filter: blur(2px); }
.dialog-title { font-size: 18px; font-weight: 500; margin-bottom: 16px; }
.dialog-lead { font-size: 14px; margin: -8px 0 16px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dialog-actions .btn-primary { order: 3; }
.dialog-actions [data-close] { order: 2; }
.dialog-extra { order: 1; display: flex; margin-right: auto; }
.dialog-extra .btn { border-color: transparent; background: transparent; padding: 0 10px; font-weight: 400; color: var(--muted); }
.dialog-extra .btn:hover { background: var(--field); color: var(--text); }
dialog .players { margin-top: -4px; }
.invite-code {
  font-size: 30px; font-weight: 500; letter-spacing: 0.22em; text-align: center;
  padding: 14px 0 14px 0.22em; margin-bottom: 16px;
  background: var(--field); border: 1px solid var(--line); border-radius: 16px;
}

/* ---- footer (matches samuelwiseman.com) ---- */
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
  margin-top: 24px; padding-top: 22px; padding-bottom: 32px;
  border-top: 1px solid var(--line);
  color: var(--faint); font-size: 13px;
}
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 561px) {
  .board-head .rcol, .board-row .rcol { display: block; }
}
@media (max-width: 560px) {
  .board-head, .board-row { grid-template-columns: 38px minmax(0, 1fr) 56px; }
  .board .rcol { display: none; }
  .rmeta { display: inline; }
  .holes-card { gap: 12px; }
}

@media (max-width: 480px) {
  .top { margin-bottom: 28px; gap: 8px; }
  .top-links { gap: 6px; }
  .pill { height: 42px; padding: 0 12px; border-radius: 14px; font-size: 14px; gap: 6px; }
  .pill.brand { padding-left: 10px; }
  .top-busy .pill.brand { padding: 0 12px; }
  .top-busy .pill.brand > span { display: none; }
  .back-label { max-width: 150px; }
  .title { font-size: 28px; }
  .list, .board-card { padding: 4px; }
  .row { gap: 12px; padding: 12px 10px; }
  .chev { display: none; }
  .row.static, a.row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .board-head, .board-row { gap: 10px; padding: 12px 10px; }
  .form-card { padding: 16px 14px 4px; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dialog { padding: 20px; }
  .hole-card { padding: 14px 14px 16px; }
  .hp { gap: 8px; }
  .stepper { gap: 4px; }
  .stepper button { width: 38px; height: 38px; font-size: 20px; }
  .stepper input { width: 46px; height: 46px; font-size: 20px; }
  .hp-pts { width: 40px; }
  .hp { grid-template-columns: minmax(0, 1fr) auto 36px; }
  .score-box { width: 46px; height: 46px; font-size: 20px; }
  .home-tiles { gap: 8px; }
  .section { margin-top: 32px; }
  .bar-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label value" "track track"; gap: 4px 10px; padding: 4px 0; }
  .bar-label { grid-area: label; }
  .bar-label small { display: inline; margin-left: 6px; }
  .bar-track { grid-area: track; }
  .bar-value { grid-area: value; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile-stat { padding: 12px 14px; border-radius: 16px; }
  .tile-value { font-size: 24px; }
  .chart-card { padding: 12px 14px; }
}
@media (max-width: 380px) {
  .brand-tail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---- format, match play and side games ---- */
.form-card label.tee-option { margin: 0; font-size: inherit; color: inherit; }
.format-options { margin-bottom: 8px; }
.format-note { margin-top: 2px; }
.pro-lock { margin-top: 4px; color: var(--muted); }
.new-game:not(.is-match) .side-pick { display: none !important; }
.new-game.is-match .player-row { grid-template-columns: minmax(0, 1fr) 76px 84px; }
.side-pick { height: 44px; padding: 0 10px; margin: 0 !important; }

.match-card { padding: 18px; }
.match + .match { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.match-total { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.match-round { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.match-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.match-side { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.match-side.side-b { justify-content: flex-end; text-align: right; }
.match-side.is-up { color: var(--text); font-weight: 600; }
.match-score { font-size: 22px; font-weight: 600; padding: 6px 12px; border-radius: 12px; background: var(--field); white-space: nowrap; }
.match-line { text-align: center; color: var(--muted); font-size: 14px; margin-top: 10px; }
.key { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.key-a { background: var(--accent); }
.key-b { background: var(--dark); }
.match-holes { list-style: none; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; margin-top: 14px; }
.mh { display: grid; place-items: center; height: 30px; border-radius: 7px; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--faint); }
.mh-a { background: var(--accent); border-color: var(--accent); color: #fff; }
.mh-b { background: var(--dark); border-color: var(--dark); color: #fff; }
.mh-halved { background: var(--field); border-color: var(--line-strong); color: var(--muted); }

.match-now { text-align: center; font-size: 14.5px; font-weight: 500; color: var(--accent); margin-top: 10px; }
.hp-side b { font-size: 16px; }
.side-now:empty { display: none; }
.side-game { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.side-title { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.side-options { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); }
.side-options .tee-option > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-winner { color: var(--accent); font-weight: 500; }
.field-row.side-row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; }
.side-fig { font-size: 15px; text-align: right; }

/* ---- home: start, your last round ---- */
.btn-hero { display: flex; width: 100%; justify-content: center; align-items: center; min-height: 58px; font-size: 18px; border-radius: 16px; margin-top: 22px; }
.last-card { display: block; padding: 18px; text-decoration: none; color: inherit; }
a.last-card:hover { border-color: var(--line-strong); }
.last-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.last-course { font-size: 18px; font-weight: 500; }
.last-sub { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.last-score { display: flex; gap: 22px; margin-top: 14px; }
.last-score > span, .mini > span { display: flex; flex-direction: column; }
.last-score b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.last-score small, .mini small { font-size: 12.5px; color: var(--muted); }
.mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.mini b { font-size: 17px; font-weight: 500; }
.one-round [data-remove-round], .one-round .round-num { display: none; }
.rounds.one-round .round-row, .rounds.one-round .round-row:only-child { grid-template-columns: minmax(0, 1fr); }

/* ---- filters ---- */
.chips { display: flex; gap: 8px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14.5px; color: var(--text); text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--line-strong); }
.chip.is-on { background: var(--dark); border-color: var(--dark); color: #fff; }
.chips + .list, .chips + .empty { margin-top: 16px; }
.stats-count { margin-top: 12px; }
.vs-other { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* ---- side game hole picker ---- */
.side-picker + .side-picker { margin-top: 4px; }
.hole-picks { margin: -4px 0 14px; }
.hole-picks-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.hole-pick-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 5px; }
.form-card label.hole-pick, .hole-pick { position: relative; margin: 0; font-size: inherit; color: inherit; }
.hole-pick input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.hole-pick span { display: grid; place-items: center; height: 36px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); font-family: var(--mono); font-size: 13px; }
.hole-pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.hole-pick input:focus-visible + span { outline: 2px solid var(--dark); outline-offset: 2px; }
.hole-pick input:disabled + span { opacity: .5; }

/* ---- home: trips and group tables ---- */
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--accent); text-transform: uppercase; }
.live-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); display: inline-block; }
.live-inline { font-size: 10px; }
.group-card { align-items: flex-start; }
.group-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.standings { display: block; margin-top: 8px; border-top: 1px solid var(--line); }
.standing { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; font-size: 15px; align-items: center; }
.standing + .standing { border-top: 1px solid var(--line); }
.standing .pos { color: var(--muted); font-size: 13px; }
.standing.me { font-weight: 600; }
.standing.me .pts { color: var(--accent); }
.today-card { display: block; padding: 16px 18px; margin-top: 18px; text-decoration: none; color: inherit; border-color: var(--accent) !important; }
.today-card b { display: block; font-weight: 500; font-size: 16px; margin-top: 6px; }
.today-card .day-meta { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.today-card .go { display: block; color: var(--accent); font-weight: 500; font-size: 14.5px; margin-top: 8px; }
.setup-note { margin-top: 14px; margin-bottom: 24px; font-size: 14px; }
.title + .new-game { margin-top: 22px; }
.stack .card + .format-area { margin-top: 28px; }
/* Guests follow the players, with a line between. */
.players + .guest-list:not(:empty) { border-top: 1px solid var(--line); }
.guest-list:empty { display: none; }
.guest-list + .row-actions { margin-top: 12px; }
.pairings-sub { margin-bottom: 20px; }
.pairings-sub + .empty { margin-top: 0; }
.tick-card { padding: 4px 16px; }
.tick-card + .card { margin-top: 12px; }
.title + .new-game, .form-error + .new-game { margin-top: 22px; }
.tick-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; font-size: 15.5px; cursor: pointer; }
.tick-row + .tick-row { border-top: 1px solid var(--line); }
.tick-row input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.tick-row small { display: block; color: var(--muted); font-size: 13px; }
.group-hint { padding: 16px; margin-top: 16px; }
.group-hint b { font-weight: 500; }
.group-hint p.faint { font-size: 14px; margin-top: 2px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ---- leagues ---- */
.inline-sel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; color: var(--text); margin-top: 10px; }
.form-card .inline-sel select { width: auto; display: inline-block; margin: 0; min-width: 76px; }
.league-table { padding: 4px 18px 8px; }
.lt-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 40px 52px; gap: 10px; align-items: center; padding: 11px 0; font-size: 15.5px; }
.lt-row + .lt-row { border-top: 1px solid var(--line); }
.lt-head { font-size: 11.5px; color: var(--muted); font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 12px 0 8px; }
.lt-row .n { text-align: right; font-family: var(--mono); }
.lt-row small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.lt-row.me { font-weight: 600; }
.lt-row.me .n:last-child { color: var(--accent); }
.section-tight { margin-top: 20px; }

/* ---- trips ---- */
.trip-live { margin-top: 6px; }
.trip-live-area { margin-top: 18px; }
.team-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 18px; }
.team-banner .tn { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.team-banner .tn b { font-weight: 600; font-size: 16px; }
.team-banner .tn-b { justify-content: flex-end; text-align: right; }
.team-banner .ts { font-size: 26px; font-weight: 600; padding: 6px 14px; border-radius: 12px; background: var(--field); white-space: nowrap; }
.team-sub { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13.5px; }
.trip-table .tt-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) repeat(var(--days), 34px) 44px; gap: 8px; align-items: center; padding: 11px 0; font-size: 15px; }
.trip-table .tt-row + .tt-row { border-top: 1px solid var(--line); }
.trip-table .tt-row .n { text-align: right; font-family: var(--mono); }
.trip-table .tt-row.me { font-weight: 600; }
.trip-table .tt-row.me .n:last-child { color: var(--accent); }
.day-card { padding: 16px; }
.day-card + .day-card { margin-top: 10px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; text-decoration: none; color: inherit; }
.day-head b { font-weight: 500; font-size: 16px; }
.day-head span, .day-head .icon-btn { color: var(--muted); font-size: 12.5px; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.day-meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 9px 0; font-size: 14.5px; }
.pair + .pair { border-top: 1px solid var(--line); }
.pair .v { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.pair .r { text-align: right; }
.pair .st { grid-column: 1 / -1; font-size: 13px; color: var(--accent); font-weight: 500; text-align: center; }
.trip-days { list-style: none; display: grid; gap: 10px; }
.trip-days .day-head { margin-bottom: 12px; }
.add-day { display: block; width: 100%; text-align: center; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 16px; color: var(--accent); font: inherit; font-weight: 500; background: transparent; cursor: pointer; margin-top: 10px; }
.trip-player { grid-template-columns: minmax(0, 1fr) 112px 76px; }
.trip-player.guest-row { grid-template-columns: minmax(0, 1fr) 112px 76px; }
.team-pick { height: 44px; margin: 0 !important; padding: 0 8px; }
.pairings { list-style: none; display: grid; gap: 10px; }
.pairing { padding: 14px 16px; }
.pairing .sub-label { margin: 0 0 8px; padding-top: 0; border-top: 0; }
.pairing-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; }
.pairing-side { display: grid; gap: 6px; }
.pairing-side select { margin-top: 0 !important; }
.pairing-row .v { color: var(--muted); font-family: var(--mono); font-size: 12px; }

/* ---- trip reports (Pro) ---- */
.reports { display: grid; gap: 10px; }
.report-card, .report-pitch { padding: 18px 20px; }
.report-day { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.report-headline { display: block; font-size: 21px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; margin: 6px 0 10px; }
.report-p { font-size: 15.5px; line-height: 1.55; }
.report-p + .report-p { margin-top: 10px; }
.awards { list-style: none; display: grid; gap: 12px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.awards li { display: grid; gap: 1px; }
.award-title { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.awards b { font-weight: 500; }
.awards small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.report-card .text-actions { margin-top: 12px; }
details.report-card summary { list-style: none; cursor: pointer; display: grid; }
details.report-card summary::-webkit-details-marker { display: none; }
details.report-card summary .report-headline { font-size: 17px; margin: 4px 0 0; }
details.report-card[open] summary .report-headline { margin-bottom: 10px; }
.report-card.is-locked + .report-card.is-locked .report-headline { font-size: 17px; }
.report-teaser { font-size: 15.5px; line-height: 1.55; margin-bottom: 12px; -webkit-mask-image: linear-gradient(#000 25%, transparent); mask-image: linear-gradient(#000 25%, transparent); }
.report-pitch p { font-size: 15px; line-height: 1.5; }
.report-pitch p + p { margin-top: 6px; }
.report-pitch .row-actions { margin: 12px 0 0; }
#reports form.text-actions .text-btn { text-align: left; }

/* ---- set-up: today's round, unless it was played on another day ---- */
.date-other { padding-top: 2px; }
.form-card .date-field input { max-width: 240px; }

/* A note that ends a card gets the same room as a field would. */
.form-card > .form-note:last-child { margin-bottom: 14px; }
/* "+ Add a day" sits apart from what follows. */
.add-day + .card { margin-top: 14px; }
.stack .add-day + .group-title { margin-top: 28px; }

/* ---- guests you can swipe away (a × on computers) ---- */
.guest-swipe { border-radius: 0; }
.players .guest-swipe + .guest-swipe, .players .player-row + .guest-swipe { border-top: 1px solid var(--line); }
.guest-x { display: none; }
@media (hover: hover) and (pointer: fine) {
  .guest-x {
    display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 9px;
    background: none; color: var(--muted); font: inherit; font-size: 20px; line-height: 1; cursor: pointer;
  }
  .guest-x:hover { background: var(--field); color: var(--text); }
  .guest-swipe .swipe-action { display: none; }
  .guest-x:focus-visible { outline: 2px solid var(--dark); outline-offset: 1px; }
  .guest-row { grid-template-columns: minmax(0, 1fr) 84px 32px; }
  .new-game.is-match .guest-row { grid-template-columns: minmax(0, 1fr) 76px 84px 32px; }
  .trip-player.guest-row { grid-template-columns: minmax(0, 1fr) 112px 76px 32px; }
}

/* ---- side games: a button each; the settings open under it ---- */
.side-toggles { margin-bottom: 4px; }
.side-picker { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-picker + .side-picker { margin-top: 10px; }
.side-picker-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.side-mode-hidden { display: none !important; }
.field-row.side-row.side-row-one { grid-template-columns: minmax(0, 1fr); }
.side-games-block { margin-bottom: 14px; }

/* ---- trips: fixed teams, or new pairs each day (no teams to pick) ---- */
.trip-plan.is-players .team-only, .trip-plan.is-players .team-pick { display: none !important; }
.trip-plan:not(.is-players) .players-only { display: none; }
.team-only .side-row { margin-top: 14px; }
.trip-plan.is-players .trip-player { grid-template-columns: minmax(0, 1fr) 76px; }
.trip-plan.is-players .trip-player.no-hi { grid-template-columns: minmax(0, 1fr); }
@media (hover: hover) and (pointer: fine) {
  .trip-plan.is-players .trip-player.guest-row { grid-template-columns: minmax(0, 1fr) 76px 32px; }
}
.match-table .wl { display: block; font-size: 12px; font-weight: 400; color: var(--muted); font-family: var(--mono); }
