/* Phone map pins -- the desktop Map's pin modules brought to the Map tab.
 *
 * Pin markers (a round head and a short tail, the app's colour), a pin card
 * that peeks from the bottom and pulls up to full height, a swipeable nearby
 * strip in sync with the map, filter chips, locate-me and the new-pin sheet.
 * Built by static/js/mobile-map-pins.js.
 *
 * Everything is scoped under an id or the .mmp-surface class and restates
 * colour with !important on the leaf: the phone paints itself with blanket
 * theme sweeps ([data-theme="light"] * * *, the modal fixer) that otherwise
 * turn this black on black. No grey fills: surfaces are the page (white or
 * black, or the owner's page colour); separation is a hairline.
 */

:root {
  --mmp-bg: #ffffff;
  --mmp-ink: #0e0e10;
  --mmp-dim: #5c5c63;
  --mmp-faint: #8a8a92;
  --mmp-line: #e6e6e9;
  --mmp-field: #ffffff;
  --mmp-field-ink: #111113;
  --mmp-btn: var(--primary-color, #111111);
  --mmp-on-btn: #ffffff;
  --mmp-me: #2563eb;
  --mmp-good: #15803d;
  --mmp-bad: #dc2626;
  --mmp-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}
html[data-theme*="dark"] {
  --mmp-bg: #0e0e10;
  --mmp-ink: #f4f4f5;
  --mmp-dim: #b4b4bb;
  --mmp-faint: #8a8a92;
  --mmp-line: #26262b;
  --mmp-field: #16161a;
  --mmp-field-ink: #f4f4f5;
  --mmp-good: #4ade80;
  --mmp-bad: #f87171;
  --mmp-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
/* The owner's page colour, when one is set (mobile-page-colors.js). */
html[data-page-color] {
  --mmp-bg: var(--pc-page);
  --mmp-ink: var(--pc-ink);
  --mmp-dim: var(--pc-dim);
  --mmp-faint: var(--pc-faint);
  --mmp-line: var(--pc-line);
  --mmp-field: var(--pc-field);
  --mmp-field-ink: var(--pc-field-ink);
  --mmp-btn: var(--pc-btn);
  --mmp-on-btn: var(--pc-on-btn);
}

/* ------------------------------------------------------------ markers */

.leaflet-marker-icon.mmp-marker { background: none !important; border: 0 !important; }
.mmp-pin {
  position: absolute; left: 0; bottom: 0; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  transform-origin: 50% 100%; transition: transform 0.18s ease;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
}
.mmp-pin__head {
  width: 40px; height: 40px; border-radius: 50%; box-sizing: border-box; overflow: hidden;
  display: grid; place-items: center;
  border: 3px solid #ffffff;
  font-size: 18px; line-height: 1;
}
.mmp-pin__head { position: relative; background: var(--mmp-btn); }
#mobile-map .mmp-pin__head img { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover !important; display: block; margin: 0 !important; }
/* The pin's icon, under the photo: what shows when there is none or it fails. */
#mobile-map .mmp-pin__glyph { font-style: normal; font-size: 18px; line-height: 1; color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; }
.mmp-pin__tail { width: 3px; height: 11px; background: var(--mmp-btn); margin-top: -1px; border-radius: 0 0 2px 2px; }
.mmp-pin.is-owner .mmp-pin__head { width: 46px; height: 46px; background: var(--mmp-btn); border-color: #ffffff; }
.mmp-pin.is-owner .mmp-pin__tail { background: #ffffff; }
#mobile-map .mmp-pin__label {
  position: absolute; top: 100%; margin-top: 4px; padding: 4px 9px; border-radius: 8px;
  background: #0e0e10; color: #ffffff !important; -webkit-text-fill-color: #ffffff !important;
  font: 800 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
}
.mmp-marker.is-selected .mmp-pin,
.mmp-marker.mmp-on .mmp-pin { transform: translateX(-50%) scale(1.25); z-index: 2; }
#mobile-map .mmp-marker.is-selected .mmp-pin__label,
#mobile-map .mmp-marker.mmp-on .mmp-pin__label { opacity: 1; }
.mmp-marker.mmp-dim .mmp-pin { opacity: 0.35; }
#mobile-map .mmp-draft .mmp-pin__head { background: #ffffff; border: 3px dashed var(--mmp-btn); color: #0e0e10; font-weight: 900; font-size: 20px; }
.mmp-me-dot {
  width: 18px; height: 18px; border-radius: 50%; box-sizing: border-box;
  background: var(--mmp-me); border: 3px solid #ffffff;
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.18);
}

/* ------------------------------------------------ shell: search + chips */

/* The search bar moves to the top under the header; the bottom belongs to
   the nearby strip and the map's own nav. */
body.virtual-active #mobile-search-bar-container.mmp-top-search {
  top: calc(env(safe-area-inset-top, 0px) + 64px) !important;
  bottom: auto !important;
}
body.virtual-active #mobile-search-bar-container.mmp-top-search #virtual-map-suggestions {
  top: calc(100% + 8px) !important;
  bottom: auto !important;
  margin-bottom: 0 !important;
}

