/* Patch — map in tall document flow (same Safari Liquid Glass fix as star hero) */

html.patch-root,
html.patch-root body.patch-page {
  overflow: hidden;
  background-color: var(--cream);
  margin: 0;
  padding: 0;
}

.patch-layout {
  position: relative;
  width: 100%;
}

.patch-map-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1080 / 2304;
  overflow: hidden;
  transform: translateY(var(--hero-video-nudge)) scale(var(--hero-video-zoom));
  transform-origin: center center;
}

@media (min-width: 768px) {
  .patch-layout,
  .patch-map-media {
    height: 100dvh;
  }

  .patch-map-media {
    aspect-ratio: auto;
    transform: none;
  }
}

#map,
#map.mapboxgl-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--cream);
}

#map .mapboxgl-canvas-container,
#map .mapboxgl-canvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

/* Safari 26+ tab bar tint — only when patch sheet is open */
.patch-safari-chrome {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 12px;
  z-index: 20;
  pointer-events: none;
  display: none;
  background-color: var(--sheet-cream);
}

html.sheet-open .patch-safari-chrome {
  display: block;
}

.patch-map-shade {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 23;
  background: rgba(10, 10, 10, 0.38);
  opacity: 0;
  pointer-events: none;
}

.patch-map-shade.is-active {
  opacity: 1;
  transition: opacity 0.08s ease;
}

.patch-map-shade[hidden] {
  display: none !important;
}

.patch-chrome {
  position: fixed;
  top: max(env(safe-area-inset-top, 0px), 20px);
  left: 20px;
  z-index: 25;
  padding: 0;
  pointer-events: none;
}

