:root {
  --ink: #18231c;
  --ink-soft: #5e695f;
  --paper: #f2f0e8;
  --panel: #f9f8f3;
  --line: rgba(24, 35, 28, 0.14);
  --green: #b9ec64;
  --green-deep: #1e4c32;
  --orange: #f36e3d;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
  --serif: "Newsreader", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #d9ddd3;
  color: var(--ink);
  font-family: var(--sans);
}

button,
select,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper);
}

.topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 292px 1fr 292px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: #f6f4ed;
}

.brand {
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  border-right: 1px solid var(--line);
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 6px;
  width: 1px;
  height: 16px;
  background: var(--paper);
}

.flag {
  position: absolute;
  left: 14px;
  top: 6px;
  width: 8px;
  height: 6px;
  background: var(--green);
  clip-path: polygon(0 0, 100% 30%, 0 100%);
}

.mode-tabs {
  justify-self: center;
  display: flex;
  align-items: stretch;
  gap: 34px;
}

.mode-tab {
  position: relative;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #788078;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.mode-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
}

.mode-tab.active {
  color: var(--ink);
}

.mode-tab.active::after {
  background: var(--orange);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 22px;
  border-left: 1px solid var(--line);
}

.round-action-button {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.round-action-button:hover {
  border-color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.45);
}

