:root {
  --paper: #f5f3ed;
  --surface: #ffffff;
  --surface-soft: #ecefe9;
  --ink: #17201d;
  --muted: #68736d;
  --line: #d7ddd8;
  --forest: #173b35;
  --forest-2: #245e53;
  --coral: #ff6f59;
  --coral-dark: #c84836;
  --lime: #cfe66f;
  --sky: #72b7d2;
  --yellow: #f3c94f;
  --danger: #af352d;
  --shadow: 0 8px 28px rgba(28, 49, 43, 0.09);
  --header-height: 70px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans TC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 2px solid var(--forest);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid rgba(215, 221, 216, 0.9);
  background: rgba(245, 243, 237, 0.94);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1440px, 100%);
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-size: 20px;
  font-weight: 850;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--forest);
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 7px;
  width: 0;
  height: 0;
  border-right: 9px solid transparent;
  border-bottom: 17px solid var(--paper);
  border-left: 9px solid transparent;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 6px;
  bottom: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-soft);
  color: var(--ink);
}

.header-search {
  position: relative;
  max-width: 420px;
  margin-left: auto;
  flex: 1;
}

.header-search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  transform: translateY(-50%);
  color: var(--muted);
}

.header-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--surface);
}

.header-search input:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(36, 94, 83, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button {
  padding: 0 16px;
  font-size: 14px;
  font-weight: 800;
}

.button svg {
  width: 17px;
  height: 17px;
}

.button-primary {
  background: var(--forest);
  color: white;
}

.button-primary:hover {
  background: #0f2d28;
}

.button-coral {
  background: var(--coral);
  color: #24130f;
}

.button-coral:hover {
  background: #ff826e;
}

.button-danger {
  background: var(--danger);
  color: white;
}

.button-danger:hover {
  background: #8e2924;
}

.button-secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: #aab5ae;
  background: #fafbf9;
}

.button-ghost {
  background: transparent;
  color: var(--forest);
}

.button-ghost:hover {
  background: var(--surface-soft);
}

.button-wide {
  width: 100%;
}