.patch-chrome__logo {
  line-height: 0;
  pointer-events: auto;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

html.is-search-active .patch-chrome__logo {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.patch-chrome__logo img {
  width: 72px;
  height: auto;
  display: block;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
}

/* Top-right map actions — account + recenter stacked below search icon */
.patch-map-actions {
  position: fixed;
  top: calc(max(12px, env(safe-area-inset-top)) + 62px);
  right: 14px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

html.is-search-active .patch-map-actions {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.patch-map-actions > * {
  pointer-events: auto;
}

.patch-account,
.location-recenter {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #FFFFFF;
  color: #0A0A0A;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(10, 10, 10, 0.12);
  -webkit-tap-highlight-color: transparent;
}

.location-recenter[hidden] {
  display: none;
}

.patch-account:active,
.location-recenter:active {
  opacity: 0.75;
}

/* Search — collapsed icon top-right, expands full width when active */
.patch-search-bar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 14px;
  left: auto;
  width: 52px;
  height: 52px;
  z-index: 27;
  pointer-events: none;
  overflow: visible;
  border-radius: 999px;
  background: #FFFFFF;
  box-shadow: 0 2px 10px rgba(10, 10, 10, 0.12);
  transition:
    width 0.32s cubic-bezier(0.32, 0.72, 0, 1),
    box-shadow 0.2s ease;
}

.patch-search-bar > * {
  pointer-events: auto;
}

html.is-search-active .patch-search-bar {
  width: calc(100vw - 28px);
  z-index: 30;
  box-shadow: 0 2px 14px rgba(10, 10, 10, 0.16);
}

/* Bottom bar — add patch button only */
.patch-map-bar {
  position: fixed;
  left: auto;
  right: 14px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 24;
  display: flex;
  align-items: center;
  pointer-events: none;
}

html.is-search-active .patch-map-bar {
  z-index: 30;
}

.patch-map-bar > * {
  pointer-events: auto;
}

.patch-search {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
}

.patch-search__trigger {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  text-align: left;
  color: #0A0A0A;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease 0.12s, visibility 0.2s ease 0.12s;
}

html.is-search-active .patch-search__trigger {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.patch-search__field {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 0 14px 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

html.is-search-active .patch-search__field {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.24s ease 0.1s;
}

.patch-search__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.patch-search__trigger:active {
  opacity: 0.75;
}

.patch-search__icon {
  flex-shrink: 0;
  color: #0A0A0A;
}

.patch-search__cancel {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.08);
  color: #0A0A0A;
  font: 400 18px/1 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-search__cancel:active {
  opacity: 0.65;
}

.patch-search__field .patch-search__icon {
  color: #9A9A9A;
}

.patch-search__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 0;
  font: 400 15px/1.2 system-ui, -apple-system, sans-serif;
  color: #0A0A0A;
  -webkit-appearance: none;
  appearance: none;
}

.patch-search__input::placeholder {
  color: #B0B0B0;
}

.patch-search__results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 2px 14px rgba(10, 10, 10, 0.16);
  overflow: hidden;
  max-height: min(36vh, 240px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.patch-search__results[hidden] {
  display: none;
}

.patch-search__result {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  margin: 0;
  padding: 12px 16px;
  text-align: left;
  font: 400 14px/1.3 system-ui, -apple-system, sans-serif;
  color: #0A0A0A;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-search__result:active,
.patch-search__result:hover {
  background: rgba(10, 10, 10, 0.05);
}

.patch-add {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #0A0A0A;
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(10, 10, 10, 0.2);
  -webkit-tap-highlight-color: transparent;
}

.patch-add:active {
  opacity: 0.75;
}

/* Current location — blue dot + pulsing accuracy ring */
.location-marker {
  position: relative;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.location-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: #4A90D9;
  border: 3px solid #FFFFFF;
  box-sizing: content-box;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.location-accuracy {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: rgba(74, 144, 217, 0.18);
  transform-origin: center center;
  animation: location-pulse 2.4s ease-out infinite;
  z-index: 0;
}

@keyframes location-pulse {
  0% { transform: scale(0.85); opacity: 0.55; }
  70% { transform: scale(1.15); opacity: 0.12; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Temporary marker for a place selected from map search */
.search-location-marker {
  position: relative;
  width: 22px;
  height: 22px;
  pointer-events: none;
}

.search-location-marker__halo,
.search-location-marker__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
}

.search-location-marker__halo {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  background: rgba(239, 105, 57, 0.24);
  animation: search-location-pulse 1.8s ease-out infinite;
}

.search-location-marker__dot {
  width: 16px;
  height: 16px;
  margin: -11px 0 0 -11px;
  background: var(--orange);
  border: 3px solid #FFFFFF;
  box-sizing: content-box;
  box-shadow: 0 2px 7px rgba(10, 10, 10, 0.32);
}

@keyframes search-location-pulse {
  0% { transform: scale(0.7); opacity: 0.7; }
  70% { transform: scale(1.25); opacity: 0.12; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* Map markers */

/* Mapbox sets transform on the marker root every frame while panning —
   that element must never have a transform transition. Effects live on inner nodes. */

.marker-photo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid var(--cream);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.marker-anchor {
  width: 44px;
  height: 44px;
}

.marker-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.marker-photo.is-active {
  transform: scale(1.15);
  border-color: var(--orange);
}

.marker-icon {
  width: 44px;
  height: 44px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.marker-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.marker-icon.is-active {
  transform: scale(1.12);
}

.marker-cluster__photo.is-icon {
  background: transparent;
  border: none;
  box-shadow: none;
}

.marker-cluster__photo.is-icon img {
  object-fit: contain;
}

.marker-cluster-anchor {
  line-height: 0;
}

.marker-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(248, 246, 236, 0.96);
  border: 2px solid var(--cream);
  border-radius: 999px;
  box-shadow: 0 2px 14px rgba(10, 10, 10, 0.22);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.marker-cluster:active {
  transform: scale(0.96);
}

.marker-cluster__stack {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.marker-cluster__photo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 2px solid var(--cream);
  overflow: hidden;
  margin-left: -10px;
  box-shadow: 0 1px 5px rgba(10, 10, 10, 0.18);
  flex-shrink: 0;
  background: var(--grey);
}

.marker-cluster__photo:first-child {
  margin-left: 0;
}

.marker-cluster__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.marker-cluster__count {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.01em;
  white-space: nowrap;
  padding-right: 2px;
}

/* Spot detail sheet — uses shared buy sheet styles from main.css */

.patch-page #patchSheet .sheet__close,
.patch-page #authSheet .sheet__close,
.patch-page #profileSheet .sheet__close,
.patch-page #submitSheet .sheet__close {
  top: 14px;
  right: 14px;
  z-index: 12;
}

.patch-page #patchSheet.sheet {
  z-index: 30;
  transform: translateY(100%);
}

.patch-page #patchSheet.sheet.is-open {
  transform: translateY(0);
}

.patch-page #patchSheet.sheet.is-dragging {
  transition: none;
}

.patch-sheet__title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.patch-sheet__title-row .product__name {
  padding-right: 0;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.patch-sheet__heart {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin: -4px -6px 0 0;
  padding: 0;
  border: none;
  background: none;
  color: #0A0A0A;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-sheet__heart svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.patch-sheet__heart.is-saved {
  color: #FF4A0F;
}

.patch-sheet__heart.is-saved svg {
  fill: #FF4A0F;
  stroke: #FF4A0F;
}

.patch-sheet__heart:active {
  transform: scale(0.92);
}

.patch-sheet__hero {
  position: relative;
  width: calc(100% + 48px);
  margin: 0 -24px 20px;
}

.patch-sheet__photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.patch-sheet__photo[hidden],
.patch-sheet__icon[hidden] {
  display: none !important;
}

.patch-sheet__hero.is-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 148px;
  background: #F1EFE2;
}

.patch-sheet__icon {
  width: 72px;
  height: 72px;
  display: block;
}

.patch-sheet__meta {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-body-color);
  margin: 0 0 4px;
}

.patch-sheet__meta strong {
  font-weight: 700;
  color: var(--black);
}

.patch-stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  margin: 20px 0;
  padding: 18px 0;
  border-top: 1px solid rgba(10, 10, 10, 0.1);
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
}

.patch-stat {
  text-align: center;
  padding: 0 10px;
  border-right: 1px solid rgba(10, 10, 10, 0.1);
  min-width: 0;
}

.patch-stat:last-child {
  border-right: none;
}

.patch-stat__value {
  display: block;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--black);
  line-height: 1.2;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.patch-stat__label {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-body-color);
  line-height: 1.2;
}

.patch-sheet__desc-wrap {
  margin-top: 20px;
}

.patch-page #patchSheet .patch-sheet__desc {
  margin: 0;
}

.patch-sheet__desc.is-collapsed {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.patch-sheet__more {
  margin-top: 8px;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  font-weight: 700;
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.patch-sheet__more:active {
  opacity: 0.65;
}

.patch-page #patchSheet .sheet__sticky-cta .add-to-cart {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

/* Auth / account sheet */
.patch-page #authSheet.sheet {
  z-index: 31;
  transform: translateY(100%);
}

.patch-page #authSheet.sheet.is-visible {
  visibility: visible;
  pointer-events: auto;
}

.patch-page #authSheet.sheet.is-open {
  transform: translateY(0);
}

.patch-page #authSheet.sheet.is-dragging {
  transition: none;
}

.patch-page #authSheet.sheet--auth {
  isolation: isolate;
}