.round-action-button b {
  display: inline-grid;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 7px;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #75ac52;
  box-shadow: 0 0 0 3px rgba(117, 172, 82, 0.14);
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 8px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.icon-button svg {
  width: 100%;
  fill: currentColor;
}

.icon-button .mute-slash {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0;
}

.icon-button.muted {
  opacity: 0.42;
}

.icon-button.muted .mute-slash {
  opacity: 1;
}

.course-header {
  height: 105px;
  padding: 16px 24px 17px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.course-context {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.course-context .eyebrow {
  margin: 0;
}

.course-picker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.course-picker > span {
  color: #8a918a;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.1em;
}

.course-picker select {
  width: 138px;
  height: 23px;
  padding: 0 22px 0 7px;
  border: 1px solid var(--line);
  background: #f8f7f1;
  font-family: var(--mono);
  font-size: 7px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #7b827a;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 33px;
  line-height: 0.95;
  font-weight: 500;
}

.hole-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hole-navigation {
  display: flex;
  align-items: center;
  height: 30px;
  border: 1px solid var(--line);
}

.hole-navigation button {
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #677068;
  cursor: pointer;
}

.hole-navigation button:hover {
  background: #e8e9e1;
  color: var(--ink);
}

.hole-navigation select {
  width: 92px;
  height: 28px;
  padding: 0 24px 0 9px;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  font-family: var(--mono);
  font-size: 8px;
}

.hole-meta {
  display: flex;
  align-items: stretch;
}

.hole-meta > div {
  min-width: 94px;
  padding: 2px 20px;
  border-left: 1px solid var(--line);
}

.hole-meta span,
.score-strip span,
.club-estimate span,
.range-labels,
.lod-note > span,
.result-kicker,
.result-stats span {
  display: block;
  margin-bottom: 4px;
  color: #777f78;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.hole-meta strong {
  white-space: nowrap;
  font-size: 13px;
}

.wind-arrow {
  display: inline-block;
  color: var(--orange);
  font-style: normal;
  font-size: 17px;
  transform: translateY(1px);
}

#holeWind {
  display: inline;
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: normal;
}

.wind-meta small {
  display: block;
  margin-top: 2px;
  color: #8b928b;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
}

.wind-meta.gusting strong {
  color: #c8572f;
}

.main-grid {
  min-height: 680px;
  height: calc(100vh - 205px);
  display: grid;
  grid-template-columns: 292px minmax(520px, 1fr) 292px;
}

.panel {
  background: var(--panel);
  position: relative;
  z-index: 2;
}

.left-panel {
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.right-panel {
  border-left: 1px solid var(--line);
  overflow-y: auto;
}

.score-strip {
  height: 67px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.score-strip > div {
  padding: 14px 16px;
  border-right: 1px solid var(--line);
}

.score-strip > div:last-child {
  border-right: 0;
}

.score-strip strong {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
}

.section {
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--line);
}

.section.compact {
  padding-top: 18px;
  padding-bottom: 12px;
}

.field-label {
  display: block;
  margin-bottom: 9px;
  color: #59625a;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.select-wrap {
  position: relative;
}

select {
  width: 100%;
  height: 42px;
  padding: 0 35px 0 12px;
  appearance: none;
  border: 1px solid #b8bdb5;
  border-radius: 0;
  background: #fffefa;
  color: var(--ink);
  outline: none;
  font-size: 12px;
  font-weight: 700;
}

.select-wrap > span {
  position: absolute;
  right: 12px;
  top: 9px;
  pointer-events: none;
}

.club-estimate {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 13px;
}

.club-estimate > div + div {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.club-estimate strong {
  font-family: var(--mono);
  font-size: 12px;
}

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.label-row strong {
  font-family: var(--mono);
  font-size: 11px;
}

.power-slider {
  width: 100%;
  height: 20px;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.power-slider::-webkit-slider-runnable-track {
  height: 5px;
  background:
    linear-gradient(90deg, #708e4e, var(--green) 72%, var(--orange)) 0 0 / 100% 100%,
    #d6d9d0;
}

.power-slider::-webkit-slider-thumb {
  width: 10px;
  height: 18px;
  margin-top: -6px;
  appearance: none;
  border: 2px solid var(--paper);
  border-radius: 1px;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.power-slider::-moz-range-track {
  height: 5px;
  background: linear-gradient(90deg, #708e4e, var(--green) 72%, var(--orange));
}

.power-slider::-moz-range-thumb {
  width: 8px;
  height: 16px;
  border: 2px solid var(--paper);
  border-radius: 1px;
  background: var(--ink);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin: 2px 1px 0;
}

.shape-control {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
}

.shape-control > span {
  color: #8a908a;
  font-family: var(--mono);
  font-size: 7px;
}

.shape-control > span:last-child {
  text-align: right;
}

.shape-track {
  position: relative;
  height: 30px;
}

.shape-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  height: 1px;
  background: #aeb4ac;
}

.shape-track::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 9px;
  width: 1px;
  height: 11px;
  background: #7c847c;
}

.shape-knob {
  position: absolute;
  z-index: 2;
  left: calc(50% - 7px);
  top: 8px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
  cursor: ew-resize;
}

.strike-section {
  padding-top: 17px;
  padding-bottom: 15px;
}

.delivery-intent {
  color: #879087;
  font-size: 7px !important;
  letter-spacing: 0.1em;
}

.shape-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 13px;
}

.shape-presets button {
  min-width: 0;
  height: 25px;
  padding: 0 4px;
  border: 1px solid #c7cbc3;
  background: rgba(255, 255, 255, 0.4);
  color: #687168;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.shape-presets button:hover {
  border-color: #8f978e;
  color: var(--ink);
}

.shape-presets button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.shape-presets button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

.delivery-row + .delivery-row {
  margin-top: 10px;
}

.delivery-label,
.impact-planner > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.delivery-label span,
.impact-planner > div:first-child span {
  color: #6f786f;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.delivery-label strong,
.impact-planner > div:first-child strong {
  font-family: var(--mono);
  font-size: 8px;
}

.delivery-slider {
  width: 100%;
  height: 17px;
  margin: 1px 0 -2px;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
}

.delivery-slider::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, #537b9b, #b8bdb5 50%, #d8874b);
}

.delivery-slider::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  margin-top: -4px;
  appearance: none;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.delivery-slider::-moz-range-track {
  height: 2px;
  background: linear-gradient(90deg, #537b9b, #b8bdb5 50%, #d8874b);
}

.delivery-slider::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--ink);
}

.delivery-ends {
  display: flex;
  justify-content: space-between;
  color: #939993;
  font-family: var(--mono);
  font-size: 5px;
}

.impact-planner {
  margin-top: 11px;
}

.impact-face {
  position: relative;
  height: 48px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid #abb1a9;
  border-radius: 18px 18px 8px 8px;
  background:
    radial-gradient(circle at 30% 35%, rgba(255, 255, 255, .78), transparent 3px),
    #e5e5dd;
  touch-action: none;
  cursor: crosshair;
}

.impact-cross {
  position: absolute;
  background: rgba(24, 35, 28, 0.14);
  pointer-events: none;
}

.impact-cross.horizontal {
  left: 7px;
  right: 7px;
  top: 50%;
  height: 1px;
}

.impact-cross.vertical {
  top: 5px;
  bottom: 5px;
  left: 50%;
  width: 1px;
}

#impactTarget {
  position: absolute;
  z-index: 2;
  left: calc(50% - 6px);
  top: calc(50% - 6px);
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 1px rgba(24, 35, 28, 0.75);
  pointer-events: none;
}

.impact-label {
  position: absolute;
  bottom: 3px;
  color: rgba(24, 35, 28, 0.4);
  font-family: var(--mono);
  font-size: 5px;
  font-style: normal;
  pointer-events: none;
}

.impact-label.heel {
  left: 8px;
}

.impact-label.toe {
  right: 8px;
}

.aim-card {
  margin: 18px 20px 0;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #e8e8df;
  border: 1px solid rgba(24, 35, 28, 0.07);
}

.aim-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #aab1a7;
  border-radius: 50%;
  color: var(--orange);
}

.aim-card strong {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
}

.aim-card span {
  display: block;
  margin-top: 3px;
  color: #7b837c;
  font-size: 9px;
}

.primary-button {
  width: calc(100% - 40px);
  height: 50px;
  margin: 15px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
  border: 0;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: background 160ms, transform 160ms;
}

.primary-button:hover {
  background: #de592b;
  transform: translateY(-1px);
}

.primary-button:disabled {
  opacity: 0.5;
  transform: none;
  cursor: wait;
}

kbd {
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
}

.text-button {
  width: 100%;
  padding: 14px;
  border: 0;
  background: transparent;
  color: #777f78;
  font-size: 10px;
  cursor: pointer;
}

.viewport-wrap {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #263c2c;
}

#courseCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.viewport-toolbar {
  position: absolute;
  z-index: 3;
  left: 16px;
  top: 16px;
  display: flex;
  gap: 8px;
}

.segmented,
.tool-button,
.camera-controls {
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 29, 22, 0.87);
  backdrop-filter: blur(8px);
}