#mmp-chips {
  position: fixed; left: 0; right: 0; z-index: 9990;
  top: calc(env(safe-area-inset-top, 0px) + 116px);
  display: flex; gap: 8px; padding: 0 12px; overflow-x: auto; scrollbar-width: none;
  pointer-events: none;
}
#mmp-chips::-webkit-scrollbar { display: none; }
#mmp-chips[hidden] { display: none !important; }
html.mmp-searching #mmp-chips { display: none !important; }
html body #mmp-chips .mmp-chip {
  pointer-events: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 18px; border: 1.5px solid var(--mmp-ink) !important;
  background: var(--mmp-bg) !important; color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  font: 800 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  cursor: pointer; white-space: nowrap;
}
html body #mmp-chips .mmp-chip small { font-size: 11px; font-weight: 700; opacity: 0.6; color: inherit !important; -webkit-text-fill-color: currentColor !important; }
html body #mmp-chips .mmp-chip[aria-pressed="true"] {
  background: var(--mmp-ink) !important; color: var(--mmp-bg) !important; -webkit-text-fill-color: var(--mmp-bg) !important;
}
html body #mmp-chips .mmp-chip--add {
  background: var(--mmp-btn) !important; border-color: var(--mmp-btn) !important;
  color: var(--mmp-on-btn) !important; -webkit-text-fill-color: var(--mmp-on-btn) !important;
}
html body #mmp-chips .mmp-chip--add.is-on {
  background: var(--mmp-ink) !important; border-color: var(--mmp-ink) !important;
  color: var(--mmp-bg) !important; -webkit-text-fill-color: var(--mmp-bg) !important;
}

html body #mmp-locate {
  position: fixed; right: 12px; z-index: 9990;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 188px);
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--mmp-ink) !important; background: var(--mmp-bg) !important;
  color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; padding: 0;
}
html body #mmp-locate svg { width: 18px; height: 18px; display: block; stroke: currentColor !important; }
html body #mmp-locate.is-on { color: var(--mmp-me) !important; -webkit-text-fill-color: var(--mmp-me) !important; }
#mmp-locate[hidden] { display: none !important; }

/* ------------------------------------------------------- nearby strip */

