/* Listing viewer: shared Bybre typography and glass controls. */
#listing-viewer{font-family:'Bybre Sans',sans-serif;--listing-ink:#17463f;--listing-edge:12px;--listing-button:44px;--listing-progress-bottom:calc(14px + env(safe-area-inset-bottom))}
#listing-viewer button,#listing-viewer a,.property-dialog{font-family:'Bybre Sans',sans-serif}
#listing-viewer .listing-glass{display:grid;place-items:center;color:var(--listing-ink);border:1px solid #fff5;background:linear-gradient(135deg,#ffffff42,#ffffff14),#d3c8ae24;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);box-shadow:inset 0 1px 0 #ffffff18;transition:background 75ms ease-out,transform 150ms ease-out}
#listing-viewer .listing-glass:active{transform:scale(.96)}
#listing-viewer .viewer-close{left:max(12px,calc((100vw - 520px)/2 + 12px));top:calc(12px + env(safe-area-inset-top));width:44px;height:44px;border-radius:17px;z-index:5}
#listing-viewer .viewer-close img{width:16px;height:16px}
#listing-viewer .listing-share{position:absolute;right:12px;top:calc(12px + env(safe-area-inset-top));width:44px;height:44px;border-radius:17px;z-index:3}
#listing-viewer .listing-share img{width:24px;height:24px}
#listing-viewer .listing-counter{position:fixed;left:50%;top:calc(19px + env(safe-area-inset-top));z-index:12;transform:translateX(-50%);height:28px;min-width:54px;padding:0 14px;border-radius:999px;font-size:16px;line-height:20px;font-weight:500;letter-spacing:0;font-variant-numeric:tabular-nums;text-shadow:none;pointer-events:none}
#listing-viewer .listing-shade{background:linear-gradient(180deg,#0002,transparent 28%,transparent 49%,#0002 70%,#0005)}
#listing-viewer .playback-controls{position:absolute;top:44%;left:50%;transform:translateX(-50%);display:flex;align-items:center;flex-direction:column;gap:14px;z-index:2}
#listing-viewer .sound-toggle,#listing-viewer .video-toggle{position:static;right:auto;bottom:auto;border-radius:50%;width:44px;height:44px}
#listing-viewer .video-toggle{width:64px;height:64px;font-size:24px}#listing-viewer .sound-toggle svg{width:22px;height:22px}
#listing-viewer .listing-info{left:12px;right:12px;bottom:calc(var(--listing-progress-bottom) + 26px);text-align:center;text-shadow:0 1px 12px #0003}
#listing-viewer .listing-info h2{font-size:18px;line-height:24px;font-weight:600;letter-spacing:-.18px;margin-bottom:4px}
#listing-viewer .listing-location{font-size:16px;line-height:24px;font-weight:400;color:#ffffffe0;letter-spacing:.16px}.listing-location span{display:inline-block;margin:0 6px}
#listing-viewer .listing-price{font-size:22px;line-height:28px;font-weight:600;letter-spacing:-.22px;margin:10px 0}
.listing-facts{display:flex;justify-content:center;flex-wrap:wrap;gap:4px 16px;list-style:none;padding:0;margin:0 0 10px;font-size:16px;line-height:24px;letter-spacing:.16px}
.listing-actions{display:flex;align-items:center;justify-content:center;gap:10px}.listing-actions button,.listing-actions a{width:44px;height:44px;border-radius:17px}.listing-actions svg{width:24px;height:24px;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
#listing-viewer .timeline{left:12px;right:12px;bottom:calc(var(--listing-progress-bottom) - 12px);height:24px}
#listing-viewer .timeline input{height:24px;border-radius:999px}#listing-viewer .timeline input::-webkit-slider-runnable-track{height:2px;border-radius:999px;background:linear-gradient(to right,#fff var(--progress),#ffffff50 var(--progress))}#listing-viewer .timeline input::-moz-range-track{height:2px;border-radius:999px;background:linear-gradient(to right,#fff var(--progress),#ffffff50 var(--progress))}#listing-viewer .timeline input::-webkit-slider-thumb{margin-top:-4px}
.swipe-intro{position:absolute;inset:0;z-index:10;width:100%;height:100%;background:#0009;color:white;cursor:pointer;touch-action:none}.swipe-intro[hidden]{display:none}.swipe-label{position:absolute;left:20px;right:20px;top:68%;text-align:center;font-family:'Bybre Sans',sans-serif;font-weight:600;font-size:16px;line-height:24px;letter-spacing:.16px;text-shadow:none}.swipe-gesture{position:absolute;left:calc(50% - 28px);top:60%;width:56px;height:64px;animation:swipe-hand 3.2s cubic-bezier(.32,.72,0,1) infinite}.swipe-gesture svg{position:absolute;inset:0;width:56px;height:64px}.swipe-ring{position:absolute;top:7px;left:50%;transform:translateX(-50%);width:40px;height:40px;border:3px solid #fff;border-radius:50%;background:#ffffff24;animation:swipe-touch 3.2s ease-out infinite}
@keyframes swipe-hand{0%,8%{transform:translateY(0);opacity:0}14%,28%{transform:translateY(0);opacity:1}54%,75%{transform:translateY(-160px);opacity:1}86%,100%{transform:translateY(-160px);opacity:0}}@keyframes swipe-touch{0%,12%{transform:translateX(-50%) scale(.2);opacity:0}22%,70%{transform:translateX(-50%) scale(1);opacity:1}85%,100%{opacity:0}}
.property-dialog{color:#141414;background:#fff;border:0;border-radius:24px 24px 0 0;padding:24px;margin:auto auto 0;width:min(100%,520px);max-width:100%;max-height:calc(100dvh - 32px);overflow:auto;box-shadow:0 8px 32px #0002}.property-dialog::backdrop{background:#0007;backdrop-filter:blur(4px)}.property-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px}.property-dialog h2{font-size:18px;font-weight:600;line-height:24px;letter-spacing:-.18px}.property-close{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:50%;background:#0000000d;font-size:26px;line-height:1}.property-address{font-size:22px;font-weight:600;line-height:28px;margin-bottom:4px}.property-location{color:#676b5f;font-size:14px;line-height:20px}.property-price{font-size:24px;line-height:32px;font-weight:600;margin:24px 0}.property-facts{margin:0 0 24px}.property-facts>div{display:flex;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid #04040314}.property-facts dt{color:#676b5f}.property-facts dd{margin:0;font-weight:500}.property-contact{display:flex;align-items:center;justify-content:center;background:#141414;color:#fff;min-height:48px;border-radius:999px;padding:12px 20px;font-size:14px;font-weight:500;letter-spacing:.28px;margin-top:24px}.floorplan-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;background:#f1f0ee;border-radius:16px;min-height:400px;padding:24px 12px;text-align:center}.floorplan-content img{width:280px;height:190px;max-width:100%;object-fit:contain}.floorplan-content p{font-size:12px;line-height:16px;color:#676b5f}
@media(min-width:640px){.property-dialog{margin:auto;border-radius:24px}#listing-viewer .swipe-intro{left:calc((100% - 520px)/2);right:auto;width:520px}}
@media(max-height:650px){#listing-viewer .playback-controls{top:32%}.swipe-label{top:58%}.swipe-gesture{top:47%}}
@media(prefers-reduced-motion:reduce){.swipe-gesture,.swipe-ring{animation:none}.swipe-gesture{transform:translateY(-32px)}#listing-viewer .listing-glass{transition:none}}

/* Fade playback controls after inactivity; a tap on the video reveals them. */
#listing-viewer .playback-controls{opacity:0;pointer-events:none;transition:opacity 300ms ease-out}
#listing-viewer .controls-visible .playback-controls,#listing-viewer .playback-controls:has(:focus-visible){opacity:1;pointer-events:auto}
#listing-viewer .listing-whatsapp-icon{width:24px;height:24px;object-fit:contain}
@media(prefers-reduced-motion:reduce){#listing-viewer .playback-controls{transition:none}}

#listing-viewer .swipe-label{font-size:22px;line-height:28px;letter-spacing:.22px}

/* One optical icon system; preserve the Figma back asset and branded WhatsApp. */
#listing-viewer .listing-share svg,#listing-viewer .sound-toggle svg,#listing-viewer .video-toggle svg,#listing-viewer .listing-actions svg,#listing-viewer .viewer-navigation svg,.property-dialog .property-close svg{display:block;width:24px;height:24px;flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
#listing-viewer .sound-toggle svg path{stroke-width:1.75}
#listing-viewer .video-toggle svg{transform:translateX(0)}
#listing-viewer .paused .video-toggle svg{transform:translateX(1px)}
#listing-viewer .viewer-navigation{gap:12px}
#listing-viewer .viewer-navigation button{width:44px;height:44px;padding:0}
#listing-viewer .listing-actions button,#listing-viewer .listing-actions a,#listing-viewer .listing-share,#listing-viewer .sound-toggle,#listing-viewer .video-toggle{padding:0;place-items:center}
.property-dialog .property-close{width:44px;height:44px;padding:0}

/* Shared Bybre ink across viewer icons; retain WhatsApp's brand artwork. */
#listing-viewer .viewer-close,#listing-viewer .listing-share,#listing-viewer .sound-toggle,#listing-viewer .video-toggle,#listing-viewer .listing-actions button,#listing-viewer .viewer-navigation button,.property-dialog .property-close{color:#17463f}
#listing-viewer .viewer-close img{visibility:hidden}
#listing-viewer .viewer-close::before{content:'';position:absolute;width:16px;height:16px;background:currentColor;mask:url('assets/back-figma.svg') center/16px 16px no-repeat;-webkit-mask:url('assets/back-figma.svg') center/16px 16px no-repeat}
#listing-viewer .viewer-navigation button{background:#ece5d5cc;border-color:#fff5;backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}

/* Persistent viewer actions stay above the scrolling video feed. */
#listing-viewer>.listing-share{right:max(12px,calc((100vw - 520px)/2 + 12px));z-index:5}

/* Progress center stays14px above the card bottom plus the mobile safe area.
   Property text and actions move as one group with a26px gap above progress. */

/* Desktop: independent portrait cards in a full-height scrolling feed. */
@media(min-width:640px){
 #listing-viewer{--listing-card-width:min(calc((var(--listing-viewport-height,100dvh) - 2 * var(--desktop-frame-gap)) * 9 / 16),calc(100vw - 2 * var(--desktop-frame-gap)));--listing-card-height:calc(var(--listing-card-width) * 16 / 9);--listing-card-top:calc((var(--listing-viewport-height,100dvh) - var(--listing-card-height))/2);--listing-card-left:calc((100vw - var(--listing-card-width))/2);--listing-toolbar-inset:12px}
 #listing-viewer .listing-feed{display:flex;flex-direction:column;align-items:center;gap:var(--desktop-frame-gap);width:100%;max-width:none;height:100%;margin:0;padding:var(--listing-card-top) 0;scroll-padding-block:var(--listing-card-top);border-radius:0;overflow:hidden auto;isolation:isolate}
 #listing-viewer .listing-slide{flex:none;width:var(--listing-card-width);height:var(--listing-card-height);aspect-ratio:9/16;border-radius:var(--card-radius);isolation:isolate}
 #listing-viewer .viewer-close{left:calc(var(--listing-card-left) + 12px);top:calc(var(--desktop-frame-gap) + 12px)}
 #listing-viewer>.listing-share{right:calc(var(--listing-card-left) + 12px);top:calc(var(--desktop-frame-gap) + 12px)}
 #listing-viewer .listing-counter{top:calc(var(--desktop-frame-gap) + 19px)}
 #listing-viewer .swipe-intro{left:var(--listing-card-left);right:auto;top:var(--listing-card-top);bottom:auto;width:var(--listing-card-width);height:var(--listing-card-height);border-radius:var(--card-radius);overflow:hidden}
 #listing-viewer .viewer-navigation{right:max(16px,calc(var(--listing-card-left) - 60px));top:50%;transform:translateY(-50%)}
}

/* Apply Linktree's 20px action icon / 40px control scale to Bybre's mobile and desktop viewer. */
 #listing-viewer .viewer-close,#listing-viewer .listing-share,#listing-viewer .sound-toggle,#listing-viewer .video-toggle,#listing-viewer .listing-actions button,#listing-viewer .listing-actions a,#listing-viewer .viewer-navigation button{width:40px;height:40px}
 #listing-viewer .listing-share svg,#listing-viewer .sound-toggle svg,#listing-viewer .video-toggle svg,#listing-viewer .listing-actions svg,#listing-viewer .viewer-navigation svg,#listing-viewer .listing-share img,#listing-viewer .listing-whatsapp-icon{width:20px;height:20px}
 #listing-viewer .viewer-close img,#listing-viewer .viewer-close::before{width:20px;height:20px}
 #listing-viewer .viewer-close::before{mask-size:20px 20px;-webkit-mask-size:20px 20px}
#listing-viewer .listing-counter{top:calc(18px + env(safe-area-inset-top))}
@media(min-width:640px){#listing-viewer .listing-counter{top:calc(var(--desktop-frame-gap) + 18px)}}

/* Circular icon controls on mobile and desktop. */
#listing-viewer .viewer-close,#listing-viewer .listing-share,#listing-viewer .sound-toggle,#listing-viewer .video-toggle,#listing-viewer .listing-actions button,#listing-viewer .listing-actions a,#listing-viewer .viewer-navigation button{border-radius:50%}

/* Shared mobile toolbar is anchored to the viewport. */
#listing-viewer>.viewer-close,#listing-viewer>.listing-share,#listing-viewer>.listing-counter{position:fixed;z-index:12}
@media(min-width:640px){
 #listing-viewer .listing-feed{scroll-behavior:smooth}
}
@media(prefers-reduced-motion:reduce){
 #listing-viewer .listing-feed{scroll-behavior:auto}
}

/* Mobile has one fixed toolbar; desktop carries a toolbar on every card. */
#listing-viewer .listing-card-header{display:none}
@media(min-width:640px){
 #listing-viewer[open]>button.viewer-close,#listing-viewer[open]>button.listing-share,#listing-viewer[open]>span.listing-counter{display:none}
 #listing-viewer .listing-card-header{display:block;position:absolute;inset:0;z-index:5;pointer-events:none}
 #listing-viewer .listing-card-header>.viewer-close,#listing-viewer .listing-card-header>.listing-share,#listing-viewer .listing-card-header>.listing-counter{position:absolute;z-index:1}
 #listing-viewer .listing-card-header>.viewer-close{left:var(--listing-toolbar-inset);top:var(--listing-toolbar-inset);pointer-events:auto}
 #listing-viewer .listing-card-header>.listing-share{right:var(--listing-toolbar-inset);top:var(--listing-toolbar-inset);pointer-events:auto}
 #listing-viewer .listing-card-header>.listing-counter{left:50%;top:calc(var(--listing-toolbar-inset) + (var(--icon-target) - 24px)/2)}
}

/* A blocked start must always leave a visible, usable retry control. */
#listing-viewer .playback-blocked .playback-controls{opacity:1;pointer-events:auto}

/* Keep the player and its overlays inside the visible mobile viewport. */
@media(max-width:639px), (hover:none) and (pointer:coarse) and (max-width:1023px){
 :root[data-modal-viewport] #listing-viewer{
  --listing-viewport-height:var(--modal-viewport-height);
  top:calc(var(--modal-viewport-bottom) - var(--modal-viewport-height));
  bottom:auto;height:var(--listing-viewport-height)
 }
 :root[data-modal-viewport] #listing-viewer>.viewer-close,
 :root[data-modal-viewport] #listing-viewer>.listing-share,
 :root[data-modal-viewport] #listing-viewer>.listing-counter{position:absolute}
}

/* Keep loading and unsuccessful starts actionable until actual playback begins. */
#listing-viewer .video-loading .playback-controls{opacity:1;pointer-events:auto}
.video-loading-label{display:none;position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%);white-space:nowrap;font-size:12px;line-height:18px;color:#fff;text-shadow:0 1px 4px #000}
.video-loading .video-loading-label{display:block}
