:root {
  /* The coaching theme: one set of colors for the whole app (the yardage book keeps its own). */
  --bg: #1e1e1e; --surface: #282828; --surface2: #333333; --line: #3d3d3d;
  --text: #ffffff; --muted: #9a9a9a; --faint: #606060;
  --accent: #007a52; --accent-ink: #ffffff; --blue: #2d7abc; --link: #44b8f0; --yellow: #f0c830;
  --pos: #00b87a; --neg: #d4706e; --danger: #d4706e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; display: flex; flex-direction: column; }
h1 { font-size: 22px; margin: 0; } h2 { font-size: 16px; margin: 24px 0 8px; } h3 { font-size: 15px; margin: 0 0 10px; }
a { color: inherit; } p { margin: 6px 0; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

#nav { display: flex; align-items: center; gap: 4px; padding: 6px max(10px, env(safe-area-inset-left)); padding-top: max(6px, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--line); }
#nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
#nav a.on { color: var(--text); background: var(--surface2); }
#account-link { margin-left: auto; display: flex; align-items: center; gap: 6px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sync-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
#sync-dot.ok { background: var(--accent); } #sync-dot.syncing { background: var(--yellow); } #sync-dot.error { background: var(--danger); }
body.playing #nav { display: none; }

#view { flex: 1; min-height: 0; overflow: auto; }
.page { max-width: 860px; margin: 0 auto; padding: 18px 14px 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .between { justify-content: space-between; }
[hidden] { display: none !important; }
.page.narrow { max-width: 480px; }
p.bad { color: var(--danger); }
button.link { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; justify-self: start; }
.stack { display: grid; gap: 8px; margin: 10px 0; max-width: 460px; }
.list { display: grid; gap: 8px; }
.round { display: flex; justify-content: space-between; text-decoration: none; margin: 0; } .round .right { text-align: right; }

button, .btn, select, input { font: inherit; color: var(--text); background: var(--surface2); border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px; min-height: 40px; }
button, .btn { cursor: pointer; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--danger); }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 2px solid var(--pos); outline-offset: 2px; }

/* play */
.play { height: 100%; display: flex; flex-direction: column; }
.mapwrap { flex: 1 1 52%; min-height: 240px; position: relative; }
#map { position: absolute; inset: 0; background: var(--bg); }
.side { flex: 1 1 48%; min-height: 0; display: flex; flex-direction: column; background: var(--bg); border-top: 1px solid var(--line); }
.panel { padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); overflow: auto; flex: 1; }
@media (min-width: 900px) {
  .play { flex-direction: row; }
  .mapwrap { flex: 1; }
  .side { flex: 0 0 430px; border-top: 0; border-left: 1px solid var(--line); }
}
.strip { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--surface); border-bottom: 1px solid var(--line); }
.strip .back { font-size: 26px; line-height: 1; text-decoration: none; padding: 2px 10px; }
.strip .total { white-space: nowrap; font-weight: 700; font-size: 13px; padding-right: 4px; }
.chips { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.chip { flex: 0 0 auto; width: 30px; text-align: center; text-decoration: none; border-radius: 7px; padding: 2px 0 3px; background: var(--surface2); border: 1px solid transparent; line-height: 1.15; }
.chip small { display: block; font-size: 10px; color: var(--muted); } .chip b { font-size: 14px; }
.chip.on { border-color: var(--text); } .chip.under b { color: var(--pos); } .chip.over b { color: var(--neg); }
.holehead { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.navbtns { display: flex; gap: 6px; }
.hint { font-weight: 600; margin: 10px 0; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.actions button { padding: 9px 4px; min-height: 46px; }
table { border-collapse: collapse; width: 100%; }
.shots { margin-top: 12px; } .shots th, .data th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; padding: 4px 6px; }
.shots th.num, .data th.num { text-align: right; }
.shots td, .data td { padding: 5px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
.shots select { padding: 4px 6px; min-height: 34px; } .shots input.ft { width: 58px; padding: 4px 6px; min-height: 34px; text-align: right; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; border: 1px solid #0008; }
.sg.pos { color: var(--pos); } .sg.neg { color: var(--neg); } .pen { color: var(--neg); font-weight: 600; }
.shotmark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #111; color: #111; font: 700 13px/22px system-ui, sans-serif; text-align: center; box-shadow: 0 1px 4px #000a; }
.shotmark.holedmark { background: #22c55e; color: #fff; }
.flag { width: 24px; height: 30px; background:
  linear-gradient(#fff, #fff) 2px 0 / 2px 30px no-repeat,
  conic-gradient(from 60deg at 4px 8px, #e5484d 60deg, transparent 0) 0 0 / 24px 16px no-repeat; filter: drop-shadow(0 1px 2px #000); }

/* stats */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; }
.tile strong { font-size: 24px; font-variant-numeric: tabular-nums; } .tile small { font-size: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 12px; }
.sgbars { display: grid; gap: 8px; }
.sgrow { display: grid; grid-template-columns: 104px 1fr 54px; align-items: center; gap: 8px; }
.sgrow.total { border-top: 1px solid var(--line); padding-top: 8px; font-weight: 700; }
.sgrow .track { position: relative; height: 16px; background: linear-gradient(var(--muted), var(--muted)) 50% 0 / 1px 100% no-repeat; }
.sgrow .bar { position: absolute; top: 0; bottom: 0; min-width: 2px; }
.sgrow .bar.pos { background: var(--pos); border-radius: 0 4px 4px 0; } .sgrow .bar.neg { background: var(--neg); border-radius: 4px 0 0 4px; }
.sgrow .val { text-align: right; font-variant-numeric: tabular-nums; }
.scroll { overflow-x: auto; }

/* editor */
.editor { height: 100%; display: flex; flex-direction: column; }
.editor #map { position: relative; flex: 1; min-height: 300px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 13px; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
.help { padding: 0 10px 8px; margin: 0; font-size: 13px; }
.leaflet-popup-content select { color: #111; background: #fff; }

details summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.steps { padding-left: 20px; } .steps li { margin: 6px 0; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; font-size: 12px; }

#toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #000d; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; max-width: 90vw; text-align: center; z-index: 2000; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
body.playing #toast { bottom: calc(118px + env(safe-area-inset-bottom)); } /* above the hole bar and score box */

/* hole viewer */
.holeview { position: relative; height: 100%; overflow: hidden; background: var(--bg); }
#gmap { position: absolute; inset: 0; }
.liveoverlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.holepill { position: absolute; left: 50%; bottom: calc(8px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 6px; background: #111c; backdrop-filter: blur(8px); border-radius: 999px; padding: 6px 8px; color: #fff; text-align: center; white-space: nowrap; }
.holepill a { font-size: 30px; line-height: 1; text-decoration: none; padding: 4px 16px 8px; }
.holepill small { display: block; font-size: 13px; opacity: .85; } .holepill strong { font-size: 17px; }
.fab { position: absolute; left: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 48px; height: 48px; border-radius: 50%; background: #11111180; backdrop-filter: blur(8px); border: 0; color: #fff; font-size: 20px; padding: 0; }
.sheet { position: absolute; left: 14px; bottom: calc(70px + env(safe-area-inset-bottom)); display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; z-index: 5; }
.sheet[hidden] { display: none; }
.teemark { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid #111; box-shadow: 0 1px 4px #000a; cursor: grab; }
/* The crosshair never moves: the map moves under it. Its height must match CROSSHAIR_Y in hole.js. */
.holeview { --cy: 33.333%; }
.crosshair { position: absolute; left: 50%; top: var(--cy); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; border: 3px solid #111; box-shadow: 0 0 0 1.5px #fff, 0 1px 4px #000; pointer-events: none; z-index: 3; }
.readout { position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; z-index: 3; text-align: center; color: #fff; line-height: 1.1; white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 1px 2px #000; }
.readout b { display: block; font-size: 30px; font-weight: 700; }
.readout.to { bottom: calc(100% - var(--cy) + 30px); }
.readout.from { top: calc(var(--cy) + 30px); }
.readout .sg, .readout .wide { display: block; font-size: 17px; font-weight: 700; }
.readout .sg.gain { color: #4ade80; } .readout .sg.loss { color: #ff6b6b; }
.readout .wide { color: #ffe14d; }
.readout .wide[hidden] { display: none; }
.vertag { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 10px; z-index: 3; font-size: 12px; font-weight: 600; color: #fff; background: #1119; border-radius: 6px; padding: 2px 7px; pointer-events: none; }
.exppill { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 10px; z-index: 3; display: flex; align-items: center; gap: 8px; background: #111c; backdrop-filter: blur(8px); border-radius: 16px; padding: 6px 8px 6px 14px; color: #fff; text-align: center; }
.exppill small { display: block; font-size: 11px; opacity: .85; line-height: 1.1; } .exppill strong { font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.exppill select { min-height: 36px; padding: 4px 8px; border-radius: 10px; background: #333333; border-color: #3d3d3d; }
.compass { position: absolute; top: calc(34px + env(safe-area-inset-top)); left: 10px; z-index: 3; width: 34px; height: 34px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #11111180; backdrop-filter: blur(8px); display: grid; place-items: center; box-shadow: 0 1px 4px #0008; }
.compass svg { width: 26px; height: 26px; transition: transform .1s linear; }
.wind { position: absolute; top: calc(74px + env(safe-area-inset-top)); left: 10px; z-index: 3; width: 34px; height: 34px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #11111180; backdrop-filter: blur(8px); display: grid; place-items: center; box-shadow: 0 1px 4px #0008; cursor: pointer; }
.wind.manual { box-shadow: 0 0 0 2px #ffe14d, 0 1px 4px #0008; }
/* Wind box: set the wind by hand to try things out. */
/* Small, low on the left, clear of the yardages so they can be watched as the wind changes. */
.sheet.windbox { left: 70px; bottom: calc(122px + env(safe-area-inset-bottom)); width: min(190px, calc(100vw - 84px)); gap: 4px; padding: 8px 10px; }
.windbox > strong { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.windbox .windlive { min-height: 0; padding: 5px 4px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: inherit; font-size: 13px; font-weight: 600; }
.windbox .windlive[hidden] { display: none; }
.windrow { display: grid; gap: 0; font-size: 12px; }
.windrow input { min-height: 0; height: 22px; padding: 0; margin: 0; border: 0; background: none; }
.windrow input { width: 100%; }
.wind[hidden] { display: none; }
.wind svg { grid-area: 1 / 1; width: 34px; height: 34px; transition: transform .1s linear; }
.wind b { grid-area: 1 / 1; color: #fff; font: 800 12px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.holeview.replaying .wind { top: calc(114px + env(safe-area-inset-top)); }
.holeview.replaying .keys { top: calc(156px + env(safe-area-inset-top)); }
.sheet .menucourse { display: grid; gap: 1px; max-width: 240px; }
.sheet .menucourse small { color: var(--muted, #9a9a9a); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.sheet .menucourse strong { font-size: 15px; line-height: 1.25; }
.sheet .credit { font-size: 11px; max-width: 220px; }
.fab.gps, .fab.width, .fab.arc, .fab.autotarget, .fab.disp, .fab.appr, .fab.comp, .fab.cleanview, .fab.club, .fab.movetee, .fab.movepin { display: grid; place-content: center; line-height: 1; font-size: 18px; }
.fab.width, .fab.arc { left: auto; right: 14px; }
.fab.add { left: auto; right: 9px; bottom: calc(8px + env(safe-area-inset-bottom)); width: 58px; height: 58px; font-size: 34px; font-weight: 600; background: #ffb020; color: #111; }
.fab.undo { top: calc(66px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 10px; width: 44px; height: 44px; font-size: 22px; font-weight: 700; background: #ffb020; color: #111; box-shadow: 0 1px 6px #0008; z-index: 4; }
.fab.undo.low { top: calc(136px + env(safe-area-inset-top)); }
.fab.movetee { bottom: calc(70px + env(safe-area-inset-bottom)); }
.fab.movepin { bottom: calc(128px + env(safe-area-inset-bottom)); }
.setnext { position: absolute; left: 70px; height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: #ffb020; color: #111; font-size: 15px; font-weight: 700; box-shadow: 0 1px 6px #0008; z-index: 4; }
.setnext.tee { bottom: calc(72px + env(safe-area-inset-bottom)); }
.setnext.pin { bottom: calc(130px + env(safe-area-inset-bottom)); }
/* Moving the tee: the screen crosshair becomes the tee dot; the real tee marker hides under it. */
.holeview.movingtee .crosshair { width: 22px; height: 22px; margin: -11px 0 0 -11px; background: #fff; border: 2px solid #111; box-shadow: 0 0 0 3px #ffb020, 0 1px 4px #000; }
.holeview.movingtee .teemark { visibility: hidden; }
.aimmark { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px #111, 0 1px 4px #000; background: transparent; pointer-events: none; }
.fab[hidden] { display: none; }
.holed { position: absolute; right: 9px; bottom: calc(78px + env(safe-area-inset-bottom)); height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: #22c55e; color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 1px 6px #0008; z-index: 3; }
.holed[hidden] { display: none; }
.setpin { position: absolute; right: 9px; bottom: calc(78px + env(safe-area-inset-bottom)); height: 50px; padding: 0 20px; border-radius: 999px; border: 0; background: #ffb020; color: #111; font-size: 17px; font-weight: 700; box-shadow: 0 1px 6px #0008; z-index: 3; }
.setpin[hidden] { display: none; }
.greenbar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 4; display: flex; align-items: center; gap: 12px; background: #111d; backdrop-filter: blur(8px); border-radius: 999px; padding: 5px 5px 5px 16px; color: #fff; white-space: nowrap; }
.greenbar[hidden] { display: none; }
.greenbar > div { display: flex; align-items: baseline; gap: 10px; } .greenbar strong { font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums; } .greenbar strong em { font-style: normal; font-size: 15px; opacity: .85; } .greenbar span { font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }
.greenbar .btn { flex: none; width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 50%; font-size: 20px; font-weight: 700; line-height: 1; }
.readout .note { display: block; font-size: 15px; font-weight: 600; }
.shotmark { width: 20px; height: 20px; border-radius: 50%; background: #ffb020; color: #111; border: 2px solid #111; font: 700 11px/16px system-ui, sans-serif; text-align: center; box-shadow: 0 1px 4px #000a; }
.fab.width { bottom: calc(194px + env(safe-area-inset-bottom)); }
.fab.arc { bottom: calc(252px + env(safe-area-inset-bottom)); }
.fab.appr { left: auto; right: 14px; bottom: calc(368px + env(safe-area-inset-bottom)); }
.fab.disp { left: auto; right: 14px; bottom: calc(310px + env(safe-area-inset-bottom)); }
.fab.arcadj.dispadj { bottom: calc(314px + env(safe-area-inset-bottom)); }
.readout .sg.disp { font-size: 15px; }
.fab.appr.on { background: #4dd0ff; color: #111; }
.sgtlabel { background: #111d; color: #e9d5ff; font: 700 12px/1 system-ui, sans-serif; padding: 4px 7px; border-radius: 999px; white-space: nowrap; pointer-events: none; border: 1px solid #c084fc; }
.fab small { font-size: 9px; font-weight: 600; }
.fab.on { background: #ffe14d; color: #111; }
.fab.arc.on { background: #fff; }
.sliders { position: absolute; left: 70px; right: 70px; bottom: calc(78px + env(safe-area-inset-bottom)); max-width: 340px; margin: 0 auto; display: grid; gap: 6px; z-index: 4; }
.arcslider { display: grid; gap: 4px; background: #111c; backdrop-filter: blur(8px); border-radius: 18px; padding: 7px 12px 4px; color: #fff; font-size: 13px; z-index: 4; }
.arcslider .presets { display: flex; gap: 5px; }
.arcslider .preset { flex: 1; min-height: 28px; padding: 0; border-radius: 999px; border: 0; background: #ffffff22; color: #fff; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.arcslider .preset.on { background: #fff; color: #111; }
.arcslider.appr .preset.on { background: #4dd0ff; }
.arcslider.appr input { accent-color: #4dd0ff; }
.arcslider .slide { display: flex; align-items: center; gap: 8px; }
.arcslider[hidden] { display: none; }
.arcslider input { flex: 1; min-height: 28px; padding: 0; border: 0; background: none; accent-color: #fff; }
.arcslider b { min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pinmark { width: 12px; height: 12px; border-radius: 50%; background: #111; border: 2.5px solid #fff; box-shadow: 0 1px 4px #000a; cursor: grab; }
.pinmark::after { content: ""; position: absolute; inset: -14px; } /* larger touch area */

/* start page */
.home .version { font-weight: 600; margin-bottom: 14px; }
.holegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.holegrid .card { margin: 0; padding: 10px; display: grid; text-decoration: none; text-align: center; }
.holegrid strong { font-size: 20px; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* Leave-round dialog */
.leave { position: absolute; inset: 0; z-index: 20; background: #000a; display: grid; place-items: center; padding: 20px; }
.leavebox { width: min(320px, 100%); background: #1e1e1e; border-radius: 16px; padding: 18px 16px 12px; display: grid; gap: 10px; color: #fff; text-align: center; box-shadow: 0 8px 30px #000a; }
.leavebox strong { font-size: 18px; margin-bottom: 4px; }
.leavebox button { min-height: 46px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 700; color: #fff; }
.leavebox .pause { background: #2d7abc; }
.leavebox .submit { background: #007a52; }
.leavebox .delete { background: #e06060; }
.leavebox .nosave { background: #3d3d3d; }
.leavebox .cancel { background: transparent; color: #9a9a9a; min-height: 36px; }
.keys { position: absolute; left: 10px; top: calc(116px + env(safe-area-inset-top)); z-index: 3; display: grid; gap: 6px; justify-items: start; pointer-events: none; }
.zonelegend { display: grid; gap: 3px; background: #111d; backdrop-filter: blur(8px); border-radius: 10px; padding: 5px 7px; color: #fff; font: 600 11px/1.1 system-ui, sans-serif; }
.zonelegend.heat { padding: 5px 6px 6px; }
.heatbar { display: grid; width: 14px; margin-right: 30px; }
.heatbar .blk { height: 13px; position: relative; }
.heatbar .blk:first-child { border-radius: 4px 4px 0 0; } .heatbar .blk:last-child { border-radius: 0 0 4px 4px; }
.heatbar em { position: absolute; left: 18px; bottom: 0; transform: translateY(50%); font-style: normal; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zonelegend small { font-size: 10px; opacity: .8; }
.zonelegend span { display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.zonelegend i { width: 12px; height: 10px; border-radius: 3px; display: inline-block; }
.arcslider .modes { justify-self: center; display: flex; justify-content: center; gap: 4px; margin: -2px auto 2px; background: #ffffff14; border-radius: 999px; padding: 2px; }
.arcslider .modes button { min-height: 26px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: #fff; font-size: 12px; font-weight: 700; }
.arcslider .modes button.on { background: #4dd0ff; color: #111; }
.arcslider.appr.sgmode .modes button.on { background: #c084fc; }
.arcslider.appr.sgmode .preset.on { background: #c084fc; color: #111; }
.arcslider.appr.sgmode input { accent-color: #c084fc; }
.fab.viewedit { top: calc(66px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 10px; width: auto; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 700; background: #ffb020; color: #111; box-shadow: 0 1px 6px #0008; z-index: 4; }
.fab.viewedit[hidden] { display: none; }
.fab.viewedit.low { top: calc(136px + env(safe-area-inset-top)); }
.fab.savehole { top: calc(68px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 62px; width: auto; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 15px; font-weight: 700; background: #22c55e; color: #fff; box-shadow: 0 1px 6px #0008; z-index: 4; }
.fab.savehole[hidden] { display: none; }
.fab.cancelhole { top: calc(68px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 152px; width: auto; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 700; background: #111d; color: #fff; box-shadow: 0 1px 6px #0008; z-index: 4; }
.fab.cancelhole[hidden] { display: none; }
.shotlist { position: absolute; right: 10px; top: calc(118px + env(safe-area-inset-top)); z-index: 4; width: min(200px, 52vw); max-height: 38vh; overflow-y: auto; display: grid; gap: 4px; background: #111d; backdrop-filter: blur(8px); border-radius: 12px; padding: 6px; }
.shotlist[hidden] { display: none; }
.shotrow { min-height: 30px; padding: 4px 8px; border: 0; border-radius: 8px; background: #ffffff14; color: #fff; font: 600 12px/1.2 system-ui, sans-serif; text-align: left; justify-content: flex-start; font-variant-numeric: tabular-nums; }
.shotrow.on { background: #ffb020; color: #111; }
.shotrow.last { background: transparent; color: #9a9a9a; padding: 4px 8px; }
.shotmove { display: flex; gap: 4px; }
.shotmove button { flex: 1; min-height: 32px; padding: 0 6px; border: 0; border-radius: 8px; background: #ffffff22; color: #fff; font-weight: 700; font-size: 12px; }
.shotmove button.go { background: #ffb020; color: #111; }
.chips { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(67px + env(safe-area-inset-bottom)); z-index: 3; display: flex; gap: 6px; }
.chips[hidden] { display: none; }
.scorechip { height: 50px; min-height: 0; padding: 4px 10px; border: 0; border-radius: 14px; background: #111c; backdrop-filter: blur(8px); color: #fff; display: grid; align-content: center; justify-items: center; gap: 1px; line-height: 1.05; }
.scorechip small { font-size: 10px; opacity: .75; font-weight: 600; }
.scorechip strong { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.scorechip strong em, .scorechip > em { font-style: normal; font-size: 12px; font-weight: 700; opacity: .9; }
.scorecard { position: absolute; inset: 0; z-index: 30; background: #000b; display: grid; place-items: center; padding: 14px; }
.scorecard[hidden] { display: none; }
.scbox { width: min(560px, 100%); background: #1e1e1e; color: #fff; border-radius: 16px; padding: 12px; display: grid; gap: 10px; box-shadow: 0 8px 30px #000a; }
.schead { display: flex; align-items: center; gap: 10px; } .schead strong { font-size: 18px; } .schead span { flex: 1; font-weight: 700; color: #cfcfcf; }
.schead button { width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: #ffffff1c; color: #fff; }
.scscroll { overflow-x: auto; display: grid; gap: 10px; }
.scbox table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.scbox th, .scbox td { padding: 4px 3px; text-align: center; border-bottom: 1px solid #333; min-width: 24px; }
.scbox th { background: #007a52; color: #fff; cursor: pointer; } .scbox th.cur { background: #ffb020; color: #111; }
.scbox th:first-child, .scbox td:first-child { text-align: left; color: #9a9a9a; background: none; font-weight: 600; cursor: default; }
.scbox th:last-child, .scbox td:last-child { font-weight: 800; }
.scbox tr.yds td { color: #9a9a9a; font-size: 11px; }
.scbox tr.score td { cursor: pointer; } .scbox tr.score span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; font-weight: 800; }
.scbox span.eagle { border-radius: 50%; background: #f0c830; color: #111; } .scbox span.birdie { border-radius: 50%; border: 2px solid #00b87a; }
.scbox span.bogey { border: 2px solid #d4706e; } .scbox span.dbl { background: #d4706e; }
.shotrow.redo { margin-top: 4px; justify-content: center; text-align: center; background: #d4706e; color: #fff; font-weight: 700; }
.topright { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 10px; z-index: 3; display: flex; align-items: stretch; gap: 6px; }
.topright .exppill { position: static; }
.topright .fab.sgviewbtn { position: static; width: auto; height: auto; min-height: 0; padding: 0 10px; border-radius: 14px; font-size: 12.5px; font-weight: 700; line-height: 1.1; background: #ffb020; color: #111; box-shadow: 0 1px 6px #0008; display: grid; place-content: center; text-align: center; }
.fab.sgviewbtn.on { background: #c084fc; color: #111; }
.fab.sgviewbtn[hidden] { display: none; }
.sgview { position: absolute; right: 10px; top: calc(116px + env(safe-area-inset-top)); z-index: 6; width: min(290px, calc(100vw - 86px)); max-height: 62vh; overflow-y: auto; display: grid; gap: 4px; background: #282828; border: 1px solid #333; border-radius: 14px; padding: 10px; color: #fff; box-shadow: 0 6px 24px #000a; font-size: 13px; }
.sgview[hidden] { display: none; }
.sghead { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; } .sghead small { flex: 1; }
.sgclose { width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #ffffff1c; color: #fff; font-size: 14px; } .sghead strong { font-size: 15px; } .sghead small { color: #9a9a9a; }
.sgrow { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 8px; border: 0; border-radius: 9px; background: #ffffff10; color: #fff; text-align: left; font-weight: 600; }
.sgrow .caret { width: 12px; color: #9a9a9a; } .sgrow .lab { flex: 1; } .sgrow small { color: #9a9a9a; font-size: 11px; margin-right: 6px; }
.sgrow b, .sgcats b, .shotinfo b { font-variant-numeric: tabular-nums; }
.sgview b.pos { color: #4ade80; } .sgview b.neg { color: #ff6b6b; }
.sgcats, .shotinfo { display: grid; gap: 2px; padding: 2px 8px 6px 26px; }
.sgcats div, .shotinfo div { display: flex; justify-content: space-between; gap: 8px; } .sgcats span, .shotinfo span { color: #cfcfcf; } .sgcats small { color: #7a7a7a; margin-left: auto; margin-right: 8px; font-size: 11px; }
.shotinfo b.muted { color: #7a7a7a; font-weight: 600; }
.sgsub { margin-top: 6px; font-size: 11px; font-weight: 700; color: #9a9a9a; text-transform: uppercase; letter-spacing: .4px; }
.shotmark { cursor: pointer; }
.shotpopup .maplibregl-popup-content { background: #282828; color: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 6px 20px #000a; font: 13px system-ui, sans-serif; }
.shotpopup .maplibregl-popup-tip { border-top-color: #282828; border-bottom-color: #282828; }
.shotpopup .maplibregl-popup-close-button { color: #9a9a9a; font-size: 18px; padding: 0 6px; min-height: 0; background: none; border: 0; }
.shotpop { display: grid; gap: 3px; min-width: 180px; }
.shotpop strong { font-size: 14px; margin-bottom: 2px; } .shotpop strong small { color: #9a9a9a; font-weight: 600; }
.shotpop div { display: flex; justify-content: space-between; gap: 10px; } .shotpop span { color: #cfcfcf; } .shotpop b { font-variant-numeric: tabular-nums; }
.shotpop b.pos { color: #4ade80; } .shotpop b.neg { color: #ff6b6b; } .shotpop b.muted { color: #7a7a7a; font-weight: 600; }
.holeview.viewing .crosshair, .holeview.viewing .readout { display: none; }
.shotinfo .line, .shotpop .line { justify-content: flex-start; } .shotinfo .line b, .shotpop .line b { font-size: 13px; }
.shotinfo .line.sub span, .shotpop .line.sub span { color: #cfcfcf; font-size: 13px; } .shotpop .line.sub { margin-bottom: 3px; }
.fab.club { left: auto; right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); }
.fab.club span { font-size: 15px; font-weight: 800; }
.fab.club.on { background: #ffb020; color: #111; }
.vertag.scouting { background: #1a4a8a; }
.vertag.tourney { background: #8a6d00; } /* Tournament mode: gold */
.clubsheet { position: absolute; inset: 0; z-index: 25; background: #000a; display: grid; place-items: end center; padding: 12px; }
.clubsheet[hidden] { display: none; }
.clubbox { width: min(420px, 100%); background: #1e1e1e; color: #fff; border-radius: 16px; padding: 12px; display: grid; gap: 10px; margin-bottom: calc(70px + env(safe-area-inset-bottom)); box-shadow: 0 8px 30px #000a; }
.clubhead { display: flex; align-items: center; } .clubhead strong { flex: 1; font-size: 16px; }
.clubhead .x { width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #ffffff1c; color: #fff; }
.clubgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.clubgrid button { min-height: 46px; padding: 4px; border: 0; border-radius: 10px; background: #333333; color: #fff; display: grid; place-content: center; gap: 1px; }
.clubgrid button b { font-size: 15px; } .clubgrid button small { font-size: 10px; color: #9a9a9a; }
.clubgrid button.on { background: #ffb020; color: #111; } .clubgrid button.on small { color: #333; }
.swings { display: flex; gap: 5px; } .swings button { flex: 1; min-height: 36px; padding: 0 4px; border: 0; border-radius: 999px; background: #333333; color: #fff; font-weight: 700; font-size: 13px; }
.swings button.on { background: #4dd0ff; color: #111; }
.clubbox .record { min-height: 46px; border: 0; border-radius: 12px; background: #ffb020; color: #111; font-size: 16px; font-weight: 800; }
.clubbox .recordrow { display: flex; gap: 8px; } .clubbox .recordrow .record { flex: 1; }
.clubbox .lostlast { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; width: 100%; max-width: none; margin: 0 0 8px; padding: 6px 14px; text-align: left; } .clubbox .lostlast small { font-size: 12px; font-weight: 500; color: #bdbdbd; }
.clubbox .lostball { min-height: 46px; border: 0; border-radius: 12px; background: #3d3d3d; color: #fff; font-size: 15px; font-weight: 700; padding: 0 14px; }
.fab.arcadj { left: auto; right: 68px; bottom: calc(256px + env(safe-area-inset-bottom)); width: 40px; height: 40px; display: grid; place-content: center; line-height: 1; font-size: 14px; }
.fab.arcadj small { font-size: 9px; font-weight: 600; }
.fab.arcadj.on { background: #fff; color: #111; }
.fab.appradj { bottom: calc(372px + env(safe-area-inset-bottom)); } .fab.appradj.on { background: #4dd0ff; }
.arcslider { min-width: 0; }
.arcslider .presets { min-width: 0; gap: 4px; }
.arcslider .preset { min-width: 0; flex: 1 1 0; font-size: 12px; }
.fab.comp { bottom: calc(360px + env(safe-area-inset-bottom)); }
.fab.cleanview { bottom: calc(186px + env(safe-area-inset-bottom)); }
.fab.autotarget { bottom: calc(302px + env(safe-area-inset-bottom)); }
.fab.autotarget.on { background: #22c55e; color: #111; }
.autokey b.pos { color: #4ade80; } .autokey b.neg { color: #ff6b6b; } .autokey span.best { font-weight: 800; color: #fff; } .autokey span { color: #cfcfcf; }
.holeview.clean .shotmark, .holeview.clean .crosshair, .holeview.clean .readout { display: none; }
.fab.comp.on { background: #f472b6; color: #111; }
.compkey b { font-variant-numeric: tabular-nums; } .compkey b.pos { color: #4ade80; } .compkey b.neg { color: #ff6b6b; }
.clubgrid button.comp { color: #111; } .clubgrid button.comp small { color: #333; }
.clubgrid button:disabled { opacity: .35; }
.compactions { display: flex; gap: 8px; } .compactions button { flex: 1; min-height: 46px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 800; }
.compactions .off { background: #3d3d3d; color: #fff; flex: 0 0 34%; } .compactions .record:disabled { opacity: .4; }
.compdots { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.compdot { position: absolute; width: 0; height: 0; color: #fff; white-space: nowrap; line-height: 1.1; text-shadow: 0 0 3px #000, 0 0 6px #000, 0 1px 2px #000; }
.compdot i { pointer-events: auto; cursor: grab; touch-action: none; position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); border: 2px solid #fff; box-sizing: border-box; box-shadow: 0 1px 4px #000a; }
.compdot b { position: absolute; left: 0; transform: translateX(-50%); font-size: 17px; font-weight: 800; }
.compdot .up { bottom: 8px; } .compdot .down { top: 8px; color: var(--c); }
.holeview.comparing .readout, .holeview.comparing .crosshair { display: none; }
.compdot i::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; } /* larger touch area */
.compdot i { transition: transform .12s; }
.compdot.active i { transform: scale(1.7); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 45%, transparent), 0 0 12px var(--c); }
.compdot.active b { font-size: 21px; } .compdot.active .up { bottom: 13px; } .compdot.active .down { top: 13px; }
.compdot.active { z-index: 1; }
.fab.compset { bottom: calc(416px + env(safe-area-inset-bottom)); left: 18px; width: 40px; height: 40px; display: grid; place-content: center; font-size: 19px; background: #f472b6; color: #111; box-shadow: 0 1px 6px #0008; }
.compmodes { display: flex; gap: 8px; } .compmodes button { flex: 1; min-height: 40px; border: 1px solid #444; border-radius: 12px; background: #2a2a2a; color: #fff; font-size: 15px; font-weight: 700; } .compmodes button.on { background: #f472b6; border-color: #f472b6; color: #111; }
.setnext.drop { bottom: calc(188px + env(safe-area-inset-bottom)); background: #4dd0ff; }
.setnext[hidden] { display: none; }
.penopts { display: grid; gap: 8px; }
.penopt { min-height: 56px; border: 0; border-radius: 12px; background: #333333; color: #fff; display: grid; gap: 2px; padding: 8px 12px; text-align: left; }
.penopt b { font-size: 16px; } .penopt small { color: #9a9a9a; font-size: 12px; }
.shotmark.pen { background: #ff6b6b; } /* went into water or OB */
.shotmark.drop { background: #4dd0ff; } /* the drop, numbered after the penalty */
.clubbox .ydmode { justify-self: center; display: flex; gap: 4px; background: #ffffff14; border-radius: 999px; padding: 2px; }
.clubbox .ydmode button { min-height: 28px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: #fff; font-size: 13px; font-weight: 700; }
.ydmode button.on { background: #fff !important; color: #111 !important; }
.coursesearch, .cx .coursesearch { flex: 0 0 48px; width: 48px; max-width: 48px; min-height: 0; padding: 0; border: 1px solid #3d3d3d; border-radius: 10px; background: #222; font-size: 18px; }
/* A dropdown under the course box: about four courses tall (the cut-off fifth shows it scrolls). */
.courseresults { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10; max-height: 190px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: #1e1e1e; border: 1px solid #333; border-radius: 10px; box-shadow: 0 8px 24px #000a; }
.courseresults[hidden] { display: none; }
.courseresults button, .cx .courseresults button { max-width: none; width: 100%; height: auto; min-height: 42px; padding: 8px 12px; border: 0; border-bottom: 1px solid #2c2c2c; border-radius: 0; background: transparent; display: block; color: #fff; text-align: left; font-size: 14px; font-weight: 600; }
.courseresults button.on, .cx .courseresults button.on { background: #007a5233; }
.courseresults .none { color: #606060; font-size: 13px; text-align: center; padding: 6px; }

/* boundary editor on the hole map (GPS Scouting) */
.holeview.bedit > :not(#gmap):not(.beditbar):not(.beditpanel) { display: none !important; }
.holeview.bedit .maplibregl-marker:not(.bvtx):not(.bmid):not(.bmove):not(.bscale):not(.btee), .holeview.bedit .maplibregl-popup, .holeview.bedit .liveoverlay { display: none !important; }
.beditbar { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; z-index: 6; display: flex; align-items: center; gap: 6px; background: #111d; backdrop-filter: blur(8px); border-radius: 14px; padding: 6px; color: #fff; }
.beditbar .bnav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
.beditbar .bnav button { width: 36px; padding: 0; font-size: 26px; line-height: 1; background: transparent; }
.beditbar strong { text-align: center; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.beditbar button, .beditpanel button { min-height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: #333333; color: #fff; font: 600 14px system-ui, sans-serif; }
.beditbar button:disabled, .beditpanel button:disabled { opacity: .4; }
.beditbar .bsave, .beditpanel .bgo { background: #007a52; color: #fff; }
.beditbar .bkeep { background: #1f6f43; }
@media (max-width: 440px) { .beditbar { gap: 4px; } .beditbar button { padding: 0 8px; font-size: 13px; } .beditbar .bnav button { width: 28px; } .beditbar .bholeword { display: none; } }
.beditpanel .bdel { background: #7f1d1d; }
.beditpanel { position: absolute; left: 8px; right: 8px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 6; display: grid; gap: 8px; background: #111d; backdrop-filter: blur(8px); border-radius: 14px; padding: 10px; color: #fff; }
.beditpanel .bhint { margin: 0; font-size: 13px; line-height: 1.3; }
.beditpanel small { font-size: 11px; }
.beditpanel .brow { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.btypes { display: flex; flex-wrap: wrap; gap: 6px; }
.beditpanel .btype { min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: #333333; border: 2px solid transparent; }
.beditpanel .btype i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.beditpanel .btype.on { border-color: var(--c); background: #3d3d3d; }
.bvtx { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #111; box-shadow: 0 1px 3px #000a; cursor: grab; touch-action: none; }
.bvtx.on { background: #ffb020; width: 20px; height: 20px; }
.bvtx.draft { background: #ffe14d; }
.bvtx.draft.first { width: 22px; height: 22px; background: #22c55e; }
.bmid { width: 11px; height: 11px; border-radius: 50%; background: #fff8; border: 1.5px solid #111a; cursor: grab; touch-action: none; }
.bmove { width: 34px; height: 34px; border-radius: 50%; background: #ffb020; color: #111; border: 2px solid #111; box-shadow: 0 1px 4px #000a; display: grid; place-items: center; font-size: 20px; line-height: 1; cursor: move; touch-action: none; z-index: 2; }
.holeview.bmoving .bvtx, .holeview.bmoving .bmid, .holeview.bmoving .bmove { display: none; }
.bscale { width: 30px; height: 30px; border-radius: 8px; background: #4dd0ff; color: #111; border: 2px solid #111; box-shadow: 0 1px 4px #000a; display: grid; place-items: center; font-size: 18px; font-weight: 700; line-height: 1; cursor: nwse-resize; touch-action: none; z-index: 2; }
.beditpanel .bsize { display: inline-flex; align-items: center; gap: 4px; margin-right: auto; font-size: 13px; font-weight: 600; }
.beditpanel .bsize button { width: 38px; padding: 0; font-size: 20px; }
.btee { pointer-events: none; display: grid; gap: 2px; justify-items: center; background: #111d; color: #fff; border-radius: 8px; padding: 3px 7px; font: 700 12px system-ui, sans-serif; white-space: nowrap; box-shadow: 0 1px 4px #000a; }
.btee.sel { outline: 2px solid #ffb020; }
.btee small { font-size: 10px; font-weight: 600; opacity: .8; }
.btee .bteeset { display: inline-flex; align-items: center; gap: 5px; }
.btee .bteeset i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff8; }
.bvtx.cut { border-color: #ef4444; width: 20px; height: 20px; cursor: pointer; }
.bvtx.cut.on { background: #ef4444; border-color: #fff; width: 24px; height: 24px; }
.bvtx.sec { background: #ef4444; }
.bmove.sec { background: #ef4444; color: #fff; }

/* course editing is for admins only */
body:not(.admin) #nav a[data-tab="course"] { display: none; }

/* expected scores (tap Expected): the scorecard, with decimal scores */
.exppill .expopen { cursor: pointer; }
.scbox.expected th, .scbox.expected td { padding: 4px 1px; min-width: 0; }
.scbox.expected tr.score span { min-width: 0; padding: 0 2px; height: 20px; font-size: 11px; }

/* ---- Live view ---- */
/* Scoring: the Live button beside the version tag, and its box. */
.fab.livebtn { top: calc(6px + env(safe-area-inset-top)); bottom: auto; left: 54px; width: auto; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; z-index: 4; box-shadow: 0 1px 4px #0008; }
.fab.livebtn[hidden] { display: none; }
.vertag ~ .fab.livebtn { left: 104px; } /* beside the Tournament tag */
.fab.livebtn i { width: 8px; height: 8px; border-radius: 50%; background: #8a8a8a; }
.fab.livebtn.on { background: #c8102e; }
.fab.livebtn.on i { background: #fff; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .fab.livebtn.on i, .livetag.on b { animation: none; } }
.livebox .leavebox { text-align: left; }
.livebox .leavebox > strong { text-align: center; }
.livebox p { margin: 0; font-size: 13.5px; line-height: 1.4; color: #cfcfcf; }
.livebox .btn { background: #2d7abc; border: 0; color: #fff; min-height: 46px; border-radius: 12px; }
.liveswitch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 17px; font-weight: 700; padding: 4px 2px; cursor: pointer; }
.liveswitch input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; padding: 0; }
.liveswitch i { flex: none; width: 52px; height: 30px; border-radius: 999px; background: #555; position: relative; transition: background .15s; }
.liveswitch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .15s; }
.liveswitch input:checked + i { background: #c8102e; }
.liveswitch input:checked + i::after { transform: translateX(22px); }
.liveswitch input:focus-visible + i { outline: 2px solid #fff; outline-offset: 2px; }
.livehead { color: #9a9a9a; font-size: 12px; margin-top: 4px; }
.livelink { width: 100%; background: #111; border: 1px solid #444; color: #fff; border-radius: 10px; font-size: 13px; padding: 10px; }
.liverow { display: flex; gap: 8px; }
.liverow button { flex: 1; }
.livenote { color: #8fd14f; font-size: 12.5px; min-height: 0; }
.livenote:empty { display: none; }
.livenote.err { color: #ffb020; }
/* Watching: whose round it is, and Refresh. */
.livetag { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 10px; z-index: 3; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: #fff; background: #111c; border-radius: 6px; padding: 3px 8px; pointer-events: none; }
.livetag b { letter-spacing: .04em; color: #bdbdbd; }
.livetag.on { background: #c8102e; }
.livetag.on b { color: #fff; }
/* Refresh: a small round button in the bottom right corner. */
.fab.liverefresh { left: auto; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 40px; height: 40px; font-size: 20px; font-weight: 700; background: #fff; color: #111; box-shadow: 0 1px 6px #0008; z-index: 4; display: grid; place-content: center; line-height: 1; }
.fab.liverefresh[hidden] { display: none; }
.fab.liverefresh.busy { opacity: .6; }
/* The latest shot, in a thin strip across the top. */
.lastshot { position: absolute; top: calc(46px + env(safe-area-inset-top)); left: 52px; right: 10px; z-index: 3; height: 28px; min-height: 0; padding: 0 12px; border: 0; border-radius: 999px; background: #111d; backdrop-filter: blur(8px); color: #fff; font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 6px #0008; }
.lastshot b { color: #ffb020; }
.lastshot[hidden] { display: none; }
.liveerr { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; color: #fff; }
.liveerr strong { font-size: 20px; }
.liveerr p { margin: 0 0 6px; color: #b5b5b5; }
.liveerr .btn { min-width: 180px; }

/* Holed out: no crosshair or readouts, just the hole and its shots. */
.holeview.holedout .crosshair, .holeview.holedout .readout { display: none; }
/* Score tiles span the hole pill's width (set in js/hole.js). */
.chips { box-sizing: border-box; }
/* One long score box, as wide as the hole pill: this hole's score on the left, "+2 thru 5" on the right. */
.chips .scorechip { flex: 1 1 0; height: 44px; padding: 0 18px; border-radius: 999px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chips .scorechip > div { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.chips .scorechip small { font-size: 12px; }
.chips .scorechip strong { font-size: 20px; }
.chips .scorechip strong em { font-size: 13px; }
.chips .scorechip .thru strong { font-size: 16px; }
/* Watching a live round: just the hole, the shots and the score. No aiming tools or expected strokes. */
.holeview.watching .fab.tools, .holeview.watching .fab.sgtools, .holeview.watching .fab.cleanview, .holeview.watching .viewbox, .holeview.watching .fab.appr, .holeview.watching .fab.disp,
.holeview.watching .fab.arc, .holeview.watching .fab.width, .holeview.watching .fab.arcadj, .holeview.watching .sliders, .holeview.watching .exppill, .holeview.watching .keys { display: none !important; }

/* ---- GPS ---- */
/* One row under Expected: the GPS button at the right edge, Undo to its left, then the
   Shot pin (record where you stand). Your distance to the pin sits in the top middle. */
.fab.gps { top: calc(66px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 10px; width: 44px; height: 44px; box-shadow: 0 1px 6px #0008; z-index: 4; }
.fab.gps[hidden], .fab.gpsshot[hidden], .gpsdist[hidden] { display: none; }
.fab.gps.on { background: #2f7df6; color: #fff; }
.fab.undo { right: 60px; }
/* Record a shot where you stand: just below the GPS button (the yardage stays at the top). */
.fab.gpsshot { top: calc(116px + env(safe-area-inset-top)); bottom: auto; left: auto; right: 10px; width: 44px; height: 44px; display: grid; place-content: center; line-height: 1; font-size: 16px; background: #2f7df6; color: #fff; box-shadow: 0 1px 6px #0008; z-index: 4; }
.gpsdist { position: absolute; top: calc(66px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 4; display: grid; justify-items: center; gap: 1px; height: 44px; min-height: 0; padding: 0 9px; align-content: center; border: 0; border-radius: 12px; background: #111c; backdrop-filter: blur(8px); color: #fff; line-height: 1.1; white-space: nowrap; box-shadow: 0 1px 6px #0008; }
.gpsdist b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.gpsdist small { font-size: 10.5px; color: #8fb8ff; font-weight: 600; }
.gpsdot { width: 16px; height: 16px; border-radius: 50%; background: #2f7df6; border: 3px solid #fff; box-shadow: 0 0 0 6px #2f7df640, 0 1px 4px #000a; }
.holeview.clean .gpsdist, .holeview.clean .fab.gpsshot, .holeview.comparing .gpsdist, .holeview.comparing .fab.gps, .holeview.comparing .fab.gpsshot { display: none; }

/* Expected: a small tile; tapping it opens the expected scorecard with the handicap levels. */
.exppill { padding: 5px 12px; border-radius: 14px; gap: 0; }
.exppill small { font-size: 10px; } .exppill strong { font-size: 18px; }
.explevels { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.explevels button { min-height: 34px; padding: 0 11px; border: 0; border-radius: 999px; background: #ffffff1c; color: #fff; font-size: 13px; font-weight: 700; }
.explevels button.on { background: #ffb020; color: #111; }

/* Hole screen, fewer buttons. Left: menu, Tee, Pin, View (View opens a box of
   switches). Right: + and Tools, which opens the aiming tools up the column. */
.fab.tools, .fab.sgtools { display: grid; place-content: center; line-height: 1; font-size: 18px; }
.fab.tools { left: auto; right: 14px; bottom: calc(136px + env(safe-area-inset-bottom)); }
.fab.sgtools { bottom: calc(244px + env(safe-area-inset-bottom)); }
.fab.tools.on, .fab.sgtools.on { background: #ffe14d; color: #111; }
.holeview:not(.toolsopen) :is(.fab.width, .fab.arc, .fab.disp, .fab.appr, .fab.arcadj) { display: none; }
.holeview:not(.sgopen) :is(.fab.comp, .fab.autotarget, .fab.compset) { display: none; }
.sheet.viewbox { left: 70px; bottom: calc(186px + env(safe-area-inset-bottom)); min-width: 230px; gap: 4px; }
.viewbox > strong { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.viewswitch { font-size: 16px; }
.viewswitch span small { display: block; font-size: 11px; font-weight: 500; }
.viewswitch.off { opacity: .55; cursor: default; }
.viewelev { border-top: 1px solid rgba(255,255,255,.15); margin-top: 4px; padding-top: 4px; display: flex; flex-direction: column; gap: 4px; }
.viewelev[hidden] { display: none; }
.viewchips { display: flex; gap: 6px; padding: 0 2px 4px; }
.viewchips.off { opacity: .45; }
/* The number stays centred; the rise/drop (small, centred on the line) and "yd" sit to its right: "161(+1) yd". */
.readout b.playslike .num { position: relative; }
.readout b.playslike .tail { position: absolute; left: 100%; top: 0; bottom: 0; display: flex; align-items: center; gap: 4px; padding-left: 4px; white-space: nowrap; }
.readout b.playslike .dz { font-size: 13px; font-weight: 700; color: #fff; }
.readout b.playslike .up { color: #ff6b6b; } .readout b.playslike .down { color: #4ade80; }
.readout b.playslike .pl { display: block; font-size: 22px; color: #9fdcff; }
.readout b.playslike .pl .wnd { font-size: 14px; font-weight: 700; }
/* Plays like: left of Expected, with its Elv and Wnd switches under it. */
.playswrap { position: relative; display: flex; }
.playswrap[hidden] { display: none; }
.playsbtn { min-height: 0; padding: 0 10px; border: 0; border-radius: 14px; background: #11111180; backdrop-filter: blur(8px); color: #fff; font-size: 12.5px; font-weight: 700; line-height: 1.1; box-shadow: 0 1px 6px #0008; }
.playsbtn.on { background: #9fdcff; color: #111; }
.playsopts { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.playsopts[hidden] { display: none; }
.playscircle { width: 40px; height: 40px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #11111180; backdrop-filter: blur(8px); color: #fff; font-size: 12px; font-weight: 700; box-shadow: 0 1px 6px #0008; }
.playscircle.on { background: #9fdcff; color: #111; }
.holeview.watching .playswrap, .holeview.clean .playswrap { display: none; }
.viewchips button { flex: 1; min-height: 0; padding: 6px 4px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: inherit; font-size: 13px; font-weight: 600; }
.viewchips button.on { background: #22c55e; border-color: #22c55e; color: #111; }
.viewswitch input:checked + i { background: #22c55e; }
/* Clean view, for screenshots: only the map, the hole pill, the menu and View
   (moved down to just above the menu once its box is closed: .viewlow), plus any box they open. */
.holeview.clean > :not(#gmap):not(.holepill):not(.menu):not(.cleanview):not(.sheet):not(.leave) { display: none !important; }
.holeview.viewlow .fab.cleanview { bottom: calc(70px + env(safe-area-inset-bottom)); }
.holeview.viewlow .sheet.viewbox { bottom: calc(70px + env(safe-area-inset-bottom)); }
/* GPS on: the distance to the pin and the GPS shot button sit at the very top. */
/* The distance box starts just left of centre, clear of the Live pill on the left and Expected on the right. */
.gpstop { position: absolute; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-40px); z-index: 4; display: flex; gap: 6px; align-items: center; }
.gpstop .gpsdist { position: static; transform: none; }
/* Watching a client's round: the tag across the top has their name, the date and
   the course; Strokes Gained sits on the right just below it. */
.holeview.watching .livetag { right: 10px; max-width: none; }
.holeview.watching .topright { top: calc(36px + env(safe-area-inset-top)); }
/* Replay. Very top: the round's tag (FINAL · name · date · course), with the hole,
   shot and club ("Hole 10 · Shot 2 · 7 Iron") just under it, then Strokes Gained (right) and the compass (left).
   Bottom right, stacked: play / pause, 2x above it, ✕ (end replay) above that. */
.replaybar { display: contents; }
.replaybar .rplabel { position: absolute; top: calc(38px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 4; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 999px; background: #111e; backdrop-filter: blur(8px); color: #fff; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 6px #0008; }
.replaybar button { position: absolute; right: 12px; z-index: 4; width: 52px; height: 52px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #111d; backdrop-filter: blur(8px); color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 1px 6px #0008; }
.replaybar .rpplay { bottom: calc(14px + env(safe-area-inset-bottom)); width: 58px; height: 58px; right: 9px; background: #ffb020; color: #111; font-size: 18px; }
.replaybar .rpspeed { bottom: calc(80px + env(safe-area-inset-bottom)); }
.replaybar .rpspeed.on { background: #4dd0ff; color: #111; }
.replaybar .rpexit { bottom: calc(140px + env(safe-area-inset-bottom)); width: 40px; height: 40px; right: 18px; font-size: 15px; }
.holeview.replaying .compass { top: calc(74px + env(safe-area-inset-top)); }
.holeview.replaying.watching .topright { top: calc(74px + env(safe-area-inset-top)); }
.rpclub { background: #111e; color: #fff; font: 800 13px/1 system-ui, sans-serif; padding: 5px 9px; border-radius: 999px; border: 1.5px solid #fff; white-space: nowrap; pointer-events: none; box-shadow: 0 1px 4px #000a; }
.holeview.clean .replaybar > * { display: none; }
/* Viewing a past round. Strokes Gained: its own taller button in the bottom-right
   corner (above the replay controls in a replay, above Refresh when watching live),
   its panel opening above it. View sits just above the menu, as Tee and Pin aren't there. */
.holeview .fab.sgviewbtn { position: absolute; top: auto; left: auto; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom)); width: auto; height: 56px; min-height: 0; padding: 0 14px; border-radius: 16px; font-size: 13.5px; font-weight: 800; line-height: 1.2; background: #ffb020; color: #111; box-shadow: 0 1px 6px #0008; display: grid; place-content: center; text-align: center; z-index: 4; }
.holeview .fab.sgviewbtn[hidden] { display: none; }
.holeview .fab.sgviewbtn.on { background: #c084fc; }
.holeview.watchlive .fab.sgviewbtn { bottom: calc(72px + env(safe-area-inset-bottom)); }
.holeview.replaying .fab.sgviewbtn { bottom: calc(196px + env(safe-area-inset-bottom)); }
.holeview.viewing .sgview { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
.holeview.replaying .sgview { bottom: calc(262px + env(safe-area-inset-bottom)); max-height: 50vh; }
.holeview.viewing .fab.cleanview { bottom: calc(80px + env(safe-area-inset-bottom)); }
.holeview.viewing .sheet.viewbox { bottom: calc(80px + env(safe-area-inset-bottom)); }
/* GPS Overview: whose bag the Club box uses, and the student search. */
.clubbox .bagwho { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; border-radius: 10px; background: #333333; color: #fff; text-align: left; }
.clubbox .bagwho b { flex: 1; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .clubbox .bagwho small { color: #8fb8ff; font-weight: 700; font-size: 12px; }
.clubbox .bagsearch { width: 100%; height: 40px; box-sizing: border-box; font-size: 15px; text-align: left; }
.clubbox .baglist { display: grid; gap: 6px; max-height: 46vh; overflow-y: auto; }
.clubbox .bagrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; background: #333333; color: #fff; text-align: left; }
.clubbox .bagrow b { font-size: 15px; } .clubbox .bagrow small { color: #9a9a9a; font-size: 12px; }
.clubbox .bagrow.on { background: #ffb020; color: #111; } .clubbox .bagrow.on small { color: #333; }
/* Searching for a student's bag: near the top, a fixed-height list (no jumping as it filters). */
.clubsheet.bagmode { place-items: start center; padding-top: calc(56px + env(safe-area-inset-top)); }
.clubsheet.bagmode .clubbox { margin-bottom: 0; }
.clubsheet.bagmode .baglist { height: min(46vh, 340px); max-height: none; align-content: start; }
.clubbox .clubhead .ydmode { justify-self: auto; }

.autokey .why { font-size: 11px; font-weight: 600; opacity: .8; }
.setbox .setrow { display: grid; grid-template-columns: 70px 1fr 78px; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.setbox .setrow input[type=range] { width: 100%; } .setbox .setrow input[type=color] { width: 100%; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; }
.setbox .setrow b { text-align: right; font-variant-numeric: tabular-nums; }
.clubsheet.setsheet { background: transparent; } /* the map stays clear, to see the lines change */

/* Yardage book (GPS Overview > View > Yardage book) */
.bookov { position: fixed; inset: 0; z-index: 50; background: #e9ece9; color: #1c2a22; display: flex; flex-direction: column; overflow: hidden; }
.booktop { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: #fff; border-bottom: 1px solid #d6dcd8; }
.booktop b { font-size: 16px; min-width: 56px; text-align: center; }
.booktop select { height: 34px; border-radius: 8px; border: 1px solid #c9d0cb; background: #fff; color: #1c2a22; padding: 0 6px; font-size: 14px; width: auto; }
.bookbtn { height: 34px; min-width: 34px; width: auto; max-width: none; padding: 0 10px; border-radius: 8px; border: 1px solid #c9d0cb; background: #fff; color: #1c2a22; font-size: 14px; font-weight: 600; }
.bookstatus { color: #5d6b62; font-size: 12px; }
.bookopts { background: #fff; border-bottom: 1px solid #d6dcd8; padding: 8px 12px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 14px; max-height: 45vh; overflow: auto; }
.bookopts .bookrow { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; }
.bookopts .bookrow select { height: 34px; border-radius: 8px; border: 1px solid #c9d0cb; background: #fff; color: #1c2a22; width: auto; }
.bookgroup { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #5d6b62; margin-top: 8px; }
.bookopt { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; cursor: pointer; }
.bookopt input { width: 18px; height: 18px; min-height: 0; padding: 0; border: 0; background: none; margin: 0; flex: none; accent-color: #2f6f35; color-scheme: light; }
.bookpages { flex: 1; overflow: auto; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: flex-start; padding: 16px 12px calc(24px + env(safe-area-inset-bottom)); }
.bookpage { display: block; width: min(420px, 100%); height: auto; aspect-ratio: 400 / 658; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); border-radius: 4px; }
.flipbook { display: flex; flex-direction: column; width: min(420px, 100%); box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.flipbook .bookpage { width: 100%; flex: none; box-shadow: none; border-radius: 0; }
.bookerr { background: #fff; color: #a03030; padding: 16px; border-radius: 6px; max-width: 420px; font-size: 14px; }
.flipbook .bookpage + .bookpage { border-top: 3px solid #1c2a4a; box-shadow: inset 0 10px 10px -8px rgba(0,0,0,.25); }
.bookprint { display: none; }
@media print {
  body.bookprinting > *:not(.bookprint) { display: none !important; }
  body.bookprinting .bookprint { display: block; }
  /* Exactly 4 1/4 x 7 in, no margins: the USGA size limit, and the green drawn within its scale limit. Print at 100%. */
  body.bookprinting .bookprint .bookpage { display: block; width: 4.25in; height: 7in; margin: 0; box-shadow: none; border-radius: 0; page-break-after: always; break-after: page; }
  @page { size: 4.25in 7in; margin: 0; }
}
.bookpdf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: #eef7ef; border-bottom: 1px solid #c9dccb; color: #1c2a22; }
.bookpdf b { font-size: 14px; width: 100%; }
.bookpdf small { width: 100%; color: #4a5a50; font-size: 12px; line-height: 1.4; }
.bookpdf a.bookbtn { display: inline-flex; align-items: center; text-decoration: none; }
.bookbtn.primary { background: #1c3a5e; color: #fff; border-color: #1c3a5e; }
/* Yardage book view (GPS Overview > View): the hole's book pages fill the
   screen; only the hole pill, View, the menu and their boxes stay. */
.holeview.bookmode > :not(.bookview):not(.holepill):not(.menu):not(.cleanview):not(.sheet):not(.leave) { display: none !important; }
.holeview .bookview { position: absolute; inset: 0; background: #fff; }
.holeview .bookview[hidden] { display: none; }
.holeview .bookmap { position: absolute; inset: 0; }
.holeview .bookview .booknote { position: absolute; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); background: #111c; color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; white-space: nowrap; pointer-events: none; }
.holeview .bookgreen { position: absolute; inset: 0; background: #e9ebefee; overflow: auto; display: flex; justify-content: center; align-items: flex-start; padding: calc(12px + env(safe-area-inset-top)) 12px calc(90px + env(safe-area-inset-bottom)); box-sizing: border-box; }
.holeview .bookgreen[hidden] { display: none; }
.holeview .bookgreenpage { width: min(420px, 100%); box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.holeview .bookgreenpage .bookpage { width: 100%; }
.holeview .bookgreen .booknote { top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); }
.holeview.bookmode .fab.cleanview { bottom: calc(70px + env(safe-area-inset-bottom)); }
.holeview.bookmode .sheet.viewbox { bottom: calc(70px + env(safe-area-inset-bottom)); }
.bookpages.adding .bookpage[data-page=hole] { cursor: crosshair; outline: 2px dashed #f3c623; outline-offset: 2px; }
/* Preview and edit: zoom (the pages scroll when bigger than the screen) and the hole's points. */
.bookpages { justify-content: safe center; }
.bookpages .flipbook { flex: none; }
.bookzoom { min-width: 40px; text-align: center; font-size: 12px; color: #5d6b62; }
.bookpoints { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 10px; background: #fff8dc; border-bottom: 1px solid #e6d9a8; }
.bookpoints[hidden] { display: none; }
.bookpoints small { font-size: 12px; color: #5d6b62; font-weight: 600; }
.bookpoints .bookbtn { height: 30px; font-size: 13px; }
.bookzoomgrp { display: inline-flex; align-items: center; gap: 4px; }
/* Reader mode: the yardage book read like an e-reader. */
.readerov { position: fixed; inset: 0; z-index: 50; background: #2b2f2c; color: #1c2a22; display: flex; flex-direction: column; overflow: hidden; }
.readertop { position: relative; flex: none; z-index: 2; display: flex; flex-direction: column; align-items: center; padding-top: env(safe-area-inset-top); }
.readermenu { width: 100%; box-sizing: border-box; background: #fff; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; padding: 0 12px; max-height: 0; overflow: hidden; transition: max-height .25s ease, padding .25s ease; }
.readerov.menuopen .readermenu { max-height: 220px; padding: 10px 12px; border-bottom: 1px solid #d6dcd8; }
.readerrow { display: flex; align-items: center; gap: 6px; }
.readerrow b { font-size: 16px; min-width: 104px; text-align: center; }
.readerseg { display: inline-flex; border: 1px solid #c9d0cb; border-radius: 8px; overflow: hidden; }
.readerseg button { height: 34px; width: auto; min-width: 0; max-width: none; padding: 0 12px; border: 0; border-radius: 0; background: #fff; color: #1c2a22; font-size: 14px; font-weight: 600; }
.readerseg button + button { border-left: 1px solid #c9d0cb; }
.readerseg button.on { background: #1c3a5e; color: #fff; }
.readertab { width: 44px; min-width: 0; max-width: none; height: 26px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; display: flex; align-items: center; justify-content: center; }
.readertab svg { width: 22px; height: 22px; fill: none; stroke: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s; }
.readerov.menuopen .readertab svg { transform: rotate(180deg); }
.readerstage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pinch-zoom; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); user-select: none; -webkit-user-select: none; }
.readerbook { display: flex; box-shadow: 0 4px 18px rgba(0,0,0,.45); transition: opacity .12s; }
.readerbook.rd-flip { flex-direction: column; }
.readerbook svg { display: block; flex: none; background: #fff; }
.readerbook.rd-flip svg + svg { border-top: 3px solid #1c2a4a; }
.readerbook.rd-side svg + svg { border-left: 3px solid #1c2a4a; }
.readernote { position: absolute; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); color: #fff; font-size: 13px; pointer-events: none; }
.readernote:empty { display: none; }

/* Icons (js/icons.js): sized to the text they sit in unless a rule below says otherwise. */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; display: inline-block; flex-shrink: 0; }
/* Practice, Combines and Learn tiles: icon in one column on the left, titles lined up after it. */
button:has(> .tileic) { justify-content: flex-start !important; gap: 16px !important; padding-left: 20px !important; padding-right: 14px !important; }
button:has(> .tileic) > div { min-width: 0; white-space: normal; }
.tileic { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; }
.tileic .ico { width: 34px; height: 34px; }
/* Search boxes: a magnifier drawn inside the box, left of the text. */
input.searchbox { padding-left: 36px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239a9a9a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M16.5 16.5L21 21'/%3E%3C/svg%3E") !important; background-repeat: no-repeat !important; background-size: 16px 16px !important; background-position: 12px center !important; }

/* A coach using the app as a student: the bar across the top (above every page). */
#actbar { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 5px) 12px 5px; background: #5c4a08; color: #fff; font: 13px/1.2 system-ui, -apple-system, sans-serif; z-index: 2100; position: relative; }
#actbar b { color: #f0c830; }
#actbar button { flex: none; height: 26px; padding: 0 12px; border: 0; border-radius: 13px; background: rgba(255,255,255,.18); color: #fff; font: 700 12px system-ui, -apple-system, sans-serif; cursor: pointer; }
/* GPS screen: every ✕ (Strokes Gained, Scorecard, Club and the other sheets) is the same round button. */
.sgclose, .schead button, .clubhead .x { width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: #ffffff1c; color: #fff; font-size: 15px; line-height: 1; flex: none; }