.button-small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.text-button {
  min-height: 36px;
  margin-top: 8px;
  background: transparent;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.icon-button {
  width: 40px;
  min-width: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.icon-button:hover {
  border-color: #aab5ae;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.mobile-nav {
  display: none;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 30px 28px 60px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.community-pulse {
  position: relative;
  min-height: 50px;
  margin: -8px 0 12px;
  padding: 0 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 24px;
  border-radius: 6px;
  background: var(--forest);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 700;
}

.community-pulse::after {
  content: "";
  position: absolute;
  top: 0;
  left: -90px;
  width: 90px;
  height: 2px;
  background: var(--coral);
  animation: pulse-scan 6s linear infinite;
}

.community-pulse strong {
  color: white;
  font-size: 16px;
}

.community-pulse svg {
  width: 16px;
  height: 16px;
}

.pulse-label,
.pulse-verified {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pulse-label {
  color: var(--lime);
  font-weight: 850;
}

.pulse-verified {
  margin-left: auto;
}

@keyframes pulse-scan {
  to {
    transform: translateX(calc(100vw + 180px));
  }
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.08;
}

h2 {
  margin-bottom: 6px;
  font-size: 23px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 5px;
  font-size: 16px;
}

.subheading,
.muted {
  color: var(--muted);
}

.subheading {
  max-width: 680px;
  margin-bottom: 0;
  line-height: 1.65;
}

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

.section-heading p {
  margin-bottom: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.76fr) minmax(520px, 1.24fr);
  height: 610px;
  min-height: 610px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.gym-panel {
  z-index: 2;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

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

.mobile-search {
  display: none;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.filter-chip.active {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.filter-chip svg {
  width: 14px;
}

.result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 2px 8px;
  color: var(--muted);
  font-size: 13px;
}

.gym-list {
  max-height: 490px;
  overflow-y: auto;
  padding: 0 10px 10px;
}

.gym-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 140ms ease;
}

.gym-row:hover,
.gym-row.selected {
  background: #f3f6f2;
}

.gym-thumb {
  position: relative;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-soft);
}

.gym-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gym-row-content {
  min-width: 0;
}

.gym-photo-credit {
  display: none;
  align-items: baseline;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 3px;
  min-width: 0;
  margin-top: 6px;
  color: #5e5e5e;
  font-size: 12px;
  line-height: 1.35;
}

.gym-photo-credit.is-visible {
  display: grid;
}

.gym-photo-credit > span:first-child {
  white-space: nowrap;
}

.gym-photo-authors {
  min-width: 0;
  overflow-wrap: anywhere;
}

.gym-photo-authors a {
  color: #3f514d;
}

.google-maps-attribution {
  flex: 0 0 auto;
  color: #5e5e5e;
  font-family: Roboto, Arial, sans-serif;
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0;
  white-space: nowrap;
}

.gym-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.gym-row-top > div:first-child {
  min-width: 0;
}

.gym-row-actions {
  display: flex;
  min-width: max-content;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.favorite-button {
  display: inline-grid;
  width: 30px;
  height: 30px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.favorite-button:hover {
  border-color: var(--coral);
  color: var(--coral-dark);
}

.favorite-button.active {
  border-color: #f2b9ae;
  background: #fff0ed;
  color: var(--coral-dark);
}

.favorite-button.active svg {
  fill: currentColor;
}

.favorite-button svg {
  width: 15px;
  height: 15px;
}

.gym-row h3 {
  margin: 1px 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gym-meta,
.route-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.gym-meta span,
.route-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gym-meta svg,
.route-meta svg {
  width: 13px;
  height: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4aa878;
}

.status.closed {
  color: var(--muted);
}

.status.closed::before {
  background: #9aa39e;
}

.gym-row-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.tiny-avatars {
  display: flex;
  align-items: center;
}

.tiny-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  margin-left: -6px;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--sky);
  color: #132d36;
  font-size: 9px;
  font-weight: 900;
}

.tiny-avatar:first-child {
  margin-left: 0;
}

.verified-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.verified-source svg {
  width: 14px;
  height: 14px;
  color: var(--forest-2);
}

.route-count {
  color: var(--forest);
  font-size: 12px;
  font-weight: 800;
}

.map-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.map-location-button {
  position: absolute;
  z-index: 500;
  top: 16px;
  right: 16px;
  display: inline-flex;
  min-height: 38px;
  padding: 0 12px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(215, 221, 216, 0.85);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 14px rgba(18, 50, 42, 0.12);
  color: var(--forest);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.map-location-button svg {
  width: 16px;
}

.map-location-button.loading svg {
  animation: locate-pulse 900ms ease-in-out infinite alternate;
}

@keyframes locate-pulse {
  to {
    opacity: 0.35;
  }
}

#gym-map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #dfe8e4;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.leaflet-popup-content-wrapper {
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 12px;
}

.map-popup {
  min-width: 240px;
  overflow: hidden;
}

.map-popup-image {
  width: 100%;
  height: 118px;
  object-fit: cover;
}

.map-popup-image-wrap {
  position: relative;
}

.map-popup-image-note,
.gym-hero-photo-note {
  position: absolute;
  z-index: 3;
  padding: 5px 7px;
  border-radius: 4px;
  background: rgba(20, 30, 27, 0.82);
  color: white;
  font-size: 10px;
  font-weight: 750;
}

.map-popup-image-note {
  right: 7px;
  bottom: 7px;
}

.map-popup-body {
  padding: 11px 12px 12px;
}

.map-popup-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.map-popup strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.map-popup span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.map-popup .popup-hours {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 750;
}

.map-popup .popup-hours.open {
  color: #267653;
}

.map-popup-links {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.map-popup a {
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 850;
}

.leaflet-popup-content {
  min-width: 240px;
}

.leaflet-popup-content-wrapper {
  overflow: hidden;
}

.leaflet-popup-content .map-popup {
  margin: -12px;
}

.map-marker {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 3px solid white;
  border-radius: 50% 50% 50% 12%;
  background: var(--forest);
  box-shadow: 0 4px 12px rgba(20, 48, 42, 0.28);
  color: white;
  font-size: 12px;
  font-weight: 900;
  transform: rotate(-45deg);
}

.map-marker.open {
  background: #236d50;
  box-shadow:
    0 0 0 5px rgba(56, 151, 108, 0.2),
    0 4px 12px rgba(20, 48, 42, 0.28);
}

.map-marker.closed {
  background: #68736d;
}

.map-marker span {
  transform: rotate(45deg);
}

.user-location-marker {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(66, 133, 244, 0.18);
  animation: user-location-pulse 1.6s ease-out infinite;
}

.user-location-marker span {
  position: absolute;
  inset: 9px;
  border: 3px solid white;
  border-radius: 50%;
  background: #2f78df;
  box-shadow: 0 2px 8px rgba(21, 65, 128, 0.3);
}

@keyframes user-location-pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(66, 133, 244, 0.08);
  }
}

.map-summary {
  position: absolute;
  z-index: 500;
  top: 16px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(215, 221, 216, 0.8);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 4px 14px rgba(18, 50, 42, 0.12);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  transform: translateX(-50%);
}

.map-summary svg {
  width: 15px;
}

.content-section {
  margin-top: 44px;
}

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

.route-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.route-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.route-image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #dde3df;
}

.route-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.route-card:hover img {
  transform: scale(1.025);
}

.grade-badge {
  display: grid;
  position: absolute;
  top: 10px;
  left: 10px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 2px 8px rgba(23, 32, 29, 0.18);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.route-color {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 22px;
  height: 22px;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(23, 32, 29, 0.15);
}

.color-blue {
  background: #2d76db;
}

.color-coral {
  background: #f15d48;
}

.color-lime {
  background: #c9e44c;
}

.color-white {
  background: #f7f5eb;
}

.color-black {
  background: #232725;
}

.route-card-body {
  padding: 14px;
}

.route-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.route-card-title h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-card-title svg {
  width: 16px;
  min-width: 16px;
  color: var(--muted);
}

.route-card .route-meta {
  margin-top: 11px;
}

.route-tags,
.gym-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-tags {
  margin-top: 12px;
}

.tag {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: #4f5c55;
  font-size: 11px;
  font-weight: 750;
}

.ad-slot {
  display: none;
}

.ad-slot.is-enabled {
  display: block;
  padding: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.gym-hero {
  position: relative;
  min-height: min(54vh, 520px);
  overflow: hidden;
  background: #213b35;
}

.gym-hero.no-photo {
  min-height: 390px;
  border-bottom: 8px solid var(--coral);
  background: #173b35;
}

.gym-hero.no-photo::before {
  content: "";
  position: absolute;
  top: 0;
  right: max(7vw, 32px);
  width: 9px;
  height: 100%;
  background: rgba(244, 184, 78, 0.72);
}

.gym-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gym-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 31, 27, 0.86), rgba(13, 31, 27, 0.28) 62%, rgba(13, 31, 27, 0.06));
}

.gym-hero.no-photo::after {
  background: rgba(7, 28, 24, 0.22);
}

.gym-hero-photo-note {
  right: 18px;
  bottom: 16px;
}

.gym-hero-photo-credit {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 16px;
  max-width: min(70%, 520px);
  padding: 6px 9px;
  border-radius: 4px;
  background: rgba(9, 25, 22, 0.84);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  line-height: 1.4;
}

.gym-hero-photo-credit a {
  color: white;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gym-hero-photo-credit .google-maps-attribution {
  color: white;
  font-weight: 400;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 74px 28px 50px;
  color: white;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 56px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  font-weight: 800;
}

.back-link svg {
  width: 16px;
}

.hero-content h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 62px);
}

.hero-address {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.82);
}

