:root {
  --paper: #f6f3ec;
  --ink: #1d2523;
  --muted: #69746f;
  --line: #d8d2c3;
  --panel: #fffaf1;
  --panel-strong: #ffffff;
  --lake: #2f8c9f;
  --forest: #2f7359;
  --clay: #b75f3d;
  --gold: #d3a437;
  --danger: #a63d3d;
  --shadow: 0 18px 48px rgba(32, 38, 35, 0.16);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#map {
  height: 100%;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 72px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 243, 236, 0.94);
  backdrop-filter: blur(16px);
  z-index: 40;
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  color: #fffaf1;
  background: linear-gradient(135deg, var(--forest), var(--lake));
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  margin-top: 4px;
}

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

.workspace {
  height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  overflow: hidden;
}

.map-stage {
  min-width: 0;
  position: relative;
  overflow: hidden;
  background: #10181d;
}

.high-contrast .map-stage {
  background: #d9f3ee;
}

.leaflet-container {
  font: inherit;
  background: #17211e;
  z-index: 1;
}

.leaflet-tile-pane {
  filter: brightness(0.9) contrast(0.92) saturate(0.82);
}

.county-boundary {
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.42));
}

.prompt-strip {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.93);
  box-shadow: var(--shadow);
  z-index: 30;
}

.prompt-strip h2 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(1.05rem, 1.6vw, 1.55rem);
  line-height: 1.15;
}

.prompt-strip p {
  max-width: 820px;
}

.score-pill {
  min-width: 96px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--panel);
  background: var(--ink);
  box-shadow: inset 0 -8px 16px rgba(255, 255, 255, 0.06);
}

.score-pill span {
  font-variant-numeric: tabular-nums;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
}

.score-pill small {
  color: rgba(255, 250, 241, 0.72);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.map-toolbar {
  position: absolute;
  right: 18px;
  bottom: 92px;
  display: grid;
  gap: 8px;
  z-index: 35;
}

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

.panel-tabs {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.95);
  backdrop-filter: blur(16px);
}

.tab-button,
.chip,
.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  min-height: 42px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.tab-button:focus-visible,
.chip:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.danger-button:focus-visible,
.icon-button:focus-visible,
.text-input:focus-visible {
  outline: 3px solid rgba(47, 140, 159, 0.28);
  outline-offset: 2px;
}

.tab-button:hover,
.chip:hover,
.primary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.tab-button {
  padding: 8px;
  color: var(--muted);
  background: transparent;
}

.tab-button.active {
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel-strong);
  box-shadow: 0 8px 18px rgba(32, 38, 35, 0.08);
}

.primary-button {
  padding: 0 14px;
  color: #fffaf1;
  border-color: var(--forest);
  background: var(--forest);
  font-weight: 800;
}

.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel-strong);
  font-weight: 750;
}

.danger-button {
  padding: 0 14px;
  color: #fffaf1;
  border-color: var(--danger);
  background: var(--danger);
  font-weight: 800;
}

.icon-button {
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel-strong);
  flex: 0 0 auto;
}

.icon-button svg,
.primary-button svg,
.ghost-button svg,
.danger-button svg,
.tab-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.panel-view {
  display: none;
  padding: 18px;
}

.panel-view.active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading h2,
.split-list h3 {
  margin: 0;
}

.section-heading h2 {
  font-size: 1.35rem;
  line-height: 1.1;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--clay);
  text-transform: uppercase;
  font-size: 0.72rem;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.date-chip,
.chip {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 0.85rem;
  font-weight: 800;
  white-space: nowrap;
}

.chip.active {
  color: #fffaf1;
  border-color: var(--lake);
  background: var(--lake);
}

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

.button-grid button {
  min-width: 0;
}

.progress-block,
.feedback-panel,
.split-list {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.progress-bar {
  height: 10px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5dfd1;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--forest), var(--gold));
  transition: width 220ms ease;
}

.feedback-panel {
  min-height: 180px;
}

.feedback-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.feedback-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.metric small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric strong {
  display: block;
  margin-top: 5px;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}

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

