:root {
  --bg: #f3f5f2;
  --card: #ffffff;
  --ink: #17221b;
  --muted: #5f6d64;
  --line: #dde3dd;
  --accent: #1f6f43;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0e7;
  --gold: #c58a12;
  --gold-soft: #fbf0d6;
  --danger: #b3261e;
  --eagle: #6a3fb5;
  --birdie: #c62828;
  --par: #17221b;
  --bogey: #1565c0;
  --double: #0d3c78;
  --shadow: 0 1px 2px rgba(20, 40, 25, .06), 0 2px 8px rgba(20, 40, 25, .05);
  --radius: 14px;
  --tabbar-h: 58px;
  --map-rough: #6fa862; --map-fw: #93cf7f; --map-green: #b9eba3; --map-tee: #a5d98f; --map-bunker: #f1e4bd; --map-water: #5ea9de; --map-edge: #3d6f37; --map-ink: #10200f; --map-halo: rgba(255, 255, 255, .85);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1411; --card: #19211c; --ink: #e8eee9; --muted: #9aa89f; --line: #2a352e;
    --accent: #4fb67c; --accent-ink: #062012; --accent-soft: #1d3326; --gold: #e2ab3b; --gold-soft: #3a2e14;
    --danger: #ef6b62; --eagle: #b593f2; --birdie: #ff7a70; --par: #e8eee9; --bogey: #6fb0ff; --double: #a9cdff;
    --shadow: none; color-scheme: dark;
    --map-rough: #2f4f2c; --map-fw: #436d3b; --map-green: #5f9450; --map-tee: #4f7f43; --map-bunker: #cbbd92; --map-water: #3a7cb0; --map-edge: #1c3119; --map-ink: #f2f7ef; --map-halo: rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  --bg: #0f1411; --card: #19211c; --ink: #e8eee9; --muted: #9aa89f; --line: #2a352e;
  --accent: #4fb67c; --accent-ink: #062012; --accent-soft: #1d3326; --gold: #e2ab3b; --gold-soft: #3a2e14;
  --danger: #ef6b62; --eagle: #b593f2; --birdie: #ff7a70; --par: #e8eee9; --bogey: #6fb0ff; --double: #a9cdff;
  --shadow: none; color-scheme: dark;
  --map-rough: #2f4f2c; --map-fw: #436d3b; --map-green: #5f9450; --map-tee: #4f7f43; --map-bunker: #cbbd92; --map-water: #3a7cb0; --map-edge: #1c3119; --map-ink: #f2f7ef; --map-halo: rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
[hidden] { display: none !important; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  min-height: 52px;
}
.topbar h1 { font-size: 19px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.2px; }
.topbar-right { display: flex; gap: 4px; }
.icon-btn {
  border: 0; background: transparent; padding: 6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); cursor: pointer; min-width: 38px; min-height: 38px;
}
.icon-btn:active { background: var(--accent-soft); }

main { max-width: 760px; margin: 0 auto; padding: 12px 16px 24px; outline: none; }

/* Tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 500; }
.tabbar svg { width: 25px; height: 25px; }
.tabbar a.active { color: var(--accent); }

/* Active round banner */
.active-round {
  position: sticky; top: calc(52px + env(safe-area-inset-top)); z-index: 15;
  max-width: 760px; margin: 8px auto 0; padding: 0 16px;
}
.active-round a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; box-shadow: var(--shadow);
}
.active-round a span { flex: 1; font-weight: 500; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Generic */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.pad { padding: 14px 16px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; margin: 22px 4px 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 54px; height: 54px; opacity: .5; }
.empty h3 { color: var(--ink); margin: 10px 0 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 11px 16px; border-radius: 12px; font-weight: 600; cursor: pointer; min-height: 44px;
  text-align: center;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1; }

input[type=text], input[type=search], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--card);
  min-height: 44px; appearance: none; -webkit-appearance: none;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin: 0 2px 5px; font-weight: 500; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg { display: flex; background: var(--line); border-radius: 11px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 6px; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); min-height: 38px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink); }
.badge.played { background: var(--accent-soft); color: var(--accent); }
.badge.wish { background: var(--gold-soft); color: var(--gold); }

