/* Real-user feedback pass: legibility, focus and optional large views. */
:root {
  --ux-green: #006b45;
  --ux-green-dark: #004b35;
  --ux-cream: #fffdf5;
  --ux-focus: #ffd95a;
}

.map-module {
  border-color: #8dad99 !important;
  box-shadow: 0 12px 32px rgba(0, 75, 53, 0.08);
}

.map-scroll {
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.floor-map > image {
  filter: contrast(1.12) saturate(0.92);
}

.ux-map-toolbar {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 0;
}

.ux-map-action,
.ux-overlay-action,
.ux-photo-expand {
  align-items: center;
  background: var(--ux-cream);
  border: 1.5px solid var(--ux-green);
  border-radius: 10px;
  color: var(--ux-green-dark);
  cursor: pointer;
  display: inline-flex;
  font: 700 14px/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  gap: 7px;
  justify-content: center;
  min-height: 42px;
  padding: 9px 13px;
}

.ux-map-action:hover,
.ux-overlay-action:hover,
.ux-photo-expand:hover {
  background: #e8f4ec;
}

.ux-map-action:focus-visible,
.ux-overlay-action:focus-visible,
.ux-photo-expand:focus-visible {
  outline: 3px solid var(--ux-focus);
  outline-offset: 2px;
}

.ux-map-focus-ring {
  animation: ux-map-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 3px rgba(0, 75, 53, 0.45));
  pointer-events: none;
}

@keyframes ux-map-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

.ux-map-overlay,
.ux-photo-overlay {
  align-items: stretch;
  background: rgba(5, 20, 15, 0.88);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  position: fixed;
  z-index: 99999;
}

.ux-overlay-dialog {
  background: #f7f6ee;
  border: 2px solid #52a87d;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1320px;
  overflow: hidden;
  width: 100%;
}

.ux-overlay-header {
  align-items: center;
  background: var(--ux-green-dark);
  color: #fff;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 62px;
  padding: 10px 14px;
}

.ux-overlay-title {
  font: 800 clamp(18px, 3vw, 24px)/1.2 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
}

.ux-overlay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.ux-overlay-action {
  background: #fffdf5;
  min-height: 40px;
  min-width: 42px;
  padding: 8px 11px;
}

.ux-map-viewport {
  flex: 1;
  overflow: auto;
  padding: 18px;
  touch-action: pan-x pan-y;
}

.ux-map-stage {
  margin: auto;
  width: 1000px;
  zoom: var(--ux-zoom, 1);
}

.ux-map-stage .map-scroll {
  max-height: none !important;
  overflow: visible !important;
}

.ux-map-stage .floor-map {
  height: auto !important;
  min-width: 1000px !important;
  width: 1000px !important;
}

.ux-map-stage .ux-map-toolbar {
  display: none;
}

.ux-photo-expand {
  background: rgba(255, 253, 245, 0.96);
  min-width: 42px;
  padding: 8px 10px;
  position: absolute;
  right: 14px;
  /* Keep this below the navigation header and progress bar. */
  top: 144px;
  z-index: 8;
}

.scene-viewport {
  position: relative;
}