.stat-card {
  min-height: 92px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.stat-card small {
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  font-size: 1.7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.leaderboard-list,
.place-list {
  margin: 12px 0 0;
  padding: 0;
}

.leaderboard-list {
  list-style: none;
}

.leaderboard-list li,
.place-row,
.county-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(216, 210, 195, 0.78);
}

.leaderboard-list li:first-child,
.place-row:first-child,
.county-row:first-child {
  border-top: 0;
}

.leaderboard-list strong,
.place-row strong {
  display: block;
}

.leaderboard-list small,
.place-row small,
.county-row small {
  color: var(--muted);
}

.place-row {
  width: 100%;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.place-row span:first-child {
  min-width: 0;
}

.place-tag {
  flex: 0 0 auto;
  min-width: 76px;
  padding: 6px 8px;
  border-radius: 999px;
  text-align: center;
  color: #fffaf1;
  background: var(--forest);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.place-tag.business {
  background: var(--clay);
}

.place-tag.visit {
  background: var(--lake);
}

.place-tag.poi {
  background: var(--gold);
  color: var(--ink);
}

.place-tag.town {
  background: var(--forest);
}

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

.text-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
}

.text-input.input-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(166, 61, 61, 0.18);
}

.field-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: var(--ink);
  font-weight: 850;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.toggle-row:first-of-type {
  border-top: 0;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.toggle-row input {
  width: 44px;
  height: 24px;
  accent-color: var(--forest);
  flex: 0 0 auto;
}

.place-pin {
  width: 30px !important;
  height: 30px !important;
  margin-left: -15px !important;
  margin-top: -15px !important;
  display: grid;
  place-items: center;
  border: 2px solid #fffaf1;
  border-radius: 50%;
  color: #fffaf1;
  box-shadow: 0 8px 18px rgba(29, 37, 35, 0.26);
  font-size: 0.72rem;
  font-weight: 900;
}

.place-pin.business {
  background: var(--clay);
}

.place-pin.visit {
  background: var(--lake);
}

.place-pin.poi {
  color: var(--ink);
  background: var(--gold);
}

.place-pin.town {
  background: var(--forest);
}

.guess-marker,
.target-marker {
  width: 34px !important;
  height: 34px !important;
  margin-left: -17px !important;
  margin-top: -17px !important;
  display: grid;
  place-items: center;
  border: 3px solid #fffaf1;
  border-radius: 50%;
  color: #fffaf1;
  box-shadow: 0 12px 26px rgba(29, 37, 35, 0.34);
  font-size: 0.72rem;
  font-weight: 900;
}

.guess-marker {
  background: var(--gold);
}

.target-marker {
  background: var(--forest);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(29, 37, 35, 0.46);
}

.modal-panel {
  position: relative;
  width: min(100%, 460px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.onboarding-panel {
  width: min(100%, 430px);
}

.modal-panel h1 {
  margin: 0 44px 10px 0;
  font-size: 2rem;
  line-height: 1;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.onboarding-note {
  padding-top: 4px;
}

.training-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.training-card {
  position: absolute;
  top: 92px;
  left: 50%;
  width: min(440px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.training-card h1 {
  margin: 0 0 8px;
  font-size: 1.7rem;
  line-height: 1;
}

.training-callout {
  margin: 12px 0 0;
  padding: 10px;
  border: 1px solid rgba(47, 115, 89, 0.24);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(47, 115, 89, 0.1);
  font-weight: 900;
  line-height: 1.35;
}

.training-actions {
  justify-content: stretch;
}

.training-actions .primary-button {
  width: 100%;
}

.prompt-strip.training-prompt {
  opacity: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--panel);
  background: var(--ink);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

@media (max-width: 880px) {
  .topbar {
    height: auto;
    align-items: flex-start;
  }

  .topbar-actions .ghost-button {
    max-width: 166px;
  }

  .workspace {
    height: auto;
    min-height: calc(100vh - 84px);
    grid-template-columns: 1fr;
  }

  .map-stage {
    height: 62vh;
    min-height: 520px;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .prompt-strip {
    left: 10px;
    right: 10px;
    top: 10px;
    padding: 12px;
  }
}

@media (max-width: 600px) {
  .brand small,
  .topbar-actions .ghost-button {
    display: none;
  }

  .topbar {
    padding: 10px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .map-stage {
    min-height: 560px;
  }

  .prompt-strip {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .score-pill {
    width: 100%;
    min-width: 0;
    height: 52px;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 8px;
  }

  .map-toolbar {
    right: 10px;
    bottom: 98px;
  }

  .panel-tabs {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 8px;
  }

  .tab-button {
    min-height: 44px;
    font-size: 0.78rem;
    gap: 4px;
  }

  .panel-view {
    padding: 14px;
  }

  .button-grid,
  .stat-grid,
  .feedback-metrics {
    grid-template-columns: 1fr;
  }
}

.app-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

.map-stage {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

.brand-chip {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-chip strong,
.brand-chip small {
  display: block;
  line-height: 1.1;
}

.brand-chip small {
  margin-top: 4px;
  color: var(--muted);
}

.options-wrap {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 55;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.options-pill {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
  font-weight: 850;
  backdrop-filter: blur(16px);
}

.options-pill svg {
  width: 18px;
  height: 18px;
}

.options-menu {
  width: 230px;
  padding: 10px;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.98);
  box-shadow: var(--shadow);
}

.options-menu .ghost-button {
  width: 100%;
  justify-content: flex-start;
}

.options-menu button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.options-menu small {
  display: block;
  color: var(--muted);
  line-height: 1.3;
}

.prompt-strip {
  top: 84px;
  left: 14px;
  right: 14px;
}

.progress-dock {
  position: absolute;
  left: 18px;
  bottom: 96px;
  z-index: 35;
  width: min(390px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px 12px;
  align-items: center;
  backdrop-filter: blur(16px);
}

.progress-dock span,
.progress-dock strong {
  font-size: 0.88rem;
  line-height: 1.2;
}

.progress-dock span {
  color: var(--muted);
  font-weight: 800;
}

.progress-dock .progress-bar {
  grid-column: 1 / -1;
  margin-top: 0;
}

.feedback-panel {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 35;
  width: min(390px, calc(100vw - 36px));
  max-height: 36vh;
  overflow: auto;
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.map-toolbar {
  right: 18px;
  bottom: 178px;
}

.ready-panel h1,
.modal-panel h1 {
  margin-right: 0;
}

@media (max-width: 760px) {
  .brand-chip {
    top: 10px;
    left: 10px;
    padding: 8px;
  }

  .brand-chip small {
    display: none;
  }

  .options-wrap {
    top: 10px;
    right: 10px;
  }

  .prompt-strip {
    top: 74px;
    left: 10px;
    right: 10px;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
  }

  .score-pill {
    width: 100%;
    min-width: 0;
    height: 48px;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 8px;
  }

  .progress-dock {
    left: 10px;
    bottom: calc(88px + 28vh);
    width: calc(100vw - 20px);
  }

  .feedback-panel {
    right: 10px;
    bottom: 76px;
    width: calc(100vw - 20px);
    max-height: 28vh;
  }

  .map-toolbar {
    right: 10px;
    bottom: calc(150px + 28vh);
  }
}

.prompt-strip {
  top: 82px;
  left: 50%;
  right: auto;
  width: min(880px, calc(100vw - 28px));
  min-height: 64px;
  padding: 10px 12px;
  transform: translateX(-50%);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.prompt-strip h2 {
  font-size: clamp(0.98rem, 1.15vw, 1.22rem);
  line-height: 1.18;
}

.prompt-strip p {
  font-size: 0.88rem;
}

.prompt-strip .eyebrow {
  margin-bottom: 4px;
}

.prompt-strip .score-pill {
  min-width: 78px;
  height: 54px;
}

.prompt-strip .score-pill span {
  font-size: 1.18rem;
}

.showing-result .prompt-strip {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -8px);
}

.feedback-panel {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: min(540px, calc(100vw - 32px));
  max-height: min(58vh, 520px);
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 180ms ease;
}

.snark-line {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 1.02rem;
  line-height: 1.35;
  font-weight: 900;
}

.feedback-panel.final-result {
  z-index: 70;
  width: min(640px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  background: rgba(255, 250, 241, 0.96);
  transform: translate(-50%, -50%);
  display: block;
}

.final-result-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.final-result h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1;
}

.final-score {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.final-score strong {
  font-size: 4.2rem;
  line-height: 0.85;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.final-score span {
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 900;
}

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

.round-score-chip {
  min-height: 78px;
  padding: 8px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 10px 22px rgba(32, 38, 35, 0.08);
}

.round-score-chip small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.round-score-chip strong {
  font-size: 1.55rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.round-score-chip span {
  font-size: 1.12rem;
  line-height: 1;
}

.category-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-pill {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--panel-strong);
  font-size: 0.78rem;
  font-weight: 850;
}

.share-text {
  width: 100%;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--panel-strong);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.final-actions {
  max-width: none;
}

.leaderboard-board {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.leaderboard-header,
.leaderboard-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.leaderboard-header h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.1;
}

.leaderboard-header small,
.leaderboard-card-title small,
.leaderboard-status {
  color: var(--muted);
  font-weight: 800;
}

.leaderboard-status {
  margin: 0;
}

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

.leaderboard-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(216, 210, 195, 0.86);
  border-radius: 8px;
  background: var(--panel-strong);
}

.compact-leaderboard {
  margin-top: 8px;
}

.compact-leaderboard li {
  padding: 8px 0;
}

.compact-leaderboard b {
  font-variant-numeric: tabular-nums;
}

.leaderboard-empty {
  color: var(--muted);
  font-weight: 800;
}

.final-site-link {
  display: block;
  padding-top: 4px;
  color: var(--lake);
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.progress-dock {
  left: 18px;
  bottom: 18px;
}

.map-toolbar {
  bottom: 104px;
}

@media (max-width: 760px) {
  .modal-backdrop {
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
    padding: 16px;
  }

  .modal-panel h1 {
    font-size: 1.65rem;
    line-height: 1.05;
  }

  .onboarding-note {
    font-size: 0.9rem;
  }

  .training-card {
    top: 138px;
    padding: 14px;
  }

  .training-card h1 {
    font-size: 1.35rem;
  }

  .training-callout {
    margin-top: 10px;
    font-size: 0.92rem;
  }

  .field-label {
    margin-top: 10px;
  }

  .modal-actions .primary-button {
    width: 100%;
  }

  .prompt-strip {
    top: 70px;
    width: calc(100vw - 20px);
    min-height: 0;
    padding: 10px;
    gap: 8px;
    flex-direction: row;
    align-items: center;
  }

  .prompt-strip h2 {
    font-size: 0.92rem;
  }

  .prompt-strip p:not(.eyebrow) {
    display: none;
  }

  .prompt-strip .score-pill {
    width: 76px;
    min-width: 76px;
    height: 42px;
    grid-template-columns: 1fr;
    gap: 0;
  }

  .prompt-strip .score-pill span {
    font-size: 1rem;
  }

  .prompt-strip .score-pill small {
    font-size: 0.58rem;
  }

  .feedback-panel {
    top: 50%;
    left: 10px;
    right: 10px;
    bottom: auto;
    width: calc(100vw - 20px);
    max-height: 50vh;
    transform: translateY(-50%);
  }

  .feedback-panel.final-result {
    top: 50%;
    left: 10px;
    right: 10px;
    bottom: auto;
    width: calc(100vw - 20px);
    max-height: 72vh;
    padding: 14px;
    transform: translateY(-50%);
  }

  .final-result h2 {
    font-size: 1.25rem;
  }

  .final-score strong {
    font-size: 3.45rem;
  }

  .round-score-row {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    gap: 5px;
  }

  .round-score-chip {
    min-height: 70px;
    padding: 8px 4px;
  }

  .round-score-chip strong {
    font-size: 1.25rem;
  }

  .round-score-chip span {
    font-size: 1.12rem;
  }

  .final-actions {
    max-width: none;
  }

  .leaderboard-grid {
    grid-template-columns: 1fr;
  }

  .progress-dock {
    left: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .map-toolbar {
    right: 10px;
    bottom: 96px;
  }
}