/* Search */
.searchbar { position: relative; margin-bottom: 10px; }
.searchbar svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.searchbar input { padding-left: 38px; border-radius: 12px; }
.list-tools { display: flex; gap: 8px; margin: 8px 0 12px; }
.list-tools select { flex: 1; min-height: 38px; padding: 7px 10px; font-size: 14px; background-image: none; }
.count-line { font-size: 13px; color: var(--muted); margin: 0 4px 8px; }

/* Course list */
.course-list { display: grid; gap: 10px; }
.course-item { display: flex; gap: 12px; padding: 10px; align-items: center; color: var(--ink); position: relative; }
.course-item .thumb { width: 84px; height: 84px; border-radius: 10px; flex: none; }
.course-item h3 { margin: 0 0 3px; font-size: 16px; line-height: 1.25; }
.course-item .meta { font-size: 13px; color: var(--muted); }
.course-item .badges { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.star-btn { border: 0; background: transparent; padding: 8px; cursor: pointer; color: var(--line); align-self: flex-start; }
.star-btn svg { width: 24px; height: 24px; }
.star-btn.on { color: var(--gold); }
.ci-side { display: flex; flex-direction: column; align-items: center; align-self: stretch; }
.ci-side .star-btn { align-self: center; }
.map-ind { display: grid; place-items: center; width: 40px; height: 32px; color: var(--line); }
.map-ind svg { width: 24px; height: 24px; }
.map-ind.on { color: var(--accent, #2e7d4f); }

/* Aerial imagery */
.aerial { position: relative; overflow: hidden; background: #3d5a40; }
.aerial .tiles { position: absolute; left: 50%; top: 50%; }
.aerial .tiles img { position: absolute; width: 256px; height: 256px; max-width: none; display: block; }
.aerial .attrib { position: absolute; right: 6px; bottom: 4px; font-size: 10px; color: #fff; text-shadow: 0 0 3px #000; opacity: .85; }
.aerial .pin { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 0 0 2px rgba(0,0,0,.25); }

/* Course detail */
.hero { height: 230px; border-radius: var(--radius); margin: 0 0 12px; }
.hero-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff; }
.hero-cap h2 { margin: 0; font-size: 22px; line-height: 1.2; }
.hero-cap div { font-size: 14px; opacity: .9; }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.quick-actions a, .quick-actions button {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; font-size: 12px; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: var(--accent); cursor: pointer;
}
.quick-actions svg { width: 22px; height: 22px; }
.quick-actions .disabled { opacity: .35; pointer-events: none; }
.info-list { list-style: none; margin: 0; padding: 0; }
.info-list li { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); align-items: flex-start; }
.info-list li:first-child { border-top: 0; }
.info-list .k { width: 108px; flex: none; color: var(--muted); font-size: 14px; padding-top: 1px; }
.info-list .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.info-list .v .small { display: block; margin-top: 2px; }

.stars { display: inline-flex; gap: 2px; }
.stars { min-height: 44px; align-items: center; }
.stars button { border: 0; background: transparent; padding: 2px; cursor: pointer; color: var(--line); }
.stars button.on { color: var(--gold); }
.stars svg { width: 26px; height: 26px; display: block; }
.stars-static { color: var(--gold); font-size: 13px; letter-spacing: 1px; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); cursor: pointer; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .add { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; color: var(--accent); font-size: 13px; font-weight: 600; border: 2px dashed var(--line); background: transparent; }
.photo-grid .add svg { width: 26px; height: 26px; }
.credit { font-size: 11px; color: var(--muted); margin-top: 6px; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom); }
.lightbox img { max-width: 100%; max-height: 75vh; border-radius: 8px; }
.lightbox .cap { color: #ddd; font-size: 13px; margin: 10px 0; text-align: center; max-width: 600px; }
.lightbox .cap a { color: #9fe0b8; }
.lightbox .btn-row { width: 100%; max-width: 420px; }

/* Rounds list */
.round-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); }
.round-item + .round-item { border-top: 1px solid var(--line); }
.round-item .score { width: 56px; text-align: center; flex: none; }
.round-item .score b { display: block; font-size: 24px; line-height: 1; }
.round-item .score small { font-size: 12px; font-weight: 600; }
.round-item h3 { margin: 0; font-size: 15px; }
.vs-under { color: var(--birdie); }
.vs-over { color: var(--bogey); }
.vs-even { color: var(--accent); }
.month-head { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 4px 6px; }

/* Play (hole entry) */
.hole-strip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.hole-strip::-webkit-scrollbar { display: none; }
.hole-strip button {
  flex: none; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 700; cursor: pointer; color: var(--muted);
}
.hole-strip button.done { color: var(--ink); background: var(--accent-soft); border-color: transparent; }
.hole-strip button.cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.play-head { display: flex; align-items: baseline; justify-content: space-between; margin: 6px 2px 10px; }
.play-head h2 { margin: 0; font-size: 28px; letter-spacing: -.5px; }
.play-head .tot { text-align: right; font-size: 14px; color: var(--muted); }
.play-head .tot b { color: var(--ink); font-size: 18px; }
.entry { padding: 14px 16px; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry-label { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--accent);
  font-size: 30px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1;
}
.stepper button:active { transform: scale(.94); }
.stepper .val { flex: 1; text-align: center; font-size: 46px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stepper .val small { display: block; font-size: 13px; font-weight: 600; margin-top: 4px; }
.stepper.sm button { width: 44px; height: 44px; font-size: 24px; }
.stepper.sm .val { font-size: 30px; }
.opt-row { display: flex; gap: 8px; }
.opt-row button { flex: 1; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.opt-row button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.mate-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.mate-row .name { flex: 1; font-weight: 600; }
.play-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* Scorecard table */
.sc-wrap { overflow-x: auto; }
table.sc { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
table.sc th, table.sc td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--line); }
table.sc th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
table.sc td:first-child, table.sc th:first-child { text-align: left; padding-left: 14px; }
table.sc tr.sub td { background: var(--accent-soft); font-weight: 700; }
table.sc tr.tot td { background: var(--accent); color: var(--accent-ink); font-weight: 800; border: 0; }
.sc-score { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; font-weight: 700; }
.sc-score.eagle { border: 2px solid var(--eagle); border-radius: 50%; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--eagle); color: var(--eagle); }
.sc-score.birdie { border: 2px solid var(--birdie); border-radius: 50%; color: var(--birdie); }
.sc-score.bogey { border: 2px solid var(--bogey); border-radius: 3px; color: var(--bogey); }
.sc-score.double { border: 2px solid var(--double); border-radius: 3px; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--double); color: var(--double); }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat { padding: 12px 14px; }
.stat .lbl { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat .num { font-size: 28px; font-weight: 750; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.region-row { padding: 11px 16px; border-top: 1px solid var(--line); }
.region-row:first-child { border-top: 0; }
.region-row .row { margin-bottom: 6px; font-size: 15px; }
.dist { display: flex; height: 26px; border-radius: 8px; overflow: hidden; }
.dist i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: var(--c); vertical-align: -1px; }
.chart svg { width: 100%; height: auto; display: block; }
.simple-list a { display: flex; gap: 10px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line); color: var(--ink); }
.simple-list a:first-child { border-top: 0; }
.simple-list .r { color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; }

/* Data page */
.data-item { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-top: 1px solid var(--line); cursor: pointer; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; color: var(--ink); }
.data-item:first-child { border-top: 0; }
.data-item svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.data-item .grow b { display: block; font-weight: 600; }
.data-item .grow span { font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
ol.howto { margin: 0; padding: 14px 16px 14px 36px; }
ol.howto li + li { margin-top: 6px; }

/* Modal sheet */
.sheet-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet h3 { margin: 4px 0 12px; font-size: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- v2 additions ---------- */
.topbar h1 .logo { height: 42px; width: auto; display: block; margin: -2px 0; }
.topbar h1 picture { display: block; }
.aerial img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.loc-prompt { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 12px; text-align: left; cursor: pointer; color: var(--ink); border-color: var(--accent); }
.loc-prompt svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.loc-prompt b { display: block; }
.loc-prompt span.small { display: block; }
.tee-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; margin: 0 8px 4px 0; white-space: nowrap; }
.tee-pill i, .tee-pick i, .tee-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--tee); box-shadow: 0 0 0 1px rgba(0,0,0,.25); flex: none; }
.hole-facts { font-size: 15px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.tee-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tee-pick button { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 8px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.tee-pick button span { grid-column: 2; font-size: 12px; color: var(--muted); }
.tee-pick button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sc-teesel { padding-bottom: 4px; }
.sc-teesel label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 0 2px 6px; }
.tee-count { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; }
.sc-teesel-row { position: relative; }
.sc-teesel-row .tee-dot { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.sc-teesel-row select { padding-left: 34px; padding-right: 40px; border-color: var(--accent); }
.sc-teesel-row::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2.4px solid var(--accent); border-bottom: 2.4px solid var(--accent); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.sc-note { padding-top: 4px; padding-bottom: 6px; }
.tee-edit { display: grid; grid-template-columns: 14px 1.4fr 1fr 1fr 1fr auto; gap: 6px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tee-edit input, .tee-edit select { min-height: 38px; padding: 6px 8px; font-size: 14px; }
.tee-edit .icon-btn { color: var(--danger); }
table.sc.edit td { padding: 4px 3px; }
table.sc.edit input { width: 100%; min-width: 46px; min-height: 36px; padding: 4px; text-align: center; border-radius: 8px; font-size: 15px; }
.version-card { display: flex; gap: 12px; align-items: center; }
.version-card img { border-radius: 12px; }
#addrResults .simple-list a { cursor: pointer; }

/* Playing with: add players one at a time (v2.1) */
.pw-list { display: grid; gap: 6px; margin-bottom: 8px; }
.pw-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 600; }
.pw-row .icon-btn { min-width: 36px; min-height: 36px; font-size: 13px; color: var(--muted); }
.pw-row .icon-btn:disabled { opacity: .25; }
.pw-row .pw-rm { color: var(--danger); font-size: 16px; }
.pw-av { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.pw-empty { padding: 4px 2px 8px; }
.pw-form { display: flex; gap: 6px; margin-bottom: 8px; }
.pw-form input { flex: 1; }
.pw-form .btn { min-width: 46px; padding: 0 12px; }
.pw-err { color: var(--danger); font-size: 13px; margin: -2px 2px 8px; }
.pw-recent { display: flex; flex-wrap: wrap; gap: 6px; }
.pw-sugg { border: 1px dashed var(--muted); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 14px; cursor: pointer; color: var(--ink); }
.mate-row .pw-av { width: 28px; height: 28px; font-size: 12px; }

/* Tee-shot mishits (v2.2) */
.mis-label { font-size: 13px; color: var(--muted); font-weight: 600; margin: 12px 2px 6px; }
.mis-label span { font-weight: 400; }
.entry .opt-row + .mis-label { margin-top: 12px; }
.entry-label + .mis-label { margin-top: 0; }
.mis-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mis-row button { min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; }
.mis-row button.on { background: var(--bogey); border-color: var(--bogey); color: #fff; }
.tee-cell small { display: block; font-size: 10px; color: var(--bogey); font-weight: 600; line-height: 1.1; }
.mis-stat { display: grid; grid-template-columns: 70px 1fr 28px; gap: 10px; align-items: center; font-size: 14px; margin-top: 6px; }
.mis-stat b { text-align: right; }

/* Trouble (v2.3) */
.entry-hint { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.trb-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.trb-row button { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; cursor: pointer; }
.trb-row button.on { background: var(--gold); border-color: var(--gold); color: #fff; }
.tee-cell small.trb { color: var(--gold); }

/* Backup reminder (v3.1) */
.backup-due { margin-bottom: 12px; border-color: var(--gold); }
.backup-due svg { width: 24px; height: 24px; color: var(--gold); flex: none; }
.backup-due b { display: block; }
.backup-due .btn-row .btn { flex: 0 0 auto; }

/* Hole maps (v3.2) */
.hm-wrap { display: flex; justify-content: center; margin: 4px 0 10px; }
.hole-map { width: 100%; max-width: 360px; height: auto; max-height: 58vh; display: block; }
.hm-rough { fill: var(--map-rough); }
.hm-fairway { fill: var(--map-fw); }
.hm-green { fill: var(--map-green); stroke: var(--map-edge); stroke-width: .8; }
.hm-green.mine { stroke-width: 1.6; }
.hm-tee { fill: var(--map-tee); stroke: var(--map-edge); stroke-width: .6; }
.hm-bunker { fill: var(--map-bunker); stroke: rgba(0, 0, 0, .18); stroke-width: .6; }
.hm-water { fill: var(--map-water); }
.hm-line { fill: none; stroke: #fff; stroke-width: 1.6; stroke-dasharray: 5 5; opacity: .9; }
.hm-teept { fill: #fff; stroke: var(--map-edge); stroke-width: 1.5; }
.hm-flag { fill: #e53935; stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; }
.hm-hole { fill: #10200f; }
.hm-me { fill: #1e88e5; stroke: #fff; stroke-width: 2.5; }
.hm-me-ring { fill: rgba(30, 136, 229, .25); }
.hm-lbl { font: 700 12px system-ui, -apple-system, sans-serif; fill: var(--map-ink); paint-order: stroke; stroke: var(--map-halo); stroke-width: 3px; }
.hm-lbl.big { font-size: 15px; }
.hm-facts { display: grid; gap: 8px; }
.hm-line1 { font-size: 15px; }
.hm-togreen { font-size: 13px; color: var(--muted); }
.hm-fcb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.hm-fcb div { background: var(--accent-soft); border-radius: 10px; padding: 6px 4px; text-align: center; color: var(--ink); }
.hm-fcb div.c { background: var(--accent); color: var(--accent-ink); }
.hm-fcb small { display: block; font-size: 11px; opacity: .8; }
.hm-fcb b { font-size: 20px; }
.hm-hz { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.hm-hz li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.hm-hz li span:not(.grow) { color: var(--muted); font-size: 13px; white-space: nowrap; }
.hm-hz li b { color: var(--ink); font-size: 15px; }
.hm-hz .grow { flex: 1; }
.hm-hz .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.hm-hz .sw.hm-bunker { background: var(--map-bunker); border: 1px solid rgba(0, 0, 0, .2); }
.hm-hz .sw.hm-water { background: var(--map-water); }
.hm-attrib { font-size: 11px; color: var(--muted); }
.hm-attrib a { color: inherit; }
.hm-card { padding: 12px; margin-bottom: 12px; }
.hm-bar { display: flex; align-items: center; gap: 8px; }
.hm-bar b { flex: 1; }
.hm-bar .chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; font-size: 13px; }
.hm-bar .chip svg { width: 16px; height: 16px; }
.hm-show { margin-bottom: 12px; }

/* Hole map indicators (v3.3): side toggles, next-hazard bar, distance rings, target */
.hm-wrap { align-items: flex-start; gap: 8px; }
.hm-wrap .hole-map { min-width: 0; flex: 1 1 auto; }
.hm-wrap.tap .hole-map { cursor: crosshair; touch-action: none; user-select: none; -webkit-user-select: none; }
.hm-tools { flex: none; display: flex; flex-direction: column; gap: 8px; }
.hm-tools button {
  width: 54px; min-height: 54px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18); padding: 4px 2px;
}
.hm-tools button svg { width: 22px; height: 22px; }
.hm-tools button span { font-size: 10px; font-weight: 600; line-height: 1; }
.hm-tools button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.hm-next { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 10px 0 4px; border-radius: 12px; background: var(--accent-soft); }
.hm-next.is-bunker { background: var(--gold-soft); }
.hm-next.is-water { background: color-mix(in srgb, var(--map-water) 22%, var(--card)); }
.hm-next .grow { flex: 1; min-width: 0; }
.hm-next small { display: block; font-size: 11px; color: var(--muted); }
.hm-next b { font-size: 16px; }
.hm-next .n { text-align: center; min-width: 46px; }
.hm-next .n b { display: block; font-size: 24px; line-height: 1.1; }
.hm-next .sw { width: 16px; height: 16px; border-radius: 4px; flex: none; }
.hm-next .sw.hm-bunker { background: var(--map-bunker); border: 1px solid rgba(0, 0, 0, .2); }
.hm-next .sw.hm-water { background: var(--map-water); }
.hm-ring { fill: none; stroke: #fff; stroke-width: 1; stroke-dasharray: 3 4; opacity: .7; }
.hm-lbl.ring { font-size: 11px; font-weight: 600; }
.hm-tline { fill: none; stroke: #ffd54f; stroke-width: 2; }
.hm-tgt-ring { fill: rgba(255, 213, 79, .25); stroke: #ffd54f; stroke-width: 2; }
.hm-tgt-x { stroke: #ffd54f; stroke-width: 2; }
.hm-lbl.tgt { font-size: 14px; }
.hm-tgt { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 2px 0 10px; }
.hm-tgt svg { width: 18px; height: 18px; color: var(--gold); flex: none; }
.hm-tgt .grow { flex: 1; }
.hm-tgt .chip { padding: 5px 11px; font-size: 13px; }
.hm-tgt small { display: block; font-size: 12px; }

/* v3.3: quick links (left of the map), collapsible hazard list */
.hm-jumps button { width: 48px; min-height: 48px; }
.hm-jumps button svg { width: 20px; height: 20px; }
/* Sections that open and close */
.fold { margin-top: 18px; }
.fold > summary { list-style: none; cursor: pointer; }
.fold > summary::-webkit-details-marker, .hm-hzd > summary::-webkit-details-marker { display: none; }
.fold-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); -webkit-tap-highlight-color: transparent; }
.fold-head b { display: block; font-size: 16px; }
.fold-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.fold[open] > .fold-head { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; box-shadow: none; }
.fold[open] > .fold-head + .card { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 1px dashed var(--line); }
.fold-act { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 6px 8px 6px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.fold-act svg { width: 18px; height: 18px; transition: transform .2s; }
.fold-hide { display: none; }
details[open] > summary .fold-act svg { transform: rotate(180deg); }
details[open] > summary .fold-show { display: none; }
details[open] > summary .fold-hide { display: inline; }
.fold-head:active .fold-act, .hm-hzd > summary:active .fold-act { filter: brightness(.95); }
.hm-hzd summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--line); list-style: none; display: flex; align-items: center; gap: 6px; }
.entry.flash { animation: hm-flash 1.2s ease-out; }
@keyframes hm-flash { 0%, 30% { background: var(--accent-soft); } 100% { background: transparent; } }

/* Permanently closed courses: grey picture with a red line across it */
.course-item.closed h3 { color: var(--muted); }
.course-item.closed .thumb, .closed-pic { position: relative; overflow: hidden; }
.course-item.closed .thumb img, .closed-pic img { filter: grayscale(1) opacity(.65); }
.course-item.closed .thumb::after, .closed-pic::after { content: ""; position: absolute; left: -15%; top: 50%; width: 130%; height: 4px; background: #e53935; transform: rotate(-35deg); box-shadow: 0 0 0 1.5px rgba(255,255,255,.8); pointer-events: none; }
.closed-pic::after { height: 6px; transform: rotate(-12deg); }
.badge.closed { background: #fdecea; color: #c62828; }
.badge.kind { background: #e3effc; color: #1c5fa8; }
.closed-banner { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 0; padding: 10px 14px; border-radius: var(--radius); background: #fdecea; color: #8e1c1c; border: 1px solid #f5c2bd; font-size: 14px; }
.closed-banner b { font-size: 15px; color: #c62828; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.closed, :root:not([data-theme="light"]) .closed-banner { background: #3a1716; color: #f4b4ae; border-color: #5c2522; } :root:not([data-theme="light"]) .closed-banner b { color: #ff8a80; } }
:root[data-theme="dark"] .badge.closed, :root[data-theme="dark"] .closed-banner { background: #3a1716; color: #f4b4ae; border-color: #5c2522; }
:root[data-theme="dark"] .closed-banner b { color: #ff8a80; }

/* Not a full course (chip & putt, par 3, ...) */
.kind-banner { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 0; padding: 10px 14px; border-radius: var(--radius); background: #e3effc; color: #1d3f66; border: 1px solid #c3daf5; font-size: 14px; }
.kind-banner b { font-size: 15px; color: #1c5fa8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.kind, :root:not([data-theme="light"]) .kind-banner { background: #15283d; color: #a9cdf2; border-color: #23405f; } :root:not([data-theme="light"]) .kind-banner b { color: #8cc0f5; } }
:root[data-theme="dark"] .badge.kind, :root[data-theme="dark"] .kind-banner { background: #15283d; color: #a9cdf2; border-color: #23405f; }
:root[data-theme="dark"] .kind-banner b { color: #8cc0f5; }