.segmented button,
.tool-button {
  height: 30px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.66);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.segmented button {
  padding: 0 11px;
}

.segmented button.active {
  background: #eef0e8;
  color: var(--ink);
}

.tool-button {
  padding: 0 11px;
}

.tool-button[aria-pressed="true"] {
  color: #fff;
}

.camera-controls {
  display: flex;
}

.camera-controls button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
}

.camera-controls button:last-child {
  border-right: 0;
  font-size: 10px;
}

.camera-controls button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.contour-icon {
  color: var(--green);
  font-size: 16px;
  vertical-align: -2px;
}

.north-indicator {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 35px;
  color: rgba(255, 255, 255, 0.86);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
}

.north-indicator i {
  display: block;
  width: 1px;
  height: 31px;
  margin: 4px auto 0;
  background: linear-gradient(var(--orange) 0 50%, rgba(255, 255, 255, 0.65) 50%);
  transform: rotate(13deg);
  transform-origin: top;
}

.north-indicator i::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 13px;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  border-bottom: 7px solid var(--orange);
}

.elevation-legend {
  position: absolute;
  z-index: 3;
  right: 17px;
  bottom: 17px;
  width: 250px;
  padding: 10px 11px 8px;
  background: rgba(19, 27, 21, 0.9);
  color: #fff;
  font-family: var(--mono);
  backdrop-filter: blur(8px);
  transition: opacity 180ms, transform 180ms;
}

.elevation-legend.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.elevation-legend-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

.elevation-legend-heading span {
  color: #b9ec64;
  font-size: 7px;
  letter-spacing: 0.09em;
}

.elevation-legend-heading strong {
  color: rgba(255, 255, 255, 0.66);
  font-size: 6px;
  font-weight: 500;
  letter-spacing: 0.07em;
}

