:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #607066;
  --line: #dce4de;
  --surface: #ffffff;
  --surface-soft: #f5f8f2;
  --green: #17643a;
  --green-strong: #0d4d2a;
  --blue: #285d8f;
  --gold: #c47b18;
  --rose: #b34848;
  --shadow: 0 18px 50px rgba(29, 52, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eaf0eb;
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
}

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

label,
input,
select,
textarea {
  min-width: 0;
}

input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background: #14241b;
  color: #f6fbf7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: #f1f6ed;
  color: #14241b;
  font-weight: 900;
}

.brand h1,
.brand p,
.view-header h2,
.view-header p,
.panel h3 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p {
  margin-top: 2px;
  color: rgba(246, 251, 247, 0.72);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button,
.ghost-button,
.primary-button,
.icon-button,
.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
}

.nav-button {
  justify-content: flex-start;
  color: rgba(246, 251, 247, 0.76);
  background: transparent;
}

.nav-button.active,
.nav-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.sidebar .ghost-button,
.import-label {
  justify-content: flex-start;
  color: #f6fbf7;
  background: rgba(255, 255, 255, 0.1);
}

#importData {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.main {
  min-width: 0;
  padding: 32px;
}

.view {
  display: none;
  max-width: 1320px;
  margin: 0 auto;
}

.view.active {
  display: block;
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.play-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.view-header h2 {
  margin-top: 4px;
  font-size: 34px;
  line-height: 1.1;
}

.primary-button {
  color: #ffffff;
  background: var(--green);
}

.primary-button:hover {
  background: var(--green-strong);
}

.ghost-button {
  color: var(--ink);
  background: #eef4ef;
}

.ghost-button:hover {
  background: #e4ece6;
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--ink);
  background: #eef4ef;
}

i[data-lucide] {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.metric-grid,
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel,
.stat-card,
.round-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric,
.stat-card {
  padding: 18px;
}

.metric span,
.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong,
.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.metric small,
.stat-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.9fr);
  gap: 18px;
}


.dashboard-coach-panel {
  margin-bottom: 18px;
}

.dashboard-coach {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.dashboard-coach > div > span,
.dashboard-snapshot span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.dashboard-coach strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
}

.dashboard-coach p,
.dashboard-snapshot small {
  margin: 6px 0 0;
  color: var(--muted);
}

.dashboard-snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dashboard-snapshot div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.dashboard-snapshot strong {
  font-size: 24px;
}

.dashboard-actions {
  display: grid;
  gap: 8px;
}

.iq-help,
.iq-trend {
  display: block;
  margin-top: 6px;
}

.quality-list {
  display: grid;
  gap: 8px;
}

.quality-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.quality-row span,
.quality-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quality-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eee9;
}

.quality-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.training-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.training-status.done {
  color: var(--green);
  background: #e5f5eb;
}

.training-status.pending {
  color: #845207;
  background: #fff4d7;
}

.compact-plan-button {
  width: fit-content;
  margin-top: 10px;
}
.backup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.backup-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.panel {
  padding: 18px;
}

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

.panel h3 {
  font-size: 18px;
}

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

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  min-width: 0;
}

.field-with-action label {
  min-width: 0;
}

.compact-field-button {
  height: 42px;
  padding: 0 12px;
  white-space: nowrap;
}

label span,
.notes-label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 100, 58, 0.14);
}

.live-options {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.options-head span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.options-head small {
  color: var(--muted);
  font-weight: 700;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 900;
}

.check-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--green);
}

.check-option span {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}

.check-option.locked {
  background: var(--surface-soft);
}

.live-option-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.live-option-presets button {
  min-height: 36px;
  padding: 0 8px;
  font-size: 13px;
}
.field-error {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--rose);
  font-size: 14px;
  font-weight: 800;
}

.field-error:empty {
  display: none;
}

.field-error p {
  margin: 0;
}

label.invalid input,
label.invalid select,
label.invalid textarea {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(179, 72, 72, 0.14);
}

.round-form {
  display: grid;
  gap: 18px;
}

.hole-toolbar {
  margin-bottom: 10px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 48px);
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #eef4ef;
}

.segment {
  min-height: 34px;
  padding: 0;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  color: #ffffff;
  background: var(--green);
}

.hole-table-wrap {
  overflow-x: auto;
}

.hole-table {
  width: 100%;
  min-width: 1420px;
  border-collapse: collapse;
  table-layout: fixed;
}

.hole-table th {
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.hole-table th,
.hole-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
}

.hole-table th:nth-child(1),
.hole-table td:nth-child(1) {
  width: 46px;
  font-weight: 900;
}

.hole-table input,
.hole-table select {
  height: 36px;
  padding: 0 8px;
}

.hole-table .tiny {
  width: 100%;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.play-layout {
  display: none;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.play-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.play-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 900;
}

.play-tab.active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.play-pane {
  display: none;
}

.play-pane.active {
  display: block;
}

.play-start-panel {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.play-start-panel h3,
.play-start-panel p {
  margin: 0;
}

.play-start-panel p {
  color: var(--muted);
}

#play:not(.live-started) .live-session,
#play:not(.live-started) .play-tabs,
#play:not(.live-started) .play-header-actions {
  display: none;
}

#play.live-started .play-start-panel {
  display: none;
}

