/* 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, filter chips,
 * locate-me, the bottom search bar 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 sits at the bottom, full width with the side gutters, just
   above the nav pill (the pill tops out ~84px above the safe area). The
   template's inline width/left/transform carry !important, so these restate
   them with a class + id + body scope. Suggestions open upward. */
html body.virtual-active #mobile-search-bar-container.mmp-bottom-search {
  top: auto !important;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px) !important;
}
html body #mobile-search-bar-container.mmp-bottom-search #virtual-map-suggestions {
  top: auto !important;
  bottom: calc(100% + 8px) !important;
  margin-bottom: 0 !important;
  max-height: min(300px, calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 220px)) !important;
}
/* The pin card and the new-pin/list sheets take the same bottom band. */
body.mmp-sheet-open #mobile-search-bar-container.mmp-bottom-search,
body.mapctl-open #mobile-search-bar-container.mmp-bottom-search { display: none !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,
html.mmp-searching #mmp-locate { 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) + 148px);
  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; }

/* ------------------------------------------------------- tiles (pins list) */

.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 #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 #mmp-list .mmp-tile__sub,
html body #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 #mmp-list .mmp-tile__note { color: var(--mmp-ink) !important; -webkit-text-fill-color: var(--mmp-ink) !important; font-weight: 700; }
html body #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-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; }


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 { 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;
}

/* No pins yet: the shared empty guide (empty-state.js) as a card over the
   map, above the search bar. */
#mmp-void {
  position: fixed; left: 12px; right: 12px; z-index: 9990;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 148px);
  border-radius: 24px; background: var(--mmp-bg) !important;
  border: 1.5px solid var(--mmp-line) !important;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18) !important;
}
#mmp-void[hidden] { display: none !important; }
html body #mmp-void .nst-es.nst-es { padding: 18px 16px 20px !important; }

/* ------------------------------------------------------------ sponsors */
/* A sponsor pin while its dates run: gold ring, a Sponsored tag, drawn above
   the other pins (zIndexOffset in mobile-map-pins.js). */
:root { --mmp-gold: #d4a106; --mmp-gold-ink: #1a1400; --mmp-gold-soft: rgba(212, 161, 6, 0.14); }
#mobile-map .mmp-pin.is-sponsor .mmp-pin__head {
  border-color: var(--mmp-gold) !important;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--mmp-gold);
}
#mobile-map .mmp-pin.is-sponsor .mmp-pin__tail { background: var(--mmp-gold) !important; height: 13px; }
#mobile-map .mmp-pin__spon {
  position: absolute; bottom: calc(100% + 7px); padding: 2px 7px; border-radius: 6px;
  background: var(--mmp-gold) !important; color: var(--mmp-gold-ink) !important; -webkit-text-fill-color: var(--mmp-gold-ink) !important;
  font: 800 10.5px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; pointer-events: none;
}
html body #mmp-card .mmp-hero.is-sponsor { box-shadow: inset 0 -4px 0 var(--mmp-gold); }
html body #mmp-card .mmp-spontag {
  position: absolute; left: 12px; bottom: 12px; z-index: 1; padding: 4px 9px; border-radius: 8px;
  background: var(--mmp-gold) !important; color: var(--mmp-gold-ink) !important; -webkit-text-fill-color: var(--mmp-gold-ink) !important;
  font: 800 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
}
html body #mmp-card .mmp-sponsor {
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 16px;
  background: var(--mmp-gold-soft) !important; border: 1.5px solid var(--mmp-gold) !important;
}
html body #mmp-card .mmp-sponsor__logo {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto; overflow: hidden; display: grid; place-items: center;
  background: #ffffff !important; color: #0e0e10 !important; -webkit-text-fill-color: #0e0e10 !important; font-size: 18px; font-weight: 900;
}
html body #mmp-card .mmp-sponsor__logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
html body #mmp-card .mmp-sponsor__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
html body #mmp-card .mmp-sponsor__text small { font-size: 12px; color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
html body #mmp-card .mmp-sponsor__text b { font-size: 16px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html body #mmp-card .mmp-sponsor__go {
  flex: 0 0 auto; height: 40px; padding: 0 18px; border-radius: 20px; display: grid; place-items: center; text-decoration: none;
  background: var(--mmp-ink) !important; color: var(--mmp-bg) !important; -webkit-text-fill-color: var(--mmp-bg) !important;
  font-size: 14px; font-weight: 800;
}

