/* ParterHouse 0.3.40 — compact fullscreen map, image fitted without horizontal pan.
 * Core and saved polygons are untouched; all coordinates remain image-relative. */
.phcore-map--phases .phcore-map__pan-hint{display:none!important}

/* One restrained filter strip: only the buttons, not the photograph, can scroll sideways on phones. */
.ph-property-map-dialog .phcore-map__toolbar,
body.ph-estate-viewer-active .ph-estate-viewer__body .phcore-map__toolbar {
  box-sizing:border-box;display:flex;flex-wrap:nowrap;align-items:center;
  justify-content:flex-start!important;gap:6px!important;
  width:100%;max-width:100%;min-width:0;
  padding:0 2px 5px!important;margin:4px 0 6px!important;
  overflow-x:auto;overflow-y:hidden;scrollbar-width:none;
  -webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;
}
.ph-property-map-dialog .phcore-map__toolbar::-webkit-scrollbar,
body.ph-estate-viewer-active .ph-estate-viewer__body .phcore-map__toolbar::-webkit-scrollbar{display:none}
.ph-property-map-dialog .phcore-map__toolbar button,
body.ph-estate-viewer-active .ph-estate-viewer__body .phcore-map__toolbar button {
  flex:0 0 auto;white-space:nowrap;font-size:12px;line-height:1.2;
  padding:7px 10px;min-height:30px;border-radius:7px;
}

/* Give the photograph almost the entire first screen. */
.ph-property-map-dialog__header,
body.ph-estate-viewer-active .ph-estate-viewer__header {
  box-sizing:border-box;padding:7px clamp(12px,2vw,28px)!important;
  min-height:56px;gap:12px;
}
.ph-property-map-dialog__title{min-width:0}
.ph-property-map-dialog__title h2,
body.ph-estate-viewer-active .ph-estate-viewer__header .ph-property-map-dialog__title h1 {
  font-size:clamp(19px,2.1vw,26px)!important;line-height:1.13!important;
  margin:0 0 2px!important;letter-spacing:-.015em;
}
.ph-property-map-dialog__title p,
body.ph-estate-viewer-active .ph-estate-viewer__header .ph-property-map-dialog__title p {
  font-size:11px!important;line-height:1.2!important;margin:0!important;
  color:#aac4d4!important;
}
.ph-property-map-dialog__title .ph-property-map-dialog__eyebrow{display:none}
.ph-property-map-dialog__close,
body.ph-estate-viewer-active .ph-estate-viewer__close {
  width:38px!important;height:38px!important;min-width:38px!important;
  max-width:38px!important;min-height:38px!important;flex:0 0 38px!important;
  font-size:29px!important;border-radius:7px!important;
}
.ph-property-map-dialog__body,
body.ph-estate-viewer-active .ph-estate-viewer__body {
  padding:3px clamp(8px,1.3vw,22px) 8px!important;
}
body.ph-estate-viewer-active .ph-estate-viewer__foot{padding:2px 12px 8px!important}

/* Replace the Core's wide panning canvas with a sized, centred photograph.
   JS supplies exact pixel width/viewport height from natural image proportions.
   CSS !important intentionally wins over Core's inline large-canvas width. */
.phcore-map--phases .phcore-map__layout>.ph-theme-mapframe{
  box-sizing:border-box;min-width:0;width:100%;position:relative;align-self:start;
}
.phcore-map--phases .ph-theme-mapframe>.phcore-map__stage[data-phcore-pan-viewport]{
  box-sizing:border-box;width:100%!important;
  height:var(--ph-theme-map-height,clamp(280px,65dvh,780px))!important;
  min-height:0!important;max-height:none!important;
  overflow-x:hidden!important;overflow-y:auto!important;
  overscroll-behavior-x:none;overscroll-behavior-y:contain;
  touch-action:pan-y;scrollbar-width:thin;cursor:default;
  border-radius:10px;
}
.phcore-map--phases .ph-theme-mapframe .phcore-map__canvas[data-phcore-pan-canvas]{
  box-sizing:border-box;position:relative;min-width:0!important;
  max-width:100%!important;width:var(--ph-theme-canvas-width,100%)!important;
  margin:0 auto!important;
}
.phcore-map--phases .ph-theme-mapframe .phcore-map__canvas>.phcore-map__image{
  display:block;width:100%!important;height:auto!important;max-width:none!important;
}
.phcore-map--phases .ph-theme-mapframe .phcore-map__canvas>.phcore-map__polygons,
.phcore-map--phases .ph-theme-mapframe .phcore-map__canvas>.phcore-map__phase-dimmer{
  width:100%!important;height:100%!important;
}