.patch-page #authSheet .sheet__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 70dvh;
  overflow: hidden;
  background: var(--sheet-cream);
}

.patch-page #authSheet .sheet__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.patch-auth {
  padding-top: 8px;
}

.patch-auth__title {
  margin: 8px 0 8px;
  padding-right: 44px;
}

.patch-auth__avatar {
  width: 72px;
  height: 72px;
  margin: 8px 0 12px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.patch-auth__avatar[hidden] {
  display: none;
}

.patch-auth__sub {
  margin: 0 0 24px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  color: #8A8A8A;
}

.patch-auth__label {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 8px;
}

.patch-auth__email {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1.5px solid #0A0A0A;
  border-radius: 12px;
  background: var(--cream);
  color: #0A0A0A;
  font: 400 15px/1.2 system-ui, -apple-system, sans-serif;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.patch-auth__email::placeholder {
  color: #B0B0B0;
}

.patch-auth__submit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: #0A0A0A;
  color: #FFFFFF;
  font: 700 15px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-auth__submit:active {
  opacity: 0.8;
}

.patch-auth__confirm {
  margin: 18px 0 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: var(--black);
  text-align: center;
}

.patch-auth__saves {
  margin: 0 0 12px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--black);
}

.patch-auth__saved-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
}

.patch-auth__saved-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
  background: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--black);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-auth__saved-item:last-child {
  border-bottom: none;
}

.patch-auth__saved-item:active {
  opacity: 0.65;
}

.patch-auth__signout {
  display: block;
  width: 100%;
  margin: 20px 0 0;
  padding: 8px;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: #8A8A8A;
  cursor: pointer;
  text-align: center;
}

.patch-auth__profile {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 12px 20px;
  border: 1.5px solid #0A0A0A;
  border-radius: 999px;
  background: transparent;
  color: #0A0A0A;
  font: 700 15px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
}

.patch-auth__signout:active {
  opacity: 0.65;
}

.patch-auth__form[hidden],
.patch-auth__confirm[hidden] {
  display: none;
}

/* Lightweight post-signup profile */
.patch-page #profileSheet.sheet {
  z-index: 33;
  transform: translateY(100%);
  background: var(--sheet-cream);
}

.patch-page #profileSheet.sheet.is-visible {
  visibility: visible;
  pointer-events: auto;
}

.patch-page #profileSheet.sheet.is-open {
  transform: translateY(0);
}

.patch-page #profileSheet .sheet__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  max-height: 76dvh;
  overflow: hidden;
  background: var(--sheet-cream);
}