/* The Sponsored switch on Add / Edit pin (owner only). */
html body #mmp-new .mmp-spon-form {
  display: flex; flex-direction: column; gap: 12px; padding: 12px 14px; border-radius: 16px;
  border: 1.5px solid var(--mmp-line) !important;
}
#mmp-new .mmp-spon-form__fields { display: flex; flex-direction: column; gap: 12px; }
#mmp-new .mmp-spon-form__fields[hidden] { display: none; }
#mmp-new .mmp-switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#mmp-new .mmp-switchrow > span { display: flex; flex-direction: column; gap: 2px; }
#mmp-new .mmp-switchrow b { font-size: 14px; font-weight: 800; }
html body #mmp-new .mmp-switchrow small { font-size: 12px; color: var(--mmp-dim) !important; -webkit-text-fill-color: var(--mmp-dim) !important; }
html body #mmp-new .mmp-switchrow input {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 50px; height: 30px; border-radius: 15px; margin: 0;
  background: var(--mmp-line) !important; position: relative; border: 0 !important; transition: background 0.2s;
}
html body #mmp-new .mmp-switchrow input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #ffffff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.2s;
}
html body #mmp-new .mmp-switchrow input:checked { background: var(--mmp-gold) !important; }
html body #mmp-new .mmp-switchrow input:checked::after { transform: translateX(20px); }
#mmp-new .mmp-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#mmp-new .mmp-field-pair > .mmp-field { min-width: 0; }
html body #mmp-new .mmp-field-pair input { width: 100%; min-width: 0; font-size: 14px; padding: 0 8px; }
#mmp-new .mmp-spon-logo { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-top: -4px; }
#mmp-new .mmp-spon-logo[hidden] { display: none; }
#mmp-new .mmp-spon-logo img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; border: 1px solid var(--mmp-line); }

/* Pin actions sheet: no bottom nav over its Delete row, in every theme. */
html body:has(#mobile-map-post-actions-sheet.is-open) #bottom-nav { display: none !important; }
/* Dark (not Glass): the page's dark sweep turned the white panel's text white. */
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet .mobile-map-post-actions-panel {
    background: #17171a !important; box-shadow: 0 24px 70px rgba(0, 0, 0, .5) !important; border: 1px solid rgba(255, 255, 255, .08) !important;
}
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet .mobile-map-post-actions-panel > div:first-child { background: rgba(255, 255, 255, .18) !important; }
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet .mobile-map-post-actions-panel > div:nth-child(2) { color: rgba(255, 255, 255, .55) !important; -webkit-text-fill-color: rgba(255, 255, 255, .55) !important; }
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet .mobile-map-post-actions-panel > div:nth-child(3) { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet [data-map-post-action-choice="edit"] { background: #232327 !important; border-color: rgba(255, 255, 255, .1) !important; }
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet [data-map-post-action-choice="edit"],
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet [data-map-post-action-choice="edit"] * { color: #fff !important; -webkit-text-fill-color: #fff !important; }
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet [data-map-post-action-choice="delete"]:not(.is-armed) { background: rgba(239, 68, 68, .12) !important; border-color: rgba(239, 68, 68, .3) !important; }
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet [data-map-post-action-choice="delete"]:not(.is-armed),
html[data-theme*="dark"]:not([data-appearance="glass"]) body #mobile-map-post-actions-sheet#mobile-map-post-actions-sheet [data-map-post-action-choice="delete"]:not(.is-armed) * { color: #f87171 !important; -webkit-text-fill-color: #f87171 !important; }