#play.live-started #startLiveRound {
  display: none;
}


#play.live-started[data-active-play-tab="hole"] .view-header {
  margin-bottom: 10px;
}

#play.live-started[data-active-play-tab="hole"] .play-layout {
  min-height: calc(100vh - 190px);
}

#play.live-started[data-active-play-tab="hole"] .play-card {
  align-self: stretch;
  display: grid;
  align-content: start;
}

#play[data-active-play-tab="hole"] .play-scorecard-pane,
#play[data-active-play-tab="scorecard"] .play-card {
  display: none;
}

#play[data-active-play-tab="scorecard"] .play-scorecard-pane {
  display: block;
}

.courses-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 18px;
}

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

.course-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.course-par-grid label {
  display: block;
}

.course-par-grid input + input {
  margin-top: 6px;
}

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

.course-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.course-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

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

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

.course-pars span {
  display: grid;
  min-height: 34px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 900;
}

.range-layout,
.training-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
}

.range-history {
  margin-top: 18px;
}

.training-list {
  display: grid;
  gap: 12px;
}

.training-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.training-card h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.training-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.training-note {
  margin-top: 6px;
  color: var(--ink);
}

.distribution-block {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.distribution-block h4 {
  margin: 0;
}

.analysis-panel {
  margin-bottom: 18px;
}

.focus-next {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid rgba(196, 123, 24, 0.34);
  border-radius: 8px;
  background: #fff8ea;
}

.focus-next span,
.focus-next p,
.forecast-card small {
  color: var(--muted);
}

.focus-next span {
  font-size: 13px;
  font-weight: 900;
}

.focus-next strong {
  font-size: 24px;
}

.focus-next p,
.forecast-card p {
  margin: 0;
}

.analysis-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
}

.analysis-hero span,
.profile-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.analysis-hero strong {
  display: block;
  font-size: 64px;
  line-height: 1;
}

.iq-trend {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 900;
}

.iq-trend.positive,
.analysis-grid p.good {
  color: var(--green);
}

.iq-trend.negative,
.analysis-grid p.warn {
  color: var(--rose);
}

.analysis-hero h3,
.analysis-hero p,
.analysis-grid h4,
.analysis-grid p,
.cost-row p,
.evidence-card h4,
.evidence-card p,
.forecast-card strong,
.forecast-card small {
  margin: 0;
}

.analysis-hero p,
.analysis-grid p,
.cost-row p,
.evidence-card p {
  color: var(--muted);
}

.analysis-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analysis-grid > div,
.profile-grid > div,
.evidence-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}

.cost-row {
  display: grid;
  grid-template-columns: 160px 110px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.cost-row:last-child {
  border-bottom: 0;
}

.cost-row span {
  font-weight: 900;
}

.forecast-card {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.forecast-card strong {
  font-size: 18px;
}

.evidence-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.progress-meter {
  height: 10px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e0e7e1;
}

.progress-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold));
}

.evidence-status {
  display: block;
  margin: 8px 0 4px;
}

.stars {
  margin-top: 10px;
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0;
}

.confidence-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.confidence-pill.low {
  background: #fff4d7;
  color: #845207;
}

.confidence-pill.medium {
  background: #eaf2ff;
  color: var(--blue);
}

.confidence-pill.high {
  background: #e5f5eb;
  color: var(--green);
}

.diary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.diary-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.diary-column h4,
.diary-card p,
.memory-card p,
.memory-result {
  margin: 0;
}

.diary-card,
.memory-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
}

.diary-card span,
.memory-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.diary-card p,
.memory-card p {
  color: var(--muted);
}

.diary-drills {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.diary-drills small,
.memory-result small {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: var(--blue);
  font-weight: 800;
}

.memory-card strong {
  font-size: 18px;
}

.memory-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.curve-table {
  overflow-x: auto;
}

.curve-table > div {
  display: grid;
  grid-template-columns: 120px repeat(7, minmax(76px, 1fr));
  min-width: 760px;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.curve-head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.profile-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 26px;
}

.play-card {
  align-self: start;
}

.play-progress {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.play-progress span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.live-hole-heading {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  text-align: center;
}

.live-hole-heading span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.live-hole-heading strong {
  display: block;
  font-size: 58px;
  line-height: 1;
}

.live-hole-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.legacy-live-form {
  display: none;
}

.live-step-card {
  display: grid;
  gap: 16px;
}

.step-heading {
  display: grid;
  gap: 4px;
  text-align: center;
}

.step-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.step-heading strong {
  font-size: 28px;
}

.number-display {
  display: grid;
  min-height: 88px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 54px;
  font-weight: 900;
}

.number-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.number-button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.number-button.active {
  border-color: var(--green);
  background: var(--surface-soft);
  box-shadow: 0 0 0 3px rgba(23, 100, 58, 0.14);
}

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

.choice-button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.choice-button.active {
  border-color: var(--green);
  background: var(--surface-soft);
  box-shadow: 0 0 0 3px rgba(23, 100, 58, 0.14);
}

.step-text-input {
  min-height: 58px;
  font-size: 18px;
}

.step-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wide-field {
  grid-column: 1 / -1;
}

.post-round-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.post-round-summary {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.post-round-summary p {
  margin: 0;
}

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

.live-summary .pill {
  justify-content: center;
  border-radius: 8px;
}

.live-hole-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.live-hole-chip {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
}

.live-hole-chip.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 100, 58, 0.14);
}

.live-hole-chip.complete {
  background: var(--surface-soft);
}

.live-hole-chip span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.live-notes {
  display: block;
  margin-top: 16px;
}

.round-list {
  display: grid;
  gap: 12px;
}

.round-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 16px;
}

