:root {
  font: 16px system-ui, sans-serif;
  color: #282828;
  background: #bebebe;
}

body { margin: 0; }
.tour { max-width: 960px; margin-inline: auto; background: #fff; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* Short pages: the white column runs to the bottom with the footer there. */
.tour > footer { margin-top: auto; }
.tour > header, .tour > section, .tour > footer { padding: 0.75rem 1rem; }
.tour h1, .tour h2 { text-align: center; margin: 0 0 0.65rem; }
.tour h1 { font-size: clamp(1.15rem, 3vw, 1.55rem); }
.tour h2 { font-size: 1.2rem; }
.tour-zip { text-align: center; margin: 0; }
.tour > .tour-agent { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem 1.5rem; padding: 1.25rem 1.5rem; background: #f6f7f5; border-block: 1px solid #e7eae4; }
.agent-identity { display: flex; align-items: center; gap: 1.25rem; min-width: 0; }
.agent-details { min-width: 0; }
.agent-logo { display: block; max-width: 7rem; max-height: 4rem; object-fit: contain; }
.agent-logo-text { padding: .75rem 1rem; border: 1px solid #e1e5dd; border-radius: 6px; background: #fff; font-size: .95rem; font-weight: 700; letter-spacing: .025em; }
.agent-label { margin: 0 0 .2rem; color: #646d5e; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.tour-agent .agent-name { text-align: left; margin: 0; font-size: 1.1rem; font-weight: 650; overflow-wrap: anywhere; }
.agent-company { margin: .25rem 0 0; color: #646d5e; font-size: .85rem; }
.agent-contact { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.agent-contact a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box; padding: .65rem 1rem; border: 1px solid #ccd5c6; border-radius: 6px; color: #314a29; text-decoration: none; font-size: .85rem; font-weight: 600; }
.agent-contact .agent-email { color: #fff; background: #486e3b; border-color: #486e3b; }
.agent-contact a:hover { background: #e8ede4; }
.agent-contact .agent-email:hover { background: #35552a; }
.agent-contact a:focus-visible { outline: 3px solid #568347; outline-offset: 3px; }
.agent-linked { flex-basis: 100%; margin: 0; padding-left: 1.2rem; font-size: .85rem; color: #646d5e; }
@media (max-width: 600px) {
  .tour > .tour-agent { padding: 1rem; }
  .agent-identity { gap: .85rem; }
  .agent-logo { max-width: 5rem; }
  .agent-logo-text { padding: .6rem .75rem; font-size: .8rem; }
  .agent-contact { width: 100%; }
  .agent-contact a { flex: 1; }
}
.video-frame, #pano { width: 100%; aspect-ratio: 16 / 10; border: 0; background: #171717; }
.video-frame { aspect-ratio: 2 / 1; }
#map-canvas { display: block; width: 100%; height: clamp(280px, 55vw, 550px); border: 0; }
.calculator-frame { display: block; width: 100%; min-height: 420px; border: 0; }
#pano { min-height: 240px; }
.gallery-stage { position: relative; background: #f2f2f2; border-radius: 6px; overflow: hidden; }
.gallery-stage a { display: block; }
/* Listing photos are 3:2, so the stage matches them; others letterbox on a
   neutral ground rather than heavy black bars. */
.gallery-stage img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}
.gallery-step {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(0 0 0 / .45);
  cursor: pointer;
  transition: background .15s;
}
.gallery-step:hover { background: rgb(0 0 0 / .7); }
.gallery-step:focus-visible { outline: 3px solid #fff; outline-offset: -5px; }
.gallery-step[data-gallery-step="-1"] { left: 0.75rem; }
.gallery-step[data-gallery-step="1"] { right: 0.75rem; }
.gallery-list {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.5rem 0.1rem;
  margin: 0;
  list-style: none;
  /* Previous/Next keep the selected thumbnail in view, and the strip still
     scrolls by wheel, touch and keyboard; the faded edge shows there is more. */
  scrollbar-width: none;
  mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}
.gallery-list:has(.gallery-item:last-child a[aria-current]) { mask-image: none; }
.gallery-thumb { display: block; width: 76px; height: 52px; object-fit: cover; border-radius: 3px; }
.gallery-item a { display: block; border: 2px solid transparent; border-radius: 5px; opacity: .75; transition: opacity .15s; }
.gallery-item a:hover, .gallery-item a[aria-current] { opacity: 1; }
.gallery-item a[aria-current] { border-color: #568347; }
.gallery-dialog { max-width: 96vw; padding: 0; border: 0; background: transparent; overflow: visible; }
.gallery-dialog::backdrop { background: rgb(0 0 0 / .85); }
.gallery-dialog-stage { position: relative; }
.gallery-dialog img { display: block; max-width: 96vw; max-height: 86vh; max-height: 86dvh; border-radius: 4px; }
.gallery-dialog-step { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; align-items: center; padding: 0 1rem; border: 0; color: #fff; background: transparent; cursor: pointer; touch-action: manipulation; }
.gallery-dialog-step[hidden] { display: none; }
.gallery-dialog-step[data-gallery-step="-1"] { left: 0; justify-content: flex-start; }
.gallery-dialog-step[data-gallery-step="1"] { right: 0; justify-content: flex-end; }
.gallery-dialog-step svg { flex-shrink: 0; padding: .55rem; width: 24px; height: 24px; border-radius: 50%; background: rgb(0 0 0 / .45); }
.gallery-dialog-step:hover svg { background: rgb(0 0 0 / .75); }
.gallery-dialog-step:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.gallery-dialog-count { position: absolute; left: 50%; bottom: .6rem; translate: -50% 0; margin: 0; padding: .25rem .65rem; color: #fff; background: rgb(0 0 0 / .55); border-radius: 999px; font-size: .8rem; pointer-events: none; }
.dialog-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgb(0 0 0 / .55);
  cursor: pointer;
}
.dialog-close:hover { background: rgb(0 0 0 / .8); }
.dialog-close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tour-audio { display: flex; justify-content: center; }
.soundtrack-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem 0.45rem 0.6rem;
  border: 1px solid #c9c9c9;
  border-radius: 999px;
  color: #282828;
  background: #fff;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.soundtrack-toggle:hover { border-color: #568347; }
.soundtrack-toggle:focus-visible { outline: 3px solid #568347; outline-offset: 2px; }
.soundtrack-toggle svg { color: #568347; }
.tour-foot { background: #eee; text-align: right; color: #595959; font-size: 0.8rem; }