.elevation-gradient {
  height: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(
    90deg,
    rgb(31, 88, 112) 0%,
    rgb(48, 133, 133) 23%,
    rgb(117, 163, 112) 46%,
    rgb(197, 177, 100) 68%,
    rgb(204, 125, 78) 84%,
    rgb(242, 218, 170) 100%
  );
}

.elevation-ticks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 6px;
}

.elevation-ticks span {
  position: relative;
  text-align: center;
}

.elevation-ticks span:first-child {
  text-align: left;
}

.elevation-ticks span:last-child {
  text-align: right;
}

.elevation-extents {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 5px;
  letter-spacing: 0.12em;
}

.green-view-guide {
  position: absolute;
  z-index: 3;
  right: 17px;
  top: 64px;
  width: auto;
  max-width: calc(100% - 34px);
  padding: 6px 7px 6px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(19, 27, 21, 0.88);
  color: #fff;
  backdrop-filter: blur(8px);
  white-space: nowrap;
  transition: opacity 180ms, transform 180ms;
}

.green-view-guide.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.green-view-guide > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.green-view-guide .eyebrow {
  margin: 0;
  color: #b9ec64;
  font-size: 7px;
}

.green-view-guide strong {
  font-size: 8px;
  font-weight: 500;
}

.slope-scale {
  margin: 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
  border-right: 1px solid rgba(255, 255, 255, 0.13);
}

.slope-scale span {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.67);
  font-family: var(--mono);
  font-size: 6px;
  text-transform: uppercase;
}

.slope-scale i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  flex: 0 0 auto;
  background: #b9ec64;
}

.slope-scale i.medium {
  background: #f1bb48;
}

.slope-scale i.strong {
  background: var(--orange);
}

.green-view-guide button {
  width: auto;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  font-family: var(--mono);
  font-size: 7px;
  text-transform: uppercase;
  cursor: pointer;
}

.green-view-guide button:hover {
  border-color: var(--green);
  color: var(--green);
}

.canvas-readout {
  position: absolute;
  left: 16px;
  bottom: 17px;
  min-width: 235px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: rgba(19, 27, 21, 0.84);
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--mono);
  font-size: 8px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.canvas-readout strong {
  color: #fff;
  font-size: 9px;
}

.map-gesture-hint {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 18px;
  padding: 7px 9px;
  background: rgba(19, 27, 21, 0.72);
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
  pointer-events: none;
}

.mobile-hint {
  display: none;
}

.swatch {
  width: 8px;
  height: 8px;
  background: var(--swatch, #6d9a53);
}

.shot-result {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  width: 390px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 23px;
  background: rgba(247, 246, 239, 0.96);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  transition: opacity 200ms, transform 200ms;
  backdrop-filter: blur(12px);
}

.shot-result.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%);
}

.shot-result > button {
  position: absolute;
  right: 9px;
  top: 7px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.shot-result > strong {
  display: block;
  margin: 3px 0 13px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 500;
}

.strike-summary {
  margin: 0 -4px 13px;
  padding: 11px;
  background: #e9e9e1;
}

.strike-summary-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #717a72;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.09em;
}

.strike-summary-heading b {
  padding: 3px 5px;
  background: var(--ink);
  color: #fff;
  font-size: 7px;
  font-weight: 500;
}

#strikeGraphic {
  width: 100%;
  height: 108px;
  display: block;
  margin-top: 3px;
}

#strikeGraphic text {
  fill: #777f78;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.06em;
}

