:root {
  --bg: #f5efe4;
  --surface: rgba(255, 250, 240, 0.9);
  --surface-strong: #fff9ef;
  --surface-dark: #153628;
  --text: #1d2a21;
  --muted: #67756c;
  --line: rgba(29, 42, 33, 0.12);
  --accent: #ca6b2c;
  --accent-deep: #8d4318;
  --green: #2d6a4f;
  --green-soft: #d8eadc;
  --shadow: 0 24px 80px rgba(32, 40, 32, 0.12);
  --shell-inline: 16px;
  --shell-top: 20px;
  --shell-bottom: 32px;
  --panel-padding: 18px;
  --panel-radius: 24px;
  --touch-height: 48px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 24px;
  scroll-padding-bottom: 140px;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(202, 107, 44, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(45, 106, 79, 0.18), transparent 28%),
    linear-gradient(180deg, #efe4d3 0%, #f8f3eb 48%, #ede5d8 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

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);
  overflow-y: auto;
}

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

.hidden {
  display: none !important;
}

.auth-panel {
  width: min(680px, 100%);
  border-radius: 28px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 250, 240, 0.96);
  box-shadow: var(--shadow);
  margin: auto;
}

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

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

.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;
  overflow-wrap: anywhere;
}

.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% - (var(--shell-inline) * 2)));
  margin: 0 auto;
  padding: var(--shell-top) 0 var(--shell-bottom);
}

.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: 30px;
  padding: 24px 24px;
}

.brand-lockup {
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.auth-brand {
  width: 216px;
  height: auto;
  display: block;
  margin-bottom: 12px;
}

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

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

.topbar-chip {
  display: grid;
  gap: 4px;
  padding: 10px 14px;
  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;
  align-items: stretch;
}

.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;
  min-height: var(--touch-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.app-nav-link.is-active {
  background: linear-gradient(135deg, var(--accent), #e28d40);
  color: white;
  box-shadow: 0 12px 30px rgba(202, 107, 44, 0.22);
}

.nav-toggle-btn {
  display: none;
}

.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;
  overflow-wrap: anywhere;
}

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);
  overflow-wrap: anywhere;
}

.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: var(--panel-radius);
  padding: var(--panel-padding);
}

.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;
}

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

.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 {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 12px 14px;
  background: rgba(255, 252, 247, 0.95);
  color: var(--text);
  min-height: var(--touch-height);
  scroll-margin-top: 24px;
  scroll-margin-bottom: 148px;
}

textarea {
  resize: vertical;
  min-height: calc(var(--touch-height) * 2.4);
}

button {
  border: none;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  min-height: var(--touch-height);
}

a,
button,
input,
select,
textarea {
  -webkit-tap-highlight-color: rgba(202, 107, 44, 0.18);
}

.round-form label,
.inline-select,
.auth-status,
.course-picker-meta {
  min-width: 0;
}

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), #e28d40);
  color: white;
  box-shadow: 0 12px 30px rgba(202, 107, 44, 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), #e28d40);
  color: white;
  box-shadow: 0 12px 30px rgba(202, 107, 44, 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;
  overflow-wrap: anywhere;
}

.quick-entry-shell {
  overflow: auto;
  scroll-padding-bottom: 140px;
  padding-bottom: 6px;
}

.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;
}

.quick-entry-totals {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(247, 243, 233, 0), rgba(247, 243, 233, 0.92) 20%, rgba(247, 243, 233, 0.98));
}

.quick-entry-total-tile {
  border: 1px solid rgba(29, 42, 33, 0.08);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(29, 42, 33, 0.08);
}

.quick-entry-total-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.quick-entry-total-score {
  display: block;
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 800;
}

.quick-entry-total-meta {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.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 {
  display: grid;
  gap: 6px;
}

.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-library-card {
  border-radius: 22px;
  border: 1px solid rgba(29, 42, 33, 0.08);
  background: var(--surface-strong);
  padding: 18px;
}

.course-library-card strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.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(202, 107, 44, 0.45), var(--accent));
}

.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;
  overflow-wrap: anywhere;
}

.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;
  overflow-wrap: anywhere;
}

.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(--accent);
}

.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;
  overflow-wrap: anywhere;
}

.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(202, 107, 44, 0.45), var(--accent));
}

.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;
}

.profile-form .auth-status,
.profile-form .hero-text {
  grid-column: 1 / -1;
}

.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(202, 107, 44, 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;
}

.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-actions .secondary-btn,
.history-item-actions .history-delete-btn {
  min-width: 96px;
}

.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;
  overflow-wrap: anywhere;
}

.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;
  padding-bottom: 4px;
}

