:root {
  --bg: #eef0ec;
  --surface: rgba(245, 248, 246, 0.9);
  --surface-strong: #f5f8f6;
  --surface-dark: #12201c;
  --text: #1c2e28;
  --muted: #4a5e58;
  --line: rgba(28, 46, 40, 0.12);
  --accent: #4a7c6f;
  --accent-deep: #2e5c52;
  --warn: #b05c3c;
  --green: #2d6a4f;
  --green-soft: #dceee9;
  --shadow: 0 24px 80px rgba(28, 46, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(74, 124, 111, 0.14), transparent 30%),
    radial-gradient(circle at bottom right, rgba(45, 106, 79, 0.14), transparent 28%),
    linear-gradient(180deg, #e8eceb 0%, #f2f4f2 48%, #e6eae8 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 80%);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 22, 18, 0.42);
  backdrop-filter: blur(12px);
}

.auth-gate.is-visible {
  display: flex;
}

.hidden {
  display: none !important;
}

.auth-panel {
  width: min(720px, 100%);
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.auth-panel-left {
  background: #12201c;
  background-image: radial-gradient(circle, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-panel-left .auth-brand {
  filter: brightness(0) invert(1);
  width: 160px;
}

.auth-panel-headline {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(22px, 2.8vw, 30px);
  color: #fff;
  line-height: 1.25;
  margin: 0;
}

.auth-panel-headline em {
  font-style: italic;
  opacity: 0.45;
}

.auth-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-bullets li {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  padding-left: 22px;
  position: relative;
  line-height: 1.45;
}

.auth-bullets li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #5db88a;
  font-weight: 700;
}

.auth-panel-right {
  background: rgba(245, 248, 246, 0.98);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.auth-panel-tagline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.google-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #dadce0;
  border-radius: 100px;
  padding: 12px 20px;
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1a2a1e;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

.google-signin-btn:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.14);
  border-color: #bbb;
}

.auth-trust {
  font-size: 11px;
  color: #a0aa9e;
  margin: 0;
  line-height: 1.5;
}

.auth-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

@media (max-width: 600px) {
  .auth-panel {
    grid-template-columns: 1fr;
    border-radius: 20px;
  }
  .auth-panel-left {
    padding: 28px 24px;
    gap: 16px;
  }
  .auth-panel-right {
    padding: 28px 24px;
  }
}

.auth-status {
  margin: 0;
  color: var(--muted);
}

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}

.page-notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: rgba(45, 106, 79, 0.08);
  color: var(--muted);
  line-height: 1.6;
}

.firebase-config-note {
  margin-top: 18px;
  color: var(--muted);
}

.firebase-config-note summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}

.page-shell {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.app-topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 16px;
}