#mmp-strip {
  position: fixed; left: 0; right: 0; z-index: 9990;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  display: flex; gap: 10px; padding: 0 12px 4px; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-padding: 0 12px;
}
#mmp-strip::-webkit-scrollbar { display: none; }
#mmp-strip[hidden] { display: none !important; }
html body #mmp-strip .mmp-tile {
  flex: 0 0 calc(100% - 64px); max-width: 320px; scroll-snap-align: start;
  display: flex; align-items: center; gap: 12px; padding: 10px; min-height: 76px; box-sizing: border-box;
  border-radius: 18px; border: 1.5px solid var(--mmp-line) !important; background: var(--mmp-bg) !important;
  color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  text-align: left; cursor: pointer;
}
html body #mmp-strip .mmp-tile.is-on { border-color: var(--mmp-btn) !important; box-shadow: 0 0 0 2px var(--mmp-btn), 0 10px 26px rgba(0, 0, 0, 0.16) !important; }
.mmp-tile__img {
  width: 54px; height: 54px; border-radius: 14px; overflow: hidden; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 22px; border: 1.5px solid var(--mmp-line);
}
.mmp-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mmp-tile__img.is-glyph { background: var(--mmp-btn); border-color: var(--mmp-btn); }
.mmp-tile__text { flex: 1; min-width: 0; }
html body :is(#mmp-strip, #mmp-list) .mmp-tile__name {
  display: flex; align-items: center; gap: 5px; font: 800 15px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
}
.mmp-tile__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body :is(#mmp-strip, #mmp-list) .mmp-tile__sub,
html body :is(#mmp-strip, #mmp-list) .mmp-tile__note {
  display: block; margin-top: 3px; font: 600 12.5px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html body :is(#mmp-strip, #mmp-list) .mmp-tile__note { color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important; font-weight: 700; }
html body :is(#mmp-strip, #mmp-list) .mmp-tile__star { color: var(--mmp-btn) !important; -webkit-text-fill-color: var(--mmp-btn) !important; flex: 0 0 auto; font-size: 12px; }

/* ------------------------------------------------ the pin card + sheets */

.mmp-sheet {
  position: fixed; left: 0; right: 0; z-index: 10030;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 84px);
  max-height: 52vh; display: flex; flex-direction: column; box-sizing: border-box;
  margin: 0 8px; border-radius: 26px; border: 1.5px solid var(--mmp-line);
  background: var(--mmp-bg) !important; color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  box-shadow: var(--mmp-shadow); overflow: hidden;
  transform: translateY(0); transition: max-height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.22s ease, opacity 0.22s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
.mmp-sheet[hidden] { display: none !important; }
.mmp-sheet.is-in { animation: mmp-rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
.mmp-sheet.is-full { max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 150px); }
@keyframes mmp-rise { from { transform: translateY(30px); opacity: 0; } }
html body :is(#mmp-card, #mmp-new, #mmp-list) { color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) * { box-sizing: border-box; color: inherit !important; -webkit-text-fill-color: currentColor !important; font-family: inherit; }
.mmp-grip {
  flex: 0 0 auto; height: 22px; display: grid; place-items: center; cursor: grab; touch-action: none;
  border: 0 !important; background: transparent !important; width: 100%; padding: 0;
}
.mmp-grip::after { content: ""; width: 42px; height: 5px; border-radius: 999px; background: var(--mmp-line); }
.mmp-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.mmp-hero { position: relative; height: 136px; overflow: hidden; display: grid; place-items: center; font-size: 52px; border-bottom: 1.5px solid var(--mmp-line); }
.mmp-sheet.is-full .mmp-hero { height: auto; aspect-ratio: 16 / 10; }
.mmp-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mmp-hero:not(.has-photo) { height: 96px; background: var(--mmp-btn); }
.mmp-sheet.is-full .mmp-hero:not(.has-photo) { aspect-ratio: auto; height: 120px; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-tag {
  position: absolute; top: 12px; left: 12px; z-index: 1; padding: 5px 10px; border-radius: 8px;
  background: #0e0e10 !important; color: #ffffff !important; -webkit-text-fill-color: #ffffff !important;
  font: 800 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.06em;
}
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-x {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  border: 0 !important; background: #ffffff !important; color: #0e0e10 !important; -webkit-text-fill-color: #0e0e10 !important;
  font-size: 15px; font-weight: 800; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18) !important; padding: 0;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
.mmp-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 13px; }
.mmp-name { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.mmp-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-meta,
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-by,
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-facts .mmp-fact__k { color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-meta b { color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important; }
.mmp-meta:empty { display: none; }
.mmp-facts { display: grid; grid-template-columns: 18px 1fr; gap: 8px 10px; font-size: 14.5px; line-height: 1.35; }
.mmp-facts:empty { display: none; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-facts a { color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important; text-decoration: underline; overflow-wrap: anywhere; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-open { color: var(--mmp-good) !important; -webkit-text-fill-color: var(--mmp-good) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-closed { color: var(--mmp-bad) !important; -webkit-text-fill-color: var(--mmp-bad) !important; }
.mmp-acts { display: flex; gap: 8px; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-go {
  flex: 1; height: 48px; border-radius: 24px; border: 0 !important;
  background: var(--mmp-btn) !important; color: var(--mmp-on-btn) !important; -webkit-text-fill-color: var(--mmp-on-btn) !important;
  font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important;
}
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-ghost {
  height: 48px; min-width: 48px; padding: 0 16px; border-radius: 24px;
  border: 1.5px solid var(--mmp-ink) !important; background: var(--mmp-bg) !important;
  color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  font-size: 14px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important;
}
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-ghost.is-on { background: var(--mmp-ink) !important; color: var(--mmp-bg) !important; -webkit-text-fill-color: var(--mmp-bg) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-go i, html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-ghost i { color: inherit !important; -webkit-text-fill-color: currentColor !important; }
.mmp-note { font-size: 15px; line-height: 1.45; padding-top: 12px; border-top: 1.5px solid var(--mmp-line); white-space: pre-wrap; overflow-wrap: anywhere; }
.mmp-note[hidden] { display: none; }
.mmp-by { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mmp-by img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid var(--mmp-line); }
.mmp-manage { display: flex; gap: 8px; padding-top: 12px; border-top: 1.5px solid var(--mmp-line); }
.mmp-manage[hidden] { display: none; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-manage .mmp-ghost { flex: 1; height: 42px; font-size: 13.5px; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-manage .mmp-del { border-color: var(--mmp-bad) !important; color: var(--mmp-bad) !important; -webkit-text-fill-color: var(--mmp-bad) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-manage .mmp-del.is-armed { background: var(--mmp-bad) !important; color: #ffffff !important; -webkit-text-fill-color: #ffffff !important; }

/* Directions chooser: Apple Maps or Google Maps. */
.mmp-choose { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mmp-choose[hidden] { display: none; }

/* --------------------------------------------------------- new pin */

.mmp-new__head { display: flex; justify-content: space-between; align-items: center; padding: 4px 18px 0; }
.mmp-new__title { font-size: 22px; font-weight: 900; letter-spacing: -0.03em; text-transform: uppercase; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-round-x {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--mmp-line) !important;
  background: var(--mmp-bg) !important; color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  font-size: 13px; padding: 0; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: none !important;
}
.mmp-new__drop { margin: 12px 18px 0; padding: 10px 14px; border-radius: 12px; border: 1.5px dashed var(--mmp-line); font-size: 14px; font-weight: 700; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-new__drop { color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-new__drop.is-set { border-style: solid; border-color: var(--mmp-good); color: var(--mmp-good) !important; -webkit-text-fill-color: var(--mmp-good) !important; }
.mmp-form { padding: 14px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.mmp-field { position: relative; display: flex; flex-direction: column; gap: 6px; }
.mmp-field > span { font-size: 14px; font-weight: 800; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field em { font-style: normal; font-weight: 500; color: var(--mmp-faint) !important; -webkit-text-fill-color: var(--mmp-faint) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field input:not([type="file"]),
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field textarea {
  height: 46px; border-radius: 12px; border: 1.5px solid var(--mmp-line) !important; padding: 0 14px;
  font-size: 16px; outline: none; background: var(--mmp-field) !important; box-shadow: none !important;
  color: var(--mmp-field-ink) !important; -webkit-text-fill-color: var(--mmp-field-ink) !important; -webkit-appearance: none; appearance: none;
}
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field textarea { height: auto; padding: 12px 14px; resize: none; line-height: 1.4; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field input:focus, html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field textarea:focus { border-color: var(--mmp-ink) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field input::placeholder, html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field textarea::placeholder { color: var(--mmp-faint) !important; -webkit-text-fill-color: var(--mmp-faint) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-field input[type="file"] { font-size: 13px; color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
.mmp-emojis { display: flex; flex-wrap: wrap; gap: 6px; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-emoji {
  width: 42px; height: 38px; border-radius: 19px; padding: 0;
  border: 1.5px solid var(--mmp-line) !important; background: var(--mmp-bg) !important;
  font-size: 18px; display: grid; place-items: center; box-shadow: none !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-emoji[aria-pressed="true"] { border-color: var(--mmp-btn) !important; box-shadow: 0 0 0 2px var(--mmp-btn) !important; }
.mmp-sugs {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 3;
  border-radius: 14px; border: 1.5px solid var(--mmp-ink); background: var(--mmp-bg); overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}
.mmp-sugs[hidden] { display: none; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-sug {
  display: block; width: 100%; padding: 11px 14px; border: 0 !important; border-bottom: 1px solid var(--mmp-line) !important;
  background: var(--mmp-bg) !important; text-align: left; font-size: 14px; font-weight: 700; box-shadow: none !important;
  color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-sug small { display: block; margin-top: 2px; font-weight: 500; font-size: 12px; color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-err { margin: 0; font-size: 13px; color: var(--mmp-bad) !important; -webkit-text-fill-color: var(--mmp-bad) !important; }
.mmp-err:empty { display: none; }
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-save {
  height: 52px; border-radius: 26px; border: 0 !important; font-size: 16px; font-weight: 900;
  background: var(--mmp-btn) !important; color: var(--mmp-on-btn) !important; -webkit-text-fill-color: var(--mmp-on-btn) !important;
  box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
html body :is(#mmp-card, #mmp-new, #mmp-list) .mmp-save:disabled { opacity: 0.4; }

/* While the map is taking a tap for a new pin. */
body.mmp-placing #mobile-map, body.mmp-placing #mobile-map .leaflet-grab { cursor: crosshair; }
html body #mmp-hint {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 9995;
  top: calc(env(safe-area-inset-top, 0px) + 164px);
  padding: 9px 16px; border-radius: 18px; background: #0e0e10 !important;
  color: #ffffff !important; -webkit-text-fill-color: #ffffff !important;
  font: 700 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; white-space: nowrap; pointer-events: none;
}
#mmp-hint[hidden] { display: none !important; }

html body #mmp-toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); z-index: 130100;
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s;
  padding: 11px 16px; border-radius: 14px; background: var(--mmp-ink) !important;
  color: var(--mmp-bg) !important; -webkit-text-fill-color: var(--mmp-bg) !important;
  font: 700 14px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html body #mmp-toast.is-up { opacity: 1; transform: translate(-50%, 0); }

/* The old peek popup and composer are replaced; never show both. */
body.mmp-on #map-post-details-popup { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .mmp-sheet, .mmp-pin, #mmp-toast { transition: none !important; animation: none !important; }
}
body.mmp-sheet-open #mmp-locate { display: none !important; }
/* The map dashboard sheet (#map-style-menu) covers the same bottom band. */
body.mapctl-open #mmp-locate,
body.mapctl-open #mmp-strip { display: none !important; }

/* ------------------------------------------------------- pins list */

#mmp-list .mmp-new__head > div { display: flex; align-items: baseline; gap: 10px; }
html body #mmp-list .mmp-list__count { font-size: 13px; font-weight: 700; color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
#mmp-list .mmp-list__search { padding-bottom: 6px; }
.mmp-list__rows { padding: 0 10px 18px; display: flex; flex-direction: column; }
html body #mmp-list .mmp-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 8px; text-align: left;
  border: 0 !important; border-bottom: 1px solid var(--mmp-line) !important; border-radius: 0;
  background: transparent !important; box-shadow: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
}
html body #mmp-list .mmp-row:last-child { border-bottom: 0 !important; }
html body #mmp-list .mmp-list__empty { margin: 18px 8px; font-size: 14px; color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
#mobile-map .mmp-draft .mmp-pin__glyph { color: #0e0e10 !important; -webkit-text-fill-color: #0e0e10 !important; }

/* Map dashboard segmented control (Location / Map / Settings). The global
   button glass rule gives every inactive segment a raised shadow, and the
   active one is filled with the same colour as the track, so the selected
   segment read as the only flat one. Flat segments; the active one is the
   ink pill, like the filter chips above the map. */
html body #map-style-menu #map-style-tabs button {
  box-shadow: none !important;
  backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
  background: transparent !important;
  color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important;
  opacity: 0.72;
}
html body #map-style-menu #map-style-tabs button[data-active="true"] {
  background: var(--mmp-ink) !important;
  color: var(--mmp-bg) !important; -webkit-text-fill-color: var(--mmp-bg) !important;
  opacity: 1;
}