.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(202, 107, 44, 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(202, 107, 44, 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;
}

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

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

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

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

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

.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;
  overflow-wrap: anywhere;
}

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

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

@media (max-width: 1180px) {
  .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;
    align-items: start;
  }

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

@media (max-width: 680px) {
  :root {
    --shell-inline: 12px;
    --shell-top: 16px;
    --shell-bottom: 24px;
    --panel-padding: 16px;
    --panel-radius: 22px;
  }

  .page-shell {
    width: min(1400px, calc(100% - (var(--shell-inline) * 2)));
  }

  .app-topbar,
  .panel {
    border-radius: var(--panel-radius);
  }

  .page-title {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .hero-text {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .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;
  }

  .panel-heading > * {
    width: 100%;
  }

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

  .entry-progress {
    width: 100%;
  }

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

  .button-row .inline-select {
    width: 100%;
  }

  .button-row .inline-select select {
    min-width: 0;
  }

  .history-pagination {
    justify-content: flex-start;
  }

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

  .insight-card-grid,
  .profile-records-grid,
  .course-history-list {
    grid-template-columns: 1fr;
  }

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

  .history-item-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .nav-toggle-btn {
    display: inline-flex;
    width: auto;
  }

  .app-nav {
    display: none;
    margin-bottom: 20px;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: var(--surface);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-nav.is-open {
    display: grid;
  }

  .app-nav-link {
    width: 100%;
  }

  .dashboard-par-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-par-tile {
    padding: 16px;
  }

  .tee-box-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-library-card,
  .record-card,
  .course-history-item,
  .course-tee-summary,
  .tee-box-card {
    padding: 16px;
  }

  .coach-output {
    gap: 12px;
  }

  .ai-output {
    padding: 14px;
  }

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

  .quick-entry-table {
    min-width: 0;
  }

  .quick-entry-header {
    display: none;
  }

  .quick-entry-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
  }

  .quick-hole-label {
    grid-column: 1 / -1;
    text-align: left;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(29, 42, 33, 0.08);
  }

  .quick-cell::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .quick-entry-totals {
    position: static;
    grid-template-columns: 1fr;
    background: transparent;
    padding-top: 2px;
  }

  .detail-content-tabs {
    width: 100%;
  }

  .detail-content-tab {
    flex: 1 1 0;
    justify-content: center;
    text-align: center;
  }

  .detail-entry-grid,
  .detail-notes-grid {
    grid-template-columns: 1fr;
  }

  .detail-grid-card .hole-fields {
    grid-template-columns: 1fr;
  }

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

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

  .history-scorecard-row,
  .course-scorecard-row {
    min-width: 560px;
  }
}

@media (max-width: 480px) {
  :root {
    --touch-height: 46px;
  }

  .auth-panel {
    padding: 22px;
    border-radius: 24px;
    width: 100%;
  }

  .app-topbar {
    padding: 18px;
  }

  .brand-logo {
    width: min(180px, 60vw);
  }

  .topbar-chip {
    width: 100%;
  }

  .auth-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-actions > * {
    width: 100%;
  }

  .auth-status {
    font-size: 0.92rem;
    line-height: 1.5;
  }

  .topbar-meta .secondary-btn,
  .button-row > *,
  .ai-actions > * {
    width: 100%;
  }

  .inline-select {
    width: 100%;
  }

  .inline-select select {
    min-width: 0;
  }

  .history-item,
  .history-summary-tile,
  .dashboard-par-tile,
  .history-summary-stat {
    padding: 12px;
  }

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

  .history-item-actions .secondary-btn,
  .history-item-actions .history-delete-btn {
    width: 100%;
    min-width: 0;
  }

  .app-nav {
    grid-template-columns: 1fr;
  }

  .panel-heading {
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-notice {
    margin-bottom: 16px;
  }

  .quick-entry-row {
    grid-template-columns: 1fr;
  }

  .quick-cell {
    gap: 5px;
  }

  .quick-entry-total-tile {
    padding: 12px;
  }

  .dashboard-par-bar-row {
    grid-template-columns: 34px 1fr;
    gap: 8px;
  }

  .dashboard-par-score {
    font-size: 1.4rem;
  }

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

  .tee-box-header,
  .hole-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tee-box-grid,
  .course-par-grid {
    grid-template-columns: 1fr;
  }

  .course-library-card strong,
  .course-tee-summary-title {
    font-size: 1rem;
  }

  .coach-card,
  .summary-card,
  .course-pars-card {
    padding: 14px;
  }

  .ai-output {
    padding: 12px;
  }

  .history-scorecard-row,
  .course-scorecard-row {
    min-width: 520px;
  }
}
