:root { --photo-map-width: calc(var(--workspace-width, 480px) * 2 / 3); }
.map-search-shortcuts { position: fixed; top: var(--desktop-search-top,10px); left: 12px; z-index: 2401; display: flex; align-items: center; gap: 7px; }
.map-search-shortcuts .map-search-nearby { position: relative; }
html:is([data-app-layout=phone],[data-app-layout=tablet]) .map-search-shortcuts { display: none; }

body.photo-map-open #mapApplication {
  width: calc(100% - var(--photo-map-width));
  transform: translateZ(0);
  overflow: hidden;
  container-type: inline-size;
}
body.photo-map-open #mapApplication .navbar-brand-text { font-size: clamp(18px, 2.6cqw, 28px); }
body.photo-map-open #mapApplication .brand-partner-logo-link { display: none; }
#btnPhotoMap[aria-expanded=true] { background:var(--ui-selected,#e8f0fe); color:var(--ui-link,#164783); border-color:var(--ui-border,#c9d8e9); }
body.then-there-open #btnPhotoMap { visibility: hidden; }

.photo-map-panel {
  --pm-surface: var(--ui-surface,#fff);
  --pm-base: var(--ui-recess,#f5f7fa);
  --pm-ink: var(--ui-text,#202936);
  --pm-muted: var(--ui-muted,#4e6375);
  --pm-line: var(--ui-border,#d6dfe8);
  --pm-active: var(--ui-selected,#e4eefb);
  --pm-link: var(--ui-link,#164783);
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  width: var(--photo-map-width);
  height: var(--app-height,100dvh);
  max-height: 100dvh;
  box-sizing: border-box;
  background: var(--pm-surface);
  color: var(--pm-ink);
  border-inline-start: 1px solid var(--pm-line);
  box-shadow: -8px 0 32px #10253c21;
  font: 14px/1.45 var(--font-body,system-ui,sans-serif);
}
.photo-map-panel[hidden], .photo-map-panel [hidden] { display: none !important; }
.photo-map-panel *, .photo-map-panel *::before, .photo-map-panel *::after { box-sizing: border-box; }
.photo-map-panel :is(h2,h3,p) { margin: 0; }
.photo-map-panel button { color: inherit; font: inherit; cursor: pointer; }
.photo-map-panel button:disabled { cursor: default; opacity: .43; }
.photo-map-panel :is(button,a):focus-visible { outline: 2px solid var(--pm-link); outline-offset: 2px; }
.pm-header { display: flex; align-items: center; gap: 9px; min-height: 62px; padding: 9px 14px; border-bottom: 1px solid var(--pm-line); }
.pm-header .pm-heading { flex: 1; font-size: 19px; font-weight: 670; letter-spacing: -.02em; }
.pm-header > .pm-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--pm-active); color: var(--pm-link); }
.pm-icon { display: inline-grid; place-items: center; flex: none; }
.pm-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pm-icon-button {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent;
}
.pm-icon-button:hover:not(:disabled), .pm-text-button:hover:not(:disabled) { background: var(--pm-active); color: var(--pm-link); }
.pm-icon-button[aria-pressed=true], .pm-icon-button[aria-pressed=mixed], .pm-button[aria-pressed=true] { background: var(--pm-active); color: var(--pm-link); }
.pm-icon-button[aria-pressed=mixed]::after { content: ''; position: absolute; right: 4px; bottom: 4px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pm-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 15px 14px 20px; }
.pm-body > * { flex-shrink: 0; }
.pm-heading { font-size: 21px; font-weight: 680; letter-spacing: -.025em; overflow-wrap: anywhere; }
.pm-heading:focus { outline: none; }
.pm-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; min-height: 28px; color: var(--pm-muted); font-size: 12px; }
.pm-crumbs .pm-icon svg { width: 12px; height: 12px; }
.pm-crumbs .pm-text-button { min-height: 28px; padding: 2px 4px; text-align: start; }
.pm-text-button, .pm-button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 34px; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--pm-link); font-weight: 620; }
.pm-text-button .pm-icon svg, .pm-button .pm-icon svg { width: 16px; height: 16px; }
.pm-button { min-height: 38px; border: 1px solid var(--pm-line); background: var(--pm-base); }
.pm-button:hover:not(:disabled) { background: var(--pm-active); color: var(--pm-link); }
.pm-album-grid, .pm-photo-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 9px; row-gap: 13px; }
.pm-album-card, .pm-photo-card { min-width: 0; position: relative; }
.pm-album-open, .pm-photo-open { display: block; width: 100%; padding: 0; border: 0; border-radius: 9px; background: transparent; text-align: start; }
.pm-album-open:hover .pm-album-info strong, .pm-photo-open:hover .pm-photo-name { color: var(--pm-link); text-decoration: underline; }
.pm-album-cover, .pm-photo-thumb, .pm-detail-image { position: relative; display: grid; place-items: center; overflow: hidden; width: 100%; aspect-ratio: 1.22; border-radius: 9px; background: var(--pm-base); color: var(--pm-muted); }
.pm-album-cover > .pm-icon svg, .pm-detail-image > .pm-icon svg { width: 26px; height: 26px; }
.pm-album-cover.is-folder { border-bottom: 3px solid var(--pm-line); }
.pm-album-cover img, .pm-photo-thumb img, .pm-detail-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.pm-album-cover.is-folder:has(img + img) img:first-of-type { width: calc(58% - 1px); }
.pm-album-cover.is-folder:has(img + img) img + img { left: 58%; width: 42%; }
.pm-album-info { display: grid; gap: 1px; padding: 7px 0 0; }
.pm-album-info strong { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.pm-album-info small { color: var(--pm-muted); font-size: 11px; }
.pm-album-card > .pm-album-toggle, .pm-photo-card > .pm-icon-button, .pm-detail-image > .pm-icon-button {
  position: absolute; top: 5px; right: 5px; z-index: 1;
  width: 33px; height: 33px; border-color: var(--pm-line); background: var(--pm-surface); color: var(--pm-muted); box-shadow: 0 1px 6px #1425392d;
}
.pm-album-card > .pm-album-toggle[aria-pressed=true], .pm-album-card > .pm-album-toggle[aria-pressed=mixed], .pm-photo-card > .pm-icon-button[aria-pressed=true] { background: var(--pm-active); color: var(--pm-link); }
.pm-photo-thumb { aspect-ratio: 1.08; }
.pm-photo-name { display: block; min-width: 0; padding-top: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.pm-album-tools, .pm-detail-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pm-album-tools { color: var(--pm-muted); border-bottom: 1px solid var(--pm-line); font-size: 12px; }
.pm-detail-tools { justify-content: start; flex-wrap: wrap; }
.pm-detail-image { aspect-ratio: 1.35; }
.pm-detail-image img { object-fit: contain; }
.pm-detail-image > .pm-icon-button { top: auto; bottom: 6px; }
.pm-photo-meta, .pm-status { color: var(--pm-muted); font-size: 12px; }
.pm-source { width: fit-content; color: var(--pm-link); }
.pm-status { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pm-footer { flex: none; border-top: 1px solid var(--pm-line); padding: 7px 10px; background: var(--pm-surface); }
.pm-footer-row { display: flex; align-items: center; gap: 3px; }
.pm-footer-row .pm-text-button { padding-inline: 5px; font-size: 12px; white-space: nowrap; }
.pm-map-count { flex: 1; min-width: 0; color: var(--pm-muted); font-size: 12px; }
.photo-map-overlay .photo-map-thumbnail-unavailable img { display: none; }
.photo-map-overlay .photo-map-thumbnail-unavailable::before { content: '▣'; color: #2d3339; }
.pm-edit-button { align-self: flex-start; }
.pm-edit-form { display: grid; gap: 10px; }
.pm-edit-form fieldset { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pm-edit-location { display: grid; justify-items: start; gap: 6px; padding: 10px; border: 1px solid var(--pm-line); border-radius: 9px; background: var(--pm-base); }
.pm-edit-location small, .pm-edit-coordinates { color: var(--pm-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pm-edit-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.pm-edit-field :is(input,textarea) { width: 100%; min-height: 38px; padding: 6px 8px; border: 1px solid var(--pm-line); border-radius: 7px; background: var(--pm-surface); color: var(--pm-ink); font: 400 15px/1.4 var(--font-body,system-ui,sans-serif); }
.pm-edit-field textarea { min-height: 76px; resize: vertical; }
.pm-edit-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 8px 0; background: var(--pm-surface); }
.photo-map-panel .pm-save-photo { background: var(--ui-accent,#164783); border-color: transparent; color: var(--ui-accent-ink,#fff); }
.photo-map-panel .pm-save-photo:hover:not(:disabled) { background: color-mix(in srgb,var(--ui-accent,#164783) 86%,var(--pm-ink)); color: var(--ui-accent-ink,#fff); }
.pm-location-overlay { position: absolute; inset: 0; z-index: 301; pointer-events: none; }
.pm-location-pin { position: absolute; width: 38px; height: 48px; padding: 0; border: 0; background: none; transform: translate(-50%,-100%); touch-action: none; cursor: grab; pointer-events: auto; filter: drop-shadow(0 2px 2px #1425396b); }
.pm-location-pin[hidden] { display: none; }
.pm-location-pin:active { cursor: grabbing; }
.pm-location-pin:focus-visible { outline: 2px solid #0e316e; outline-offset: 2px; border-radius: 10px; }
.pm-location-pin svg { display: block; width: 100%; height: 100%; fill: #ca4821; stroke: #fff; stroke-width: 2; }
.pm-location-pin circle { fill: #fff; }

@media (prefers-reduced-motion:no-preference) {
  .photo-map-panel:not([hidden]) { animation: workspace-panel-open 220ms cubic-bezier(.2,.8,.2,1) both; }
}
@media (min-width: 681px) {
  html:is([data-app-layout=phone],[data-app-layout=tablet]) body.photo-map-open #mapApplication { width: calc(100% - var(--photo-map-width)) !important; }
}
@media (max-width: 680px) {
  html body.photo-map-open #mapApplication { width: 100%; height: calc(var(--app-viewport-height,100dvh) * .48) !important; }
  .photo-map-panel { inset: auto 0 0; width: 100%; height: calc(var(--app-viewport-height,100dvh) * .52); max-height: 58dvh; border: 0; border-top: 1px solid var(--pm-line); border-radius: 18px 18px 0 0; }
  .pm-header { min-height: 48px; padding-block: 4px; }
  .pm-body { padding-block: 8px 14px; }
  .pm-album-grid, .pm-photo-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .pm-detail-image { height: clamp(92px,22dvh,220px); }
  .pm-footer { padding-bottom: max(7px,var(--app-safe-bottom,0px)); }
  .pm-edit-field :is(input,textarea) { font-size: 16px; }
  body.photo-map-open #mobileAppShell :is(.app-bottom-dock,.app-main-view-toggle,.app-map-logo,.app-location-status,.app-centre-cross) { visibility: hidden; }
}
