/* «Места» - travel map and passport stamps on the client card (places-map.js).
   No tiles: land, borders and the ocean are painted with the panel tokens,
   so every mood theme repaints the map with the rest of the page. */

.pm-card { padding: 0; overflow: hidden; }
.pm-card > .ct-card-head { padding: 18px 20px 0; margin-bottom: 12px; }
.pm-card .pm-host { padding: 0 12px 12px; }

.pm-wrap {
  --pm-ocean: color-mix(in srgb, var(--blue) 8%, var(--paper-2));
  --pm-ocean-2: color-mix(in srgb, var(--blue) 14%, var(--paper-2));
  --pm-land: var(--surface);
  --pm-border: color-mix(in srgb, var(--ink) 17%, transparent);
  position: relative;
  height: 480px;
  border-radius: var(--r-lg);
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 22% 18%, var(--pm-ocean) 0%, var(--pm-ocean-2) 100%);
  box-shadow: inset 0 0 0 1px var(--divider);
}
.pm-map { position: absolute; inset: 0; background: transparent; font: inherit; }
.pm-map.leaflet-container { background: transparent; outline: 0; cursor: grab; }
.pm-map.leaflet-container.leaflet-dragging { cursor: grabbing; }

/* fade the drawing in once it is placed */
.pm-wrap .leaflet-overlay-pane, .pm-wrap .leaflet-marker-pane { opacity: 0; transition: opacity .5s ease; }
.pm-wrap.pm-ready .leaflet-overlay-pane, .pm-wrap.pm-ready .leaflet-marker-pane { opacity: 1; }

.pm-loading, .pm-fail {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  color: var(--subtle); font-size: 13.5px; text-align: center; padding: 20px;
}
.pm-loading span {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2.5px solid var(--divider); border-top-color: var(--accent);
  animation: pm-spin .8s linear infinite;
}
@keyframes pm-spin { to { transform: rotate(360deg); } }