.hero-address svg {
  width: 17px;
}

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

.hero-actions .button-secondary {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.92);
}

.stats-band {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.gym-tabs-band {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.gym-tabs {
  display: flex;
  width: min(1180px, 100%);
  min-height: 56px;
  margin: 0 auto;
  padding: 0 28px;
  align-items: stretch;
  gap: 28px;
}

.gym-tab {
  position: relative;
  display: inline-flex;
  min-width: 92px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
}

.gym-tab svg {
  width: 17px;
}

.gym-tab span {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  font-size: 11px;
}

.gym-tab.active {
  color: var(--forest);
}

.gym-tab.active::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: var(--coral);
}

.stats-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 20px 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  padding: 2px 26px;
  border-right: 1px solid var(--line);
}

.stat:first-child {
  padding-left: 0;
}

.stat:last-child {
  border-right: 0;
}

.stat strong {
  display: block;
  margin-bottom: 3px;
  font-size: 22px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.gym-content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 34px 28px 80px;
}

.gym-tab-panel {
  min-height: 260px;
}

.gym-tab-panel > .route-toolbar {
  margin-top: 0;
}

.place-photo-section {
  margin-bottom: 34px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.place-photo-section .section-heading {
  margin-bottom: 14px;
}

.place-photo-host {
  width: min(500px, 100%);
  min-height: 126px;
}

.place-photo-host gmp-place-details-compact {
  width: min(500px, 100%);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color-scheme: light;
}

.place-photo-loading,
.place-photo-error,
.place-photo-pending {
  display: flex;
  min-height: 112px;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f8f6;
}

.place-photo-loading {
  width: min(500px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.place-photo-loading svg {
  animation: spin 900ms linear infinite;
}

.place-photo-pending > svg,
.place-photo-error > svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--forest);
}

.place-photo-pending div,
.place-photo-error div {
  flex: 1;
}

.place-photo-pending p,
.place-photo-error p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.place-photo-error a {
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.gym-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 24px;
  align-items: start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.gym-side-info {
  min-width: 0;
}

.gym-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.opening-hours {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.opening-hours-title {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.opening-hours-title h3 {
  margin: 0;
}

.hours-row {
  display: flex;
  min-height: 34px;
  padding: 0 6px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid #e8ebe8;
  color: var(--muted);
  font-size: 12px;
}

.hours-row strong {
  color: var(--ink);
  font-weight: 750;
}

.hours-row.today {
  background: #eef4f0;
  color: var(--forest);
  font-weight: 800;
}

.hours-note {
  padding: 14px 6px;
  border-top: 1px solid #e8ebe8;
  color: var(--forest);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

.verified-at {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.open-text {
  color: #267653;
}

.gym-intro p {
  max-width: 720px;
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.route-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 18px;
}

.route-toolbar .filter-row {
  flex: 1;
}

.route-toolbar select {
  min-width: 140px;
  height: 38px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.gym-content .route-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.route-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 26px 28px 80px;
}

.route-page > .back-link {
  margin-bottom: 20px;
  color: var(--muted);
}

.route-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.75fr);
  gap: 34px;
  align-items: start;
}

.route-photo {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #dce1dd;
}

.route-photo img {
  width: 100%;
  max-height: 720px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.route-photo .grade-badge {
  top: 16px;
  left: 16px;
  width: 52px;
  height: 52px;
  font-size: 16px;
}

.route-info {
  position: sticky;
  top: calc(var(--header-height) + 22px);
}

.route-info-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.route-info h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 48px);
}

.route-info .route-meta {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.route-description {
  margin: 20px 0;
  color: #3f4a45;
  line-height: 1.7;
}

.route-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.send-button.sent {
  border-color: var(--forest);
  background: var(--forest);
  color: white;
}

.is-bookmarked {
  border-color: #d7b343;
  background: #fff9df;
}

.is-bookmarked svg,
.route-card-bookmark.active svg {
  fill: currentColor;
  color: #947313;
}

.route-card-bookmark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
}

.route-facts {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.route-report-link {
  margin-top: 14px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.route-report-link svg {
  width: 14px;
}

.fact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.fact-row span {
  color: var(--muted);
}

.thread-section {
  margin-top: 46px;
}

.beta-player {
  margin-bottom: 34px;
}

.beta-note {
  margin-top: 12px;
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  border-left: 3px solid var(--yellow);
  background: #fffdf3;
  color: #4f4a36;
}

.beta-note svg {
  width: 18px;
  margin-top: 1px;
}

.beta-note p {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.65;
}

.video-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #111;
  aspect-ratio: 16 / 9;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.comment-composer {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 16px 0 22px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.composer-box {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.composer-box textarea {
  display: block;
  width: 100%;
  min-height: 86px;
  padding: 13px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  line-height: 1.55;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: #fafbf9;
}

.comment-list {
  padding-top: 4px;
}

.comment {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-header strong {
  font-size: 13px;
}

.comment-time {
  color: var(--muted);
  font-size: 11px;
}

.comment-kind {
  padding: 3px 6px;
  border-radius: 4px;
  background: #e9f0ee;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 850;
}

.comment-body {
  margin-bottom: 10px;
  line-height: 1.65;
}

.comment-actions {
  display: flex;
  gap: 14px;
}

.comment-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.comment-action svg {
  width: 14px;
}

.inline-beta {
  width: min(420px, 100%);
  margin: 12px 0;
}

.profile-page {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 30px 28px 80px;
}

.profile-hero {
  position: relative;
  min-height: 330px;
  padding: 54px 58px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: center;
  border-radius: 8px;
  background: var(--forest);
  color: white;
}

.profile-hero::after {
  content: "";
  position: absolute;
  right: 34%;
  bottom: 0;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.08);
}

.profile-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 650px;
}

.profile-hero .eyebrow,
.profile-gate .eyebrow {
  color: var(--lime);
}

.profile-hero h1 {
  max-width: 620px;
  font-size: clamp(36px, 5vw, 62px);
}

.profile-hero p:not(.eyebrow) {
  max-width: 580px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
}

.route-thread {
  position: relative;
  z-index: 1;
  width: 390px;
  height: 260px;
  justify-self: end;
}

.route-segment,
.route-hold {
  position: absolute;
  display: block;
}

.route-segment {
  width: 92px;
  height: 5px;
  transform-origin: left center;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.28);
}

.segment-a {
  left: 46px;
  bottom: 43px;
  transform: rotate(-57deg);
}

.segment-b {
  left: 98px;
  bottom: 119px;
  transform: rotate(19deg);
}

.segment-c {
  left: 182px;
  bottom: 90px;
  transform: rotate(-49deg);
}

.segment-d {
  left: 235px;
  bottom: 159px;
  transform: rotate(-12deg);
}

.route-hold {
  width: 42px;
  height: 28px;
  border: 5px solid rgba(23, 59, 53, 0.45);
  border-radius: 58% 42% 50% 38%;
  background: var(--coral);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.14);
  animation: hold-breathe 3.2s ease-in-out infinite;
}

.hold-a {
  left: 25px;
  bottom: 20px;
}

.hold-b {
  left: 85px;
  bottom: 101px;
  width: 34px;
  height: 44px;
  border-radius: 44% 56% 38% 62%;
  background: var(--yellow);
  animation-delay: 0.35s;
}

.hold-c {
  left: 171px;
  bottom: 71px;
  width: 46px;
  height: 31px;
  background: var(--sky);
  animation-delay: 0.7s;
}

.hold-d {
  left: 224px;
  bottom: 143px;
  width: 36px;
  height: 37px;
  background: var(--lime);
  animation-delay: 1.05s;
}

.hold-e {
  left: 316px;
  bottom: 165px;
  width: 50px;
  height: 26px;
  animation-delay: 1.4s;
}

@keyframes hold-breathe {
  50% {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 rgba(0, 0, 0, 0.1);
  }
}

.profile-stats {
  min-height: 116px;
  margin-bottom: 34px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.profile-stats > div {
  min-width: 0;
  padding: 24px 28px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-right: 1px solid var(--line);
}

.profile-stats > div:last-child {
  border-right: 0;
}

.profile-stats strong {
  overflow-wrap: anywhere;
  font-size: 26px;
  line-height: 1.1;
}

.profile-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 34px;
  align-items: start;
}

.rhythm-panel,
.badge-panel {
  min-width: 0;
}

.rhythm-panel {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rhythm-total,
.badge-count {
  color: var(--forest-2);
  font-size: 13px;
  font-weight: 850;
}

.rhythm-chart {
  height: 224px;
  padding-top: 20px;
  display: grid;
  grid-template-columns: repeat(7, minmax(28px, 1fr));
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.rhythm-day {
  height: 100%;
  display: grid;
  grid-template-rows: 22px 1fr 28px;
  align-items: end;
  justify-items: center;
  gap: 5px;
}

.rhythm-value {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.rhythm-bar {
  width: min(34px, 100%);
  height: var(--bar-height);
  min-height: 6px;
  align-self: end;
  border-radius: 5px 5px 0 0;
  background: var(--forest-2);
  transform-origin: bottom;
  animation: bar-rise 500ms ease-out both;
}

.rhythm-day:nth-child(3n + 2) .rhythm-bar {
  background: var(--coral);
}

.rhythm-day:nth-child(3n) .rhythm-bar {
  background: var(--sky);
}

.rhythm-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

@keyframes bar-rise {
  from {
    transform: scaleY(0);
  }
}

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

.achievement {
  min-height: 132px;
  padding: 17px;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.achievement-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
}

.achievement-icon svg {
  width: 20px;
}

.achievement.unlocked {
  border-color: #b8c97a;
  background: #fbfdef;
}

.achievement.unlocked .achievement-icon {
  background: var(--lime);
  color: var(--forest);
}

.achievement h3 {
  margin-bottom: 3px;
  font-size: 14px;
}

.achievement p {
  min-height: 32px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.achievement small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.achievement-progress {
  height: 4px;
  margin-bottom: 5px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-soft);
}

.achievement-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--forest-2);
}

.activity-section {
  margin-top: 46px;
}

.activity-list {
  border-top: 1px solid var(--line);
}

.activity-row {
  min-height: 108px;
  padding: 18px 4px;
  display: grid;
  grid-template-columns: 72px 112px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.activity-row time {
  display: grid;
  gap: 2px;
}

.activity-row time strong {
  font-size: 17px;
}

.activity-row time span,
.activity-main p {
  color: var(--muted);
  font-size: 12px;
}

.activity-discipline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--forest-2);
  font-size: 12px;
  font-weight: 800;
}

.activity-discipline svg {
  width: 15px;
}

.activity-main {
  min-width: 0;
}

.activity-main h3 {
  margin-bottom: 4px;
}

.activity-main p {
  margin-bottom: 0;
}

.activity-main .activity-note {
  margin-top: 7px;
  color: #47534d;
  line-height: 1.55;
}

.activity-delete {
  color: var(--muted);
}

.activity-empty {
  min-height: 260px;
  padding: 44px 20px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.activity-empty > svg {
  width: 34px;
  height: 34px;
  margin-bottom: 12px;
  color: var(--forest-2);
}

.activity-empty p {
  margin-bottom: 18px;
  color: var(--muted);
}

.profile-locked {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
}

.profile-gate {
  position: relative;
  width: min(880px, 100%);
  min-height: 420px;
  padding: 70px 390px 70px 58px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--forest);
  color: white;
}

.profile-gate h1 {
  font-size: 46px;
}

.profile-gate > p:not(.eyebrow) {
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.7;
}

.route-thread-gate {
  position: absolute;
  right: 10px;
  bottom: 70px;
}

.donate-page {
  min-height: calc(100vh - var(--header-height));
}

.donate-hero {
  position: relative;
  min-height: 440px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--forest);
  color: white;
}

.donate-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
}

.donate-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 42, 36, 0.96), rgba(15, 42, 36, 0.45));
}