/* Stage selectors float above the map instead of taking a separate row. */
.phcore-map--phases .ph-theme-mapframe>.phcore-map__phase-nav{
  box-sizing:border-box;position:absolute;z-index:16;
  left:9px;top:9px;width:max-content;max-width:calc(100% - 18px);
  display:flex;align-items:center;gap:5px;flex-wrap:wrap;
  margin:0!important;padding:5px!important;border:1px solid rgba(158,197,216,.30);
  border-radius:9px;color:#fff;background:rgba(8,27,42,.83);
  box-shadow:0 3px 18px rgba(0,0,0,.23);
  -webkit-backdrop-filter:blur(9px);backdrop-filter:blur(9px);
}
.phcore-map--phases .ph-theme-mapframe>.phcore-map__phase-nav>strong{display:none}
.phcore-map--phases .ph-theme-mapframe>.phcore-map__phase-nav button{
  padding:6px 9px;min-height:29px;border-radius:5px;
  font-size:12px;line-height:1.25;white-space:nowrap;
}
.phcore-map--phases .ph-theme-mapframe>.phcore-map__phase-nav button[aria-pressed="true"]{
  background:#00a9d6;border-color:#00a9d6;color:#fff;
}
.phcore-map--phases .ph-theme-mapframe>.phcore-map__phase-nav button:focus-visible{
  outline:2px solid #fff;outline-offset:2px;
}

/* Cards stay beside the photograph on desktop and below it on phones. */
.ph-property-map-dialog .phcore-map__layout,
body.ph-estate-viewer-active .ph-estate-viewer__body .phcore-map__layout{
  align-items:start!important;gap:12px!important;
}
.phcore-map--phases .phcore-map__sidebar{min-height:0}
.phcore-map--phases .phcore-map__list{max-height:var(--ph-theme-map-height,70dvh);overflow-y:auto}

@media(max-width:850px){
  .ph-property-map-dialog .phcore-map__layout,
  body.ph-estate-viewer-active .ph-estate-viewer__body .phcore-map__layout{
    grid-template-columns:minmax(0,1fr)!important;
  }
}
@media(max-width:700px){
  .ph-property-map-dialog__header,
  body.ph-estate-viewer-active .ph-estate-viewer__header{padding:7px max(11px,env(safe-area-inset-left))!important}
  .ph-property-map-dialog__body,
  body.ph-estate-viewer-active .ph-estate-viewer__body{padding:3px max(6px,env(safe-area-inset-left)) 9px!important}
  .phcore-map--phases .ph-theme-mapframe>.phcore-map__phase-nav{
    left:6px;top:6px;max-width:calc(100% - 12px);padding:4px!important;gap:3px;
  }
  .phcore-map--phases .ph-theme-mapframe>.phcore-map__phase-nav button{
    font-size:11px;min-height:26px;padding:5px 6px;
  }
  .phcore-map--phases .phcore-map__list{max-height:none}
  .ph-property-map-dialog .phcore-map__toolbar button,
  body.ph-estate-viewer-active .ph-estate-viewer__body .phcore-map__toolbar button{
    font-size:11px;padding:6px 9px;min-height:29px;
  }
}

/* 0.3.40 — explicit fit-to-height can require horizontal panning. */
.phcore-map--phases.ph-map-mode-height .ph-theme-mapframe>.phcore-map__stage[data-phcore-pan-viewport]{
  overflow-x:auto!important;overflow-y:auto!important;touch-action:pan-x pan-y;
}
.phcore-map--phases.ph-map-mode-height .ph-theme-mapframe .phcore-map__canvas[data-phcore-pan-canvas]{
  max-width:none!important;min-width:0!important;margin:0 auto!important;
}
.phcore-map--phases.ph-map-mode-width .ph-theme-mapframe>.phcore-map__stage[data-phcore-pan-viewport],
.phcore-map--phases.ph-map-mode-contain .ph-theme-mapframe>.phcore-map__stage[data-phcore-pan-viewport]{
  overflow-x:hidden!important;touch-action:pan-y;
}


/* 0.3.43 — On phones and tablets the stage chooser is a narrow vertical rail.
   Leave the photograph unobstructed across the rest of its width. Desktop
   retains the previous horizontal controls. */
@media (max-width: 768px), (max-width: 1366px) and (pointer: coarse) {
  .phcore-map--phases .ph-theme-mapframe > .phcore-map__phase-nav {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: max-content !important;
    max-width: min(134px, calc(100% - 14px)) !important;
    min-width: 0 !important;
    gap: 3px !important;
    padding: 5px !important;
    left: 7px !important;
    top: 7px !important;
    border-radius: 8px !important;
  }
  .phcore-map--phases .ph-theme-mapframe > .phcore-map__phase-nav button {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-height: 28px !important;
    padding: 6px 9px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    border-radius: 5px !important;
  }
  /* Users can enlarge the MAP deliberately with a two-finger gesture. When
     zoomed, native one-finger inertial panning works in both directions. */
  .phcore-map--phases.ph-theme-touch-zoom .ph-theme-mapframe > .phcore-map__stage[data-phcore-pan-viewport] {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }
  .phcore-map--phases.ph-theme-touch-zoom.is-ph-touch-zoomed .ph-theme-mapframe > .phcore-map__stage[data-phcore-pan-viewport] {
    overflow-x: auto !important;
    overflow-y: auto !important;
    touch-action: pan-x pan-y;
  }
  .phcore-map--phases.ph-theme-touch-zoom.is-ph-touch-zoomed .ph-theme-mapframe .phcore-map__canvas[data-phcore-pan-canvas] {
    max-width: none !important;
    width: var(--ph-theme-canvas-width) !important;
  }
}