.round-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.round-card p {
  margin: 0;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 13px;
  font-weight: 800;
}

.round-actions {
  display: flex;
  align-items: start;
  gap: 8px;
}

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

.focus-item {
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.focus-item strong {
  display: block;
}

.focus-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.search-input,
.window-select {
  max-width: 280px;
}

.trend-bars {
  display: grid;
  gap: 12px;
}

.trend-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e6ece8;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
}

dialog {
  width: min(840px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

#roundDialog {
  width: min(980px, calc(100vw - 24px));
}

dialog::backdrop {
  background: rgba(8, 20, 14, 0.54);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-header h3 {
  margin: 0;
}

#dialogBody {
  padding: 18px;
  max-height: 76vh;
  overflow: auto;
}

.mini-table {
  width: 100%;
  border-collapse: collapse;
}

.mini-table th,
.mini-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.round-report {
  display: grid;
  gap: 16px;
}

.round-report-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: stretch;
  padding: 18px;
  border: 1px solid rgba(23, 100, 58, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #f5fbf6 0%, #ffffff 62%);
}

.round-report-hero > div:first-child > span,
.round-section-head span,
.round-report-story article > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.round-report-hero strong {
  display: block;
  font-size: clamp(54px, 11vw, 88px);
  line-height: 0.92;
  color: var(--green-dark);
}

.round-report-hero p {
  margin: 8px 0 0;
  color: var(--ink);
  font-weight: 900;
}

.round-report-meta {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 150px;
}

.round-report-meta span,
.round-note-strip span {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.round-report-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.round-report-story {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.round-report-story article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.round-report-story strong {
  display: block;
  margin-top: 5px;
  font-size: 16px;
}

.round-report-story p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.round-note-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.round-note-strip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.round-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.round-section-head strong {
  font-size: 13px;
  color: var(--muted);
}

.round-score-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 8px;
}

.round-score-tile {
  min-height: 66px;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.round-score-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.round-score-tile strong {
  font-size: 12px;
}

.round-score-tile.score-birdie,
.round-score-tile.score-eagle {
  border-color: rgba(42, 157, 91, 0.45);
  background: #f3fbf6;
}

.round-score-tile.score-bogey,
.round-score-tile.score-double {
  border-color: rgba(199, 131, 28, 0.42);
  background: #fffaf0;
}

.round-hole-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.round-hole-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.round-hole-card.score-birdie,
.round-hole-card.score-eagle {
  border-color: rgba(42, 157, 91, 0.38);
  background: #f8fdf9;
}

.round-hole-card.score-bogey,
.round-hole-card.score-double {
  border-color: rgba(199, 131, 28, 0.34);
  background: #fffdf8;
}

.round-hole-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.round-hole-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.round-hole-card header strong {
  display: block;
  font-size: 24px;
}

.round-hole-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.round-detail-chip {
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.round-detail-chip.warn {
  background: #fff4d7;
}

.round-detail-chip small,
.round-detail-chip strong {
  display: block;
}

.round-detail-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.round-detail-chip strong {
  margin-top: 2px;
  font-size: 13px;
}

.round-hole-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  padding: 12px 14px;
  background: #17201b;
  color: #ffffff;
  box-shadow: var(--shadow);
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty {
  padding: 28px;
  border: 1px dashed #bfcac2;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.danger {
  color: #ffffff;
  background: var(--rose);
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-button {
    justify-content: center;
  }

  .nav-button span {
    display: none;
  }

  .sidebar-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .main {
    padding: 20px;
  }

  .metric-grid,
  .stats-grid,
  .analysis-grid,
  .profile-grid,
  .evidence-list,
  .form-grid,
  .split-layout,
  .diary-layout,
  .play-layout,
  .courses-layout,
  .range-layout,
  .training-layout {
    grid-template-columns: 1fr 1fr;
  }

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

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

@media (max-width: 680px) {
  .view-header,
  .round-card {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .view-header h2 {
    font-size: 28px;
  }

  .metric-grid,
  .stats-grid,
  .form-grid,
  .split-layout,
  .diary-layout,
  .play-layout,
  .courses-layout,
  .range-layout,
  .training-layout,
  .course-meta-grid,
  .post-round-grid {
    grid-template-columns: 1fr;
  }

  .live-hole-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .round-actions,
  .form-actions {
    justify-content: stretch;
  }

  
.backup-panel {
    grid-template-columns: 1fr;
  }

  .round-actions button,
  .form-actions button,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .field-with-action .compact-field-button {
    width: auto;
  }

  .trend-row {
    grid-template-columns: 86px minmax(0, 1fr) 50px;
  }

  .analysis-hero,
  .cost-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
  }

  body {
    min-height: 100dvh;
    touch-action: manipulation;
  }

  .app-shell {
    display: block;
    min-height: 100dvh;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: block;
    height: calc(72px + env(safe-area-inset-bottom));
    padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: #14241b;
    box-shadow: 0 -12px 30px rgba(20, 36, 27, 0.18);
  }

  .brand,
  .sidebar-actions {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    height: 100%;
  }

  .nav-button {
    min-width: 0;
    height: 56px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.05;
  }

  .nav-button span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-button i {
    width: 20px;
    height: 20px;
  }

  .main {
    min-height: 100dvh;
    padding: calc(14px + env(safe-area-inset-top)) 12px calc(96px + env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  .view {
    width: 100%;
    max-width: none;
  }

  .view:not(.active) {
    display: none !important;
  }

  .view-header {
    gap: 12px;
    margin-bottom: 14px;
  }

  .hole-table-wrap {
    overflow: visible;
  }

  .hole-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .hole-table thead {
    display: none;
  }

  .hole-table,
  .hole-table tbody,
  .hole-table tr,
  .hole-table td {
    display: block;
    width: 100%;
  }

  .hole-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .hole-table td {
    border: 0;
    padding: 0;
  }

  .hole-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
  }

  .hole-table td:first-child,
  .hole-table td:last-child {
    grid-column: 1 / -1;
  }

  .hole-table td:first-child {
    font-size: 18px;
  }

  .hole-table input,
  .hole-table select {
    width: 100%;
    min-width: 0;
  }
}



@media (max-width: 760px) {
  body.play-live-lock {
    height: 100dvh;
    overflow: hidden;
  }

  body.play-live-lock .app-shell {
    min-height: 100dvh;
    padding-bottom: 0;
  }

  body.play-live-lock .sidebar {
    display: none;
  }

  body.play-live-lock .main {
    height: 100dvh;
    padding: calc(8px + env(safe-area-inset-top)) 8px 8px;
    overflow: hidden;
  }

  body.play-live-lock #play.active {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
    max-width: none;
    overflow: hidden;
  }

  body.play-live-lock #play .view-header {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  body.play-live-lock #play .eyebrow {
    display: none;
  }

  body.play-live-lock #play .view-header h2 {
    margin: 0;
    font-size: 20px;
  }

  body.play-live-lock #play .play-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    min-width: 154px;
  }

  body.play-live-lock #play .play-header-actions button {
    min-height: 34px;
    padding: 0 8px;
    font-size: 12px;
  }

  body.play-live-lock #play .play-tabs {
    gap: 6px;
    margin-bottom: 8px;
  }

  body.play-live-lock #play .play-tab {
    min-height: 34px;
    font-size: 13px;
  }

  body.play-live-lock #play .play-layout {
    min-height: 0;
    height: 100%;
    margin-top: 0;
    overflow: hidden;
  }

  body.play-live-lock #play .play-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  body.play-live-lock #play .play-progress {
    gap: 5px;
    margin-bottom: 8px;
  }

  body.play-live-lock #play .live-hole-heading {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
    margin-bottom: 8px;
  }

  body.play-live-lock #play .live-hole-heading strong {
    font-size: 38px;
  }

  body.play-live-lock #play .icon-button {
    width: 38px;
    min-height: 38px;
  }

  body.play-live-lock #play .live-step-card {
    min-height: 0;
    gap: 10px;
    overflow: hidden;
  }

  body.play-live-lock #play .step-heading strong {
    font-size: 23px;
  }

  body.play-live-lock #play .number-display {
    min-height: 48px;
    font-size: 34px;
  }

  body.play-live-lock #play .number-pad,
  body.play-live-lock #play .choice-grid,
  body.play-live-lock #play .step-actions {
    gap: 8px;
  }

  body.play-live-lock #play .number-button,
  body.play-live-lock #play .choice-button {
    min-height: 42px;
    font-size: 18px;
  }

  body.play-live-lock #play .step-actions button {
    min-height: 42px;
  }
}



