/* Carryover styles, tuned for a phone in bright sunshine:
   - white background, near-black text, heavy weights (glare washes out thin and grey text)
   - no pale grey text; "secondary" text is still dark
   - strong, saturated colours that differ in lightness, not only in hue
   - big numbers and big touch targets (at least 48 px)
   A darker theme is kept for evening rounds (Setup > Display). */

:root {
  --bg: #ffffff; --card: #ffffff; --ink: #000000; --muted: #2e2e2e; --line: #1a1a1a; --soft-line: #9a9a9a;
  --green: #00692c; --green-soft: #d7f0dd; --red: #c1000f; --gold: #8a5a00; --blue: #0047d6;
  --btn: #ececec; --header: #0a3d91; --accent: #0a47b8; --accent-soft: #dbe7ff;
}
:root[data-theme="dark"] {
  --bg: #000000; --card: #111111; --ink: #ffffff; --muted: #d8d8d8; --line: #e6e6e6; --soft-line: #5a5a5a;
  --green: #5fe08a; --green-soft: #133d22; --red: #ff6b6b; --gold: #ffcf4a; --blue: #7fb0ff;
  --btn: #262626; --header: #0b1f45; --accent: #7fb0ff; --accent-soft: #142a52;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #000000; --card: #111111; --ink: #ffffff; --muted: #d8d8d8; --line: #e6e6e6; --soft-line: #5a5a5a;
    --green: #5fe08a; --green-soft: #133d22; --red: #ff6b6b; --gold: #ffcf4a; --blue: #7fb0ff;
    --btn: #262626; --header: #0b1f45; --accent: #7fb0ff; --accent-soft: #142a52;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 600 18px/1.35 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
header { position: sticky; top: 0; z-index: 2; background: var(--header); color: #fff;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 0; }
h1 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
nav { display: flex; gap: 2px; }
nav button { flex: 1; min-height: 50px; background: transparent; color: #fff; border: 0;
  font-size: 18px; font-weight: 800; line-height: 1; border-bottom: 5px solid transparent; opacity: .85; }
nav button.on { opacity: 1; border-bottom-color: #ffd400; }
main { padding: 10px; max-width: 560px; margin: 0 auto; padding-bottom: calc(env(safe-area-inset-bottom) + 120px); }
section { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
h2 { font-size: 16px; font-weight: 800; margin: 0 0 10px; color: var(--ink); text-transform: uppercase; letter-spacing: .03em; }
label { display: block; font-size: 16px; font-weight: 700; color: var(--ink); margin: 10px 0 4px; }
input, select { font: inherit; font-weight: 700; color: var(--ink); background: var(--bg); border: 2px solid var(--line);
  border-radius: 8px; padding: 10px; width: 100%; min-height: 48px; }
input[type=checkbox] { width: 26px; height: 26px; min-height: 0; accent-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row .narrow { flex: 0 0 78px; }
.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; color: var(--ink); font-size: 17px; }
button { font-family: inherit; }
button.primary, button.ghost { font: inherit; font-weight: 800; border-radius: 10px; padding: 12px 14px; min-height: 52px; }
button.primary { background: var(--accent); color: #fff; border: 2px solid var(--accent); }
:root[data-theme="dark"] button.primary { color: #000; }
button.ghost { background: var(--btn); color: var(--ink); border: 2px solid var(--line); }
button:disabled { opacity: .4; }
.holes { display: grid; grid-template-columns: 30px 1fr 1fr; gap: 4px 6px; align-items: center; font-size: 16px; }
.holes input { padding: 6px; text-align: center; min-height: 42px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sub { color: var(--muted); font-size: 15px; font-weight: 600; }

/* ---------- GPS ---------- */
.gpsbox { padding: 6px; }
.gpstop { display: flex; align-items: stretch; gap: 6px; }
.holebtn { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: var(--ink);
  font: inherit; font-size: 24px; font-weight: 900; padding: 4px 2px; min-height: 52px; }
.holebtn .sub { font-size: 18px; }
.circ { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--bg); font-weight: 900; font-size: 20px; flex: none; }
.club { display: grid; place-items: center; min-width: 64px; padding: 0 8px; background: var(--blue); color: #fff;
  border-radius: 10px; font-size: 30px; font-weight: 900; }
.club:empty { display: none; }
.posthead { display: flex; justify-content: space-between; align-items: center; }
.postnums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; text-align: center; }
.postnums span { display: block; font-size: 13px; font-weight: 800; color: var(--muted); }
.postnums b { display: block; font-size: 28px; font-weight: 900; font-variant-numeric: tabular-nums; }
.postnums div:first-child b { font-size: 36px; color: var(--accent); }
a.btnlink { flex: 1; display: grid; place-items: center; text-decoration: none; font-weight: 800; border-radius: 10px;
  min-height: 52px; background: var(--btn); color: var(--ink); border: 2px solid var(--line); }
.teerow { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 6px; margin-top: 6px; }
.teerow input { padding: 8px 6px; }
.clubrow { display: grid; grid-template-columns: 30px 1fr 80px 30px 48px; gap: 6px; align-items: center; margin-top: 6px; }
.clubrow button.ghost { min-height: 44px; padding: 0; }
.clubrow span { font-size: 15px; }
details summary { cursor: pointer; font-weight: 800; color: var(--ink); min-height: 44px; display: flex; align-items: center; }
.topyd { flex: 1; display: flex; justify-content: space-between; align-items: center; background: #000; color: #fff;
  border-radius: 10px; padding: 2px 12px; border: 2px solid #000; }
:root[data-theme="dark"] .topyd { border-color: #fff; }
.topyd span { font-size: 15px; font-weight: 700; color: #fff; }
.topyd b { font-size: 48px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.05; }
.gpsbody { display: flex; gap: 6px; margin-top: 6px; }
.distcol { flex: 0 0 35%; display: flex; flex-direction: column; justify-content: space-between; }
.drow { text-align: right; padding: 3px 2px; border-bottom: 2px solid var(--soft-line); }
.drow:last-child { border-bottom: 0; }
.drow span { display: block; font-size: 14px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.drow b { display: block; font-size: 34px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.drow.main { background: var(--green); border-radius: 8px; padding: 5px 6px; border: 0; }
.drow.main span, .drow.main b { color: #fff; }
:root[data-theme="dark"] .drow.main span, :root[data-theme="dark"] .drow.main b { color: #000; }
.drow.main b { font-size: 44px; }
.holemap { position: relative; flex: 1; border-radius: 10px; overflow: hidden; background: #ece7d6;
  touch-action: none; border: 2px solid var(--line); }
.holemap svg { display: block; width: 100%; height: auto; max-height: 72vh; }
.cleartarget { position: absolute; left: 6px; top: 6px; background: #000; color: #fff; border: 2px solid #fff;
  border-radius: 8px; padding: 10px 12px; font-size: 16px; font-weight: 800; min-height: 44px; }
.nomap { padding: 60px 16px; text-align: center; color: #fff; min-height: 260px; font-size: 18px; font-weight: 700; }
.offmap { position: absolute; left: 6px; right: 6px; bottom: 6px; text-align: center; color: #fff; background: #000;
  border-radius: 8px; padding: 6px; font-size: 15px; font-weight: 700; }

.holelist { padding: 0; overflow: hidden; }
.lhead { display: flex; justify-content: space-between; align-items: baseline; padding: 12px; border-bottom: 2px solid var(--line); }
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; border: 0;
  border-bottom: 2px solid var(--soft-line); padding: 10px 12px; color: var(--ink); font: inherit; min-height: 72px; }
.lrow.cur { background: var(--accent-soft); }
.ltext { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lmain { font-size: 20px; font-weight: 800; }
.lstats { display: flex; flex-wrap: wrap; gap: 10px; font-size: 16px; font-weight: 800; color: var(--ink); }
.lstats .good { color: var(--green); } .lstats .bad { color: var(--red); } .lstats .putt { color: var(--gold); }
svg.thumb, .thumb.none { width: 44px; height: 100px; border-radius: 6px; flex: none; border: 2px solid var(--line); }
.thumb.none { background: var(--btn); }

/* ---------- Card (one hole at a time) ---------- */
.holehead { display: flex; justify-content: space-between; align-items: baseline; }
.holehead .num { font-size: 38px; font-weight: 900; }
.holehead .meta { color: var(--ink); font-size: 20px; font-weight: 800; }
.player { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 2px solid var(--soft-line); }
.player:first-of-type { border-top: 0; }
.player > div:first-child { flex: 1; min-width: 0; padding-right: 6px; }
.pname { font-size: 20px; font-weight: 900; }
.dots { color: var(--gold); letter-spacing: 2px; font-size: 18px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--btn); color: var(--ink); font-size: 30px; font-weight: 800; line-height: 1; }
.stepper .score { width: 50px; text-align: center; font-size: 34px; font-weight: 900; }
.score.under { color: var(--red); }
/* Not entered yet: shown as a dashed box, not pale grey (pale grey vanishes in sun). */
.score.empty { color: var(--muted); font-weight: 700; border: 2px dashed var(--muted); border-radius: 8px; }
.stepper.putts { margin-top: 8px; justify-content: flex-end; }
.stepper.putts button { width: 44px; height: 44px; font-size: 24px; }
.stepper.putts .score { width: 80px; font-size: 20px; font-weight: 800; padding: 2px 0; }
.stepper.putts small { font-size: 14px; font-weight: 700; color: var(--ink); }
.fw { display: inline-flex; margin-top: 8px; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; }
.fw button { background: var(--btn); color: var(--ink); border: 0; padding: 0 10px; min-height: 44px; font-size: 17px;
  font-weight: 800; min-width: 44px; }
.fw button + button { border-left: 2px solid var(--line); }
.fw button.on { background: var(--green); color: #fff; }
:root[data-theme="dark"] .fw button.on { color: #000; }
.extras { display: flex; gap: 6px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.chip { background: var(--btn); color: var(--ink); border: 2px solid var(--line); border-radius: 8px;
  padding: 0 10px; min-height: 44px; font-size: 17px; font-weight: 800; white-space: nowrap; }
.chip.on { background: #ffd400; border-color: #000; color: #000; }
.pen { display: inline-flex; align-items: center; border: 2px solid var(--line); border-radius: 8px; overflow: hidden;
  font-size: 17px; font-weight: 800; color: var(--ink); }
.pen button { background: var(--btn); color: var(--ink); border: 0; width: 40px; height: 44px; font-size: 22px; font-weight: 800; }
.pen span { padding: 0 6px; min-width: 50px; text-align: center; white-space: nowrap; }
.pen.has span { color: #fff; background: var(--red); align-self: stretch; display: grid; place-items: center; }
.gir { font-size: 13px; font-weight: 900; padding: 1px 6px; border-radius: 6px; color: var(--ink);
  border: 2px solid var(--ink); vertical-align: 3px; }
.gir.yes { color: #fff; background: var(--green); border-color: var(--green); }
:root[data-theme="dark"] .gir.yes { color: #000; }
.navrow { display: flex; gap: 8px; }
.navrow button { flex: 1; }
.live div { display: flex; justify-content: space-between; padding: 6px 0; font-size: 17px; border-bottom: 1px solid var(--soft-line); }
.live div:last-of-type { border-bottom: 0; }
.live .sub { padding: 0; }

/* ---------- Bets and scorecard ---------- */
.money td, .money th { padding: 8px 4px; text-align: left; border-bottom: 2px solid var(--soft-line); font-size: 16px; }
.money th { font-weight: 900; }
.money { width: 100%; border-collapse: collapse; }
.money td.amt, .money th.amt { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); font-weight: 900; }
.neg { color: var(--red); font-weight: 900; }
.pay { font-size: 21px; font-weight: 800; padding: 8px 0; }
.scroll { overflow-x: auto; }
.grid { border-collapse: collapse; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 6px 7px; text-align: center; border-bottom: 2px solid var(--soft-line); }
.grid td:first-child, .grid th:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
/* Header: small "PinMoney" label, then the course being played as the headline */
.brand { display: block; font-size: 13px; font-weight: 900; letter-spacing: .02em; opacity: .85; }
.coursename { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 20px; font-weight: 900; line-height: 1.2; }
.coursename.none { font-size: 16px; font-weight: 700; opacity: .8; }
.coursesub { display: block; font-size: 13px; font-weight: 700; opacity: .85; }
.coursesub:empty { display: none; }
.wolfrow { margin: 10px 0 4px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; }
.wolfpick { display: flex; flex-wrap: wrap; margin-top: 6px; }
.wolfpick button { flex: 1 1 auto; }
.bbbline + .bbbline { margin-top: 8px; }
.notice { background: #ffd400; color: #000; font-weight: 800; padding: 10px 12px; border-bottom: 2px solid #000; }
.notice[hidden] { display: none; }
.okbar { background: var(--green); color: #fff; font-weight: 800; border-color: var(--green); }
:root[data-theme="dark"] .okbar { color: #000; }
.playerbox { border: 2px solid var(--soft-line); border-radius: 10px; padding: 8px; margin-bottom: 8px; }
.packrow { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 2px solid var(--soft-line); }
.packrow:first-child { border-top: 0; }
.packrow button { flex: 0 0 auto; }
.updatebar { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: #ffd400; color: #000;
  font-weight: 800; padding: 8px 12px; border-bottom: 2px solid #000; }
.updatebar button { background: #000; color: #fff; border: 0; border-radius: 8px; padding: 10px 14px; font: inherit; font-weight: 800; min-height: 44px; }
.coursebox { border-color: var(--accent); border-width: 3px; }
.photomap { border-radius: 10px; overflow: hidden; border: 2px solid var(--line); touch-action: none; background: #2e6b2a; }
.photomap svg { display: block; width: 100%; height: auto; max-height: 70vh; }

/* Tees: colour dot, look-up results, tick list */
.teedot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #000; margin-right: 6px; vertical-align: -1px; }
.teeresult { display: block; width: 100%; text-align: left; margin-top: 6px; }
.teepick { align-items: flex-start; margin-top: 4px; }
.teepick .sub { margin-top: 0 !important; }

/* 9-hole choice and past rounds */
.holespick button { flex: 1; }
.histround { border-top: 1px solid var(--soft-line); padding: 8px 0; }
.histround summary { display: block; list-style: none; cursor: pointer; }
.histround summary > .sub { display: block; margin-top: 2px; }
.histround[open] summary .histline b::after { content: " ▾"; color: var(--muted, #888); }
.histround summary::-webkit-details-marker { display: none; }
.histline { display: flex; justify-content: space-between; gap: 8px; }
.histline .sub { text-align: right; }
td.under { color: var(--red); font-weight: 900; }

/* Card: the whole scorecard when the phone is turned sideways */
.landcard { display: none; }
@media (orientation: landscape) and (max-height: 600px) {
  body.oncard main { max-width: none; padding: 6px max(6px, env(safe-area-inset-left)) 40px max(6px, env(safe-area-inset-right)); }
  body.oncard header { position: static; }
  body.oncard .cardport { display: none; }
  body.oncard .landcard { display: block; padding: 6px; }
}
.lgrid { width: 100%; font-size: 15px; }
.lgrid th, .lgrid td { padding: 4px 2px; border-bottom: 1px solid var(--soft-line); }
.lgrid th[data-landhole] { cursor: pointer; }
.lgrid .cur { background: var(--accent-soft); }
.lgrid .tot { font-weight: 900; background: var(--btn); }
.lgrid td:first-child { white-space: nowrap; padding-right: 6px; }
.lgrid td small { font-weight: 600; opacity: .75; }
.lgrid tr.sub td { font-weight: 600; }
.lgrid .sc { display: inline-block; min-width: 22px; line-height: 20px; padding: 1px; box-sizing: border-box; }
.lgrid .sc.birdie { border: 2px solid var(--red); border-radius: 50%; color: var(--red); }
.lgrid .sc.eagle { border: 2px solid var(--red); border-radius: 50%; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--red); color: var(--red); }
.lgrid .sc.bogey { border: 2px solid var(--ink); }
.lgrid .sc.dbl { border: 2px solid var(--ink); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }

/* Sideways card: tap a score to change it */
.lgrid td.ledit { cursor: pointer; }
.lgrid td.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.landedit { position: fixed; left: 50%; bottom: max(8px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 5;
  align-items: center; gap: 10px; padding: 8px 12px; background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.35); white-space: nowrap; }
@media (orientation: landscape) and (max-height: 600px) { body.oncard .landedit { display: flex; } }
.landedit button { min-width: 48px; min-height: 44px; font-size: 22px; font-weight: 900; }
.landedit button.ghost, .landedit button.primary { font-size: 16px; padding: 0 12px; }
.landedit .score { min-width: 44px; text-align: center; font-size: 26px; font-weight: 900; }
.landedit .score.empty { opacity: .5; border: 2px dashed var(--soft-line); border-radius: 8px; }
.landedit .score.under { color: var(--red); }
/* Sideways card: header on one line to leave room for the card */
@media (orientation: landscape) and (max-height: 600px) {
  body.oncard h1 { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  body.oncard h1 .coursename { display: block; flex: 0 1 auto; min-width: 0; white-space: nowrap; text-overflow: ellipsis; }
  body.oncard h1 .brand, body.oncard h1 .coursesub { flex: 0 0 auto; }
}
.histround summary > .histtee { display: block; font-size: 16px; margin-top: 2px; }

/* ---------- Statistics ---------- */
/* Chart colours (checked for colour-blind separation): score mix is a diverging scale
   (blue under par, neutral grey par, yellow then rose over); fairways are three labelled hues;
   putts are one blue, light to dark. Dark-theme steps are chosen for the dark surface. */
.stats { --s-birdie: #2a78d6; --s-par: #8f8f8f; --s-bogey: #eda100; --s-double: #b8305e;
  --f-left: #eb6834; --f-hit: #2a78d6; --f-right: #1baf7a;
  --p1: #86b6ef; --p2: #3d84d9; --p3: #104281; --bar: #2a78d6; --bar-part: #9cc0ec; --bar-under: #1baf7a; }
:root[data-theme="dark"] .stats { --s-birdie: #3987e5; --s-par: #7a7a7a; --s-bogey: #c98500; --s-double: #c93c6b;
  --f-left: #d95926; --f-hit: #3987e5; --f-right: #199e70;
  --p1: #a6c8f2; --p2: #3d84d9; --p3: #1d4f8f; --bar: #3987e5; --bar-part: #2b4f7c; --bar-under: #199e70; }
@media (prefers-color-scheme: dark) { :root[data-theme="auto"] .stats { --s-birdie: #3987e5; --s-par: #7a7a7a; --s-bogey: #c98500; --s-double: #c93c6b;
  --f-left: #d95926; --f-hit: #3987e5; --f-right: #199e70;
  --p1: #a6c8f2; --p2: #3d84d9; --p3: #1d4f8f; --bar: #3987e5; --bar-part: #2b4f7c; --bar-under: #199e70; } }
.histtabs { margin-bottom: 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.stile { border: 2px solid var(--soft-line); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; }
.slabel { font-size: 14px; color: var(--muted); }
.svalue { font-size: 30px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.snote { font-size: 13px; color: var(--muted); }
.segbar { display: flex; gap: 2px; height: 44px; margin-top: 8px; }
.segbar .seg { display: flex; align-items: center; justify-content: center; min-width: 4px; font-size: 15px; font-weight: 900; color: #fff; }
.segbar .seg:first-child { border-radius: 6px 0 0 6px; } .segbar .seg:last-child { border-radius: 0 6px 6px 0; } .segbar .seg:only-child { border-radius: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 15px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.s-birdie { background: var(--s-birdie); } .s-par { background: var(--s-par); } .s-bogey { background: var(--s-bogey); color: #000 !important; } .s-double { background: var(--s-double); }
.f-left { background: var(--f-left); } .f-hit { background: var(--f-hit); } .f-right { background: var(--f-right); color: #000 !important; }
.p1 { background: var(--p1); color: #000 !important; } .p2 { background: var(--p2); } .p3 { background: var(--p3); }
.meters { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.meter { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr 52px; gap: 8px; align-items: center; }
.mname { font-size: 16px; } .mname .sub { display: block; font-size: 13px; }
.mtrack { height: 14px; background: var(--btn); border-radius: 7px; overflow: hidden; }
.mfill { display: block; height: 100%; background: var(--bar); border-radius: 7px; }
.mval { text-align: right; font-variant-numeric: tabular-nums; }
.tpbars { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.tprow { display: grid; grid-template-columns: minmax(100px, 1.1fr) 2fr minmax(70px, auto); gap: 8px; align-items: center; }
.tpname { font-size: 16px; } .tpname .sub { display: block; font-size: 13px; }
.tptrack { position: relative; height: 16px; }
.tpzero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--muted); }
.tpfill { position: absolute; top: 0; bottom: 0; background: var(--bar); border-radius: 0 4px 4px 0; }
.tpfill.under { background: var(--bar-under); border-radius: 4px 0 0 4px; }
.tpval { text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
.trend { width: 100%; height: auto; margin-top: 6px; }
.trend .grid { stroke: var(--soft-line); stroke-width: 1; opacity: .5; }
.trend .zero { stroke: var(--ink); stroke-width: 1.5; }
.trend .axis { fill: var(--muted); font-size: 11px; font-weight: 700; }
.trend .vlabel { fill: var(--ink); font-size: 12px; font-weight: 900; }
.trend .col { fill: var(--bar); } .trend .col.part { fill: var(--bar-part); } .trend .col.under { fill: var(--bar-under); }
.holespick { display: flex; width: 100%; }
.holespick button { flex: 1; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
.lastpick button { font-size: 16px; padding-left: 4px; padding-right: 4px; }
button.danger { color: var(--red); border-color: var(--red); }

/* End round, in the header on every tab while a round has scores */
header { position: sticky; }
.hdrend { position: absolute; right: 10px; top: calc(env(safe-area-inset-top) + 8px); min-height: 36px; padding: 0 12px;
  font-size: 15px; font-weight: 900; color: #000; background: #ffd400; border: 0; border-radius: 18px; z-index: 3; }
.hdrend[hidden] { display: none; }
header h1 { padding-right: 0; }
header:has(.hdrend:not([hidden])) h1 { padding-right: 116px; }

/* Fixing a past round */
.histedit { display: flex; }
.gridedit td.ledit { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.gridedit td.picked { outline: 3px solid var(--accent); outline-offset: -3px; }
.histedit { left: 8px; right: 8px; transform: none; flex-wrap: wrap; justify-content: center; white-space: normal; gap: 8px; }
.histedit > span:first-child { flex-basis: 100%; text-align: center; }

/* v50 layout: five tabs, gear for settings, folded sections */
nav button { font-size: 16px; padding: 0 2px; }
.hdrgear { position: absolute; right: 8px; top: calc(env(safe-area-inset-top) + 6px); width: 40px; height: 40px; padding: 0;
  font-size: 24px; line-height: 1; color: #fff; background: transparent; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; z-index: 3; }
.hdrgear.on { background: #ffd400; color: #000; border-color: #ffd400; }
.hdrend { right: 56px; }
header h1 { padding-right: 48px; }
header:has(.hdrend:not([hidden])) h1 { padding-right: 160px; }
.pagetitle { font-size: 24px; margin: 4px 0 10px; }
details.foldsec { background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 4px 12px; margin-bottom: 12px; }
details.foldsec > summary { font-size: 16px; }
details.foldsec[open] { padding-bottom: 12px; }
details.foldsec section { border: 0; padding: 8px 0 0; margin: 0; }
.gamessum details > summary { color: var(--accent); }
.gamessum details section { border: 0; border-top: 2px solid var(--soft-line); border-radius: 0; padding: 10px 0 0; margin: 10px 0 0; }
.bigstart { width: 100%; min-height: 58px; font-size: 20px; }

/* Header photo: the course from above (public-domain USGS imagery), tinted; plain blue without one */
header.photo { background-color: var(--header); background-size: cover; background-position: center; }
header.photo h1, header.photo nav button { text-shadow: 0 1px 3px rgba(0,0,0,.85), 0 0 8px rgba(0,0,0,.5); }
header.photo nav button { opacity: .95; }

/* GPS top bar: never spills past the edge; far from the hole it just says so */
.gpstop { min-width: 0; }
.topyd { min-width: 0; overflow: hidden; }
.topyd b { font-size: clamp(30px, 11vw, 48px); white-space: nowrap; }
.topyd.far { justify-content: center; min-height: 58px; }
.topyd.far span { font-size: 18px; font-weight: 900; }
.drow.notyet { border: 0; }
.drow.notyet span { font-size: 15px; }
.drow.notyet b { font-size: 30px; }
.gpsbox.isfar .offmap { display: none; }
.addcourse { border-top: 2px solid var(--soft-line); margin-top: 8px; padding-top: 4px; }

/* User guide */
.guidetoc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.guidetoc button { flex: 1 1 45%; min-height: 40px; font-size: 15px; }
.guideitem { border-top: 2px solid var(--soft-line); padding: 10px 0; }
.guideitem:first-of-type { border-top: 0; padding-top: 0; }
.guideitem > div { font-weight: 600; margin-top: 2px; }
@keyframes guideflash { 0%, 60% { outline-color: #ffd400; box-shadow: 0 0 0 6px rgba(255,212,0,.5); } 100% { outline-color: transparent; box-shadow: none; } }
.guideflash { outline: 4px solid #ffd400; outline-offset: 2px; border-radius: 10px; animation: guideflash 2.6s ease-out; }