.donate-copy {
  position: relative;
  z-index: 2;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 70px 28px 58px;
}

.coffee-visual {
  position: absolute;
  z-index: 2;
  right: max(8vw, 80px);
  bottom: 70px;
  width: 230px;
  height: 230px;
}

.coffee-cup {
  position: absolute;
  right: 28px;
  bottom: 18px;
  width: 150px;
  height: 112px;
  border: 8px solid rgba(255, 255, 255, 0.86);
  border-top-width: 14px;
  border-radius: 8px 8px 48px 48px;
  background: rgba(23, 59, 53, 0.46);
  transform: rotate(-3deg);
}

.coffee-handle {
  position: absolute;
  right: 2px;
  bottom: 49px;
  width: 58px;
  height: 63px;
  border: 8px solid rgba(255, 255, 255, 0.86);
  border-left: 0;
  border-radius: 0 34px 34px 0;
}

.steam {
  position: absolute;
  top: 24px;
  width: 6px;
  height: 74px;
  border-radius: 4px;
  background: var(--lime);
  opacity: 0.8;
  animation: steam-rise 2.4s ease-in-out infinite;
}

.steam-one {
  left: 76px;
}

.steam-two {
  left: 123px;
  height: 56px;
  animation-delay: 0.8s;
}

@keyframes steam-rise {
  50% {
    opacity: 0.35;
    transform: translateY(-16px) rotate(5deg);
  }
}