@media (max-width: 760px) {
  body.keyboard-open .sidebar {
    display: none;
  }

  body.keyboard-open:not(.play-live-lock) .app-shell {
    padding-bottom: 0;
  }

  body.keyboard-open:not(.play-live-lock) .main {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .checkbox-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Dashboard mobile fix */
@media (max-width: 760px) {
  .dashboard-coach {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard-actions {
    grid-template-columns: 1fr 1fr;
  }
}

/* Live completion and score marks */
.play-card.hole-complete-pulse {
  animation: holeCompletePulse 950ms ease-out;
}

@keyframes holeCompletePulse {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow);
  }
  35% {
    transform: scale(1.018);
    box-shadow: 0 0 0 6px rgba(42, 157, 91, 0.2), 0 18px 36px rgba(23, 100, 58, 0.18), var(--shadow);
  }
  100% {
    transform: scale(1);
    box-shadow: var(--shadow);
  }
}

.live-hole-chip {
  display: grid;
  grid-template-rows: auto 24px auto;
  justify-items: center;
  align-content: center;
  gap: 2px;
}

.live-hole-chip .hole-number,
.live-hole-chip .hole-score {
  display: block;
  margin: 0;
}

.live-hole-chip .hole-number {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.live-hole-chip .hole-score {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.score-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--ink);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.score-mark.score-birdie,
.score-mark.score-eagle {
  color: #17643a;
  border: 2px solid #2a9d5b;
  border-radius: 999px;
  background: #e5f5eb;
}

.score-mark.score-eagle {
  box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 1px #2a9d5b;
}

.score-mark.score-par {
  color: var(--muted);
}

.score-mark.score-bogey,
.score-mark.score-double {
  color: #845207;
  border: 2px solid #c7831c;
  border-radius: 4px;
  background: #fff4d7;
}

.score-mark.score-double {
  box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 1px #c7831c;
}

.live-hole-chip.score-birdie,
.live-hole-chip.score-eagle {
  border-color: rgba(42, 157, 91, 0.45);
  background: #f3fbf6;
}

.live-hole-chip.score-bogey,
.live-hole-chip.score-double {
  border-color: rgba(199, 131, 28, 0.42);
  background: #fffaf0;
}

@media (prefers-reduced-motion: reduce) {
  .play-card.hole-complete-pulse {
    animation: none;
  }
}

/* Progression */
.progression-panel {
  margin-bottom: 18px;
}

.progression-panel .panel-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

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

.progression-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.progression-card h4,
.progression-card p {
  margin: 0;
}

.progression-card h4 {
  font-size: 15px;
}

.progression-card p,
.progression-card small {
  color: var(--muted);
}

.records-card,
.dna-card {
  grid-column: span 2;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.record-row:last-child {
  border-bottom: 0;
}

.record-row span,
.milestone-list span,
.dna-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.record-row strong,
.milestone-list strong,
.goal-card strong {
  font-size: 18px;
}

.record-row small {
  grid-column: 1 / -1;
}

.record-row.pending strong {
  color: var(--muted);
}

.milestone-list {
  display: grid;
  gap: 12px;
}

.milestone-list article {
  display: grid;
  gap: 6px;
}

.milestone-list article > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dde7e1;
}

.progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #2a9d5b);
}

.goal-card {
  border-color: #d9c27b;
  background: #fffaf0;
}

.goal-card.done {
  border-color: rgba(42, 157, 91, 0.42);
  background: #f3fbf6;
}

.dna-card article {
  display: grid;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.dna-card article:last-child {
  border-bottom: 0;
}

.dna-card article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.star-meter {
  display: inline-grid;
  grid-template-columns: repeat(5, 10px);
  gap: 3px;
}

.star-meter i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d2ddd6;
}

.star-meter i.filled {
  background: var(--green);
}

@media (max-width: 980px) {
  .progression-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .progression-grid,
  .records-card,
  .dna-card {
    grid-template-columns: 1fr;
    grid-column: auto;
  }
}
/* Primary play nav */
.nav-button.nav-play {
  color: #ffffff;
  background: rgba(42, 157, 91, 0.26);
  border: 1px solid rgba(229, 245, 235, 0.24);
}

.nav-button.nav-play.active,
.nav-button.nav-play:hover {
  color: #ffffff;
  background: #2a9d5b;
  box-shadow: 0 10px 22px rgba(42, 157, 91, 0.28);
}

.nav-button.nav-play i {
  stroke-width: 2.7;
}

@media (max-width: 760px) {
  .nav-button.nav-play {
    height: 64px;
    margin-top: -10px;
    border-radius: 16px;
    background: #2a9d5b;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
  }

  .nav-button.nav-play.active {
    box-shadow: 0 0 0 3px rgba(229, 245, 235, 0.24), 0 12px 24px rgba(0, 0, 0, 0.24);
  }

  .nav-button.nav-play i {
    width: 24px;
    height: 24px;
  }
}

/* Dashboard shortcuts */
.dashboard-links-panel {
  margin-bottom: 18px;
}

.dashboard-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.shortcut-button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 2px 10px;
  align-items: center;
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
}

