:root {
  --forest: #2f5d3a;
  --forest-dark: #234a2d;
  --campsite: #2f7d3a;
  --rest-area: #2f6db5;
  --rest-stop: #c97a1e;
  --fire: #d9480f;
  --bg: #f4f3ee;
  --ink: #1c2419;
  --muted: #5d6657;
  --card: #ffffff;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

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

/* Top bar */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(8px + var(--safe-top)) 14px 8px;
  background: linear-gradient(180deg, rgba(244, 243, 238, 0.97), rgba(244, 243, 238, 0));
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--card);
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.brand-mark {
  font-size: 18px;
}
.brand-name {
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--forest);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.spot-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--card);
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.lang-toggle {
  border: none;
  background: var(--card);
  color: var(--forest);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 11px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

/* Locate button */
.locate-btn {
  position: absolute;
  right: 14px;
  bottom: calc(86px + var(--safe-bottom));
  z-index: 1000;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  color: var(--forest);
  font-size: 22px;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.locate-btn.active {
  background: var(--forest);
  color: #fff;
}

/* Filters */
.filters {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar {
  display: none;
}
.filter-group {
  display: flex;
  gap: 6px;
}
.filter-divider {
  width: 1px;
  align-self: stretch;
  margin: 4px 2px;
  background: rgba(0, 0, 0, 0.12);
  flex: none;
}
.chip {
  flex: none;
  border: none;
  background: var(--card);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 13px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  opacity: 0.62;
  transition: opacity 0.12s, transform 0.08s;
}
.chip:active {
  transform: scale(0.96);
}
.chip.on {
  opacity: 1;
}
.chip.on.type-campsite {
  background: var(--campsite);
  color: #fff;
}
.chip.on.type-rest_area {
  background: var(--rest-area);
  color: #fff;
}
.chip.on.type-rest_stop {
  background: var(--rest-stop);
  color: #fff;
}
.chip.on.amenity {
  background: var(--forest-dark);
  color: #fff;
}

/* Map markers */
.pin {
  width: 24px;
  height: 24px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
}
.pin span {
  transform: rotate(45deg);
  font-size: 11px;
  line-height: 1;
}
.pin.type-campsite {
  background: var(--campsite);
}
.pin.type-rest_area {
  background: var(--rest-area);
}
.pin.type-rest_stop {
  background: var(--rest-stop);
}

/* Bottom sheet */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.25);
  padding: 18px 18px calc(20px + var(--safe-bottom));
  transform: translateY(110%);
  transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 70vh;
  overflow-y: auto;
}
.sheet.open {
  transform: translateY(0);
}
.sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: rgba(0, 0, 0, 0.06);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.sheet h2 {
  margin: 0 34px 4px 0;
  font-size: 19px;
}
.sheet .type-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}
.sheet .type-label.type-campsite {
  color: var(--campsite);
}
.sheet .type-label.type-rest_area {
  color: var(--rest-area);
}
.sheet .type-label.type-rest_stop {
  color: var(--rest-stop);
}
.amenity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}
.tag {
  font-size: 12.5px;
  font-weight: 600;
  background: #eef1ea;
  color: var(--forest-dark);
  padding: 5px 10px;
  border-radius: 8px;
}
.tag.fire {
  background: #fde4d8;
  color: var(--fire);
}
/* Ratings */
.rating-block {
  margin: 14px 0;
  padding: 14px;
  background: #f6f8f3;
  border-radius: 12px;
}
.rating-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.stars-static {
  font-size: 17px;
  letter-spacing: 1px;
  color: #d7dccf;
  white-space: nowrap;
}
.stars-static .star.on {
  color: #f5a623;
}
.rating-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.rating-text.muted {
  color: var(--muted);
  font-weight: 500;
}
.your-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.yr-label {
  font-size: 13px;
  color: var(--muted);
}
.stars-input {
  display: inline-flex;
}
.stars-input .star {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  padding: 0 2px;
  color: #d7dccf;
  transition: color 0.08s, transform 0.08s;
}
.stars-input .star.on {
  color: #f5a623;
}
.stars-input .star:active {
  transform: scale(1.2);
}
.auth-inline {
  margin-top: 12px;
}
.auth-inline[hidden] {
  display: none;
}
.auth-step {
  display: flex;
  gap: 8px;
}
.auth-step[hidden] {
  display: none;
}
.code-input {
  letter-spacing: 6px;
  font-weight: 700;
  text-align: center;
}
.auth-inline input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cdd4c4;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}
.btn-send {
  border: none;
  background: var(--forest);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-send:disabled {
  opacity: 0.6;
}
.rating-msg:not(:empty) {
  margin-top: 10px;
  font-size: 13px;
  color: var(--forest-dark);
  font-weight: 600;
}
.account-line {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.consent-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
}
.consent-note a {
  color: var(--forest);
}
#noticePrivacy {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: #dfe9d8;
}
.link-signout {
  border: none;
  background: none;
  color: var(--forest);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.sheet p.desc {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  margin: 12px 0;
}
.sheet .contact {
  font-size: 13px;
  color: var(--muted);
  margin: 8px 0 14px;
  word-break: break-word;
}
.sheet-actions {
  display: flex;
  gap: 10px;
}
.btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--forest);
  color: #fff;
}
.btn-secondary {
  background: #eef1ea;
  color: var(--forest-dark);
}

/* First-run notice */
.notice[hidden] {
  display: none;
}
.notice {
  position: absolute;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 36, 25, 0.55);
  backdrop-filter: blur(2px);
}
.notice p {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  margin: 0 0 12px;
  max-width: 420px;
  font-size: 14.5px;
  line-height: 1.5;
  box-shadow: var(--shadow);
}
.notice button {
  border: none;
  background: var(--forest);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: 12px;
  cursor: pointer;
}

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