.donate-copy h1 {
  max-width: 720px;
  font-size: clamp(36px, 6vw, 68px);
}

.donate-copy p {
  max-width: 620px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 17px;
  line-height: 1.7;
}

.donate-content {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 46px 28px 80px;
}

.donate-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 50px;
}

.amount-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 20px 0;
}

.amount-button {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 850;
}

.amount-button span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.amount-button.selected {
  border-color: var(--forest);
  box-shadow: inset 0 0 0 2px var(--forest);
  background: #f1f6f3;
}

.support-note {
  padding: 14px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.fund-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.fund-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.fund-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--forest);
}

.fund-icon svg {
  width: 19px;
}

.fund-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.transparency-box {
  margin-top: 26px;
  padding: 18px;
  border-left: 4px solid var(--yellow);
  background: #fffdf3;
}

.transparency-box p {
  margin-bottom: 0;
  color: #625d46;
  font-size: 13px;
  line-height: 1.6;
}

.app-footer {
  width: min(1440px, 100%);
  min-height: 92px;
  margin: 0 auto;
  padding: 26px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.app-footer > div {
  display: grid;
  gap: 3px;
}

.app-footer strong {
  color: var(--ink);
  font-size: 14px;
}

.app-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-weight: 750;
}

.app-footer a:hover {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-page {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 58px 28px 90px;
}

.legal-page > header {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.legal-page > header h1 {
  font-size: clamp(38px, 6vw, 66px);
}

.legal-page > header > p:not(.eyebrow) {
  max-width: 680px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.legal-page time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.legal-sections section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.legal-sections h2 {
  font-size: 19px;
}

.legal-sections p {
  max-width: 760px;
  margin-bottom: 0;
  color: #4c5852;
  line-height: 1.85;
}

.account-policy-links {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.account-policy-links button {
  padding: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font: inherit;
}

.danger-notice {
  border-color: #efb7b1;
  background: #fff2f0;
}

.modal-backdrop {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  padding: 18px;
  place-items: center;
  background: rgba(12, 24, 21, 0.6);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(620px, 100%);
  max-height: min(90vh, 800px);
  overflow-y: auto;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(10, 24, 20, 0.28);
}

.modal-small {
  width: min(440px, 100%);
}

.modal-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.modal-header h2 {
  margin-bottom: 3px;
}

.modal-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  padding: 20px 22px 24px;
}

.setup-notice {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 11px;
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid #e4c768;
  border-radius: 6px;
  background: #fffbed;
}

.setup-notice svg {
  width: 21px;
  color: #745f12;
}

.setup-notice p {
  margin: 3px 0 0;
  color: #6b6038;
  font-size: 11px;
  line-height: 1.5;
}

.setup-notice .button {
  grid-column: 2;
  justify-self: start;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
}

.auth-mode-switch button {
  min-height: 36px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.auth-mode-switch button.active {
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(20, 40, 34, 0.08);
  color: var(--forest);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.upload-guide {
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9f5;
}

.upload-guide summary {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--forest);
  font-size: 13px;
  font-weight: 850;
  list-style: none;
}

.upload-guide summary::-webkit-details-marker {
  display: none;
}

.upload-guide summary > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.upload-guide summary svg {
  width: 17px;
  height: 17px;
  transition: transform 160ms ease;
}

.upload-guide[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.upload-guide[open] summary > svg {
  transform: rotate(180deg);
}

.upload-guide ol {
  margin: 0;
  padding: 15px;
  display: grid;
  gap: 13px;
  list-style: none;
}

.upload-guide li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}

.guide-step-number {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 11px;
  font-weight: 850;
}

.upload-guide strong {
  display: block;
  margin-top: 2px;
  font-size: 12px;
}

.upload-guide p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest-2);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.guide-link svg {
  width: 13px;
  height: 13px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.image-upload {
  position: relative;
  min-height: 150px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px dashed #9eaaa3;
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.image-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.image-upload-placeholder {
  padding: 22px;
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--forest-2);
  text-align: center;
  font-size: 12px;
  font-weight: 850;
}

.image-upload-placeholder svg {
  width: 26px;
  height: 26px;
}

.image-upload-preview {
  display: none;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #101714;
}

.image-upload.has-preview {
  border-style: solid;
  background: #101714;
}

.image-upload.has-preview .image-upload-placeholder {
  display: none;
}

.image-upload.has-preview .image-upload-preview {
  display: block;
}

.discipline-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.discipline-field legend {
  margin-bottom: 7px;
  padding: 0;
  font-size: 12px;
  font-weight: 800;
}

.segmented-input {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.segmented-input label {
  min-width: 0;
  cursor: pointer;
}

.segmented-input input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-input span {
  min-height: 36px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.segmented-input input:checked + span {
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(20, 40, 34, 0.1);
  color: var(--forest);
}

.segmented-input input:focus-visible + span {
  outline: 2px solid var(--forest-2);
  outline-offset: -2px;
}

.confirmation-copy {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.form-field label {
  font-size: 12px;
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
}

.form-field input,
.form-field select {
  height: 42px;
  padding: 0 11px;
}

.form-field textarea {
  min-height: 92px;
  padding: 10px 11px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 3px rgba(36, 94, 83, 0.1);
}

.field-help {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.captcha-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.captcha-field > span {
  font-size: 12px;
  font-weight: 800;
}

.captcha-field [data-turnstile-action] {
  min-height: 65px;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 9px;
  align-items: start;
  color: #4e5a54;
  font-size: 12px;
  line-height: 1.5;
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  accent-color: var(--forest);
}

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

.login-provider {
  width: 100%;
  min-height: 46px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 11px;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.empty-state {
  padding: 54px 20px;
  border: 1px dashed #bbc4be;
  border-radius: 8px;
  text-align: center;
}

.empty-state svg {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: var(--muted);
}

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

.missing-gym-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 42px;
  padding: 30px 32px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f4f7f5;
}

.missing-gym-band .eyebrow {
  margin-bottom: 6px;
}

.missing-gym-band h2 {
  margin-bottom: 7px;
}

.missing-gym-band p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.missing-gym-band .button {
  flex: 0 0 auto;
}

.toast {
  position: fixed;
  z-index: 3000;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 13px 16px;
  border-radius: 6px;
  background: var(--ink);
  box-shadow: 0 10px 36px rgba(8, 25, 20, 0.24);
  color: white;
  font-size: 13px;
  font-weight: 750;
  animation: toast-in 180ms ease-out;
}

.toast svg {
  width: 17px;
  min-width: 17px;
  color: var(--lime);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1050px) {
  .desktop-nav {
    display: none;
  }

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

  .home-grid {
    grid-template-columns: minmax(310px, 0.82fr) minmax(430px, 1.18fr);
  }

  .profile-hero {
    grid-template-columns: minmax(0, 1fr) 320px;
    padding: 48px 42px;
  }

  .route-thread {
    width: 320px;
    transform: scale(0.85);
    transform-origin: right center;
  }

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

@media (max-width: 820px) {
  :root {
    --header-height: 60px;
  }

  body {
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }

  .app-header {
    height: var(--header-height);
  }

  .header-inner {
    padding: 0 16px;
  }

  .brand {
    font-size: 18px;
  }

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

  .header-search,
  .header-actions .button-primary {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  .mobile-nav {
    position: fixed;
    z-index: 900;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: calc(62px + env(safe-area-inset-bottom));
    padding: 7px 8px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
  }

  .mobile-nav a,
  .mobile-nav button {
    display: grid;
    min-width: 0;
    place-items: center;
    gap: 3px;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
  }

  .mobile-nav svg {
    width: 20px;
    height: 20px;
  }

  .mobile-nav .active {
    color: var(--forest);
  }

  .page-shell {
    padding: 22px 16px 40px;
  }

  .app-footer {
    padding: 24px 16px 90px;
    align-items: flex-start;
    flex-direction: column;
  }

  .app-footer nav {
    gap: 12px 18px;
  }

  .legal-page {
    padding: 38px 16px 70px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .button {
    width: 100%;
    margin-top: 16px;
  }

  .community-pulse {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px 16px;
    padding: 12px 16px;
  }

  .pulse-verified {
    margin-left: 0;
  }

  .home-grid {
    display: flex;
    height: auto;
    min-height: 0;
    flex-direction: column-reverse;
  }

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

  .mobile-search {
    position: relative;
    display: block;
    margin-bottom: 12px;
  }

  .mobile-search svg {
    position: absolute;
    top: 50%;
    left: 12px;
    width: 17px;
    transform: translateY(-50%);
    color: var(--muted);
  }

  .mobile-search input {
    width: 100%;
    height: 42px;
    padding: 0 12px 0 39px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
  }

  .gym-list {
    max-height: none;
  }

  #gym-map {
    height: 42vh;
    min-height: 320px;
  }

  .route-grid,
  .gym-content .route-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gym-hero {
    min-height: 440px;
  }

  .gym-hero.no-photo {
    min-height: 360px;
  }

  .gym-hero-photo-credit {
    right: 12px;
    bottom: 10px;
    max-width: calc(100% - 24px);
  }

  .gym-hero::after {
    background: linear-gradient(0deg, rgba(13, 31, 27, 0.92), rgba(13, 31, 27, 0.12) 80%);
  }

  .hero-content {
    padding: 44px 18px 34px;
  }

  .back-link {
    margin-bottom: 124px;
  }

  .stats-inner {
    padding: 16px;
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 9px 14px;
  }

  .stat:nth-child(2) {
    border-right: 0;
  }

  .stat:nth-child(3),
  .stat:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .stat:nth-child(3) {
    padding-left: 0;
  }

  .gym-content {
    padding: 26px 16px 46px;
  }

  .gym-tabs {
    min-height: 52px;
    padding: 0 16px;
    gap: 18px;
  }

  .gym-intro {
    grid-template-columns: 1fr;
  }

  .gym-side-actions {
    justify-content: flex-start;
  }

  .route-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .route-layout {
    grid-template-columns: 1fr;
  }

  .route-page {
    padding: 18px 16px 46px;
  }

  .route-page > .back-link {
    margin-bottom: 14px;
  }

  .route-info {
    position: static;
  }

  .profile-page {
    padding: 22px 16px 50px;
  }

  .profile-hero {
    min-height: 430px;
    padding: 42px 34px 190px;
    display: block;
  }

  .profile-hero::after {
    display: none;
  }

  .profile-hero .route-thread {
    position: absolute;
    right: 8px;
    bottom: -12px;
    transform: scale(0.72);
    transform-origin: right bottom;
  }

  .profile-stats {
    grid-template-columns: 1fr 1fr;
  }

  .profile-stats > div:nth-child(2) {
    border-right: 0;
  }

  .profile-stats > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .profile-gate {
    padding: 52px 34px 220px;
  }

  .route-thread-gate {
    right: 0;
    bottom: 8px;
    transform: scale(0.72);
    transform-origin: right bottom;
  }

  .donate-grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .coffee-visual {
    right: 26px;
    bottom: 36px;
    transform: scale(0.76);
    transform-origin: right bottom;
  }

  .missing-gym-band {
    align-items: stretch;
    padding: 26px 22px;
    flex-direction: column;
  }

  .missing-gym-band .button {
    width: 100%;
  }

  .place-photo-pending,
  .place-photo-error {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .place-photo-pending .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .page-heading h1 {
    font-size: 31px;
  }

  .home-grid {
    margin: 0 -16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .missing-gym-band {
    margin-right: -16px;
    margin-left: -16px;
    padding: 24px 16px;
  }

  .panel-toolbar {
    padding: 14px 16px;
  }

  .gym-list {
    padding: 0 8px 8px;
  }

  .gym-row {
    grid-template-columns: 82px 1fr;
    padding: 12px 8px;
  }

  .gym-row-top {
    display: block;
  }

  .gym-row h3 {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .gym-row-actions {
    margin-top: 6px;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  .map-location-button {
    right: 12px;
    width: 40px;
    min-width: 40px;
    padding: 0;
    justify-content: center;
  }

  .map-location-button span {
    display: none;
  }

  .gym-thumb {
    width: 82px;
    height: 88px;
  }

  .route-grid,
  .gym-content .route-grid {
    grid-template-columns: 1fr;
  }

  .route-card {
    display: grid;
    grid-template-columns: 42% 58%;
  }

  .route-image-wrap {
    height: 100%;
    min-height: 156px;
    aspect-ratio: auto;
  }

  .route-card-body {
    padding: 13px;
  }

  .hero-content h1 {
    font-size: 36px;
  }

  .hero-actions .button {
    flex: 1;
    padding: 0 10px;
  }

  .route-photo {
    margin: 0 -16px;
    border-radius: 0;
  }

  .route-photo img {
    aspect-ratio: 1 / 1;
  }

  .route-action-grid {
    grid-template-columns: 1fr;
  }

  .comment,
  .comment-composer {
    grid-template-columns: 34px 1fr;
  }

  .avatar {
    width: 34px;
    height: 34px;
  }

  .donate-hero {
    min-height: 470px;
  }

  .donate-copy {
    padding: 52px 18px 190px;
  }

  .donate-copy h1 {
    font-size: 40px;
  }

  .donate-content {
    padding: 34px 16px 50px;
  }

  .amount-options {
    grid-template-columns: 1fr;
  }

  .amount-button {
    min-height: 60px;
  }

  .coffee-visual {
    right: 16px;
    bottom: 14px;
    transform: scale(0.66);
  }

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

  .profile-hero {
    min-height: 450px;
    padding: 34px 22px 188px;
  }

  .profile-hero h1,
  .profile-gate h1 {
    font-size: 36px;
  }

  .profile-stats > div {
    padding: 18px 16px;
  }

  .profile-stats strong {
    font-size: 21px;
  }

  .rhythm-panel {
    padding: 20px 14px;
  }

  .rhythm-chart {
    gap: 6px;
  }

  .activity-row {
    grid-template-columns: 62px minmax(0, 1fr) 38px;
    gap: 10px;
  }

  .activity-discipline {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-top: 2px;
    justify-self: end;
  }

  .activity-main {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  .activity-delete {
    grid-column: 3;
    grid-row: 1 / 3;
  }

  .profile-gate {
    min-height: 500px;
    padding: 42px 22px 230px;
  }

  .segmented-input {
    grid-template-columns: 1fr 1fr;
  }

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

  .form-field.full {
    grid-column: auto;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 94vh;
    border-radius: 8px 8px 0 0;
  }

  .toast {
    right: 16px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    left: 16px;
  }
}

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