:root {
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #17382c;
  background: #fafaf4;
  font-synthesis: none;
  --forest: #153f32;
  --cream: #fafaf4;
  --line: #d7dfd2;
  --control-gap: 10px;
  --nav: calc(64px + env(safe-area-inset-bottom));
  font-size: 15px;
}
#choose-location-course { width: min(92vw, 32rem); max-height: 85dvh; overflow: auto; }
#choose-location-course button { display: block; width: 100%; margin-top: .65rem; min-height: 44px; text-align: left; }
* {
  box-sizing: border-box;
}
html, body, main, nav, dialog {
  touch-action: pan-x pan-y;
}
/* The map owns its pinch/pan gestures; surrounding controls never zoom the page. */
#map {
  touch-action: none;
}
html {
  height: 100%;
  overflow: hidden;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* Keep navigation in the app shell. Only the active view scrolls, so Safari
   never has to reposition a fixed footer over a scrolling document. */
main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
main > [data-view] {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}
button,
input,
select,
textarea {
  font: inherit;
}
input, select, textarea {
  font-size: 16px;
}
button,
select,
input[type="search"] {
  min-height: 44px;
}
button {
  min-width: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  background: var(--cream);
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled) {
  background: #eef1e8;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #ff8559;
  outline-offset: 2px;
}
button[aria-pressed="true"],
.primary {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}
button.primary:hover {
  background: #23583f;
}
input,
textarea,
select {
  border: 1px solid var(--line);
  background: #fff;
  color: #17382c;
  border-radius: 10px;
  padding: 10px;
  max-width: 100%;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
label input[type="checkbox"] {
  margin-right: 12px;
}
label:has(input[type="checkbox"]) {
  min-height: 44px;
  display: flex;
  align-items: center;
}
input[type="range"] {
  display: block;
  width: 100%;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
.muted,
small {
  color: #56675b;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 800;
}
.home {
  max-width: 620px;
  margin: auto;
  padding: calc(38px + env(safe-area-inset-top)) 24px calc(var(--nav) + 64px);
}
.home h1 {
  margin: 0 auto;
  width: min(100%, 340px);
  line-height: 0;
}
.home-logo {
  display: block;
  width: 100%;
  height: auto;
}
.version-badge {
  width: fit-content;
  margin: 8px auto 0;
  padding: 3px 10px;
  border: 1px solid #174b3d33;
  border-radius: 999px;
  color: #174b3d;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .06em;
}
.home form {
  margin: 30px 0 14px;
}
.search-row {
  display: flex;
  gap: 8px;
}
.search-row input {
  min-width: 0;
  flex: 1;
}
.home > .primary {
  width: 100%;
}
#coverage {
  font-size: 12px;
  margin: 18px 0;
}
#results {
  display: grid;
  gap: 10px;
}
#results button {
  text-align: left;
  padding: 16px;
  font-size: 17px;
}
#results small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  margin-top: 6px;
}
#pagination {
  margin-top: 16px;
}
#map-view {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
#map {
  position: absolute;
  inset: 0;
}
#map > svg {
  width: 100%;
  height: 100%;
}
.saved-map-marker {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 150px;
  pointer-events: none;
  color: #17382c;
  font: 600 11px/1.4 ui-sans-serif, sans-serif;
}
.saved-marker-symbol {
  flex: none;
  width: 22px;
  height: 22px;
  border: 1px solid #153f32;
  border-radius: 50%;
  background: #ff8559;
  text-align: center;
  font-size: 16px;
}
.saved-marker-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 5px;
  border-radius: 4px;
  background: #fafaf4ed;
}
.shot-map-marker {max-width:none;width:max-content;}
.shot-map-marker .saved-marker-label {flex:none;overflow:visible;text-overflow:clip;}
.shot-map-marker .saved-marker-symbol {width:auto;min-width:22px;padding:0 3px;font-size:12px;line-height:20px;}
.map-header {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.map-header > * {
  pointer-events: auto;
  background: var(--cream);
  border: 1px solid var(--line);
  box-shadow: 0 3px 14px #153f3214;
  border-radius: 14px;
}
.hole-control {
  display: flex;
  max-width: calc(100% - 116px);
  align-items: center;
}
.hole-control button {
  border: 0;
  background: none;
  font-size: 25px;
  padding: 0;
  flex: none;
}
.hole-picker {
  min-width: 0;
  margin: 0;
}
.hole-picker select {
  border: 0;
  background: transparent;
  max-width: 130px;
  padding: 8px 2px;
  font-size: 16px;
  font-weight: 700;
}
.yardages {
  width: 110px;
  flex: none;
  padding: 10px 9px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.yardages > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.yardages strong {
  font-size: 34px;
  line-height: 1.1;
  font-weight: 650;
}
.yardages #distance-unit {
  font-size: 11px;
  margin-left: 4px;
}
.edges {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  margin-top: 5px;
}
.edges b {
  display: block;
  font-size: 14px;
}
.yardages small {
  font-size: 8px;
}
.course-context {
  position: absolute;
  top: calc(70px + env(safe-area-inset-top));
  left: 16px;
  max-width: calc(100% - 145px);
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
}
.course-context span {
  display: block;
  width: fit-content;
  background: #fafaf4e8;
  border-radius: 4px;
  padding: 1px 4px;
  margin-bottom: 3px;
}
#title {
  font-weight: 700;
}
#map-state {
  font-size: 10px;
}
#gps-state.manual {
  background: #ff8559;
  color: #17382c;
  font-weight: 700;
}
.map-rail {
  position: absolute;
  right: 12px;
  top: max(calc(164px + env(safe-area-inset-top)), var(--map-rail-start, 0px));
  bottom: 50px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: none;
}
.map-rail button {
  width: 52px;
  min-height: 48px;
  flex: none;
  padding: 4px;
  font-size: 19px;
  box-shadow: 0 2px 8px #153f3210;
}
.map-rail small {
  display: block;
  font-size: 9px;
  line-height: 1.2;
  color: inherit;
}
.maplibregl-ctrl-bottom-right {
  right: 6px;
  bottom: 5px;
  max-width: calc(100% - 12px);
}
.maplibregl-ctrl-attrib {
  font-size: 9px !important;
  background: #fafaf4e8 !important;
}
nav {
  position: relative;
  flex: none;
  display: flex;
  height: var(--nav);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--cream);
  border-top: 1px solid var(--line);
  z-index: 5;
}
nav button {
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 7px 2px 5px;
  font-size: 10px;
  font-weight: 500;
  background: transparent;
}
nav button span {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  margin-bottom: 3px;
}
nav button[aria-current="page"] {
  color: var(--forest);
  font-weight: 800;
  background: #e7ede2;
}
#status {
  position: fixed;
  bottom: calc(var(--nav) + 6px);
  left: 12px;
  max-width: calc(100% - 24px);
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #fafaf4ee;
  margin: 0;
  pointer-events: none;
  z-index: 3;
}
#status:empty {
  display: none;
}
body:has(#map-view:not([hidden])) #status {
  bottom: calc(var(--nav) + 28px);
  max-width: calc(100% - 84px);
}
#map-notice {
  position: absolute;
  bottom: 65px;
  left: 12px;
  max-width: calc(100% - 85px);
  background: #fafaf4ee;
  font-size: 11px;
  border-radius: 6px;
  padding: 6px;
  pointer-events: none;
}
#map-notice:empty {
  display: none;
}
#target-card {
  position: absolute;
  bottom: 110px;
  left: 12px;
  max-width: calc(100% - 88px);
  background: var(--cream);
  border-radius: 12px;
  box-shadow: 0 3px 12px #153f3222;
  padding: 4px 4px 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