.shortcut-button:hover {
  border-color: rgba(23, 100, 58, 0.28);
  background: #f3fbf6;
}

.shortcut-button i {
  grid-row: span 2;
  width: 22px;
  height: 22px;
  color: var(--green);
}

.shortcut-button span {
  font-weight: 950;
}

.shortcut-button small {
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 980px) {
  .dashboard-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .dashboard-links {
    grid-template-columns: 1fr;
  }
}

.hole-complete-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: #ffffff;
  background: #2a9d5b;
  box-shadow: 0 14px 30px rgba(23, 100, 58, 0.28);
  font-weight: 950;
  transform: translateX(-50%);
  animation: holeCompleteBadge 950ms ease-out both;
}

.hole-complete-badge i {
  width: 18px;
  height: 18px;
}

.play-card {
  position: relative;
}

@keyframes holeCompleteBadge {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.94);
  }
  18%, 72% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -4px) scale(0.98);
  }
}
@media (max-width: 720px) {
  .round-report-hero,
  .round-report-story,
  .round-note-strip,
  .round-hole-cards {
    grid-template-columns: 1fr;
  }

  .round-report-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .round-score-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .round-hole-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .round-report-stats,
  .round-score-grid,
  .round-hole-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .round-report-hero {
    padding: 14px;
  }
}
/* Round report scorecard-first interaction */
.back-button {
  flex-shrink: 0;
}