.patch-page #profileSheet .sheet__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.patch-profile {
  padding-top: 8px;
}

.patch-profile__title {
  margin: 8px 0;
  padding-right: 44px;
}

.patch-profile__sub {
  margin: 0 0 24px;
  color: #8A8A8A;
  font: 400 14px/1.4 var(--font-body);
}

.patch-profile__label {
  display: block;
  margin: 0 0 8px;
  color: var(--black);
  font: 600 12px/1.3 var(--font-body);
}

.patch-profile__label span {
  color: #8A8A8A;
  font-weight: 400;
}

.patch-profile__name {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1.5px solid #0A0A0A;
  border-radius: 12px;
  background: var(--cream);
  color: #0A0A0A;
  font: 400 15px/1.2 system-ui, -apple-system, sans-serif;
  outline: none;
}

.patch-profile__photo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 104px;
  height: 104px;
  margin: 0 0 24px;
  padding: 0;
  overflow: hidden;
  border: 1.5px dashed rgba(10, 10, 10, 0.35);
  border-radius: 50%;
  background: var(--cream);
  color: #6F6F6F;
  cursor: pointer;
}

.patch-profile__photo-empty {
  max-width: 64px;
  font: 600 12px/1.3 var(--font-body);
}

.patch-profile__photo-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.patch-profile__photo-preview[hidden],
.patch-profile__error[hidden] {
  display: none;
}

.patch-profile__error {
  margin: -8px 0 14px;
  color: #B42318;
  font: 600 13px/1.35 var(--font-body);
}

.patch-profile__skip {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 10px;
  border: none;
  background: transparent;
  color: #707070;
  font: 600 13px/1.2 var(--font-body);
  cursor: pointer;
}

/* Submit a patch sheet */
.patch-page #submitSheet.sheet {
  z-index: 32;
  transform: translateY(100%);
}

.patch-page #submitSheet.sheet.is-visible {
  visibility: visible;
  pointer-events: auto;
}

.patch-page #submitSheet.sheet.is-open {
  transform: translateY(0);
}

.patch-page #submitSheet.sheet.is-dragging {
  transition: none;
}

.patch-page #submitSheet .sheet__inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  max-height: min(96dvh, 100%);
  overflow: hidden;
  background: var(--sheet-cream);
}

.patch-page #submitSheet .sheet__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.patch-submit {
  padding-top: 8px;
}

.patch-submit__title {
  margin: 8px 0 20px;
  padding-right: 44px;
}

.patch-submit__label {
  margin: 22px 0 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0A0A0A;
}

.patch-submit__label:first-of-type {
  margin-top: 0;
}

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

.patch-submit__type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 108px;
  padding: 16px;
  border: 1.5px solid rgba(10, 10, 10, 0.18);
  border-radius: 16px;
  background: var(--cream);
  color: #0A0A0A;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-submit__type.is-selected {
  border-color: #0A0A0A;
  background: #FFFFFF;
}

.patch-submit__type-emoji {
  font-size: 28px;
  line-height: 1;
}

.patch-submit__type-text {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.patch-submit__field-label {
  display: block;
  margin: 0 0 8px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
}

.patch-submit__input,
.patch-submit__textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 14px 16px;
  border: 1.5px solid #0A0A0A;
  border-radius: 12px;
  background: var(--cream);
  color: #0A0A0A;
  font: 400 15px/1.35 system-ui, -apple-system, sans-serif;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  resize: vertical;
}

.patch-submit__input::placeholder,
.patch-submit__textarea::placeholder {
  color: #B0B0B0;
}

.patch-submit__place {
  margin-bottom: 4px;
}

.patch-submit__place-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: #0A0A0A;
  color: #FFFFFF;
  font: 700 15px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-submit__place-btn:active {
  opacity: 0.85;
}

.patch-submit__place-confirm {
  margin: 10px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.35;
  color: #8A8A8A;
}

.patch-submit__place-confirm--empty {
  color: #B0B0B0;
}

.patch-submit__count {
  margin: -4px 0 0;
  text-align: right;
  font-family: var(--font-body);
  font-size: 12px;
  color: #8A8A8A;
}

.patch-submit__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.patch-submit__tag {
  margin: 0;
  padding: 9px 14px;
  border: 1.5px solid rgba(10, 10, 10, 0.18);
  border-radius: 999px;
  background: transparent;
  color: #0A0A0A;
  font: 600 13px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-submit__tag.is-selected {
  border-color: #0A0A0A;
  background: #0A0A0A;
  color: #FFFFFF;
}

.patch-submit__photo {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 1.5px dashed rgba(10, 10, 10, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-submit__photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 160px;
  padding: 24px 16px;
  text-align: center;
}

.patch-submit__photo-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
}

.patch-submit__photo-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: #0A0A0A;
}