.graphic-target,
.graphic-cross {
  stroke: rgba(24, 35, 28, 0.24);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.graphic-path-target,
.graphic-face-target {
  stroke: rgba(24, 35, 28, 0.58);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 6 5;
}

.graphic-path {
  stroke: #397a91;
  stroke-width: 2;
  stroke-linecap: round;
}

.graphic-face {
  stroke: var(--orange);
  stroke-width: 3;
  stroke-linecap: round;
}

.graphic-clubface {
  fill: rgba(255, 255, 255, 0.36);
  stroke: #858d85;
  stroke-width: 1;
}

.graphic-impact-target {
  fill: none;
  stroke: rgba(24, 35, 28, 0.38);
  stroke-width: 1;
  stroke-dasharray: 2 2;
}

.graphic-impact {
  fill: var(--orange);
  stroke: #fff;
  stroke-width: 1.5;
}

.strike-legend {
  display: flex;
  justify-content: flex-end;
  gap: 11px;
  margin: -3px 1px 7px;
  color: #777f78;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.07em;
}

.strike-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.strike-legend i {
  display: block;
  width: 18px;
  height: 0;
  border-top: 2px solid #397a91;
}

.strike-legend i.planned {
  border-top: 2px dashed rgba(24, 35, 28, 0.62);
}

.strike-legend i.actual {
  border-image: linear-gradient(90deg, #397a91 0 50%, var(--orange) 50% 100%) 1;
}

.strike-values {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(24, 35, 28, 0.12);
}

.strike-values > div {
  padding-top: 7px;
}

.strike-values > div:nth-child(n + 4) {
  margin-top: 7px;
  border-top: 1px solid rgba(24, 35, 28, 0.08);
}

.strike-values span {
  display: block;
  margin-bottom: 2px;
  color: #828982;
  font-family: var(--mono);
  font-size: 6px;
}

.strike-values b {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
}

.strike-values small {
  display: block;
  margin-top: 2px;
  color: #777f78;
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.04em;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.scorecard-modal {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 50%;
  width: min(680px, calc(100% - 36px));
  padding: 26px;
  background: rgba(247, 246, 239, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
  transition: opacity 200ms, transform 200ms;
  backdrop-filter: blur(14px);
}

.scorecard-modal.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%);
}

.history-modal {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100% - 36px));
  max-height: calc(100% - 36px);
  padding: 24px;
  overflow-y: auto;
  background: rgba(247, 246, 239, 0.98);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
  transition: opacity 200ms, transform 200ms;
  backdrop-filter: blur(14px);
}

.history-modal.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%);
}

.modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.history-header {
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.history-header strong {
  display: block;
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.history-list {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

.history-empty {
  margin: 8px 0 18px;
  color: #777f78;
  font-size: 11px;
}

.history-item {
  width: 100%;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: #fffefa;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.history-item:hover {
  border-color: #8d968d;
}

.history-item-meta,
.history-item-stat {
  font-family: var(--mono);
  font-size: 7px;
  color: #727b73;
}

.history-item-main {
  min-width: 0;
}

.history-item-main strong,
.history-item-main span {
  display: block;
}

.history-item-main strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-main span {
  margin-top: 2px;
  color: #727b73;
  font-size: 8px;
}

.history-item-stat {
  color: var(--ink);
  text-align: right;
}

.history-card-button {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: var(--ink);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.scorecard-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.scorecard-header strong {
  display: block;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.round-score {
  min-width: 48px;
  padding: 8px;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 16px;
  text-align: center;
}

.scorecard-grid {
  margin: 18px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.scorecard-row {
  display: grid;
  grid-template-columns: 54px repeat(9, 1fr);
}

.scorecard-cell {
  min-width: 0;
  padding: 7px 3px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 8px;
  text-align: center;
}

.scorecard-cell.label {
  color: #777f78;
  text-align: left;
  padding-left: 8px;
}

.scorecard-cell.current {
  background: #e1edcf;
  color: #39592e;
  font-weight: 700;
}

.scorecard-cell.over {
  color: #c64f2b;
}

.scorecard-cell.under {
  color: #39714b;
}

.scorecard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scorecard-actions > span {
  color: #777f78;
  font-family: var(--mono);
  font-size: 8px;
}

.scorecard-actions button {
  min-width: 150px;
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  border: 0;
  background: var(--orange);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
}

.scorecard-buttons {
  display: flex;
  gap: 8px;
}

.scorecard-actions button.secondary {
  min-width: auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.result-stats b {
  font-family: var(--mono);
  font-size: 11px;
}

.loading-screen {
  position: absolute;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #203225;
  color: #fff;
  transition: opacity 450ms;
}

.loading-screen.done {
  opacity: 0;
  pointer-events: none;
}

.loader-logo {
  width: 54px;
  height: 54px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.loader-logo span {
  width: 5px;
  height: 27px;
  border-radius: 3px;
  background: var(--green);
  animation: scan 1.1s infinite ease-in-out alternate;
}

@keyframes scan {
  to {
    transform: rotate(90deg);
    background: var(--orange);
  }
}

.loading-screen > strong {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
}

.loading-screen > span {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--mono);
  font-size: 9px;
}

.loading-track {
  width: 190px;
  height: 2px;
  margin-top: 17px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
}

.loading-track i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 160ms;
}

.side-heading {
  padding: 20px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.side-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
}

.live-badge {
  padding: 4px 6px;
  background: #dcead0;
  color: #50723b;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.voxel-preview {
  height: 112px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  background: #e4e7dc;
}

.voxel-preview > div:last-child span {
  display: block;
  margin-bottom: 4px;
  color: #647065;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.voxel-preview > div:last-child strong {
  font-family: var(--mono);
  font-size: 14px;
}

.voxel-cube {
  --cube-color: #7ba95a;
  position: relative;
  width: 48px;
  height: 48px;
  background: var(--cube-color);
  transform: skewY(30deg) scaleY(0.86);
  box-shadow: inset -10px -10px rgba(0, 0, 0, 0.08);
}

.voxel-cube::before {
  content: "";
  position: absolute;
  left: 0;
  top: -28px;
  width: 48px;
  height: 32px;
  background: color-mix(in srgb, var(--cube-color) 88%, white);
  transform: skewY(-30deg) scaleY(0.86);
  transform-origin: bottom left;
}

.probe-list {
  margin: 0;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
}

.probe-list > div {
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid rgba(24, 35, 28, 0.07);
  font-size: 10px;
}

.probe-list > div:last-child {
  border-bottom: 0;
}

.probe-list dt {
  color: #758077;
}

.probe-list dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
}

.small-muted {
  color: #8b918b;
  font-family: var(--mono);
  font-size: 8px;
}

.legend button {
  width: 100%;
  padding: 5px 2px;
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.legend button:hover {
  background: rgba(24, 35, 28, 0.04);
}

.legend button i {
  width: 7px;
  height: 7px;
  background: var(--type-color);
}

.legend button b {
  color: #858c85;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 400;
}

.legend [data-type="green"] { --type-color: #abd76a; }
.legend [data-type="water"] { --type-color: #3d8290; }
.legend [data-type="fairway"] { --type-color: #73a855; }
.legend [data-type="short-rough"] { --type-color: #496f3d; }
.legend [data-type="long-rough"] { --type-color: #315234; }
.legend [data-type="hard-sand"] { --type-color: #cfb878; }
.legend [data-type="soft-sand"] { --type-color: #e0d09b; }
.legend [data-type="brush"] { --type-color: #6a6e3e; }
.legend [data-type="trees"] { --type-color: #183828; }
.legend [data-type="gravel"] { --type-color: #999b8f; }
.legend [data-type="concrete"] { --type-color: #c1c3bd; }

.lod-note {
  margin: 5px 20px 20px;
  padding: 13px;
  border-left: 2px solid var(--green-deep);
  background: #ebece4;
}

.lod-note strong {
  font-family: var(--mono);
  font-size: 11px;
}

.lod-note p {
  margin: 6px 0 0;
  color: #747c75;
  font-size: 8px;
  line-height: 1.5;
}

.pipeline-drawer {
  display: none;
  min-height: 240px;
  grid-template-columns: 1.2fr 2fr 1fr;
  gap: 35px;
  padding: 30px;
  border-top: 1px solid var(--line);
  background: #eceae1;
}

.pipeline-drawer.open {
  display: grid;
}

.pipeline-intro h2 {
  max-width: 360px;
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}

.pipeline-intro p,
.pipeline-warning p {
  margin: 0;
  color: #6f776f;
  font-size: 10px;
  line-height: 1.7;
}

.pipeline-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline-steps li {
  min-height: 49px;
  padding: 7px 0;
  display: grid;
  grid-template-columns: 32px 1fr 36px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.pipeline-steps li > span,
.pipeline-steps li > i {
  color: #8b918a;
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
}

.pipeline-steps li > i {
  text-align: right;
}

.pipeline-steps li.done > i {
  color: #658d48;
}

.pipeline-steps li.active > i {
  color: var(--orange);
}

.pipeline-steps strong {
  display: block;
  font-size: 10px;
}

.pipeline-steps p {
  margin: 2px 0 0;
  color: #858b85;
  font-size: 8px;
}

.pipeline-warning {
  align-self: center;
  padding: 17px;
  border: 1px solid #d0c7b2;
  background: #f4efe2;
}

.pipeline-warning strong {
  display: block;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 9px;
}

footer {
  min-height: 33px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: #899089;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

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

  .main-grid {
    grid-template-columns: 260px minmax(480px, 1fr) 0;
  }

  .right-panel {
    display: none;
  }

  .hole-meta > div {
    min-width: 76px;
    padding: 2px 12px;
  }
}

@media (max-width: 800px) {
  .topbar {
    height: 56px;
    grid-template-columns: 1fr auto;
  }

  .mode-tabs {
    display: none;
  }

  .top-actions {
    border-left: 0;
  }

  .save-state {
    display: none;
  }

  .course-header {
    height: auto;
    align-items: center;
  }

  .hole-meta > div:not(:first-child) {
    display: none;
  }

  .hole-title-row {
    align-items: flex-end;
    gap: 10px;
  }

  .course-picker select {
    width: 126px;
  }

  .hole-title-row h1 {
    max-width: 210px;
    font-size: 27px;
  }

  .hole-navigation select {
    display: none;
  }

  .main-grid {
    height: auto;
    min-height: 0;
    width: 100vw;
    max-width: 100%;
    display: flex;
    flex-direction: column-reverse;
    overflow: hidden;
  }

  .viewport-wrap {
    width: 100vw;
    max-width: 100%;
    height: 50vh;
    min-height: 380px;
  }

  .left-panel {
    display: grid;
    grid-template-columns: 50% 50%;
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    border-top: 1px solid var(--line);
    overflow: hidden;
  }

  .score-strip {
    display: grid;
    grid-column: 1 / -1;
  }

  .left-panel .section {
    display: block;
    min-width: 0;
    padding: 16px 14px;
  }

  .left-panel .select-wrap,
  .left-panel select {
    min-width: 0;
  }

  .left-panel select {
    padding-left: 9px;
    font-size: 10px;
  }

  .left-panel > .section:nth-child(4) {
    display: block;
    grid-column: 1 / -1;
  }

  .left-panel > .section:nth-child(3) {
    border-left: 1px solid var(--line);
  }

  .aim-card {
    display: flex;
    grid-column: 1 / -1;
    margin: 14px 20px 0;
  }

  .primary-button {
    grid-column: 1 / -1;
    margin-top: 14px;
  }

  .text-button {
    grid-column: 1 / -1;
    padding: 10px;
  }

  .club-estimate {
    gap: 8px;
  }

  .club-estimate > div + div {
    padding-left: 8px;
  }

  .pipeline-drawer.open {
    grid-template-columns: 1fr;
  }

  .green-view-guide {
    right: 8px;
    top: 52px;
    max-width: calc(100% - 16px);
    gap: 7px;
    padding-left: 8px;
  }

  .green-view-guide > div:first-child strong {
    display: none;
  }

  .slope-scale {
    gap: 6px;
    padding: 0 7px;
  }

  .viewport-toolbar {
    left: 10px;
    top: 10px;
    gap: 4px;
  }

  .viewport-toolbar .tool-button {
    display: none;
  }

  .segmented button {
    padding: 0 7px;
  }

  .map-gesture-hint {
    bottom: 12px;
  }

  .elevation-legend {
    right: 8px;
    bottom: 44px;
    width: min(250px, calc(100% - 16px));
  }

  .desktop-hint {
    display: none;
  }

  .mobile-hint {
    display: inline;
  }

  .shot-result {
    width: calc(100% - 24px);
    padding: 18px;
  }

  .scorecard-modal {
    width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    padding: 18px;
    overflow-y: auto;
  }

  .scorecard-header strong {
    font-size: 23px;
  }

  .scorecard-row {
    grid-template-columns: 42px repeat(9, 1fr);
  }

  .scorecard-cell {
    padding: 6px 1px;
    font-size: 6px;
  }

  .scorecard-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .scorecard-actions button {
    width: 100%;
  }

  .scorecard-buttons {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