.top-scorecard {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.round-score-tile {
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: 160ms ease;
}

.round-score-tile:hover,
.round-score-tile.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(23, 100, 58, 0.14);
  transform: translateY(-1px);
}

.round-hole-detail-stack {
  display: grid;
  gap: 10px;
  touch-action: pan-y;
}

.round-hole-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 18px;
  border: 1px dashed #bfcac2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  text-align: center;
}

.round-hole-empty i {
  width: 22px;
  height: 22px;
}

.round-hole-empty span {
  color: var(--ink);
  font-weight: 900;
}

.round-hole-empty small {
  font-weight: 800;
}

.round-hole-detail-stack.has-selection .round-hole-empty {
  display: none;
}

.round-hole-nav-row {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.round-hole-detail-stack.has-selection .round-hole-nav-row {
  display: grid;
}

.round-hole-detail-stack .round-hole-cards {
  display: block;
}

.round-hole-detail-stack .round-hole-card {
  display: none;
}

.round-hole-detail-stack .round-hole-card.active {
  display: block;
  animation: roundHoleIn 180ms ease-out;
}

@keyframes roundHoleIn {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 720px) {
  .round-hole-nav-row .ghost-button {
    width: 100%;
  }

  .top-scorecard {
    padding: 12px;
  }
}
/* Outdoor contrast tuning */
:root {
  --ink: #07140e;
  --muted: #3f5146;
  --line: #b9c8bd;
  --surface-soft: #edf4ee;
  --green: #105f34;
  --green-strong: #083f22;
  --blue: #174f87;
  --gold: #9a5a05;
  --rose: #9f3030;
  --shadow: 0 14px 36px rgba(15, 38, 27, 0.18);
}

html {
  background: #dfe9e2;
}

.sidebar {
  background: #0b1d13;
}

.brand p,
.nav-button {
  color: rgba(255, 255, 255, 0.84);
}

.nav-button.active,
.nav-button:hover,
.sidebar .ghost-button:hover,
.import-label:hover {
  background: rgba(255, 255, 255, 0.17);
}

.metric,
.panel,
.stat-card,
.round-card,
.top-scorecard,
.round-hole-card,
.round-score-tile {
  border-color: var(--line);
}

.ghost-button,
.icon-button,
.segment {
  background: #e0eae3;
  color: var(--ink);
}

.ghost-button:hover,
.icon-button:hover,
.segment:hover {
  background: #d2dfd6;
}

.primary-button {
  background: #0f6b39;
  box-shadow: 0 8px 18px rgba(8, 63, 34, 0.22);
}

.primary-button:hover {
  background: #084524;
}

input,
select,
textarea {
  border-color: #aebfb3;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
.round-score-tile:hover,
.round-score-tile.active,
.live-hole-chip.active {
  border-color: #0f6b39;
  box-shadow: 0 0 0 3px rgba(15, 107, 57, 0.24);
}

.pill,
.round-detail-chip,
.course-meta span,
.training-status {
  border: 1px solid #c0cec4;
}

.score-mark.score-birdie,
.score-mark.score-eagle {
  color: #064322;
  border-color: #0f7c42;
  background: #d8f2df;
}

.score-mark.score-par {
  color: #25352c;
}

.score-mark.score-bogey,
.score-mark.score-double {
  color: #5b3600;
  border-color: #a76107;
  background: #ffedbf;
}

.live-hole-chip.score-birdie,
.live-hole-chip.score-eagle,
.round-score-tile.score-birdie,
.round-score-tile.score-eagle,
.round-hole-card.score-birdie,
.round-hole-card.score-eagle {
  border-color: rgba(15, 124, 66, 0.62);
  background: #ecfaef;
}

.live-hole-chip.score-bogey,
.live-hole-chip.score-double,
.round-score-tile.score-bogey,
.round-score-tile.score-double,
.round-hole-card.score-bogey,
.round-hole-card.score-double {
  border-color: rgba(167, 97, 7, 0.58);
  background: #fff6dc;
}
/* Overview and coach simplification */
.dashboard-links-panel {
  margin-bottom: 14px;
}

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

.shortcut-button {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 54px;
  padding: 10px 12px;
  gap: 8px;
}

.shortcut-button i {
  grid-row: auto;
  width: 20px;
  height: 20px;
}

.shortcut-button small {
  display: none;
}

#golfIqPanel .analysis-hero {
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 12px;
}

#golfIqPanel .analysis-hero > div {
  min-width: 0;
}

#golfIqPanel .analysis-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

#golfIqPanel .analysis-grid > div {
  display: grid;
  gap: 7px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

#golfIqPanel .analysis-grid h4 {
  color: var(--ink);
  font-size: 14px;
}

#golfIqPanel .analysis-grid p {
  line-height: 1.45;
}