.patch-submit__photo-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: #8A8A8A;
}

.patch-submit__photo-preview {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.patch-submit__error {
  margin: 16px 0 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #FF4A0F;
}

.patch-submit__submit {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  padding: 15px 20px;
  border: none;
  border-radius: 999px;
  background: #0A0A0A;
  color: #FFFFFF;
  font: 700 15px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-submit__submit:disabled {
  opacity: 0.45;
  cursor: default;
}

.patch-submit__submit:not(:disabled):active {
  opacity: 0.8;
}

.patch-submit__success-msg {
  margin: 8px 0 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.4;
  color: #0A0A0A;
}

.patch-submit [hidden],
#submitFormRest[hidden],
#submitSuccessView[hidden],
#submitPhotoBlock[hidden] {
  display: none !important;
}

#submitPhotoPreview[hidden],
#submitError[hidden] {
  display: none !important;
}

/* Pin-first location placement */
.patch-place-pin {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 35;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: #FF4A0F;
  border: 3px solid #FFFFFF;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  pointer-events: none;
}

.patch-place-pin[hidden] {
  display: none !important;
}

.patch-place-strip {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 37;
  padding: 16px 16px max(16px, env(safe-area-inset-bottom));
  background: var(--sheet-cream);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 28px rgba(10, 10, 10, 0.14);
}

.patch-place-strip[hidden] {
  display: none !important;
}

.patch-place-strip__hint {
  margin: 0 0 12px;
  text-align: center;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: #0A0A0A;
}

.patch-place-strip__search {
  position: relative;
  margin-bottom: 12px;
}

.patch-place-strip__input,
.patch-place-strip__name {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid #0A0A0A;
  border-radius: 12px;
  background: var(--cream);
  color: #0A0A0A;
  font: 400 14px/1.2 system-ui, -apple-system, sans-serif;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.patch-place-strip__input::placeholder,
.patch-place-strip__name::placeholder {
  color: #B0B0B0;
}

.patch-place-strip__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.patch-place-strip__results {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px 0;
  max-height: 160px;
  overflow-y: auto;
  border: 1.5px solid rgba(10, 10, 10, 0.12);
  border-radius: 12px;
  background: #FFFFFF;
}

.patch-place-strip__results[hidden] {
  display: none;
}

.patch-place-strip__result {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  margin: 0;
  padding: 11px 14px;
  text-align: left;
  font: 400 13px/1.3 system-ui, -apple-system, sans-serif;
  color: #0A0A0A;
  cursor: pointer;
}

.patch-place-strip__result:active,
.patch-place-strip__result:hover {
  background: rgba(10, 10, 10, 0.05);
}

.patch-place-strip__label {
  display: block;
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: #0A0A0A;
}

.patch-place-strip__name {
  margin-bottom: 8px;
}

.patch-place-strip__near {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.35;
  color: #8A8A8A;
}

.patch-place-strip__near[hidden] {
  display: none;
}

.patch-place-strip__kinds {
  margin: 0 0 12px;
}

.patch-place-strip__kinds[hidden] {
  display: none !important;
}

.patch-place-strip__kind-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.patch-place-strip__kind {
  margin: 0;
  padding: 10px 6px;
  border: 1.5px solid #0A0A0A;
  border-radius: 12px;
  background: transparent;
  color: #0A0A0A;
  font: 600 12px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-place-strip__kind.is-selected {
  background: #0A0A0A;
  color: #FFFFFF;
}

.patch-place-strip__error {
  margin: 0 0 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #FF4A0F;
}

.patch-place-strip__error[hidden] {
  display: none;
}

.patch-place-strip__locate {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  border: none;
  background: transparent;
  color: #8A8A8A;
  font: 500 13px/1.3 system-ui, -apple-system, sans-serif;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-place-strip__locate[hidden] {
  display: none !important;
}

.patch-place-strip__confirm {
  display: block;
  width: 100%;
  margin: 0;
  padding: 14px 20px;
  border: none;
  border-radius: 999px;
  background: #0A0A0A;
  color: #FFFFFF;
  font: 700 15px/1.2 system-ui, -apple-system, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.patch-place-strip__confirm:active {
  opacity: 0.85;
}

.patch-page.is-placing-patch .patch-map-actions,
.patch-page.is-placing-patch .patch-search-bar,
.patch-page.is-placing-patch .patch-map-bar,
.patch-page.is-placing-patch .patch-chrome {
  pointer-events: none;
  opacity: 0.28;
}