.ux-photo-stage {
  align-items: center;
  background: #0a1b15;
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.ux-photo-stage img {
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  width: 100%;
}

.survey-photo {
  filter: contrast(1.06) saturate(1.04);
}

.immersive-scene .ar-cue {
  max-width: min(82%, 410px) !important;
  padding: 10px 14px !important;
}

.immersive-scene .ar-cue-icon {
  height: 58px !important;
  width: 58px !important;
}

.immersive-scene .ar-cue strong {
  font-size: clamp(18px, 2.5vw, 23px) !important;
}

body.ux-overlay-open {
  overflow: hidden !important;
}

/* One clear exit control: the left X opens the existing confirmation dialog. */
.ar-header.ux-single-exit {
  grid-template-columns: 56px minmax(0, 1fr) !important;
}

.ar-header.ux-single-exit .ar-home {
  display: none !important;
}

.ar-back[data-ux-single-exit="true"] svg {
  display: none !important;
}

.ar-back[data-ux-single-exit="true"]::before {
  content: "\00d7";
  font: 400 32px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ux-landmark-hint {
  color: #d8eee1 !important;
  font-size: 11px !important;
  line-height: 1.35 !important;
  margin-top: 7px !important;
  max-width: 32ch;
}

/* Meeting feedback: remove the secondary sentence below the arrival action. */
.stage-arrival .action-caption {
  display: none !important;
}

/* Remove internal photo-source notes from the user-facing landmark card. */
.scene-caption .scene-photo-label {
  display: none !important;
}

.ux-mobile-discovery {
  display: none;
}

@media (max-width: 820px) {
  .ar-home {
    min-width: 64px !important;
    padding: 0 9px !important;
    width: auto !important;
  }

  .ar-home span {
    display: inline !important;
  }

  .ux-mobile-discovery {
    display: grid;
    gap: 10px;
    margin: 4px 0 18px;
  }

  .ux-discovery-intro {
    color: #587064;
    font-size: 12px;
    line-height: 1.45;
    margin: -4px 0 2px;
  }

  .ux-search-field {
    align-items: center;
    background: #fffdf5;
    border: 1.5px solid #aac5b3;
    border-radius: 5px;
    color: var(--ux-green-dark);
    display: flex;
    gap: 8px;
    min-height: 46px;
    padding: 0 12px;
  }

  .ux-search-field > span {
    font-size: 25px;
    line-height: 1;
    transform: rotate(-20deg);
  }

  .ux-destination-search {
    background: transparent;
    border: 0;
    color: #123f31;
    flex: 1;
    font-size: 14px;
    min-width: 0;
    outline: 0;
  }

  .ux-destination-search::placeholder {
    color: #6d8278;
    opacity: 1;
  }

  .ux-search-field:focus-within {
    border-color: var(--ux-green);
    box-shadow: 0 0 0 3px rgba(0, 107, 69, 0.14);
  }

  .ux-view-tabs {
    background: #edf2e7;
    border: 1px solid #b9cbb9;
    border-radius: 5px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
  }

  .ux-view-tab {
    align-items: center;
    background: transparent;
    border: 0;
    color: #244b3f;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    gap: 7px;
    justify-content: center;
    min-height: 44px;
  }

  .ux-view-tab[aria-selected="true"] {
    background: var(--ux-green);
    color: #fff;
  }

  .ux-view-tab:focus-visible {
    outline: 3px solid var(--ux-focus);
    outline-offset: -3px;
  }

  .ux-filter-empty {
    background: #fff9e9;
    border: 1px solid #cbd8c6;
    color: #425e52;
    font-size: 13px;
    padding: 12px;
    text-align: center;
  }

  .stage-select .workspace {
    gap: 0 !important;
  }

  .stage-select:not(.ux-mobile-map-view) .visual-panel {
    display: none !important;
  }

  .stage-select.ux-mobile-map-view .start-card,
  .stage-select.ux-mobile-map-view .destination-heading,
  .stage-select.ux-mobile-map-view .destination-grid {
    display: none !important;
  }

  .stage-select.ux-mobile-map-view .visual-panel {
    display: flex !important;
    margin-top: 0;
  }

  /* Default maps fit the phone. The full-screen overlay below keeps zoom/pinch. */
  .stage-select .map-scroll,
  .dialog-map .map-scroll {
    max-width: 100%;
    overflow-x: hidden !important;
    padding: 8px 4px !important;
  }

  .stage-select .floor-map,
  .dialog-map .floor-map {
    height: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .stage-select .swipe-note,
  .dialog-map .swipe-note {
    display: none !important;
  }

  .ux-map-toolbar {
    justify-content: stretch;
  }

  .ux-map-action {
    width: 100%;
  }

  .ux-overlay-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .ux-overlay-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .ux-map-viewport {
    padding: 8px;
  }

  .ux-map-stage,
  .ux-map-stage .floor-map {
    min-width: 860px !important;
    width: 860px !important;
  }

  .ux-photo-expand .ux-button-label {
    display: none;
  }

  .ux-photo-expand {
    right: 10px;
    top: 138px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ux-map-focus-ring {
    animation: none;
  }

  .map-scroll {
    scroll-behavior: auto;
  }
}
.map-destination-marker {
  cursor: pointer;
  touch-action: manipulation;
}

.map-destination-marker text {
  pointer-events: none;
}

.map-destination-marker:hover circle:not(.destination-hit-area),
.map-destination-marker:focus-visible circle:not(.destination-hit-area) {
  fill: #ffd95a;
  stroke: #004b35;
  stroke-width: 2.5;
}

.map-destination-marker:focus-visible {
  outline: none;
}

/* Narrow-phone safety pass: keep every guide control inside the CSS viewport. */
@media (max-width: 480px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .guide-shell {
    max-width: 100%;
    overflow-x: hidden;
    padding: 0 !important;
    width: 100%;
  }

  .guide-layout,
  .guide-phone,
  .immersive-scene,
  .immersive-scene .scene-viewport {
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .immersive-scene {
    border-left-width: 0;
    border-radius: 0;
    border-right-width: 0;
  }

  .ar-interface {
    box-sizing: border-box;
    padding: 14px 10px 12px !important;
    width: 100%;
  }

  .ar-header {
    display: grid !important;
    gap: 6px !important;
    grid-template-columns: 44px minmax(0, 1fr) 54px !important;
    width: 100%;
  }

  .ar-header.ux-single-exit {
    grid-template-columns: 44px minmax(0, 1fr) !important;
  }

  .ar-back {
    min-width: 44px !important;
    width: 44px !important;
  }

  .ar-destination-pill {
    gap: 7px !important;
    min-width: 0 !important;
    padding: 9px 8px !important;
    width: 100%;
  }

  .ar-destination-pill > div {
    min-width: 0;
    overflow: hidden;
  }

  .ar-destination-pill small {
    font-size: 7px !important;
    letter-spacing: 0.7px !important;
  }

  .ar-destination-pill strong {
    display: block;
    font-size: 15px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ar-home {
    min-width: 54px !important;
    padding: 0 6px !important;
    width: 54px !important;
  }

  .ar-home svg {
    display: none;
  }

  .ar-home span {
    display: inline !important;
    font-size: 12px;
  }

  .guide-step-progress,
  .ar-bottom-stack {
    box-sizing: border-box;
    max-width: 100%;
    width: 100%;
  }

  .immersive-scene .ar-cue {
    box-sizing: border-box;
    max-width: calc(100% - 32px) !important;
    width: calc(100% - 32px) !important;
  }

  .ux-photo-expand {
    right: 10px;
    top: 126px;
  }
}

@media (max-width: 350px) {
  .ar-header {
    grid-template-columns: 40px minmax(0, 1fr) 48px !important;
    gap: 4px !important;
  }


  .ar-header.ux-single-exit {
    grid-template-columns: 40px minmax(0, 1fr) !important;
  }

  .ar-back {
    min-width: 40px !important;
    width: 40px !important;
  }

  .ar-home {
    min-width: 48px !important;
    width: 48px !important;
  }

  .ar-destination-pill strong {
    font-size: 14px !important;
  }
}
