/* Design: "A refined" (links heritage). Phone first, centred column on desktop. */
:root {
  --bg: #F3F6F4; --ink: #14211B; --green: #16523A; --green-dk: #0E3826; --gold: #E2B659; --brand2: #2C7A9E;
  --line: #7E8C86; --line2: #E3EAE6; --muted: #4D5A55; --muted2: #3E4A45; --tag: #2D6A84; --card: #FFFFFF;
  --good: #2F7D4F; --ok: #B7791F; --poor: #B23B2E; --rain: #3D6FA8; --warn-bg: #FBF3DF;
  --hole: #5E9A4B; --map-bg: #CFE3D8; --stale: #9AA39A; --proj: #F0D9A0; --proj-bar: #F3E6C2;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
body { min-height: 100vh; }
input, button, select { font: inherit; }
a { color: var(--green); }
a:hover { color: var(--green-dk); }
h1, h2, h3, .serif { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; letter-spacing: -.01em; }
.page { max-width: 480px; margin: 0 auto; padding-bottom: 28px; }
.page.wide { max-width: 1100px; }

header.top { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-size: 20px; color: var(--green); text-decoration: none; }
.brand b { color: var(--brand2); font-weight: 700; }
.brand small { font-size: 14px; }
.toplink { font-size: 14px; font-weight: 600; min-height: 44px; display: flex; align-items: center; }

.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--tag); }
.hero { padding: 0 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.hero h1 { margin: 0; font-size: 34px; line-height: 1.05; }
.hero p { margin: 0; font-size: 14px; color: var(--muted2); }

section.block { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 10px; }
section.block h2 { margin: 0; font-size: 20px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Radar card */
.radar-card { margin: 0 20px; background: var(--green); color: var(--bg); border-radius: 18px; overflow: hidden; }
.radar-card .head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; }
.radar-card h2 { margin: 0; font-size: 20px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.live.stale::before { background: var(--stale); }
.radar-card .lead { margin: 0; padding: 0 16px 12px; font-size: 16px; line-height: 1.45; }
.radar-card .foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; gap: 10px; font-size: 14px; }
.btn-gold { flex: none; color: var(--ink); background: var(--gold); border-radius: 22px; padding: 0 16px; height: 44px; display: inline-flex; align-items: center; font-weight: 700; font-size: 14px; text-decoration: none; border: 0; cursor: pointer; }
.btn-gold:hover { color: var(--ink); filter: brightness(1.05); }
.btn-line { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 22px; padding: 0 16px; height: 44px; font-weight: 600; cursor: pointer; }
.mini-map { height: 260px; background: var(--map-bg); }

/* Tee windows */
.wins { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.win { text-align: left; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: var(--card); color: var(--ink); min-height: 88px; cursor: pointer; }
.win[aria-pressed="true"] { background: var(--green); color: var(--bg); border-color: var(--green); }
.win .d { font-size: 13px; font-weight: 600; }
.win .t { font-size: 15px; }
.win .s { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.good { background: var(--good); } .ok { background: var(--ok); } .poor { background: var(--poor); }

/* Poor-weather suggestions */
.alt { margin: 14px 20px 0; background: var(--warn-bg); border: 1.5px solid var(--gold); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.alt h3 { margin: 0; font-size: 19px; }
.alt p { margin: 0; font-size: 14px; color: var(--muted2); }
.alt a { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); min-height: 60px; }
.alt a .n { flex: 1; display: flex; flex-direction: column; }
.alt a .n span:first-child { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 16px; }
.alt a .n span:last-child { font-size: 12px; color: var(--muted); }
.alt a b { font-size: 16px; }

/* Window detail */
.detail { margin: 14px 20px 0; background: var(--card); border-radius: 18px; overflow: hidden; }
.detail .hd { padding: 12px 14px; font-size: 14px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 14px 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); }
.stat .v { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 20px; }
.stat .u { font-size: 12px; }
.detail .sum { margin: 0; padding: 0 14px 12px; font-size: 15px; line-height: 1.45; }
.hours { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(44px, 1fr); gap: 2px; padding: 0 14px 14px; overflow-x: auto; }
.hour { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted2); }
.hour .bar { width: 100%; max-width: 26px; height: 46px; background: var(--line2); border-radius: 4px; display: flex; align-items: flex-end; overflow: hidden; }
.hour .bar span { display: block; width: 100%; background: var(--rain); }
.hour b { font-size: 12px; color: var(--ink); }

/* Week */
.week { background: var(--card); border-radius: 16px; padding: 14px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.week .day.faded .bar.good { background: repeating-linear-gradient(135deg, var(--good) 0 4px, #B9D8C3 4px 8px); }
.week .day.faded .bar.ok { background: repeating-linear-gradient(135deg, var(--ok) 0 4px, #EBD3A6 4px 8px); }
.week .day.faded .bar.poor { background: repeating-linear-gradient(135deg, var(--poor) 0 4px, #EDC0BA 4px 8px); }
.week .bar { width: 100%; max-width: 30px; border-radius: 6px 6px 2px 2px; display: block; }
.week .sc { font-size: 13px; font-weight: 700; }
.week .dn { font-size: 12px; font-weight: 600; }
.week .dd { font-size: 11px; color: var(--muted); }

/* Outlook */
.outlook { background: var(--card); border-radius: 14px; padding: 4px 14px; }
.ol { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.ol:last-child { border-bottom: 0; }
.ol .a { width: 84px; white-space: nowrap; } .ol .b { width: 58px; white-space: nowrap; } .ol .c { flex: 1; font-size: 13px; color: var(--rain); white-space: nowrap; } .ol .e { width: 58px; font-size: 13px; white-space: nowrap; text-align: right; }
.ol.head { padding: 8px 0 4px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ol .f { width: 40px; text-align: right; font-size: 12px; color: var(--tag); }
.ol.lowconf .a b { font-weight: 600; }

footer.attrib { padding: 20px 20px 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
footer.attrib p { margin: 0 0 6px; }

/* Finder */
.search { display: flex; flex-direction: column; gap: 6px; }
.search label { font-size: 13px; font-weight: 600; }
.search input { height: 50px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px; font-size: 16px; background: var(--card); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--green); color: var(--bg); border-color: var(--green); }
.list { display: flex; flex-direction: column; gap: 8px; }
.course-row { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); min-height: 60px; border: 0; width: 100%; text-align: left; cursor: pointer; }
.course-row .n { flex: 1; display: flex; flex-direction: column; }
.course-row .n span:first-child { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 16px; }
.course-row .n span:last-child { font-size: 12px; color: var(--muted); }
.course-row .sc { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted2); align-items: center; }
.legend span { display: inline-flex; gap: 5px; align-items: center; }

/* Radar page */
.radar-page { display: flex; flex-direction: column; gap: 12px; }
.big-map { height: min(55vh, 620px); border-radius: 18px; overflow: hidden; margin: 0 20px; background: var(--map-bg); }
.controls { margin: 0 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.controls input[type=range] { flex: 1; min-width: 160px; accent-color: var(--green); height: 44px; }
.controls .time { font-weight: 700; min-width: 54px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; min-height: 44px; }
.holes-list { background: var(--card); border-radius: 14px; padding: 4px 14px; }
.hl { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.hl:last-child { border-bottom: 0; }
.hole-label { background: var(--ink); color: var(--card); border-radius: 9px; font-size: 10px; font-weight: 700; padding: 1px 5px; border: 0; white-space: nowrap; }
.empty { padding: 30px 20px; text-align: center; color: var(--muted2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 900px) {
  .radar-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
}

/* Self-hosted fonts (SIL OFL), so no request goes to Google. */
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
.radar-side { padding: 0 20px; }
.radar-side .holes-list { margin-top: 4px; }
@media (min-width: 900px) { .radar-side { padding: 0 20px 0 0; } }

/* Autocomplete */
.combo { position: relative; }
.combo input { width: 100%; }
.suggest { position: absolute; z-index: 1000; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(20, 33, 27, .15); max-height: 360px; overflow-y: auto; }
.suggest li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 12px; min-height: 48px; border-radius: 8px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--bg); }
.suggest .nm { font-weight: 600; }
.suggest .nm mark { background: none; color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.suggest .ct { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Landing page (first visit, option A) */
.land-hero { padding: 28px 24px 0; display: flex; flex-direction: column; gap: 12px; }
.land-hero .eyebrow { font-weight: 600; }
.land-hero h1 { margin: 0; font-size: 40px; line-height: 1.04; color: var(--green); }
.land-hero p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--muted2); }
/* A plain list, not cards: nothing here is tappable, so nothing should look like a button. */
.land-feats { margin: 0; padding: 18px 24px 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 20px; }
.land-feats li { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--muted2); }
.land-feats .ic-radar { color: var(--rain); } .land-feats .ic-clock { color: var(--good); } .land-feats .ic-flag { color: var(--ok); }
.land-go { padding: 28px 24px 8px; display: flex; flex-direction: column; gap: 12px; }
.land-go .search label { font-size: 14px; font-weight: 700; }
.land-combo .ic-search { position: absolute; left: 14px; top: 17px; color: var(--muted); pointer-events: none; }
.land-combo input { height: 54px; border: 1.5px solid var(--green); border-radius: 14px; padding-left: 44px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or span { flex: 1; height: 1px; background: var(--line); }
.btn-green { height: 54px; border-radius: 27px; border: 0; background: var(--green); color: var(--bg); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.btn-green .ic { color: var(--gold); }
.btn-green:disabled { opacity: .75; cursor: progress; }
.note.center { text-align: center; }

/* Shared-forecast banner */
.shared-banner { margin: 0 20px 14px; background: var(--warn-bg); border: 1.5px solid var(--gold); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.shared-banner span { font-size: 13px; color: var(--muted2); line-height: 1.4; }

/* Tee time + share, inside the window detail */
.share { border-top: 1px solid var(--line2); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.tee-row { display: flex; align-items: center; gap: 10px; }
.tee-row label { flex: 1; font-size: 14px; font-weight: 600; }
.tee-row select { height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 0 10px; font-size: 16px; color: var(--ink); }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btns .btn-gold { flex: 1; justify-content: center; gap: 8px; font-size: 15px; }
.share-btns .btn-line { display: inline-flex; align-items: center; gap: 6px; }
.share .note:empty { display: none; }
.share .note { color: var(--good); font-weight: 600; font-size: 13px; }

/* Rain and wind timeline under the course map */
.tl-map { position: relative; }
.tl-tint { position: absolute; inset: 0; z-index: 450; background: var(--rain); opacity: 0; pointer-events: none; transition: opacity .2s; }
.tl-wind { position: absolute; top: 10px; right: 10px; z-index: 460; background: rgba(14, 56, 38, .88); color: var(--bg); border-radius: 20px; padding: 4px 10px 4px 6px; display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; pointer-events: none; }
.tl-wind svg { transition: transform .2s; color: var(--gold); }
.timeline { background: var(--card); color: var(--ink); padding: 10px 16px 6px; display: flex; flex-direction: column; gap: 6px; }
.tl-read { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tl-when { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 17px; }
.tl-src { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 11px; background: var(--line2); color: var(--muted2); }
.tl-src.radar, .tl-src.comp { background: var(--gold); color: var(--ink); }
.tl-src.proj { background: var(--proj); color: var(--ink); }
.tl-vals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tl-vals span { display: flex; flex-direction: column; }
.tl-vals small { font-size: 11px; color: var(--muted); }
.tl-vals b { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 16px; }
.tl-bars { display: flex; align-items: flex-end; gap: 1px; height: 34px; margin-top: 4px; }
.tl-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; background: var(--line2); border-radius: 2px; }
.tl-bar.radar, .tl-bar.comp, .tl-bar.proj { background: var(--proj-bar); }
.tl-bar.on { background: var(--gold); }
.tl-bar span { display: block; width: 100%; background: var(--rain); border-radius: 2px; }
#tl-slider { width: 100%; height: 40px; margin: 0; accent-color: var(--green); }
.tl-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.share-btns [hidden] { display: none; }

/* Layout helpers that replaced inline styles */
.radar-page .controls { margin-top: 12px; }
.coverage-note { margin: 8px 20px 0; }
.radar-card.flush { margin: 0; }
.alt .dot { width: 12px; height: 12px; }
.score-key { margin: 8px 0 0; }

/* Rain loop controls on the course map */
.tl-ctrl { display: flex; align-items: center; gap: 6px; }
.tl-ctrl button { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.tl-ctrl button.play { background: var(--green); border-color: var(--green); color: var(--bg); }
.tl-ctrl .grow { flex: 1; }

/* Hole-by-hole strip on the radar card */
.hole-strip { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 16px 12px; }
.hole-strip span { min-width: 30px; padding: 3px 6px; border-radius: 8px; font-size: 12px; font-weight: 700; text-align: center; background: rgba(243, 246, 244, .14); }
.hole-strip span.wet { background: var(--rain); }
.hole-strip span small { display: block; font-weight: 400; font-size: 10px; }

@media (prefers-reduced-motion: reduce) {
  .tl-tint, .tl-wind svg { transition: none; }
}
a.inherit { color: inherit; }
.holes-h { margin: 12px 0 0; font-size: 20px; }

/* Radar page loop: time readout, frame ticks (radar solid, projection hatched), step controls */
.loop-read { margin: 12px 20px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loop-read .grow { flex: 1; }
.btn-line.small { min-height: 44px; padding: 0 14px; font-size: 14px; }
.loop-ticks { margin: 8px 20px 0; display: flex; gap: 2px; height: 10px; }
.loop-ticks span { flex: 1; border-radius: 2px; background: var(--line2); }
.loop-ticks span.proj { background: repeating-linear-gradient(135deg, var(--line2) 0 3px, transparent 3px 6px); }
.loop-ticks span.now { box-shadow: inset 0 -3px 0 var(--green); }
.loop-ticks span.on { background: var(--green); }
.loop-ticks span.proj.on { background: var(--brand2); }
.loop-ticks span.fc { background: var(--line2); opacity: .6; }
.loop-ticks span.fc.on { background: var(--brand2); opacity: 1; }
.radar-page .controls .tl-ctrl { flex: none; }
.holes-far .hole-label { display: none; }
/* Satellite base map: mute the photo so rain colours and hole lines read clearly on top */
.sat .leaflet-tile-pane { filter: brightness(.78) saturate(.6); }
.sat .leaflet-overlay-pane .leaflet-image-layer { filter: saturate(1.5) contrast(1.15); }
.sat .leaflet-overlay-pane path { stroke: #F3F6F4; }
.credits summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); }
.credits[open] summary { color: var(--ink); }
