:root {
  --ink: #13231d;
  --forest: #10271f;
  --green: #23694e;
  --green-2: #2f8060;
  --lime: #cbe879;
  --paper: #f4f3ed;
  --card: #fffefa;
  --muted: #6c756f;
  --line: #dde1db;
  --danger: #a34137;
  --shadow: 0 18px 45px rgba(25, 45, 36, .09);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 90% -10%, #e5edcd 0, transparent 29rem), var(--paper); color: var(--ink); }
.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 22px; }
.auth-screen.is-hidden { display: none; }
.auth-card { width: min(100%, 430px); padding: 30px 25px; border: 1px solid var(--line); border-radius: 26px; background: var(--card); box-shadow: var(--shadow); }
.auth-mark { margin-bottom: 20px; }
.auth-card h1 { margin: 7px 0 9px; font-family: Georgia, serif; font-size: 31px; line-height: 1.05; letter-spacing: -.03em; }
.auth-copy { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-switch { display: block; margin: 14px auto 0; border: 0; background: transparent; color: var(--green); font-size: 13px; font-weight: 800; cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.sync-chip { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 6px 9px; border-radius: 9px; background: #e7eee4; color: var(--green); font-size: 10px; font-weight: 800; }
button, input, select { font: inherit; }
button { color: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 850px); min-height: 100vh; margin: 0 auto; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; gap: 12px; padding: calc(18px + env(safe-area-inset-top)) 18px 13px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--forest); box-shadow: inset 0 0 0 5px #264237; }
.brand-mark span { width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: -5px -5px 0 -3px #fff, 5px -5px 0 -3px #fff, -5px 5px 0 -3px #fff, 5px 5px 0 -3px #fff; }
.brand-copy { flex: 1; }
.brand-copy h1 { margin: 1px 0 0; font-family: Georgia, serif; font-size: 21px; letter-spacing: -.02em; }
.eyebrow { margin: 0; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.icon-button { display: grid; place-items: center; border: 0; width: 44px; height: 44px; border-radius: 50%; background: #e7e9e1; cursor: pointer; }
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.view { display: none; padding: 8px 16px 30px; }
.view.is-active { display: block; animation: appear .25s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.hero-card { display: flex; justify-content: space-between; align-items: end; gap: 20px; min-height: 150px; padding: 25px; border-radius: 25px; background: linear-gradient(135deg, #10271f, #244c3b); color: white; box-shadow: var(--shadow); overflow: hidden; position: relative; }
.hero-card::after { content: ""; position: absolute; width: 170px; height: 170px; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; right: -45px; top: -70px; box-shadow: 0 0 0 27px rgba(255,255,255,.025), 0 0 0 54px rgba(255,255,255,.02); }
.hero-card .eyebrow { color: var(--lime); }
.hero-card h2 { max-width: 390px; margin: 7px 0 7px; font-family: Georgia, serif; font-size: clamp(27px, 5vw, 36px); line-height: 1.03; letter-spacing: -.035em; }
.hero-card p:last-child { max-width: 410px; margin: 0; color: #d7e1db; font-size: 13px; line-height: 1.45; }
.session-count { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 10px 12px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: rgba(255,255,255,.07); backdrop-filter: blur(5px); z-index: 1; }
.session-count strong { color: var(--lime); font-size: 28px; line-height: 1; }
.session-count span { color: #c9d3cd; font-size: 9px; font-weight: 800; line-height: 1.05; letter-spacing: .08em; text-transform: uppercase; }
.shot-card { margin-top: -1px; padding: 22px 18px 20px; border-radius: 0 0 25px 25px; background: var(--card); box-shadow: var(--shadow); }
.course-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; margin-bottom: 17px; }
.course-row .standard-field { margin: 0; }
.course-row select { width: 100%; min-height: 42px; border: 1px solid #d7ddd6; border-radius: 12px; padding: 0 10px; background: #fbfbf7; }
.field-label, .distance-field > span:first-child, .note-field > span, .standard-field > span { display: block; margin-bottom: 8px; color: #53615a; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.club-strip { display: flex; gap: 8px; margin: 0 -18px; padding: 0 18px 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.club-strip::-webkit-scrollbar { display: none; }
.club-pill { flex: 0 0 auto; min-width: 58px; height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: #f6f6f1; font-weight: 800; cursor: pointer; scroll-snap-align: start; }
.club-pill.is-active { border-color: var(--forest); background: var(--forest); color: white; box-shadow: 0 6px 14px rgba(16,39,31,.18); }
.shot-mode { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; margin: 12px 0 18px; padding: 4px; border-radius: 14px; background: #e9ece6; }
.mode-button { min-height: 39px; border: 0; border-radius: 10px; background: transparent; color: #68736d; font-size: 13px; font-weight: 700; cursor: pointer; }
.mode-button.is-active { background: white; color: var(--ink); box-shadow: 0 3px 10px rgba(24,40,33,.09); }
.distance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.distance-grid:has(.distance-field.is-hidden) { grid-template-columns: 1fr; }
.distance-field.is-hidden, .is-hidden { display: none !important; }
.distance-input { display: flex; align-items: baseline; border: 1px solid #d7ddd6; border-radius: 17px; background: #fbfbf7; overflow: hidden; transition: .2s; }
.distance-input:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(47,128,96,.12); }
.distance-input input { width: 100%; min-width: 0; padding: 13px 4px 13px 16px; border: 0; outline: 0; background: transparent; color: var(--forest); font-family: Georgia, serif; font-size: 30px; font-weight: 700; }
.distance-input b { padding-right: 14px; color: var(--muted); font-size: 12px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; }
.mishit-toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.mishit-toggle input { position: absolute; opacity: 0; }
.toggle-box { display: flex; align-items: center; width: 39px; height: 23px; padding: 3px; border-radius: 20px; background: #ccd2cd; transition: .2s; }
.toggle-box span { width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: .2s; }
.mishit-toggle input:checked + .toggle-box { background: #bd6b60; }
.mishit-toggle input:checked + .toggle-box span { transform: translateX(16px); }
.mishit-toggle b { display: block; font-size: 13px; }
.mishit-toggle small { display: block; color: var(--muted); font-size: 10px; }
.note-button, .text-button { border: 0; background: transparent; color: var(--green); font-size: 12px; font-weight: 800; cursor: pointer; }
.note-field { margin-top: 13px; }
.gps-option { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 13px; border: 1px solid #d7ddd6; border-radius: 14px; background: #f7f8f3; cursor: pointer; }
.gps-option input { width: 19px; height: 19px; accent-color: var(--green); }
.gps-option b, .gps-option small { display: block; }
.gps-option b { font-size: 13px; }
.gps-option small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.note-field input, .standard-field input, .filter-bar select { width: 100%; min-height: 48px; border: 1px solid #d7ddd6; border-radius: 13px; background: #fbfbf7; padding: 0 13px; outline: 0; }
.note-field input:focus, .standard-field input:focus, .filter-bar select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(47,128,96,.12); }
.primary-button, .secondary-button, .danger-button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; border: 0; border-radius: 15px; font-weight: 800; cursor: pointer; }
.primary-button { margin-top: 18px; background: var(--forest); color: white; box-shadow: 0 10px 20px rgba(16,39,31,.19); }
.primary-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.secondary-button { border: 1px solid var(--line); background: white; }
.secondary-button.compact { width: auto; min-height: 38px; padding: 0 12px; font-size: 11px; }
.danger-button { margin-top: 10px; background: #f7e8e5; color: var(--danger); }
.form-error { min-height: 16px; margin: 8px 0 -7px; color: var(--danger); font-size: 12px; text-align: center; }
.recent-block { padding: 27px 2px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.section-heading h2 { margin: 4px 0 0; font-family: Georgia, serif; font-size: 25px; letter-spacing: -.025em; }
.recent-list, .history-list { display: grid; gap: 9px; }
.empty-state { padding: 28px 18px; border: 1px dashed #c8cec7; border-radius: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.shot-row { display: grid; grid-template-columns: 47px 1fr auto; align-items: center; gap: 11px; min-height: 67px; padding: 10px 12px; border: 1px solid #e2e4df; border-radius: 17px; background: rgba(255,255,255,.76); }
.club-badge { display: grid; place-items: center; height: 42px; border-radius: 13px; background: #e5eee8; color: var(--green); font-size: 12px; font-weight: 900; }
.shot-row.is-mishit { opacity: .62; }
.shot-row.is-mishit .club-badge { background: #f3dfdc; color: var(--danger); }
.shot-detail b { display: block; font-size: 13px; }
.shot-detail small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.shot-distance { text-align: right; }
.shot-distance b { font-family: Georgia, serif; font-size: 23px; }
.shot-distance span { color: var(--muted); font-size: 10px; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 50%; display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 850px); min-height: 70px; padding: 7px 12px calc(7px + env(safe-area-inset-bottom)); transform: translateX(-50%); border-top: 1px solid rgba(20,35,29,.09); background: rgba(253,252,247,.91); backdrop-filter: blur(18px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: #7f8882; font-size: 10px; font-weight: 700; cursor: pointer; }
.bottom-nav button.is-active { color: var(--green); }
.bottom-nav svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.sticky-heading { position: sticky; z-index: 3; top: 0; padding: 10px 0 12px; background: linear-gradient(var(--paper) 78%, transparent); }
.metric-switch { display: flex; padding: 3px; border-radius: 12px; background: #e1e5df; }
.metric-switch button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 800; cursor: pointer; }
.metric-switch button.is-active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.insight-banner { margin-bottom: 12px; padding: 13px 15px; border-left: 3px solid var(--lime); border-radius: 0 13px 13px 0; background: #e6eed5; color: #355044; font-size: 12px; line-height: 1.4; }
.club-grid { display: grid; gap: 11px; }
.club-card { position: relative; padding: 17px; border: 1px solid #e0e4de; border-radius: 20px; background: rgba(255,255,255,.83); box-shadow: 0 7px 21px rgba(25,45,36,.045); overflow: hidden; }
.club-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.club-card h3 { margin: 0; font-family: Georgia, serif; font-size: 22px; }
.club-card-head button { border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 800; cursor: pointer; }
.stat-main { display: flex; align-items: flex-end; gap: 5px; margin-top: 15px; }
.stat-main strong { font-family: Georgia, serif; font-size: 39px; line-height: .9; letter-spacing: -.04em; }
.stat-main > span { color: var(--muted); font-size: 12px; }
.stat-main .no-stat { font-family: inherit; font-size: 20px; letter-spacing: 0; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.mini-stat { padding: 10px 11px; border-radius: 13px; background: #f3f4ef; }
.mini-stat span { display: block; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mini-stat b { display: block; margin-top: 3px; font-size: 13px; }
.progress-track { height: 7px; margin-top: 15px; border-radius: 10px; background: #e7e9e4; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #82a852); }
.guidance { display: flex; justify-content: space-between; gap: 12px; margin: 7px 1px 0; color: var(--muted); font-size: 10px; }
.guidance b { color: var(--green); }
.estimate-chip { display: inline-flex; margin-top: 12px; padding: 5px 8px; border-radius: 8px; background: #edf1e8; color: #58675f; font-size: 10px; font-weight: 700; }
.filter-bar { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8px; margin-bottom: 14px; }
.filter-bar label { grid-column: 1 / -1; }
.filter-bar label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.history-row { position: relative; grid-template-columns: 47px minmax(0, 1fr) auto 33px; }
.delete-shot { display: grid; place-items: center; width: 33px; height: 33px; margin-left: 4px; border: 0; border-radius: 11px; background: #f4e7e4; color: var(--danger); font-size: 18px; cursor: pointer; }
dialog { width: min(calc(100% - 24px), 560px); max-height: 89vh; margin: auto auto 0; padding: 10px 19px calc(22px + env(safe-area-inset-bottom)); border: 0; border-radius: 27px 27px 0 0; background: var(--card); color: var(--ink); box-shadow: 0 -20px 50px rgba(10,30,20,.2); overflow-y: auto; }
dialog::backdrop { background: rgba(8,20,15,.48); backdrop-filter: blur(2px); }
dialog[open] { animation: rise .22s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
.dialog-handle { width: 45px; height: 4px; margin: 1px auto 18px; border-radius: 5px; background: #ccd0ca; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.dialog-heading h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 26px; }
.dialog-heading .icon-button { flex: 0 0 auto; font-size: 27px; font-weight: 300; }
.standard-field { display: block; margin-top: 14px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.helper-copy { margin: 12px 2px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.privacy-card { display: flex; gap: 13px; padding: 15px; border-radius: 16px; background: #e8efdd; }
.privacy-card svg { flex: 0 0 auto; width: 23px; fill: none; stroke: var(--green); stroke-width: 1.8; }
.privacy-card b { font-size: 13px; }
.privacy-card p { margin: 4px 0 0; color: #607068; font-size: 11px; line-height: 1.5; }
.settings-actions { display: grid; gap: 9px; margin-top: 17px; }
.course-list { display: grid; gap: 7px; margin-top: 18px; }
.course-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; }
.course-list-row small { display: block; margin-top: 2px; color: var(--muted); }
.course-list-row button { border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 800; cursor: pointer; }
.settings-actions .danger-button { margin-top: 8px; }
.file-button { position: relative; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-number { display: flex; justify-content: space-between; align-items: end; padding: 17px; border-radius: 17px; background: var(--forest); color: white; }
.profile-number span { color: #cdd8d2; font-size: 11px; }
.profile-number strong { color: var(--lime); font-family: Georgia, serif; font-size: 38px; }
.profile-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 10px; }
.profile-stat { padding: 12px 8px; border-radius: 14px; background: #f1f3ee; text-align: center; }
.profile-stat span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.profile-stat b { display: block; margin-top: 4px; font-size: 13px; }
.shot-dots { display: flex; flex-wrap: wrap; gap: 5px; margin: 18px 2px 7px; }
.shot-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-2); }
.shot-dot.mishit { background: #cd877f; }
.stat-explainer { color: var(--muted); font-size: 11px; line-height: 1.55; }
.toast { position: fixed; z-index: 30; bottom: calc(84px + env(safe-area-inset-bottom)); left: 50%; max-width: calc(100% - 28px); padding: 11px 17px; transform: translate(-50%, 18px); border-radius: 12px; background: #172c24; color: white; box-shadow: 0 12px 35px rgba(0,0,0,.19); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 680px) {
  .topbar, .view { padding-left: 28px; padding-right: 28px; }
  .shot-card { padding-left: 25px; padding-right: 25px; }
  .club-strip { margin-left: -25px; margin-right: -25px; padding-left: 25px; padding-right: 25px; }
  .club-grid { grid-template-columns: 1fr 1fr; }
  dialog { margin-bottom: auto; border-radius: 27px; padding-bottom: 25px; }
}
@media (max-width: 390px) {
  .hero-card { padding: 21px 18px; }
  .session-count { padding: 8px; }
  .session-count strong { font-size: 23px; }
  .mishit-toggle small { display: none; }
  .sync-chip { max-width: 92px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