/* ── land ── */
.pm-grat { stroke: color-mix(in srgb, var(--blue) 11%, transparent); stroke-width: .6; fill: none; }
.pm-c { fill: var(--pm-land); stroke: var(--pm-border); stroke-linejoin: round; transition: fill .25s ease; }
.pm-c:hover { fill: var(--elevated); }
.pm-c-been { fill: color-mix(in srgb, var(--accent) 30%, var(--pm-land)); stroke: color-mix(in srgb, var(--accent) 55%, transparent); }
.pm-c-been:hover { fill: color-mix(in srgb, var(--accent) 42%, var(--pm-land)); }
.pm-c-lives { fill: color-mix(in srgb, var(--blue) 26%, var(--pm-land)); stroke: color-mix(in srgb, var(--blue) 55%, transparent); }
.pm-c-wants { fill: url(#pm-hatch); stroke: color-mix(in srgb, var(--amber) 65%, transparent); }
.pm-hatch-bg { fill: color-mix(in srgb, var(--amber) 9%, var(--pm-land)); }
.pm-hatch-ln { stroke: color-mix(in srgb, var(--amber) 55%, transparent); stroke-width: 2.4; }

/* ── the walk through the trips ── */
.pm-route {
  stroke: var(--accent); stroke-width: 2.2; fill: none; opacity: .9;
  stroke-dasharray: 1 7; stroke-linecap: round;
  animation: pm-march 1.4s linear infinite;
}
.pm-route-next { stroke: var(--green); stroke-dasharray: 6 6; stroke-linecap: butt; }
@keyframes pm-march { to { stroke-dashoffset: -16; } }

/* ── pins ── */
.leaflet-marker-icon.pm-m { background: none; border: 0; }
.pm-pin {
  position: relative; display: grid; place-items: center; width: 100%; height: 100%;
  transition: transform .22s cubic-bezier(.3, 1.6, .5, 1);
}
.pm-ready .pm-pin { animation: pm-pop .55s cubic-bezier(.3, 1.6, .5, 1) backwards; }
@keyframes pm-pop { from { transform: scale(0); } }
.pm-m:hover .pm-pin, .pm-lit .pm-pin { transform: scale(1.35); }

.pm-been {
  border-radius: 50%; background: var(--accent); color: #fff;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(16, 20, 36, .28), 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent);
  font: 700 11.5px/1 var(--font-display);
}
.pm-been.pm-many { font-size: 12.5px; }
.pm-been.pm-old { background: color-mix(in srgb, var(--accent) 58%, #fff); }
.pm-lit .pm-been { box-shadow: 0 2px 6px rgba(16, 20, 36, .28), 0 0 0 9px color-mix(in srgb, var(--accent) 26%, transparent); }
.pm-heart {
  position: absolute; top: -8px; right: -8px; width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center; font: normal 9px/1 var(--font-ui);
  background: #fff; color: var(--red); box-shadow: 0 1px 3px rgba(16, 20, 36, .3);
}
.pm-next .pm-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--green);
  border: 2.5px solid #fff; box-shadow: 0 2px 6px rgba(16, 20, 36, .3);
}
.pm-next .pm-ring {
  position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--green);
  animation: pm-pulse 1.9s ease-out infinite;
}
@keyframes pm-pulse { 0% { transform: scale(.45); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.pm-want svg {
  width: 100%; height: 100%; overflow: visible;
  fill: color-mix(in srgb, var(--amber) 28%, #fff); stroke: var(--amber); stroke-width: 1.7; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(16, 20, 36, .25));
}
.pm-lit .pm-want svg { fill: var(--amber); }

/* ── tooltips ── */
.leaflet-tooltip.pm-tip {
  background: var(--ink); color: #fff; border: 0; border-radius: 12px;
  padding: 9px 12px 10px; box-shadow: 0 12px 28px -8px rgba(16, 20, 36, .45);
  font: 13px/1.35 var(--font-ui); white-space: nowrap; max-width: 320px;
}
.leaflet-tooltip-top.pm-tip::before { border-top-color: var(--ink); }
.pm-tip-in { display: flex; flex-direction: column; gap: 2px; }
.pm-tip-in b { font: 600 15px/1.25 var(--font-display); }
.pm-tip-c { color: rgba(255, 255, 255, .6); font-size: 12px; }
.pm-tip-sub { color: rgba(255, 255, 255, .82); white-space: normal; width: max-content; max-width: 260px; }
.pm-tip-tag {
  align-self: flex-start; margin-bottom: 3px; padding: 2px 7px; border-radius: var(--r-pill);
  font: 600 10.5px/1.4 var(--font-ui); letter-spacing: .04em; text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 85%, #000); color: #fff;
}
.pm-tip-next .pm-tip-tag { background: var(--green); }
.pm-tip-want .pm-tip-tag { background: var(--amber); }
.leaflet-tooltip.pm-ctip {
  background: var(--surface); color: var(--ink); border: 1px solid var(--stroke); border-radius: 8px;
  box-shadow: var(--sh-1); padding: 3px 8px; font: 500 12px var(--font-ui);
}
.leaflet-tooltip-top.pm-ctip::before { border-top-color: var(--surface); }

/* ── chrome over the map ── */
.pm-stats, .pm-legend, .pm-ctl, .pm-pending, .pm-empty {
  position: absolute; z-index: 500;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(10px) saturate(1.4); backdrop-filter: blur(10px) saturate(1.4);
  border: 1px solid var(--divider); box-shadow: 0 6px 18px -10px rgba(16, 20, 36, .35);
}
.pm-stats { top: 12px; left: 12px; display: flex; gap: 2px; padding: 6px; border-radius: 14px; }
.pm-stats > div { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 4px 10px; }
.pm-stats > div + div { border-left: 1px solid var(--divider); }
.pm-stats b { font: 700 22px/1.1 var(--font-display); color: var(--ink); }
.pm-stats span { font-size: 11.5px; color: var(--subtle); }
.pm-stats-next b { color: var(--green); }

.pm-legend { left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: var(--r-pill); }
.pm-legend button {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 9px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--subtle); font: 500 12.5px var(--font-ui); cursor: pointer;
  transition: background .15s, color .15s;
}
.pm-legend button.on { color: var(--ink); background: var(--surface); box-shadow: var(--sh-1); }
.pm-legend button:not(.on) .pm-lg { filter: grayscale(1); opacity: .45; }
.pm-legend em { font-style: normal; font-weight: 600; color: var(--subtle); font-variant-numeric: tabular-nums; }
.pm-lg { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex: none; }
.pm-lg-been { background: var(--accent); box-shadow: 0 0 0 2px #fff, 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.pm-lg-next { background: var(--green); box-shadow: 0 0 0 2px #fff, 0 0 0 3px color-mix(in srgb, var(--green) 35%, transparent); }
.pm-lg-want { border-radius: 2px; transform: rotate(45deg) scale(.85); background: var(--amber); }
.pm-lg-route { width: 16px; height: 0; border-radius: 0; border-top: 2px dotted var(--accent); }

.pm-ctl { top: 12px; right: 12px; display: flex; flex-direction: column; padding: 3px; border-radius: 12px; }
.pm-ctl button {
  width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--ink);
  font: 500 17px/1 var(--font-ui); cursor: pointer;
}
.pm-ctl button:hover { background: var(--elevated); }
.pm-ctl button[data-z="fit"], .pm-ctl button[data-z="full"] { font-size: 15px; }
.pm-ctl button + button[data-z="fit"] { margin-top: 4px; border-top: 1px solid var(--divider); border-radius: 0 0 9px 9px; }

.pm-pending { right: 12px; bottom: 12px; max-width: 46%; padding: 6px 11px; border-radius: var(--r-pill); font-size: 12px; color: var(--subtle); }
.pm-empty {
  top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 16px 22px; border-radius: 16px;
  display: flex; flex-direction: column; gap: 4px; text-align: center; max-width: 320px;
}
.pm-empty b { font: 600 16px var(--font-display); }
.pm-empty span { font-size: 13px; color: var(--subtle); }

.pm-wrap.pm-full {
  position: fixed; inset: 16px; z-index: 1200; height: auto;
  box-shadow: 0 0 0 100vmax rgba(16, 20, 36, .55), var(--sh-2);
}
body.pm-noscroll { overflow: hidden; }

/* list rows that have a point light up together with it */
[data-pm-key] { transition: background .15s; border-radius: var(--r-sm); }
[data-pm-key].pm-row-lit { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.pm-locate {
  display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 4px; vertical-align: -5px;
  border: 0; border-radius: 50%; background: none; padding: 0; cursor: pointer; color: var(--subtle);
  transition: color .15s, background .15s;
}
.pm-locate svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.pm-locate:hover { color: var(--accent-ink); background: var(--accent-weak); }

/* ── passport stamps ── */
.pm-stamps { display: flex; flex-wrap: wrap; gap: 18px 14px; padding: 8px 4px 6px; }
.pm-stamp {
  --c: var(--accent);
  position: relative; width: 132px; min-height: 104px; padding: 12px 10px 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center;
  color: var(--c); border: 2.5px solid var(--c); border-radius: 18px;
  outline: 1px solid color-mix(in srgb, var(--c) 70%, transparent); outline-offset: 3px;
  transform: rotate(var(--r, -3deg));
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--c) 7%, transparent), transparent 60%),
    color-mix(in srgb, var(--c) 4%, var(--surface));
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.pm-stamp:hover { transform: rotate(0deg) scale(1.05); }
.pm-stamp:nth-child(3n) { border-radius: 50% / 42%; }
.pm-stamp-ic { font-size: 22px; line-height: 1; }
.pm-stamp-t { font: 700 11.5px/1.15 var(--font-display); letter-spacing: .05em; text-transform: uppercase; max-width: 100%; overflow-wrap: anywhere; }
.pm-stamp-y { font: 700 18px/1 var(--font-display); letter-spacing: .08em; }
.pm-stamp-d { font-size: 10.5px; opacity: .75; letter-spacing: .04em; text-transform: uppercase; }

@media (max-width: 640px) {
  .pm-wrap { height: 380px; }
  .pm-stats > div { min-width: 52px; padding: 3px 7px; }
  .pm-stats b { font-size: 18px; }
  .pm-pending { display: none; }
  .pm-stamp { width: 116px; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-route, .pm-next .pm-ring, .pm-ready .pm-pin { animation: none; }
}