@media (max-width: 980px) {
  .dashboard-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .dashboard-links {
    grid-template-columns: 1fr;
  }
}
/* Coach analysis hub */
.coach-hub-panel {
  margin-bottom: 18px;
}

.coach-hub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.coach-hub-button {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  text-align: left;
}

.coach-hub-button:hover {
  border-color: var(--green);
  background: #ecfaef;
}

.coach-hub-button i {
  width: 20px;
  height: 20px;
  color: var(--green);
}

@media (max-width: 980px) {
  .coach-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .coach-hub {
    grid-template-columns: 1fr;
  }
}
/* Coach hub-only flow */
#coach:not(.coach-detail-open) #coachWindow {
  display: none;
}
#coach .coach-section-toolbar,
#coach .coach-detail-panel {
  display: none;
}

#coach.coach-detail-open .coach-hub-panel {
  display: none;
}

#coach.coach-detail-open .coach-section-toolbar {
  display: flex;
  margin-bottom: 12px;
}

#coach.coach-detail-open .coach-detail-panel.active {
  display: block;
}

.coach-hub-button.active {
  border-color: var(--green);
  background: #e6f7ea;
}
/* Product polish pass */
.empty-state {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.dashboard-live,
.dashboard-goal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.dashboard-live > div > span,
.dashboard-goal span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.dashboard-live strong,
.dashboard-goal strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
}