.app-topbar,
.panel {
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.app-topbar {
  border-radius: 32px;
  padding: 28px 32px;
}

.brand-lockup {
  display: grid;
  gap: 14px;
}

.brand-logo {
  width: clamp(168px, 18vw, 236px);
  height: auto;
  display: block;
}

.auth-brand {
  width: 180px;
  height: auto;
  display: block;
}

.page-title {
  font-size: clamp(2.2rem, 3vw, 3.4rem);
}

.topbar-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-chip {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(45, 106, 79, 0.08);
}

.topbar-chip span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.topbar-chip strong {
  font-size: 1rem;
}

.app-nav {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.app-nav-link {
  text-decoration: none;
  color: var(--green);
  background: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(29, 42, 33, 0.08);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 800;
}

.app-nav-link.is-active {
  background: linear-gradient(135deg, var(--accent), #3d7a6c);
  color: white;
  box-shadow: 0 12px 30px rgba(74, 124, 111, 0.28);
}

.eyebrow,
.section-kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-deep);
  margin: 0 0 14px;
}

.section-kicker {
  margin-bottom: 8px;
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
h2 {
  font-family: "DM Serif Display", serif;
  line-height: 1;
  font-weight: 400;
}

h1 {
  font-size: clamp(2.6rem, 4vw, 4.9rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.8rem, 2.2vw, 2.6rem);
}

.hero-text {
  max-width: 65ch;
  margin: 18px 0 0;
  font-size: 1.04rem;
  line-height: 1.7;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
}

.page-grid {
  display: grid;
  gap: 24px;
}

.page-grid-round {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  align-items: start;
}

.compact-status-panel {
  grid-column: 2;
}

.score-panel {
  grid-column: 1 / -1;
}

.history-panel-wide {
  grid-column: 1 / -1;
}

.panel {
  border-radius: 28px;
  padding: 24px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.button-row,
.ai-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.history-pagination {
  margin-bottom: 16px;
  justify-content: flex-end;
}

.profile-form {
  max-width: 720px;
}

.inline-select {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
}

.inline-select select {
  min-width: 180px;
}

.round-form,
.hole-fields {
  display: grid;
  gap: 14px;
}

.control-panel {
  padding: 20px 24px;
}

.control-panel .panel-heading {
  margin-bottom: 16px;
  align-items: flex-start;
}

.control-panel .panel-heading h2 {
  font-size: clamp(1.5rem, 1.8vw, 2.15rem);
}

.round-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.round-form-span-2 {
  grid-column: span 2;
}

.course-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.course-picker-meta {
  padding-bottom: 12px;
  white-space: nowrap;
  font-size: 0.9rem;
}

.round-form-span-3 {
  grid-column: 1 / -1;
}

.round-form label,
.hole-fields label,
.notes-field {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: rgba(245, 248, 246, 0.95);
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}

.primary-btn,
.secondary-btn {
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #3d7a6c);
  color: white;
  box-shadow: 0 12px 30px rgba(74, 124, 111, 0.28);
}

.secondary-btn {
  background: var(--green-soft);
  color: var(--green);
}

.score-pill {
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--green-soft);
  color: var(--green);
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 800;
}

.entry-mode-bar,
.entry-panel-heading,
.detail-entry-controls {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.entry-mode-bar {
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.entry-mode-tabs,
.entry-progress {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.entry-mode-btn,
.detail-hole-tab {
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: rgba(45, 106, 79, 0.08);
  color: var(--green);
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 800;
}

.entry-mode-btn.is-active,
.detail-hole-tab.is-active {
  background: linear-gradient(135deg, var(--accent), #3d7a6c);
  color: white;
  box-shadow: 0 12px 30px rgba(74, 124, 111, 0.22);
}

.detail-hole-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.detail-hole-check {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  flex: 0 0 auto;
}

.entry-progress-chip {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(29, 42, 33, 0.06);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.entry-panel {
  display: grid;
  gap: 18px;
}

.entry-panel-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.quick-entry-shell {
  overflow: auto;
}

.quick-entry-table {
  min-width: 780px;
  display: grid;
  gap: 10px;
}

.quick-entry-header,
.quick-entry-row {
  display: grid;
  grid-template-columns: 88px repeat(6, minmax(92px, 1fr));
  gap: 10px;
  align-items: center;
}

.quick-entry-header {
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-entry-grid {
  display: grid;
  gap: 10px;
}

.qe-nine-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 12px 0;
}

.qe-nine-spacer {
  height: 10px;
}

.quick-entry-totals {
  display: grid;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(29, 42, 33, 0.1);
  margin-bottom: 4px;
}

.quick-entry-total-row {
  display: grid;
  grid-template-columns: 88px repeat(6, minmax(92px, 1fr));
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(29, 42, 33, 0.04);
  border-radius: 10px;
  font-size: 0.88rem;
}

.quick-entry-total-row.is-grand-total {
  background: rgba(29, 42, 33, 0.09);
  font-weight: 700;
}

.qet-label {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.quick-entry-total-row.is-grand-total .qet-label {
  color: var(--text);
}

.qet-score {
  font-weight: 700;
}

.quick-entry-row {
  background: var(--surface-strong);
  border: 1px solid rgba(29, 42, 33, 0.08);
  border-radius: 20px;
  padding: 12px;
}

.quick-entry-row.is-complete {
  border-color: rgba(45, 106, 79, 0.26);
  box-shadow: inset 0 0 0 1px rgba(45, 106, 79, 0.08);
}

.quick-hole-label {
  font-size: 1.05rem;
  text-align: center;
}

.quick-cell input,
.quick-cell select {
  min-width: 0;
}

.par-value {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(29, 42, 33, 0.05);
  color: var(--text);
  font-weight: 800;
}

.detail-hole-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-content-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-content-tab {
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: rgba(29, 42, 33, 0.05);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
}

.detail-content-tab.is-active {
  background: rgba(45, 106, 79, 0.14);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(45, 106, 79, 0.12);
}

.detail-content-panel {
  display: grid;
  gap: 14px;
}

.detail-entry-controls {
  justify-content: flex-end;
}

.detail-entry-grid,
.detail-notes-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.detail-grid-card,
.detail-note-card {
  height: 100%;
}

.detail-grid-card .hole-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.detail-note-card .notes-field textarea {
  min-height: 150px;
}

.course-form {
  align-items: start;
}

.course-pars-card {
  border-radius: 22px;
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: var(--surface-strong);
  padding: 18px;
}

.compact-panel-heading {
  margin-bottom: 14px;
}

.compact-panel-heading h3 {
  font-family: "DM Serif Display", serif;
  font-size: 1.4rem;
  font-weight: 400;
}

.course-par-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.course-hole-config {
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: rgba(45, 106, 79, 0.05);
  padding: 12px;
  display: grid;
  gap: 8px;
}

.course-hole-config > span {
  display: block;
  text-align: center;
  font-weight: 800;
  color: var(--text);
}

.course-hole-config label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--muted);
}

.course-library-list {
  display: grid;
  gap: 14px;
}

/* ── Course tabs ────────────────────────────────────────────────── */

.course-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid rgba(29, 42, 33, 0.1);
  margin-bottom: 20px;
}

.course-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s;
}

.course-tab:hover {
  color: var(--ink);
}

.course-tab.is-active {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* ── Course card ─────────────────────────────────────────────────── */

.course-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.course-card-name-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.course-card-meta {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

/* ── Disclosure (collapsible sections) ──────────────────────────── */

.course-disclosure {
  border-top: 1px solid rgba(29, 42, 33, 0.08);
  margin-top: 10px;
}

.course-disclosure-summary,
.course-pars-summary {
  padding: 8px 0;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.course-disclosure-summary::-webkit-details-marker,
.course-pars-summary::-webkit-details-marker {
  display: none;
}

.course-disclosure-summary::before,
.course-pars-summary::before {
  content: "›";
  display: inline-block;
  font-size: 1rem;
  transition: transform 0.2s;
  color: var(--muted);
}

details[open] > .course-disclosure-summary::before,
details[open] > .course-pars-summary::before {
  transform: rotate(90deg);
}

.course-disclosure-summary:hover,
.course-pars-summary:hover {
  color: var(--ink);
}

.course-pars-disclosure {
  margin-top: 14px;
}

.course-pars-disclosure .course-pars-card {
  margin-top: 10px;
}

/* ── Community courses ──────────────────────────────────────────── */

.community-search-row {
  margin-bottom: 16px;
}

.community-search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid rgba(29, 42, 33, 0.18);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.community-search-input:focus {
  border-color: var(--green);
}

.community-course-card {
  background: var(--cream);
  border: 1.5px solid rgba(29, 42, 33, 0.1);
}

.community-course-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.community-course-contributor {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.course-shared-badge {
  display: inline-block;
  padding: 2px 10px;
  background: rgba(27, 127, 91, 0.12);
  color: #1b7f5b;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
}

.course-share-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.course-share-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}

.course-share-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── End community courses ──────────────────────────────────────── */

.course-library-card {
  border-radius: 22px;
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: var(--surface-strong);
  padding: 18px;
}

.course-card-name-group strong {
  display: block;
  font-size: 1.05rem;
}

.course-library-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.tee-box-list,
.course-tee-list {
  display: grid;
  gap: 14px;
}

.tee-box-card,
.course-tee-summary {
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: rgba(255, 255, 255, 0.7);
  padding: 16px;
}

.tee-box-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.tee-box-header h4,
.course-tee-summary-title {
  margin: 6px 0 0;
  font-size: 1.05rem;
}

.tee-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.course-tee-summary p + p {
  margin-top: 6px;
}

.course-par-preview {
  margin-top: 10px !important;
  font-family: "DM Serif Display", serif;
  color: var(--text) !important;
}

.hole-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-height: 78vh;
  overflow: auto;
  padding-right: 6px;
}

.hole-card {
  background: var(--surface-strong);
  border: 1px solid rgba(29, 42, 33, 0.08);
  border-radius: 24px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.hole-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.par-pill {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(45, 106, 79, 0.12);
  color: var(--green);
  font-size: 0.84rem;
  font-weight: 800;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 0;
}

.summary-card,
.coach-card {
  background: var(--surface-strong);
  border: 1px solid rgba(29, 42, 33, 0.08);
  border-radius: 22px;
  padding: 18px;
}

.profile-records-grid,
.course-history-list {
  display: grid;
  gap: 14px;
}

.insight-card-grid {
  display: grid;
  gap: 14px;
}

.dashboard-par-card {
  margin-top: 18px;
}

.dashboard-par-header {
  margin-bottom: 14px;
}

.dashboard-par-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.dashboard-par-tile {
  background: var(--surface-strong);
  border: 1px solid rgba(29, 42, 33, 0.08);
  border-radius: 22px;
  padding: 18px;
}

.dashboard-par-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.dashboard-par-score {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.dashboard-par-benchmark {
  display: block;
  color: var(--muted);
  margin-bottom: 12px;
}

.dashboard-par-bars {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.dashboard-par-bar-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
}

.dashboard-par-bar-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.dashboard-par-bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(29, 42, 33, 0.08);
  overflow: hidden;
}

.dashboard-par-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: rgba(29, 42, 33, 0.24);
}

.dashboard-par-bar-fill.is-positive {
  background: linear-gradient(90deg, rgba(45, 106, 79, 0.55), var(--green));
}

.dashboard-par-bar-fill.is-negative {
  background: linear-gradient(90deg, rgba(176, 92, 60, 0.45), var(--warn));
}

.dashboard-par-bar-fill.is-neutral {
  background: linear-gradient(90deg, rgba(29, 42, 33, 0.2), rgba(29, 42, 33, 0.45));
}

.dashboard-par-bar-fill.is-baseline {
  background: linear-gradient(90deg, rgba(29, 42, 33, 0.15), rgba(29, 42, 33, 0.35));
}

.dashboard-par-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.profile-records-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.insight-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.record-card,
.course-history-item {
  background: var(--surface-strong);
  border: 1px solid rgba(29, 42, 33, 0.08);
  border-radius: 22px;
  padding: 18px;
}

.record-card span,
.course-history-item span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.record-card strong,
.course-history-item strong {
  display: block;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.record-card p,
.course-history-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.mini-insight-card {
  position: relative;
  overflow: hidden;
}

.mini-insight-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(29, 42, 33, 0.12);
}

.mini-insight-card.is-positive::before {
  background: var(--green);
}

.mini-insight-card.is-negative::before {
  background: var(--warn);
}

.mini-insight-card.is-neutral::before {
  background: rgba(29, 42, 33, 0.25);
}

#trendList .mini-insight-card::before {
  display: none;
}

.mini-insight-label {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.mini-insight-value {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.mini-insight-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.benchmark-meter {
  position: relative;
  height: 10px;
  margin: 12px 0 10px;
  border-radius: 999px;
  background: rgba(29, 42, 33, 0.1);
  overflow: hidden;
}

.benchmark-meter-fill {
  height: 100%;
  border-radius: inherit;
  background: rgba(29, 42, 33, 0.2);
}

.benchmark-meter-fill.is-positive {
  background: linear-gradient(90deg, rgba(45, 106, 79, 0.55), var(--green));
}

.benchmark-meter-fill.is-neutral {
  background: linear-gradient(90deg, rgba(29, 42, 33, 0.25), rgba(29, 42, 33, 0.45));
}

.benchmark-meter-fill.is-negative {
  background: linear-gradient(90deg, rgba(176, 92, 60, 0.45), var(--warn));
}

.benchmark-meter-target {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  border-radius: 999px;
  background: rgba(29, 42, 33, 0.65);
  transform: translateX(-50%);
}

.strokes-gained-card #sgTotal {
  font-size: 1.2rem;
}

.strokes-gained-card .approach-insight-tile strong {
  font-variant-numeric: tabular-nums;
}

.summary-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.summary-card strong {
  font-size: 2rem;
  font-weight: 800;
}

.coach-output {
  display: grid;
  gap: 14px;
}

.approach-insights-card {
  margin-bottom: 16px;
}

.approach-insights-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.approach-insights-subtitle {
  margin: 8px 0 0;
}

.insight-sample {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(74, 124, 111, 0.12);
  color: var(--accent-deep);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.approach-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.approach-insight-tile {
  border-radius: 18px;
  padding: 16px;
  background: rgba(45, 106, 79, 0.08);
}

.approach-insight-tile span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
}

.approach-insight-tile strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.25rem;
}

.approach-insight-tile p {
  margin: 0;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.coach-card p,
.coach-card li {
  color: var(--muted);
  line-height: 1.6;
}

.coach-card-action {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(29, 42, 33, 0.08);
}

/* ─── Premium gate card ─────────────────────────────────────────────────────── */

.premium-gate-card {
  text-align: center;
  padding: 36px 28px;
}

.premium-gate-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.premium-gate-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}

.premium-gate-pitch {
  color: var(--muted);
  line-height: 1.6;
  max-width: 420px;
  margin: 0 auto 20px;
}

.premium-gate-bullets {
  list-style: none;
  padding: 0;
  margin: 0 auto 28px;
  max-width: 360px;
  text-align: left;
  display: grid;
  gap: 8px;
}

.premium-gate-bullets li {
  font-size: 0.9rem;
  color: var(--muted);
  padding-left: 20px;
  position: relative;
}

.premium-gate-bullets li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.premium-upgrade-btn {
  display: inline-block;
  text-decoration: none;
  margin-bottom: 14px;
}

.premium-gate-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.coach-email-btn {
  width: 100%;
}

.bullet-list ul {
  margin: 0;
  padding-left: 18px;
}

.bullet-list p {
  margin: 0;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(45, 106, 79, 0.08);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.history-item-copy {
  display: grid;
  gap: 4px;
}

.history-item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.history-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.saved-indicator {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(45, 106, 79, 0.12);
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.history-subtitle {
  margin: 0 0 16px;
}

.history-summary-tile {
  margin-top: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(29, 42, 33, 0.08);
}

.history-summary-title {
  display: block;
  margin-bottom: 12px;
  font-size: 1rem;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.history-summary-stat {
  border-radius: 14px;
  padding: 12px;
  background: rgba(45, 106, 79, 0.08);
  display: grid;
  gap: 6px;
}

.history-summary-stat span {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-summary-stat strong {
  font-size: 1.1rem;
}

.history-summary-detail {
  margin: 0;
}

.history-scorecard-section {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.history-scorecard-title {
  display: block;
  font-size: 0.98rem;
}

.history-scorecard-grid {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.history-scorecard-row {
  display: grid;
  grid-template-columns: 60px repeat(10, minmax(44px, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 620px;
}

.history-scorecard-label,
.history-scorecard-cell {
  min-height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
}

.history-scorecard-label {
  background: rgba(29, 42, 33, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-scorecard-cell {
  background: rgba(45, 106, 79, 0.08);
  color: var(--text);
  font-weight: 700;
}

.history-scorecard-row.is-hole-row .history-scorecard-cell {
  background: rgba(29, 42, 33, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.history-scorecard-row.is-score-row .history-scorecard-cell {
  font-size: 1rem;
  font-weight: 800;
}

.history-scorecard-row.is-score-row .history-scorecard-cell.is-under-par {
  color: var(--green);
}

.history-scorecard-row.is-score-row .history-scorecard-cell.is-even-par {
  color: var(--text);
}

.history-scorecard-row.is-score-row .history-scorecard-cell.is-over-par {
  color: #b42318;
}

.history-scorecard-cell.is-total {
  background: rgba(74, 124, 111, 0.14);
  color: var(--accent-deep);
}

.course-scorecard-section {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.course-scorecard-title {
  display: block;
  font-size: 0.98rem;
}

.course-scorecard-grid {
  display: grid;
  gap: 8px;
  overflow-x: auto;
}

.course-scorecard-row {
  display: grid;
  grid-template-columns: 84px repeat(10, minmax(42px, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 660px;
}

.course-scorecard-label,
.course-scorecard-cell {
  min-height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  text-align: center;
}

.course-scorecard-label {
  background: rgba(29, 42, 33, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.course-scorecard-cell {
  background: rgba(45, 106, 79, 0.08);
  color: var(--text);
  font-weight: 700;
}

.course-scorecard-row.is-hole-row .course-scorecard-cell {
  background: rgba(29, 42, 33, 0.06);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.course-scorecard-cell.is-total {
  background: rgba(74, 124, 111, 0.14);
  color: var(--accent-deep);
}

.history-delete-btn {
  padding: 10px 14px;
  white-space: nowrap;
}

.chart-card {
  min-height: 190px;
}

.chart-empty {
  margin: 0;
}

.trend-svg {
  width: 100%;
  height: auto;
}

.chart-axis {
  stroke: rgba(29, 42, 33, 0.18);
  stroke-width: 1.5;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-svg .chart-point-score {
  fill: var(--accent);
}

.chart-line-net {
  stroke: var(--green);
}

.chart-line-gir {
  stroke: #2d6a4f;
}

.chart-line-handicap {
  stroke: #9c7a3c;
}

.trend-svg .chart-point-handicap {
  fill: #9c7a3c;
}

.trend-svg circle {
  fill: var(--green);
}

.trend-svg .chart-point-net {
  fill: #1b7f5b;
}

.trend-svg .chart-point-gir {
  fill: var(--warn);
}

.chart-label,
.chart-scale {
  fill: var(--muted);
  font-size: 11px;
  font-family: "Manrope", sans-serif;
}

.chart-scale-right {
  text-anchor: end;
}

.security-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.ai-output {
  border-radius: 18px;
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: rgba(245, 248, 246, 0.95);
  padding: 16px;
}

.ai-markdown {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  line-height: 1.65;
}

/* ── Mobile/Desktop visibility helpers ─────────────────── */
.mobile-only { display: none; }
.desktop-only { display: block; }

@media (max-width: 680px) {
  .mobile-only { display: block; }
  .desktop-only { display: none; }
}

/* ── Mobile scorecard ──────────────────────────────────── */
.mobile-scorecard-shell {
  display: none;
}

@media (max-width: 680px) {
  .mobile-scorecard-shell {
    display: block;
  }

  .mobile-sticky-header {
    display: flex;
    justify-content: space-around;
    padding: 12px 16px;
    background: var(--surface-dark, #153628);
    border-radius: 16px;
    margin-bottom: 12px;
  }

  .msh-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }

  .msh-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
  }

  .msh-value {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
  }

  .mobile-scorecard-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin: 0 -18px;
  }

  .mobile-scorecard-segment {
    display: flex;
    gap: 0;
    min-width: max-content;
    padding: 0 18px 0 0;
  }

  .mobile-scorecard {
    display: flex;
    flex-direction: row;
    gap: 0;
  }

  .ms-nine-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 14px 0 6px;
  }

  .ms-subtotal-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px 4px;
    border-top: 1.5px solid var(--line, #e8e0d4);
    margin-top: 2px;
  }

  .ms-subtotal-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    min-width: 36px;
  }

  .ms-subtotal-score {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    min-width: 28px;
  }

  .ms-subtotal-meta {
    font-size: 12px;
    color: var(--muted);
  }

  .ms-col {
    display: flex;
    flex-direction: column;
    min-width: 44px;
    width: 44px;
  }

  .ms-col-labels {
    min-width: 56px;
    width: 56px;
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface);
  }

  .ms-col-divider {
    border-right: 2px solid var(--accent);
  }

  .ms-cell {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border-bottom: 1px solid var(--line, #e8e0d4);
    border-right: 1px solid var(--line, #e8e0d4);
  }

  .ms-label-cell {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    justify-content: flex-end;
    padding-right: 10px;
  }

  .ms-hole-num {
    font-weight: 800;
    font-size: 13px;
    background: var(--green-soft, #d8eadc);
  }

  .ms-par {
    color: var(--muted);
    font-size: 13px;
  }

  .ms-si {
    color: var(--muted);
    font-size: 11px;
  }

  .ms-score-cell {
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    min-width: 44px;
    color: var(--muted);
  }

  .ms-score-cell[data-to-par="eagle"] { background: #ffd700; color: #000; }
  .ms-score-cell[data-to-par="birdie"] { background: #2d6a4f; color: #fff; }
  .ms-score-cell[data-to-par="par"]    { background: var(--surface); color: var(--text); }
  .ms-score-cell[data-to-par="bogey"]  { background: #fff3e0; color: var(--text); }
  .ms-score-cell[data-to-par="double"] { background: #ffebee; color: #c62828; }

  .ms-putts, .ms-pen {
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
  }

  .ms-col-complete .ms-hole-num {
    background: var(--green, #2d6a4f);
    color: #fff;
  }

  .mobile-scorecard-hint {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    margin-top: 8px;
    opacity: 0.7;
  }
}

/* ── Mobile hole modal ─────────────────────────────────── */
.mobile-hole-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
}

.mobile-hole-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 22, 18, 0.5);
  backdrop-filter: blur(4px);
}

.mobile-hole-sheet {
  position: relative;
  width: 100%;
  max-height: 90vh;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-hole-sheet.is-open {
  transform: translateY(0);
}

.mh-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 4px;
}

.mh-header h3 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.mh-meta {
  font-size: 13px;
  color: var(--muted);
  width: 100%;
}

.mh-close {
  background: var(--line, #e8e0d4);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.mh-section {
  margin-bottom: 20px;
}

.mh-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.mh-tile-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.mh-tile {
  min-width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 2px solid var(--line, #e8e0d4);
  background: var(--bg);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mh-tile.is-selected {
  background: var(--green, #2d6a4f);
  border-color: var(--green, #2d6a4f);
  color: #fff;
}

.mh-toggle-row {
  display: flex;
  gap: 8px;
}

.mh-toggle-btn {
  flex: 1;
  height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line, #e8e0d4);
  background: var(--bg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mh-toggle-btn.is-selected {
  background: var(--green, #2d6a4f);
  border-color: var(--green, #2d6a4f);
  color: #fff;
}

.mh-stepper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mh-stepper-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line, #e8e0d4);
  background: var(--bg);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mh-stepper-val {
  font-size: 24px;
  font-weight: 800;
  min-width: 32px;
  text-align: center;
}

.mh-approach-toggle {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1.5px dashed var(--line, #e8e0d4);
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 12px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.mh-approach-body {
  margin-bottom: 12px;
}

.mh-approach-body.hidden {
  display: none;
}

.mh-text-input {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  border: 1.5px solid var(--line, #e8e0d4);
  padding: 0 14px;
  font-size: 16px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}

.mh-nav-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.mh-nav-btn {
  flex: 1;
  height: 52px;
  border-radius: 100px;
  border: 2px solid var(--line, #e8e0d4);
  background: var(--bg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.mh-nav-next {
  background: var(--accent, #4a7c6f);
  border-color: var(--accent, #4a7c6f);
  color: #fff;
}

/* ── Mobile detail entry ───────────────────────────────── */
.mobile-detail-entry {
  padding: 4px 0;
}

.mde-hole-header {
  margin-bottom: 20px;
}

.mde-hole-name {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 4px;
}

.mde-hole-meta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.mde-score-tiles {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.mde-score-tile {
  min-width: 60px;
  height: 60px;
  border-radius: 14px;
  border: 2px solid var(--line, #e8e0d4);
  background: var(--bg);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.mde-score-tile.is-selected {
  background: var(--green, #2d6a4f);
  border-color: var(--green, #2d6a4f);
  color: #fff;
}

.mde-score-tile[data-relation="eagle"] { border-color: #ffd700; }
.mde-score-tile[data-relation="birdie"] { border-color: var(--green); }
.mde-score-tile[data-relation="bogey"] { border-color: #ffb74d; }
.mde-score-tile[data-relation="double"] { border-color: #ef5350; }

.mde-fw-gir-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.mde-subsection {
  flex: 1;
}

.mde-subsection-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.mde-section {
  margin-bottom: 20px;
}

.mde-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mde-pill {
  height: 42px;
  padding: 0 16px;
  border-radius: 100px;
  border: 2px solid var(--line, #e8e0d4);
  background: var(--bg);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mde-pill.is-selected {
  background: var(--green, #2d6a4f);
  border-color: var(--green, #2d6a4f);
  color: #fff;
}

.mde-notes-input {
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid var(--line, #e8e0d4);
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}

.mde-nav-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line, #e8e0d4);
}

.mde-nav-btn {
  flex: 1;
  height: 52px;
  border-radius: 100px;
  border: 2px solid var(--line, #e8e0d4);
  background: var(--bg);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mde-nav-next {
  background: var(--accent, #4a7c6f);
  border-color: var(--accent, #4a7c6f);
  color: #fff;
}

.mde-nav-btn:disabled {
  opacity: 0.35;
}
  .layout,
  .page-grid-round {
    grid-template-columns: 1fr;
  }

  .compact-status-panel {
    grid-column: auto;
  }

  .hole-grid {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .app-topbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 1400px);
    padding-top: 20px;
  }

  .app-topbar,
  .panel {
    border-radius: 24px;
  }

  .panel {
    padding: 18px;
  }

  .hole-grid,
  .summary-grid,
  .history-grid,
  .approach-insight-grid,
  .detail-grid-card .hole-fields {
    grid-template-columns: 1fr;
  }

  .history-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .round-form {
    grid-template-columns: 1fr;
  }

  .round-form-span-2 {
    grid-column: auto;
  }

  .course-picker-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .course-picker-meta {
    padding-bottom: 0;
    white-space: normal;
  }

  .round-form-span-3 {
    grid-column: auto;
  }

  .course-par-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .panel-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .entry-mode-bar,
  .entry-panel-heading,
  .detail-entry-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .button-row,
  .ai-actions {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .approach-insights-header {
    flex-direction: column;
  }

  .history-item-top {
    flex-direction: column;
  }

  .history-item-actions {
    width: 100%;
  }

  .history-summary-grid {
    grid-template-columns: 1fr;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .quick-entry-table {
    min-width: 640px;
  }
}

/* ── Handicap nudge ── */
.handicap-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  margin-bottom: 16px;
  background: rgba(45, 106, 79, 0.08);
  border: 1px solid rgba(45, 106, 79, 0.18);
  border-radius: 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}
.handicap-nudge a {
  color: #1b7f5b;
  font-weight: 700;
  text-decoration: none;
}
.handicap-nudge a:hover { text-decoration: underline; }
.nudge-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  padding: 4px 6px;
  line-height: 1;
  flex-shrink: 0;
  border-radius: 6px;
}
.nudge-dismiss:hover { background: rgba(0,0,0,0.06); color: var(--text); }

/* ── Mobile navigation ─────────────────────────────────────────────────────── */

.nav-hamburger {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 30;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  cursor: pointer;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.nav-hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(15,22,18,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nav-scrim.is-visible {
  display: block;
}

@media (max-width: 768px) {
  .nav-hamburger {
    display: flex;
  }

  .app-nav {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 85vw);
    z-index: 19;
    flex-direction: column;
    background: var(--surface-strong);
    padding: 72px 16px 40px;
    gap: 6px;
    overflow-y: auto;
    box-shadow: 4px 0 32px rgba(0,0,0,0.15);
    border-radius: 0 24px 24px 0;
    transform: translateX(-105%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0;
    display: flex !important;
  }

  .app-nav.is-open {
    transform: translateX(0);
  }

  .app-nav-link {
    border-radius: 12px;
    padding: 14px 18px;
    width: 100%;
  }
}

/* ─── Garmin Import ──────────────────────────────────────────────────────── */

.garmin-import-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.garmin-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}

.garmin-steps li {
  padding-left: 4px;
}

.garmin-url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.garmin-url-code {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-family: "SF Mono", "Fira Mono", "Consolas", monospace;
  background: var(--green-soft);
  color: var(--accent-deep);
  padding: 8px 12px;
  border-radius: 8px;
  overflow-x: auto;
  white-space: nowrap;
  display: block;
  border: 1px solid var(--line);
}

.garmin-upload-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.garmin-upload-label span {
  pointer-events: none;
}

.garmin-preview-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

.garmin-preview-stats p {
  margin: 0;
}

.garmin-new-count {
  color: var(--accent);
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}
