/* Existing tour palette and controls, with no persistent scene rail. */
body.ibdaa-gallery-preview #pano-scenes-rail,
body.ibdaa-gallery-preview #pano-room-list { display:none !important; }
body.ibdaa-gallery-preview.panorama-mode {
  --compact-shots: 100px;
  --compact-map: min(230px, calc(100vw - 2 * var(--compact-edge) - 116px));
}
body.ibdaa-gallery-preview.panorama-mode #pano-scenes-toggle {
  min-height:48px !important; max-height:48px !important;
  gap:7px !important; padding:0 12px !important; font-size:13px !important;
  color:#fff !important; background:#182c63 !important; border-color:#182c63 !important;
}
body.ibdaa-gallery-preview.panorama-mode #pano-scenes-toggle span {
  position:static !important; width:auto !important; height:auto !important;
  clip-path:none !important; overflow:visible !important; white-space:nowrap;
}
body.ibdaa-gallery-preview.panorama-mode #ibn-map .ibn-toggle[aria-expanded=false] {
  justify-content:flex-start; padding:0 12px; gap:8px;
}
body.ibdaa-gallery-preview.panorama-mode #ibn-map .ibn-toggle[aria-expanded=false] .ibn-map-title {
  position:static !important; width:auto !important; height:auto !important;
  clip-path:none !important; flex:1; min-width:0; font-size:12px !important;
  overflow:hidden !important; white-space:nowrap; text-overflow:ellipsis;
}
body.ibdaa-gallery-preview.panorama-mode #ibn-map .ibn-toggle[aria-expanded=false] .ibn-chevron {
  display:inline !important; font-size:17px;
}
#ibdaa-scene-gallery {
  --gallery-ink:#172344; --gallery-muted:#5b6478; --gallery-accent:#b08733;
  position:fixed; inset:auto 0 calc(76px + env(safe-area-inset-bottom));
  width:min(940px,calc(100vw - 32px)); max-width:none;
  max-height:calc(100dvh - 112px); margin:0 auto; padding:0;
  border:1px solid #d9d0bf; border-radius:22px; box-sizing:border-box;
  background:#f8f6ef; color:var(--gallery-ink);
  font-family:inherit; box-shadow:0 12px 48px rgba(12,18,36,.25);
  overflow:hidden;
}
#ibdaa-scene-gallery::backdrop { background:rgba(12,18,36,.24); }
#ibdaa-scene-gallery[open] { display:flex; flex-direction:column; }
.ibdaa-gallery-header {
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:18px 22px; border-bottom:1px solid #e1dbce; flex:none;
}
.ibdaa-gallery-header h2 { margin:0; font-family:inherit; font-size:22px; font-weight:800; line-height:1.35; color:var(--gallery-ink); }
.ibdaa-gallery-header p { margin:5px 0 0; color:var(--gallery-muted); font-size:13px; line-height:1.5; }
.ibdaa-gallery-close {
  display:grid; place-items:center; flex:none; width:44px; height:44px;
  padding:0; border:1px solid #d9d0bf; border-radius:13px;
  color:var(--gallery-ink); background:#fff; cursor:pointer;
}
.ibdaa-gallery-close svg { width:20px; height:20px; }
.ibdaa-gallery-scroll { overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; min-height:0; padding:18px 22px 22px; }
.ibdaa-gallery-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
.ibdaa-scene-card {
  appearance:none; display:flex; flex-direction:column; min-width:0; padding:0;
  text-align:start; background:#fff; border:1px solid #ded8cc; border-radius:15px;
  color:var(--gallery-ink); font-family:inherit; cursor:pointer; overflow:hidden;
  transition:border-color .15s,box-shadow .15s;
}
.ibdaa-scene-card:hover { border-color:var(--gallery-accent); box-shadow:0 3px 12px rgba(24,37,66,.12); }
.ibdaa-scene-card[aria-current] { border:2px solid var(--gallery-accent); }
.ibdaa-scene-card:focus-visible,.ibdaa-gallery-close:focus-visible { outline:3px solid #1d376b; outline-offset:3px; }
.ibdaa-scene-preview { width:100%; aspect-ratio:16/9; position:relative; background:#e9e3d8; overflow:hidden; }
.ibdaa-scene-preview canvas { display:block; width:100%; height:100%; object-fit:cover; }
.ibdaa-preview-state { position:absolute; inset:0; display:grid; place-items:center; color:#616571; font-size:12px; }
.ibdaa-scene-badge { position:absolute; top:8px; inset-inline-start:8px; padding:3px 7px; border-radius:7px; background:rgba(248,246,239,.96); color:#172344; font-size:11px; font-weight:700; line-height:1.5; }
.ibdaa-scene-card[aria-current] .ibdaa-scene-badge { background:#172c60; color:#fff; }
.ibdaa-scene-name { display:flex; align-items:center; min-height:48px; padding:7px 11px; box-sizing:border-box; font-size:14px; font-weight:700; line-height:1.45; overflow-wrap:break-word; }
@media(max-width:1100px) { .ibdaa-gallery-grid { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:640px) {
  #ibdaa-scene-gallery { inset:auto 0 0; width:100%; max-height:76dvh; border-radius:24px 24px 0 0; border-bottom:0; }
  .ibdaa-gallery-header { padding:17px 16px 13px; gap:8px; }
  .ibdaa-gallery-header h2 { font-size:19px; }
  .ibdaa-gallery-header p { font-size:12px; }
  .ibdaa-gallery-scroll { padding:14px 14px calc(20px + env(safe-area-inset-bottom)); }
  .ibdaa-gallery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
  .ibdaa-scene-name { font-size:13px; min-height:46px; padding:8px 9px; }
}
@media(max-height:500px) {
  #ibdaa-scene-gallery { bottom:0; max-height:94dvh; }
  .ibdaa-gallery-header { padding-top:10px; padding-bottom:10px; }
}
@media(prefers-reduced-motion:reduce) { .ibdaa-scene-card { transition:none; } }