.dashboard-live p,
.dashboard-goal p {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.active-live {
  border-left: 4px solid var(--green);
}

.secondary-links-panel {
  opacity: 0.96;
}

.score-mark.score-eagle {
  color: #ffffff;
  border-color: #6f3cc3;
  background: #6f3cc3;
  box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px #6f3cc3;
}

.score-mark.score-birdie {
  color: #ffffff;
  border-color: #b42318;
  background: #b42318;
  border-radius: 999px;
}

.score-mark.score-par {
  color: #25352c;
  border: 1px solid #b8c2ba;
  background: #f7faf8;
}

.score-mark.score-bogey {
  color: #ffffff;
  border-color: #2563eb;
  background: #2563eb;
  border-radius: 4px;
}

.score-mark.score-double {
  color: #ffffff;
  border-color: #123064;
  background: #123064;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2px #ffffff, 0 0 0 2px #123064;
}

.live-hole-chip.score-birdie,
.live-hole-chip.score-eagle,
.round-score-tile.score-birdie,
.round-score-tile.score-eagle,
.round-hole-card.score-birdie,
.round-hole-card.score-eagle,
.live-hole-chip.score-bogey,
.live-hole-chip.score-double,
.round-score-tile.score-bogey,
.round-score-tile.score-double,
.round-hole-card.score-bogey,
.round-hole-card.score-double {
  background: #ffffff;
}

@media (max-width: 760px) {
  .app-shell {
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }

  .sidebar {
    height: calc(62px + env(safe-area-inset-bottom));
    padding: 4px max(6px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
  }

  .nav-button {
    height: 50px;
    padding: 4px 3px;
    gap: 2px;
  }

  .nav-button.nav-play {
    height: 56px;
    margin-top: -4px;
    border-radius: 14px;
  }

  .main {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .dashboard-live,
  .dashboard-goal {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .empty-actions,
  .dashboard-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-mark {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
}
.secondary-links-panel .dashboard-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Rounds import/export lives in the rounds flow */
.rounds-backup-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.rounds-backup-panel h3 {
  margin: 0;
}

.rounds-backup-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.rounds-backup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rounds-backup-actions .ghost-button,
.rounds-backup-actions .import-label {
  justify-content: center;
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
}

.rounds-backup-actions .ghost-button:hover,
.rounds-backup-actions .import-label:hover {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

@media (max-width: 760px) {
  .rounds-backup-panel {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rounds-backup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .rounds-backup-actions .ghost-button,
  .rounds-backup-actions .import-label {
    width: 100%;
  }
}
/* Dashboard shortcuts should feel like the overview home base */
.secondary-links-panel .dashboard-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shortcut-button.primary-shortcut {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.shortcut-button.primary-shortcut i,
.shortcut-button.primary-shortcut small {
  color: rgba(255, 255, 255, 0.86);
}

.shortcut-button.primary-shortcut:hover {
  background: #0f5a32;
  border-color: #0f5a32;
}

@media (max-width: 760px) {
  .secondary-links-panel .dashboard-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .secondary-links-panel .dashboard-links {
    grid-template-columns: 1fr;
  }
}
/* Rounds actions belong to the header, not the round list */
.rounds-view-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  align-items: start;
  gap: 12px 18px;
}

.rounds-header-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.rounds-header-actions .primary-button {
  width: 100%;
  min-height: 42px;
}

.rounds-header-actions .primary-button[data-view-link="register"] {
  grid-column: 1 / -1;
}

.rounds-header-actions .import-label {
  justify-content: center;
  color: #ffffff;
  background: #0f6b39;
  box-shadow: 0 8px 18px rgba(8, 63, 34, 0.22);
}

.rounds-view-header .search-input {
  grid-column: 1 / -1;
  width: 100%;
}

@media (max-width: 760px) {
  .rounds-view-header {
    grid-template-columns: 1fr;
  }

  .rounds-header-actions {
    grid-template-columns: 1fr 1fr;
  }
}
/* Round hole detail opens as its own focused window */
.round-hole-window {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(7, 20, 14, 0.52);
  touch-action: pan-y;
}

.round-hole-window.open {
  display: flex;
}

.round-hole-window-panel {
  width: min(520px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.round-hole-window-header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #f8fbf9;
}

.round-hole-window-header div {
  text-align: center;
}

.round-hole-window-header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.round-hole-window-header strong {
  display: block;
  margin-top: 2px;
  font-size: 22px;
}

.round-hole-window-body {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 14px;
}

.round-hole-window .round-hole-cards {
  display: block;
  min-width: 0;
}

.round-hole-window .round-hole-card {
  display: none;
  border-width: 2px;
}

.round-hole-window .round-hole-card.active {
  display: block;
  animation: roundHoleIn 180ms ease-out;
}

.round-hole-window .round-hole-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.round-hole-swipe-hint {
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.rounds-header-actions .primary-button.import-label,
.rounds-header-actions .primary-button.import-label:hover {
  justify-content: center;
  color: #ffffff;
  background: #0f6b39;
  border-color: #0f6b39;
}

.rounds-header-actions .primary-button.import-label:hover {
  background: #084524;
}

@media (max-width: 560px) {
  .round-hole-window {
    align-items: stretch;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .round-hole-window-panel {
    width: 100%;
    max-height: none;
    min-height: 100%;
    border-radius: 12px;
  }

  .round-hole-window-body {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .round-hole-side-nav {
    display: none;
  }
}
/* Calmer round setup flow */
.play-setup-panel {
  padding: 0;
  overflow: hidden;
}

.play-setup-flow {
  display: grid;
  gap: 0;
}

.setup-step {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.setup-step:last-of-type {
  border-bottom: 0;
}

.setup-step-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.setup-step-head > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
  font-weight: 950;
}

.setup-step-head h3,
.setup-step-head p {
  margin: 0;
}

.setup-step-head h3 {
  font-size: 20px;
}

.setup-step-head p {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

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

.course-setup-grid .setup-course-select,
.setup-grid .wide-field {
  grid-column: 1 / -1;
}

.setup-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.setup-preset {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 13px;
  border: 2px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  text-align: left;
}

.setup-preset:hover,
.setup-preset.active {
  border-color: var(--green);
  background: #ecfaef;
}

.setup-preset strong {
  font-size: 15px;
}

.setup-preset small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.setup-detail-options {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbf9;
}

.setup-detail-options summary {
  min-height: 44px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 950;
}

.compact-checkbox-grid {
  padding: 0 12px 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.setup-start-row {
  display: flex;
  justify-content: flex-end;
  padding: 16px 18px 18px;
  background: #f8fbf9;
}

.setup-start-button {
  min-width: min(260px, 100%);
  min-height: 50px;
  font-size: 16px;
}

.setup-flow-note {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #ffffff;
  font-weight: 750;
}

.setup-flow-note strong {
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .setup-step {
    padding: 14px;
  }

  .setup-grid,
  .setup-preset-grid {
    grid-template-columns: 1fr;
  }

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

  .setup-start-row {
    position: sticky;
    bottom: calc(66px + env(safe-area-inset-bottom));
    z-index: 2;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
  }

  .setup-start-button {
    width: 100%;
  }

  .setup-flow-note {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* Play setup wizard: one setup step at a time */
#play:not(.live-started) .play-setup-panel {
  overflow: visible;
}

#play:not(.live-started) .setup-step,
#play:not(.live-started) .setup-start-row {
  display: none;
}

#play:not(.live-started) .setup-step.active {
  display: grid;
  border-bottom: 0;
  animation: setupStepIn 180ms ease-out;
}

#play:not(.live-started)[data-setup-step="3"] .setup-start-row {
  display: flex;
}

.setup-nav-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.setup-nav-row.single-action {
  justify-content: flex-end;
}

.setup-nav-row .primary-button,
.setup-nav-row .ghost-button {
  min-width: 132px;
}

@keyframes setupStepIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 760px) {
  .setup-nav-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .setup-nav-row.single-action {
    grid-template-columns: 1fr;
  }

  .setup-nav-row .primary-button,
  .setup-nav-row .ghost-button {
    width: 100%;
    min-width: 0;
  }
}
/* Import button in Rounds should match primary action buttons exactly */
.rounds-header-actions .rounds-import-button {
  justify-content: center;
  width: 100%;
  min-height: 42px;
  color: #ffffff;
  background: #0f6b39;
  border: 0;
  box-shadow: 0 8px 18px rgba(8, 63, 34, 0.22);
  cursor: pointer;
}

.rounds-header-actions .rounds-import-button:hover {
  color: #ffffff;
  background: #084524;
}
.rounds-header-actions .rounds-import-button span {
  display: inline;
  margin: 0;
  color: #ffffff;
  font-size: inherit;
  font-weight: inherit;
}

.rounds-header-actions .rounds-import-button svg,
.rounds-header-actions .rounds-import-button i {
  color: #ffffff;
  stroke: currentColor;
}