#target-card[hidden] {
  display: none;
}
.target-marker {
  border: 2px solid #153f32;
  border-radius: 50%;
  background: #ff8559;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 30px;
}
#plan-summary {display:block;margin-top:4px;color:var(--forest);line-height:1.4;}
#plan-summary[hidden] {display:none;}
#target-card>div {min-width:0;}
#target-card button {padding:8px;min-width:44px;flex-shrink:0;}
#plan-open[aria-pressed="true"] {background:var(--forest);color:var(--cream);}
.has-playing-bar #target-card {bottom:calc(var(--playing-bar-height,68px) + 92px);}
#planner-dialog {width:min(480px,calc(100% - 24px));max-height:85dvh;border:1px solid #d6ddcf;border-radius:22px;background:var(--cream);padding:22px;color:var(--forest);overflow:auto;}
#planner-dialog header {display:flex;align-items:center;justify-content:space-between;gap:12px;}
#planner-dialog label {display:block;margin:16px 0;}
#planner-dialog select {display:block;width:100%;margin-top:6px;}
#plan-show {width:100%;}
.check-label {display:flex!important;align-items:flex-start;gap:10px;line-height:1.5;margin:16px 0;}
.check-label input {width:20px!important;height:20px;min-height:20px!important;margin-top:2px;flex:0 0 20px;}
.sg-bars>div {display:grid;grid-template-columns:85px 1fr 52px;align-items:center;gap:8px;margin:22px 0;}
.sg-bars small {display:block;font-size:11px;color:#677369;}
.sg-bars strong {text-align:right;font-size:15px;}
.sg-track {height:22px;position:relative;background:linear-gradient(to right,transparent 49.5%,#8c998b 49.5%,#8c998b 50.5%,transparent 50.5%);}
.sg-track i {position:absolute;top:3px;height:16px;border-radius:3px;}
.sg-track .gain {background:#315d47;}.sg-track .loss {background:#db744f;}
.sg-total {display:flex;align-items:center;gap:16px;padding:16px;background:#edf0e7;border-radius:12px;margin:22px 0 8px;}
.sg-total strong {font-size:30px;}.sg-card details {margin-top:20px;}.sg-card summary {cursor:pointer;padding:8px 0;}
.sg-card a {overflow-wrap:anywhere;}
.empty-stage {
  max-width: 580px;
  margin: auto;
  padding: 80px 26px calc(var(--nav) + 50px);
  line-height: 1.7;
}
.empty-stage h1 {
  font-family: Georgia, serif;
  font-size: 36px;
}
dialog {
  border: 1px solid var(--line);
  color: #17382c;
  background: var(--cream);
  border-radius: 22px 22px 0 0;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom));
  width: min(100%, 560px);
  max-width: 100%;
  max-height: 65dvh;
  margin: auto auto 0;
  box-shadow: 0 -8px 35px #153f3233;
}
dialog::backdrop {
  background: #153f3222;
}
dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
dialog h2 {
  font-size: 20px;
  margin: 0;
}
dialog textarea {
  width: 100%;
}
dialog label {
  margin-top: 12px;
}
dialog select {
  width: 100%;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: var(--control-gap);
}
#saved-tools > div {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 12px;
  overflow-wrap: anywhere;
}
#saved-tools button {
  float: right;
}
#direction {
  font-size: 12px;
  margin: 15px 0;
}
#storage-status {
  font-size: 12px;
  margin-top: 12px;
}
pre {
  white-space: pre-wrap;
  font-size: 11px;
  overflow-wrap: anywhere;
}
#feature-info {
  font-size: 11px;
  overflow-wrap: anywhere;
}
#fallback-note {
  position: absolute;
  bottom: 90px;
  left: 12px;
  background: #fff1d9;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (max-height: 600px) {
  .map-rail {
    top: max(145px, var(--map-rail-start, 0px));
    bottom: 38px;
  }
  .map-rail button {
    min-height: 44px;
  }
  .yardages {
    padding: 6px;
  }
  .yardages strong {
    font-size: 28px;
  }
  .map-header {
    top: 8px;
  }
  .course-context {
    top: 63px;
  }
  #target-card {
    bottom: 82px;
  }
}
@media (min-width: 800px) {
  .map-header {
    left: 24px;
    right: 24px;
  }
  .map-rail {
    right: 24px;
  }
  .course-context {
    left: 28px;
  }
  .yardages {
    width: 130px;
  }
  .hole-picker select {
    max-width: 220px;
  }
  .home {
    padding-top: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.yardages strong.long-distance {
  font-size: 24px;
}
.edges {
  gap: 6px;
}
.edges span {
  min-width: 0;
}
.edges b {
  font-size: 12px;
}
.yardages {
  overflow: hidden;
}
.hole-picker {
  flex: 1;
}
.hole-picker select {
  width: 100%;
}
.yardages strong.long-distance {
  font-size: 18px;
}

.offline-panel {margin-top:24px;}
.offline-badge {display:block;width:fit-content;margin-top:6px;padding:3px 8px;border-radius:6px;background:var(--surface-soft,#e8eee8);font-size:.8rem;font-weight:600;}
.details-offline {font-size:.9rem;}
.details-offline p {overflow-wrap:anywhere;}

.round-home {margin:24px 0;padding:16px;border:1px solid var(--line);border-radius:16px;}
.round-page {padding:32px 20px calc(var(--nav) + 28px);max-width:800px;margin:auto;}
#playing-bar {position:absolute;bottom:8px;left:12px;right:12px;z-index:3;}
#playing-bar>button {width:100%;}
#playing-actions {display:grid;grid-template-columns:1.4fr 1fr 1fr .8fr;gap:8px;}
#playing-actions[hidden] {display:none;}
#playing-score[hidden] {display:none;}
#score-actions {display:grid;grid-template-columns:1fr 1fr 1.2fr;gap:8px;}
#score-actions button {padding:10px 4px;font-size:13px;min-height:50px;}
#score-count {margin:0 0 5px;padding:5px 10px;border-radius:10px;background:var(--cream,#fafbf3);color:var(--forest,#173e32);width:max-content;font-size:13px;}
#playing-actions button {padding:10px 4px;font-size:13px;min-height:50px;}
.has-playing-bar .maplibregl-ctrl-bottom-right {bottom:var(--playing-bar-height,68px);}
.has-playing-bar .map-rail {bottom:calc(var(--playing-bar-height,68px) + 40px);}
.has-playing-bar:has(.maplibregl-compact-show) .map-rail {bottom:calc(var(--playing-bar-height,68px) + 80px);}
.has-playing-bar #map-notice {bottom:150px;}
#play-dialog {max-width:500px;width:calc(100% - 24px);max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:20px;background:var(--cream);color:var(--forest);padding:22px;}
#play-dialog label {display:grid;gap:6px;margin:14px 0;}
#play-dialog input,#play-dialog select {width:100%;padding:10px;}
#play-dialog::backdrop {background:#0a211855;}
.dialog-actions {display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;}
.dialog-actions button {flex:1;}
#play-error {color:#9a3426;}
.hole-score {padding:14px 0;border-bottom:1px solid var(--line);}
.hole-score summary {padding:12px 0;font-weight:700;cursor:pointer;}
.hole-score summary span {display:block;font-weight:400;margin-top:5px;}
#round-history button {display:block;width:100%;text-align:left;margin:10px 0;}
#history-banner {position:fixed;bottom:var(--nav);left:0;right:0;background:var(--cream);border-top:2px solid var(--forest);padding:8px 12px;z-index:8;display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px;}
#history-banner[hidden] {display:none;}
.reviewing .round-page,.reviewing .home {padding-bottom:calc(var(--nav) + 95px);}
.reviewing .maplibregl-ctrl-bottom-right {bottom:70px;}

.stats-heading,.backup-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:16px;}
.stats-heading h1 {font-size:28px;margin:6px 0 0;}
#backup-open {max-width:145px;font-size:13px;}
.backup-panel {margin:auto;width:calc(100% - 24px);max-width:500px;max-height:85dvh;overflow:auto;padding:20px;border:1px solid var(--line);border-radius:20px;background:var(--cream);color:var(--forest);}
.backup-panel::backdrop {background:#0a211855;}
.backup-heading h2 {margin:8px 0;}
.backup-panel label {display:block;margin:16px 0;}
.backup-panel textarea,.backup-panel input:not([type=checkbox]) {width:100%;padding:10px;}
.backup-panel button {margin:4px;}

/* Paper-scorecard structure, using the playing map's existing design tokens. */
[data-view="scorecard"].round-page {padding:22px 12px calc(var(--nav) + 28px);}
[data-view="scorecard"]>h1 {font-size:24px;margin:6px 0 20px;}
.card-heading h2 {font-size:21px;line-height:1.25;margin:0 0 8px;}
.card-heading p {margin:6px 0;font-size:13px;}
.card-tee {display:flex;align-items:center;gap:7px;font-weight:650;}
.card-tee {display:block;line-height:1.5;}
.card-tee .tee-dot {display:inline-block;vertical-align:middle;margin-right:5px;}
.card-yardage-summary {padding:12px;border-radius:12px;background:#edf1e8;}
#course-details {margin:auto;width:calc(100% - 20px);max-width:780px;max-height:90dvh;overflow:auto;border-radius:22px;padding:22px;background:var(--cream);}
#course-details>header {align-items:flex-start;gap:12px;}
#details-title {font-family:Georgia,serif;font-size:30px;line-height:1.15;margin:10px 0;}
#details-banner {margin:12px 0 6px;border:1px solid var(--line);border-radius:16px;overflow:hidden;background:#f0f3e9;}
#details-layout svg {display:block;width:100%;height:180px;}
#details-banner figcaption {padding:7px 10px;font-size:11px;color:#59675c;background:var(--cream);}
#details-banner a {color:inherit;}
#details-close {min-width:44px;font-size:24px;}
.details-actions {display:flex;gap:10px;position:sticky;top:-22px;z-index:3;background:var(--cream);padding:12px 0;}
.details-actions button {flex:1;min-height:48px;}
#course-details section {border-top:1px solid var(--line);margin-top:20px;padding-top:8px;}
#course-details h3 {margin:12px 0;}
#course-details label {display:block;}
#course-details select,#course-details input {width:100%;padding:12px;min-height:44px;margin:8px 0;}
#details-candidates button,#details-history button {display:block;width:100%;text-align:left;margin:10px 0;}
#details-status {font-size:14px;line-height:1.5;color:#59675c;}
#details-provider {margin-top:16px;font-size:14px;}
#details-provider summary {cursor:pointer;padding:12px 0;}
#details-card .card-heading {display:block;}
#details-card .card-heading h2 {display:none;}
#course-details-open {display:block;width:fit-content;min-height:32px;padding:3px 8px;font-size:12px;background:var(--cream);margin-top:3px;pointer-events:auto;}
.tee-dot {width:12px;height:12px;border-radius:50%;border:1px solid #17382c55;background:var(--tee);}
.card-total {display:flex;align-items:baseline;gap:12px;width:fit-content;padding:10px 14px;margin:16px 0;background:#eaf0e3;border:1px solid var(--line);border-radius:14px;font-size:13px;}
.card-total strong {font-size:25px;font-variant-numeric:tabular-nums;}
.card-nine {border:1px solid var(--line);border-radius:14px;overflow:hidden;margin:14px 0;background:var(--cream);}
.card-scroll {overflow-x:auto;overscroll-behavior-x:contain;}
.golf-card {border-collapse:separate;border-spacing:0;width:100%;min-width:590px;table-layout:fixed;font-size:13px;font-variant-numeric:tabular-nums;}
.golf-card th,.golf-card td {text-align:center;border-right:1px solid var(--line);border-bottom:1px solid var(--line);height:34px;padding:3px;position:relative;}
.golf-card th:first-child {position:sticky;left:0;z-index:1;width:66px;background:#edf1e8;text-align:left;padding-left:10px;font-size:11px;letter-spacing:.03em;}
.golf-card thead th {background:var(--forest);color:var(--cream);border-color:#fafaf42a;}
.golf-card thead th:first-child {background:var(--forest);z-index:2;}
.golf-card tr:last-child>* {border-bottom:0;}
.golf-card tr>*:last-child {border-right:0;}
.golf-card button {border:0;background:transparent;color:inherit;padding:0;width:100%;min-width:0;min-height:44px;border-radius:8px;}
.golf-card .card-score {display:inline-flex;align-items:center;justify-content:center;min-height:44px;width:100%;font-size:16px;font-weight:700;}
.golf-card .card-score.over {box-shadow:inset 0 0 0 1px #ff8559;background:#ff855916;}
.golf-card .card-score.under {border-radius:50%;box-shadow:inset 0 0 0 1px var(--forest);background:#eaf0e3;}
.card-subtotal {background:#edf1e8;font-weight:700;}
.card-grand {background:#dfe9d6;font-weight:750;}
.card-penalty {position:absolute;top:0;right:4px;color:#a83e1b;pointer-events:none;}
.card-hint {font-size:12px;color:#59675c;line-height:1.5;margin:10px 3px;}
.round-length {padding:0;border:0;margin:18px 0;}
.round-length legend {margin-bottom:8px;}
.round-length>div {display:flex;gap:8px;}
.round-length button {flex:1;}
.round-length button[aria-pressed="true"] {background:var(--forest);color:var(--cream);}
.shot-picker {border:0;padding:0;margin:16px 0;}
.shot-picker legend {font-weight:700;margin-bottom:8px;}
.shot-picker>div {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;}
.shot-picker button {padding:8px 2px;font-size:13px;min-height:44px;}
.shot-picker button[aria-pressed="true"] {background:var(--forest);color:var(--cream);border-color:var(--forest);box-shadow:inset 0 -3px #ff8559;}
.round-delete {color:#923d2a;border-color:#d7b4a9;}
#app-update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 1500;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: #153f32;
  color: #fafaf2;
  box-shadow: 0 4px 20px #0004;
}
#app-update-banner[hidden] { display: none; }
#app-update-banner span { flex: 1; font-size: 14px; }
#app-update-banner button { flex-shrink: 0; min-height: 44px; color:var(--forest); background:var(--cream); }
body:has(#map-view:not([hidden])) #app-update-banner {
  bottom:calc(var(--nav) + var(--playing-bar-height,0px) + 12px);
  right:84px;
  flex-wrap:wrap;
}
body:has(#map-view:not([hidden])) #app-update-banner span {flex:1 1 180px;min-width:0;}
@media(min-width:800px){body:has(#map-view:not([hidden])) #app-update-banner{right:96px;}}
/* The dialog title is a screen-reader focus target, not an interactive control. */
#details-title:focus { outline: none; }
#details-other-wrap, #details-round-options { display: grid; gap: 12px; }
#details-other-wrap[hidden], #details-round-options[hidden] { display: none; }

/* M5: compact conditions in the top header, without moving the map rail. */
.map-header:has(#weather-button:not([hidden])) {display:grid;grid-template-columns:minmax(0,1fr) 46px 110px;gap:6px;}
.map-header:has(#weather-button:not([hidden])) .hole-control {max-width:100%;min-width:0;width:fit-content;}
.map-header:has(#weather-button:not([hidden])) .hole-picker select {max-width:130px;font-size:16px;}
#weather-button {width:46px;min-width:44px;min-height:48px;padding:4px 1px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;font-size:12px;font-weight:650;line-height:1.15;font-variant-numeric:tabular-nums;}
#weather-button svg {width:22px;height:22px;}
#weather-dialog {width:calc(100% - 24px);max-width:420px;max-height:85dvh;overflow:auto;background:var(--cream);color:var(--forest);border:1px solid var(--line);border-radius:20px;padding:20px;}
#weather-dialog header {display:flex;justify-content:space-between;align-items:center;gap:10px;}
#weather-dialog h2 {font-size:22px;margin:0;}
#weather-dialog .weather-summary {font-size:22px;font-weight:650;}
#weather-dialog a {color:var(--forest);}
.weather-grid {display:grid;grid-template-columns:1fr auto;gap:12px 16px;font-size:14px;}
.weather-grid dd {margin:0;font-weight:650;text-align:right;}
@media(max-width:350px){.map-header:has(#weather-button:not([hidden])){grid-template-columns:minmax(0,1fr) 44px 88px;gap:4px;}.map-header .yardages{width:88px;padding:8px 4px;}#weather-button{width:44px;}.map-header:has(#weather-button:not([hidden])) .hole-picker select{font-size:16px;}}
@media(min-width:800px){.map-header:has(#weather-button:not([hidden])){grid-template-columns:minmax(0,1fr) 46px 130px;}}

/* M6 performance — quiet surfaces, one primary chart per detail. */
[data-view="stats"].round-page {max-width:900px;margin:0 auto;width:100%;box-sizing:border-box;}
.stats-heading {align-items:center;margin-bottom:24px;}
.stats-heading #backup-open {font-size:12px;padding:10px 12px;max-width:118px;}
.analytics-filters {display:flex;gap:12px;align-items:flex-end;}
.analytics-filters label {flex:1;min-width:0;}
.analytics-filters button {font-size:13px;padding:12px;}
.analytics-filters select,.analytics-filter-grid input,#stats-extra select {width:100%;min-width:0;box-sizing:border-box;}
.analytics-filter-grid {display:grid;grid-template-columns:1fr 1fr;gap:12px;}
#stats-extra,#stats-custom {background:var(--cream,#f8f9f2);border:1px solid #d9dfd5;border-radius:16px;padding:14px;margin-top:12px;}
#stats-extra label {display:block;margin-bottom:10px;}
#stats-error:empty {display:none;}
#stats-error {color:#873820;}
#analytics-summary {font-size:12px;line-height:1.6;margin:12px 0 18px;}
.stats-tabs {display:grid;grid-template-columns:repeat(4,1fr);gap:4px;padding:4px;background:#e8ede4;border-radius:14px;margin-bottom:24px;}
.stats-tabs button {min-width:0;padding:12px 4px;border:0;border-radius:11px;background:transparent;font-size:14px;}
.stats-tabs button[aria-pressed="true"] {background:var(--forest,#153f32);color:#fff;box-shadow:0 2px 5px #133e3220;}
.stats-card {border:1px solid #d9dfd5;border-radius:22px;padding:20px;background:#fffdf8;margin:0 0 18px;overflow:hidden;}
.stats-card h2,#stats-panel h2 {font-size:20px;line-height:1.25;margin:0 0 16px;}
.stats-card h3 {font-size:15px;margin:20px 0 12px;}
.stats-card p {line-height:1.55;}
.stats-card-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;}
.stats-card-heading h2 {margin-bottom:0!important;}
.stats-card-heading select {max-width:180px;font-size:16px;padding:9px;}
.stats-card-heading label {font-size:12px;max-width:58%;}
.stat-hero {display:flex;gap:16px;align-items:center;margin:14px 0;}
.stat-hero>strong {font-size:48px;font-weight:650;line-height:1.1;letter-spacing:-2px;}
.stat-hero>strong small {font-size:16px;letter-spacing:0;}
.stat-hero>span {font-size:14px;line-height:1.5;}
.stat-hero small,.sample-count {font-size:12px;color:#5d6e62;}
.stat-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 20px;}
.stat-tile {display:flex;flex-direction:column;align-items:flex-start;text-align:left;border:1px solid #d9dfd5;background:#fffdf8;border-radius:18px;padding:16px;gap:8px;min-width:0;}
.stat-tile>span {font-size:13px;font-weight:500;}
.stat-tile strong {font-size:30px;line-height:1.1;}
.stat-tile small {font-size:11px;font-weight:400;color:#5d6e62;}
.stat-grid.compact>div {display:flex;flex-direction:column;gap:6px;padding:12px;background:#edf1e9;border-radius:12px;}
.stat-grid.compact strong {font-size:22px;}.stat-grid.compact span,.stat-grid.compact small {font-size:12px;}
.chart-caption {font-size:12px!important;color:#5d6e62;line-height:1.6;}
.stats-insights {padding-left:20px;}.stats-insights li {margin:12px 0;font-size:14px;line-height:1.5;}
.stats-empty,.chart-empty {padding:28px 16px;background:#edf1e9;border-radius:16px;line-height:1.6;font-size:14px;}
.bag-chart {margin:18px 0 24px;}
.bag-chart>button {display:grid;grid-template-columns:64px minmax(0,1fr) 64px;gap:10px;align-items:center;width:100%;background:transparent;border:0;border-bottom:1px solid #d9dfd5;border-radius:0;padding:14px 8px;text-align:left;}
.bag-chart>button>span:first-child {font-size:13px;}.bag-chart>button>small {grid-column:3;font-size:11px;color:#647466;margin-top:-6px;font-weight:400;}
.bag-chart>button>strong {font-size:17px;text-align:right;}.bag-chart strong small {font-size:11px;font-weight:400;}
.bag-chart>button>small.bag-longest {grid-column:2 / 4;text-align:right;margin-top:0;}
.club-longest>strong {font-size:32px;letter-spacing:-1px;}
.bag-chart>button[aria-pressed="true"] {color:var(--forest);background:#e8ede4;border-radius:12px;}
.bag-range {position:relative;display:block;height:22px;margin-right:4px;background:linear-gradient(transparent 10px,#d9dfd5 10px,#d9dfd5 12px,transparent 12px);}
.bag-range i {position:absolute;top:5px;height:12px;min-width:2px;border-radius:8px;background:#829b83;}
.bag-range b {position:absolute;top:1px;width:4px;height:20px;background:#173e32;transform:translateX(-2px);border-radius:2px;}
.distance-range {font-size:14px;}.sample-note {font-size:12px;background:#fff0e7;border-left:3px solid #ff8559;padding:10px;}
.segmented,.game-tabs {display:flex;gap:4px;background:#edf1e9;border-radius:12px;padding:4px;margin:16px 0;}
.segmented button,.game-tabs button {flex:1;min-width:0;border:0;background:transparent;padding:10px 5px;font-size:12px;border-radius:9px;}
.segmented button[aria-pressed="true"],.game-tabs button[aria-pressed="true"] {background:#173e32;color:white;}
.dispersion-chart {width:100%;display:block;overflow:visible;}
.plot-bg {fill:#edf1e9;}.plot-axis {fill:none;stroke:#a9b7a8;stroke-width:1;stroke-dasharray:4 5;}
.spread-region {fill:#a3b59a;fill-opacity:.2;stroke:#71896e;stroke-width:1;}
.shot-hit {fill:transparent;}.shot-dot {fill:#315b47;stroke:#fffdf8;stroke-width:1.5;}
.median-cross {stroke:#ff8559;stroke-width:3;}
[data-shot-point] {cursor:pointer;}[data-shot-point]:focus-visible {outline:2px solid #ff8559;}
[data-shot-point]:hover .shot-dot,[data-shot-point].selected .shot-dot {fill:#ff8559;stroke:#173e32;stroke-width:2;}
#stats-panel svg text {fill:#536a59;font-size:10px;font-family:inherit;}
#stats-panel svg {width:100%;}.trend-line {stroke:#315b47;stroke-width:2.5;fill:none;}
.distance-histogram {display:flex;align-items:flex-end;gap:8px;height:100px;padding-top:22px;border-bottom:1px solid #bcc9b8;}
.distance-histogram>div {position:relative;flex:1;height:var(--bar);background:#829b83;border-radius:5px 5px 0 0;min-height:2px;}
.distance-histogram span {position:absolute;top:-20px;width:100%;text-align:center;font-size:11px;}
.range-labels {display:flex;justify-content:space-between;font-size:12px;margin-top:8px;}
.selected-shot {border-left:3px solid #ff8559;padding:4px 0 8px 14px;margin:20px 0;}
.selected-shot p {font-size:13px;}.selected-shot button {font-size:13px;}
.stats-shots summary {padding:14px 0;font-size:14px;cursor:pointer;}
.shot-list {display:grid;gap:6px;max-height:320px;overflow:auto;}
.shot-list button {text-align:left;font-size:13px;}.shot-list small {display:block;font-size:11px;font-weight:400;margin-top:4px;}
.stats-table {width:100%;border-collapse:collapse;font-size:13px;table-layout:fixed;}
.stats-table th,.stats-table td {padding:12px 6px;border-bottom:1px solid #d9dfd5;text-align:left;overflow-wrap:anywhere;}
.stats-table thead th {font-size:11px;color:#5d6e62;}.stats-table td small {display:block;margin-top:4px;color:#5d6e62;}
.history-search {display:grid;gap:6px;font-size:14px;font-weight:600;margin:16px 0 8px;}
.history-search input {width:100%;min-width:0;}
.history-course {border:1px solid #d9dfd5;border-radius:16px;margin:12px 0;padding:0 12px;}
.history-course>summary {padding:14px 0;min-height:44px;cursor:pointer;font-weight:700;overflow-wrap:anywhere;}
.history-course>summary small {display:block;font-size:12px;font-weight:400;color:var(--muted);margin:4px 0 0 18px;}
.analytics-round {border-top:1px solid #d9dfd5;overflow:hidden;}
#round-history .analytics-round>button {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;margin:0;border:0;background:transparent;text-align:left;padding:12px 0;}
.round-meta {display:grid;gap:4px;min-width:0;overflow-wrap:anywhere;}
.round-meta strong {font-size:15px;}.round-meta span {font-size:12px;font-weight:400;}
.round-score {text-align:center;min-width:58px;}
.round-score strong {display:block;font-size:28px;line-height:1.1;font-variant-numeric:tabular-nums;}
.round-score small {display:block;font-size:10px;line-height:1.25;font-weight:400;margin-top:3px;}
.round-row-actions {display:flex;gap:8px;padding:0 0 12px;}
#round-history .round-row-actions button {width:auto;margin:0;font-size:12px;padding:8px;}
@media (max-width:360px){.stats-card {padding:14px;}.stat-tile {padding:12px;}.analytics-filters {gap:6px;}.analytics-filters button {max-width:94px;}.stats-tabs button {font-size:12px;}.stat-hero>strong {font-size:40px;}.bag-chart>button {grid-template-columns:56px minmax(0,1fr) 58px;gap:6px;}}

/* Group play shares the existing card and dialog design. */
.group-dialog{width:min(94vw,34rem);max-height:calc(100dvh - 2rem);overflow:auto;padding:1.25rem;border:1px solid var(--border,#d6ddd0);border-radius:1.5rem;background:var(--paper,#fafaf4);color:var(--ink,#183e30)}
.group-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem}.group-heading h2{margin:0}.group-heading button{font-size:1.6rem;min-width:44px}
.group-dialog label{display:grid;gap:.4rem;margin:1rem 0}.group-dialog input,.group-dialog select{box-sizing:border-box;width:100%;min-height:48px;font:inherit;padding:.65rem;border:1px solid #d6ddd0;border-radius:.65rem;background:#fff;color:inherit}
.group-dialog button{min-height:44px}.group-dialog .primary{margin-top:.5rem}.group-dialog #group-entry>button,.group-dialog #group-start,.group-dialog #group-ready{width:100%}
.group-code{font-size:2rem;font-weight:800;letter-spacing:.14em;margin:.35rem 0 1rem}.group-roster{padding:0;list-style:none;margin:1.2rem 0}.group-roster li{display:flex;justify-content:space-between;gap:1rem;border-bottom:1px solid #d6ddd0;padding:.75rem 0}.group-roster span{font-size:.85rem}
.group-home p{font-size:1rem}#group-message:empty{display:none}
/* Group entry stays compact, after the primary course lookup. */
.group-home { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:stretch; gap:.5rem; margin:.75rem 0; }
.group-home button { width:100%; min-width:0; min-height:44px; padding:.65rem .5rem; text-align:center; }
.group-home:has(#group-final-open[hidden]) { grid-template-columns:1fr; }
.group-home small { grid-column:1/-1; color:var(--muted); }
.group-home small:empty { display:none; }
#group-results { display:grid; gap:.5rem; margin:.75rem 0; }
#group-results button { text-align:left; width:100%; }
#group-course-choice { border-top:1px solid #d8ded3; margin-top:1rem; padding-top:.5rem; }
#group-search button { margin-top:.5rem; }

#group-nearby { width:100%; margin-top:.75rem; }
#group-card-delete { margin-top:1rem; min-height:44px; }
.multi-player-card { min-width:660px; }
.multi-player-card th:first-child { width:110px; overflow-wrap:anywhere; }
.multi-player-card th small { display:block; font-weight:400; margin-top:4px; }
.multi-player-card .card-self>* { background:#e8eee2; }
#group-card .card-hint { margin-top:1rem; }
#group-history-back { margin-bottom:1rem; }

#missing-map-note:empty {display:none;}
#missing-map-note {color:var(--forest);font-weight:600;max-width:100%;}

/* Separate independent actions, including rows that wrap on narrow screens. */
.tool-grid {margin-block:var(--control-gap) 16px;}
.tool-grid button {min-width:0;overflow-wrap:anywhere;}
:is([data-sheet="tools"],[data-sheet="details"],#details-provider,#backup-dialog,#restore-preview,#group-course-picker,#group-entry,#group-lobby,#round-home-content)>button {
  display:block;
  max-width:100%;
  margin-block:var(--control-gap);
  margin-inline:0;
}
#details-search {margin-bottom:var(--control-gap);}
.details-lookup-actions {display:flex;flex-wrap:wrap;gap:var(--control-gap);}
.details-lookup-actions button {flex:1 1 110px;min-width:0;}
#details-candidates button {overflow-wrap:anywhere;}
#details-candidates:empty,#saved-tools:empty {display:none;}
#save-note {margin-top:var(--control-gap);}
:is(.dialog-actions,.round-row-actions) {gap:var(--control-gap);flex-wrap:wrap;}
.dialog-actions button {flex:1 1 120px;}
.round-row-actions button {flex:1 1 120px;}
:is(.search-row,.details-actions,.round-length>div,.group-home) {gap:var(--control-gap);}
.shot-picker>div {gap:8px;}
.map-rail {gap:8px;padding-bottom:4px;}
.map-rail button {flex:0 1 48px;min-height:44px;}
#pagination {display:flex;flex-wrap:wrap;gap:var(--control-gap);}
#saved-tools>div {display:flow-root;}
#saved-tools button {margin:0 0 var(--control-gap) var(--control-gap);}

/* GPS status travels with yardage, separate from the course title/actions. */
.map-header>.yardage-panel {background:none;border:0;box-shadow:none;border-radius:0;}
.yardage-panel .yardages {background:var(--cream);border:1px solid var(--line);border-radius:14px;box-shadow:0 3px 14px #153f3214;}
#gps-state {display:block;width:100%;margin-top:4px;padding:1px 3px;border-radius:4px;background:#fafaf4e8;font-size:10px;line-height:14px;text-align:center;overflow-wrap:anywhere;}

.yardage-panel {width:110px;flex:none;}
@media(max-width:350px){.yardage-panel{width:88px;}}
@media(min-width:800px){.yardage-panel{width:130px;}}

/* Keep recording actions visible while the choices scroll. */
#play-dialog {overflow:hidden;padding:0;}
#play-form {display:flex;flex-direction:column;max-height:calc(85dvh - 2px);min-height:0;}
#play-title {flex:none;margin:0;padding:20px 22px 12px;}
#play-fields {overflow-y:auto;min-height:0;padding:0 22px;overscroll-behavior:contain;}
#play-error {flex:none;margin:0;padding:8px 22px 0;}
#play-error:empty {display:none;}
#play-form>.dialog-actions {flex:none;margin:0;padding:12px 22px max(16px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--cream);}
#play-form>.dialog-actions button {flex:1 1 0;min-width:0;}

/* Approved clean-outline controls; no runtime icon CDN dependency. */
.ui-icon {display:inline-block;width:26px;height:26px;vertical-align:middle;flex:none;}
.map-rail button {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;}
nav button span {display:flex;justify-content:center;align-items:center;}
.tee-icon {position:relative;}
.tee-ball {position:absolute;box-sizing:border-box;left:6px;top:1px;width:14px;height:14px;border:1.4px solid currentColor;border-radius:50%;}
.tee-cup {position:absolute;box-sizing:border-box;left:8px;top:14px;width:10px;height:5px;border:1.4px solid currentColor;border-top:0;border-radius:0 0 7px 7px;}
.tee-stem {position:absolute;left:12.3px;top:18px;width:1.4px;height:7px;background:currentColor;border-radius:1px;}
.bag-icon {background:currentColor;mask:var(--bag-image) center/contain no-repeat;-webkit-mask:var(--bag-image) center/contain no-repeat;}
.club-heading {display:flex;align-items:center;justify-content:space-between;gap:12px;}
.club-heading #bag-profile {flex:1;min-width:0;width:auto;min-height:44px;font-size:16px;margin:0;}
#club-choices legend {width:100%;}
#club-choices [data-pick] {min-width:0;overflow-wrap:anywhere;}
#edit-bag {min-width:44px;min-height:44px;padding:6px;display:flex;align-items:center;justify-content:center;}
.icon-credit {font-size:11px;color:var(--muted);margin:8px 0;}
.icon-credit a {color:inherit;}
#bag-dialog {width:calc(100% - 24px);max-width:500px;max-height:85dvh;padding:0;overflow:hidden;background:var(--cream);color:var(--forest);border:1px solid var(--line);border-radius:20px;}
#bag-form {display:flex;flex-direction:column;max-height:calc(85dvh - 2px);min-height:0;}
#bag-form header {padding:18px 22px 8px;flex:none;}
#bag-form h2 {margin:0;}
#bag-count {margin:6px 0 0;}
#bag-fields {overflow-y:auto;min-height:0;padding:0 22px;overscroll-behavior:contain;}
.bag-group {padding:0;border:0;margin:16px 0;}
.bag-group legend {font-weight:700;margin-bottom:8px;}
.bag-group>div {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;}
.bag-group button {min-height:44px;padding:8px 2px;font-size:13px;overflow-wrap:anywhere;}
.bag-group button[aria-pressed="true"] {background:var(--forest);color:var(--cream);}
.bag-custom-row {display:flex;gap:8px;margin-top:8px;}
.bag-custom-row input {min-width:0;width:100%;font-size:16px;}
#bag-error {margin:0;padding:8px 22px 0;flex:none;}
#bag-error:empty {display:none;}
#bag-form footer {flex:none;margin:0;padding:12px 22px max(16px,env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--cream);}
#bag-form footer button {flex:1 1 0;min-width:0;}

/* Intent subtitles do not narrow the club or lie pickers. */
.shot-intent-picker>div {grid-template-columns:repeat(2,minmax(0,1fr));}
.shot-intent-picker button {padding:10px 8px;text-align:left;line-height:1.3;}
.shot-intent-picker button small {display:block;margin-top:4px;font-size:11px;font-weight:400;color:inherit;opacity:.85;}
.shot-intent-note {font-size:12px;line-height:1.45;}
#shot-detail {scroll-margin-top:16px;scroll-margin-bottom:calc(var(--nav) + 16px);}

/* Search feedback belongs to Home, even when a request completes on another tab. */
body:not(:has([data-view="home"]:not([hidden]))) #status[data-scope="search"] {display:none;}

