/* ═══════════════════════════════════════════════════════
   CAMPUS FACILITIES LOCATOR — style.css  (Mobile-Ready v3)
   Palette: Maroon #7B1D1E · Yellow #F6AC02 · White #FFF
═══════════════════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  --maroon:       #7B1D1E;
  --maroon-dark:  #5a1415;
  --maroon-light: #9e2527;
  --yellow:       #F6AC02;
  --yellow-dark:  #CF8E07;
  --gray:         #CCCCCC;
  --gray-light:   #f0f0f0;
  --gray-mid:     #e4e4e4;
  --gray-text:    #6b6b6b;
  --white:        #FFFFFF;
  --bg:           #f5f4f2;
  --text-dark:    #1e1e1e;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 18px rgba(0,0,0,0.11);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.15);
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    16px;
  --header-h:     60px;
  --footer-h:     62px;
  --sidebar-w:    252px;
  --font-head:    'Libre Baskerville', Georgia, serif;
  --font-body:    'Outfit', sans-serif;
  --transition:   0.22s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.6;
  /* Prevent page-level scroll — everything scrolls inside its own container */
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--maroon);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.28);
  animation: slideDown 0.35s ease both;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.header-logo {
  height: 36px;
  width: 36px;
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid rgba(246,172,2,0.5);
  flex-shrink: 0;
}

.header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.55);
  font-weight: 300;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Center: Search */
.header-center {
  flex: 1;
  max-width: 440px;
  position: relative;
}

.search-box { position: relative; width: 100%; }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  pointer-events: none;
  transition: color var(--transition);
}

.search-box:focus-within .search-icon { color: var(--yellow); }

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 36px 0 36px;
  border: 1.5px solid rgba(255,255,255,0.18);
  border-radius: 50px;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.86rem;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.search-input::placeholder { color: rgba(255,255,255,0.45); }

.search-input:focus {
  background: var(--white);
  color: var(--text-dark);
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(246,172,2,0.2), 0 3px 12px rgba(0,0,0,0.15);
}

.search-input:focus::placeholder { color: #aaa; }

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 3px 5px;
  font-size: 0.75rem;
  display: none;
  transition: color var(--transition);
  line-height: 1;
}

.search-clear-btn.visible { display: block; }
.search-clear-btn:hover   { color: var(--white); }
.search-input:focus ~ .search-clear-btn { color: var(--gray-text); }

/* Search Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  border: 1px solid var(--gray-mid);
  overflow: hidden;
  z-index: 300;
  display: none;
  max-height: 280px;
  overflow-y: auto;
}

.search-results.open { display: block; animation: dropdown-in 0.17s ease; }

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition);
  border-bottom: 1px solid var(--gray-light);
}

.search-result-item:last-child  { border-bottom: none; }
.search-result-item:hover       { background: #fdf5f5; }
.search-result-item.keyboard-focused { background: var(--maroon); color: #fff; }
.search-result-item.keyboard-focused .search-result-building { color: rgba(255,255,255,.7); }

.search-result-icon   { color: var(--maroon); font-size: 0.88rem; flex-shrink: 0; }
.search-result-name   { font-weight: 500; font-size: 0.86rem; color: var(--text-dark); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-building {
  font-size: 0.71rem;
  color: var(--gray-text);
  background: var(--gray-light);
  padding: 2px 8px;
  border-radius: 50px;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-no-results {
  padding: 16px;
  color: var(--gray-text);
  font-size: 0.83rem;
  text-align: center;
}

/* Right: Explore label */
.header-right { flex-shrink: 0; }

.header-explore-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,0.7);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-left: 1px solid rgba(255,255,255,0.18);
  padding-left: 14px;
  white-space: nowrap;
  user-select: none;
}

.header-explore-label i { color: var(--yellow); font-size: 0.9rem; }

/* Keep old nav hidden if still in HTML */
.header-nav { display: none !important; }

/* ═══════════════════════════════════════════
   MAIN WRAPPER
   Full viewport minus header. No scroll on body.
═══════════════════════════════════════════ */
.main-wrapper {
  display: flex;
  height: calc(100dvh - var(--header-h) - var(--footer-h));
  margin-top: var(--header-h);
  overflow: hidden;
  position: relative;
}

/* ═══════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-mid);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.28s ease;
  box-shadow: 3px 0 14px rgba(0,0,0,0.07);
  z-index: 10;
  animation: slideRight 0.35s 0.1s ease both;
}

@keyframes slideRight {
  from { transform: translateX(-30px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

.sidebar.collapsed { width: 0; border-right: none; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--maroon);
  flex-shrink: 0;
  border-bottom: 2px solid rgba(246,172,2,0.25);
}

.sidebar-title {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
}

.sidebar-title i { color: var(--yellow); font-size: 1rem; }

.sidebar-collapse-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 3px 7px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover { color: var(--white); background: rgba(255,255,255,0.1); }


/* Scrollable building list */
.facility-list {
  list-style: none;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  padding: 6px 0;
  -webkit-overflow-scrolling: touch;
}

/* Building item */
.facility-list-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px 11px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  position: relative;
  overflow: hidden;
  transition: background var(--transition), border-left-color var(--transition), transform var(--transition);
}

.facility-list-item:hover  { background: #fdf3f3; border-left-color: var(--maroon-light); transform: translateX(1px); }
.facility-list-item.active { background: linear-gradient(to right, #f9eaea, #fffafa); border-left-color: var(--maroon); }

/* Icon */
.facility-item-icon {
  width: 34px;
  height: 34px;
  background: var(--gray-light);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--maroon);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.facility-list-item:hover .facility-item-icon,
.facility-list-item.active .facility-item-icon {
  background: var(--maroon);
  color: var(--white);
  transform: scale(1.06);
  box-shadow: 0 3px 10px rgba(123,29,30,0.22);
}

/* Text */
.facility-item-info { overflow: hidden; flex: 1; min-width: 0; }

.facility-item-name {
  font-size: 0.855rem;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.facility-list-item.active .facility-item-name { color: var(--maroon); }

.recommended-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 1px;
}

.recommended-badge .bi-stars { color: #f5a623; }

.building-item-count {
  font-size: 0.72rem;
  color: var(--gray-text);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.building-item-arrow {
  flex-shrink: 0;
  color: var(--gray-text);
  font-size: 0.78rem;
  transition: transform var(--transition), color var(--transition);
  align-self: center;
}

.facility-list-item:hover .building-item-arrow,
.facility-list-item.active .building-item-arrow {
  transform: translateX(3px);
  color: var(--maroon);
}

/* Ripple */
.ripple {
  position: absolute;
  inset: 0;
  background: rgba(123,29,30,0.08);
  border-radius: inherit;
  pointer-events: none;
  animation: ripple-fade 0.48s ease forwards;
}

@keyframes ripple-fade {
  from { opacity: 1; transform: scale(0.9); }
  to   { opacity: 0; transform: scale(1.05); }
}

/* Empty state */
.sidebar-empty-state {
  list-style: none;
  text-align: center;
  padding: 36px 16px;
  color: var(--gray-text);
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sidebar-empty-state i  { font-size: 1.8rem; opacity: 0.3; }
.sidebar-empty-state small { font-size: 0.72rem; opacity: 0.7; }

/* Sidebar footer */
.sidebar-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--gray-mid);
  background: var(--gray-light);
  color: var(--gray-text);
  font-size: 0.7rem;
  flex-shrink: 0;
  text-align: center;
  line-height: 1.5;
}

/* Sidebar tab (collapsed) */
.sidebar-tab {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  background: var(--maroon);
  color: var(--white);
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  width: 22px;
  height: 52px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  box-shadow: 3px 0 10px rgba(0,0,0,0.15);
  transition: background var(--transition);
}

.sidebar-tab:hover  { background: var(--maroon-dark); }
.sidebar-tab.visible { display: flex; }

/* Building list item entrance */
.building-list-item {
  animation: item-in 0.22s ease both;
}

@keyframes item-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   MAP SECTION
   Takes remaining width. Map pans/zooms inside it.
═══════════════════════════════════════════ */
.map-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* critical — nothing bleeds out */
  background: var(--bg);
  position: relative;
  animation: fadeIn 0.4s 0.15s ease both;
  min-width: 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Toolbar */
.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-mid);
  flex-shrink: 0;
  gap: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.map-toolbar-label {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--maroon);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.map-toolbar-controls { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

.map-ctrl-btn {
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  color: var(--gray-text);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.88rem;
  transition: all var(--transition);
  touch-action: manipulation;
}

.map-ctrl-btn:hover {
  background: var(--maroon);
  color: var(--white);
  border-color: var(--maroon);
  transform: scale(1.06);
  box-shadow: 0 2px 8px rgba(123,29,30,0.22);
}

/*
  MAP CONTAINER — the clipping viewport for the SVG.
  padding: 0 so the SVG fills edge-to-edge (JS autoFitMap centers it).
  touch-action: none hands all gestures to the JS pan/zoom handlers.
*/
.map-container {
  flex: 1;
  overflow: hidden;
  padding: 0;
  cursor: grab;
  position: relative;
  touch-action: none;
  background: var(--white);
}

.map-container:active { cursor: grabbing; }

/*
  MAP INNER — holds the absolutely-positioned SVG.
  No border/shadow/radius: the SVG fills edge-to-edge.
  position: relative is the containing block for the SVG (position: absolute).
*/
.map-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--white);
  position: relative;
  animation: map-load-in 0.4s 0.25s ease both;
}

@keyframes map-load-in {
  from { opacity: 0; transform: scale(0.988); }
  to   { opacity: 1; transform: scale(1); }
}

/* SVG inside — transform is applied by JS; size set by JS to viewBox dimensions */
.map-inner svg {
  display: block;
}

.map-inner svg text {
  pointer-events: none !important;
}

.map-inner svg g {
  pointer-events: none;
}

.map-inner svg #img {
  pointer-events: none;
}

/* Building SVG shapes */
.map-inner svg .building-shape {
  cursor: pointer;
  transition: opacity 0.16s, filter 0.16s;
  pointer-events: all;
}

.map-inner svg .building-shape:hover {
  opacity: 0.82;
  filter: drop-shadow(0 0 6px rgba(246,172,2,0.8));
}

.map-inner svg .building-shape.highlighted {
  fill: rgba(246,172,2,0.2);
  stroke: #F6AC02;
  stroke-width: 2;
}

/* Map Placeholder */
.map-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    var(--gray-light), var(--gray-light) 10px,
    #ebe9e7 10px, #ebe9e7 20px
  );
}

.placeholder-inner {
  text-align: center;
  padding: 36px 28px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 2px dashed var(--gray);
  max-width: 340px;
}

.placeholder-icon { font-size: 3rem; color: var(--maroon); display: block; margin-bottom: 12px; opacity: 0.6; }
.placeholder-title { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; color: var(--maroon); margin-bottom: 8px; }
.placeholder-desc  { font-size: 0.81rem; color: var(--gray-text); line-height: 1.7; }
.placeholder-desc code { background: var(--gray-light); border-radius: 4px; padding: 1px 5px; font-size: 0.77rem; color: var(--maroon); }

/* Map hint toast */
.map-hint {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,20,0.78);
  color: var(--white);
  font-size: 0.76rem;
  padding: 7px 18px;
  border-radius: 50px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  z-index: 5;
}

.map-hint.visible { opacity: 1; }

/* ═══════════════════════════════════════════
   BUILDING MODAL
═══════════════════════════════════════════ */
.building-modal-content {
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.22);
  font-family: var(--font-body);
}

.building-modal-header {
  background: var(--maroon);
  padding: 16px 20px;
  border-bottom: 3px solid var(--yellow);
  align-items: flex-start;
}

.modal-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.modal-building-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--yellow);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--white);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-building-desc { color: rgba(255,255,255,0.67); font-size: 0.79rem; }

.building-modal-body {
  padding: 20px;
  background: var(--white);
  min-height: 100px;
}

.facilities-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--maroon);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.facilities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* Facility Card */
.facility-card {
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: default;
  position: relative;
  overflow: hidden;
  animation: card-in 0.25s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.facility-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--maroon), var(--maroon-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}

.facility-card:hover {
  border-color: rgba(123,29,30,0.25);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  background: var(--white);
  transform: translateY(-3px);
}

.facility-card:hover::before { transform: scaleX(1); }
.facility-card:hover .facility-card-icon { transform: scale(1.08); }

.facility-card-icon {
  color: var(--maroon);
  font-size: 1.2rem;
  margin-bottom: 7px;
  display: block;
  transition: transform var(--transition);
}

.facility-card-name { font-weight: 700; font-size: 0.84rem; color: var(--text-dark); margin-bottom: 4px; }
.facility-card-desc { font-size: 0.73rem; color: var(--gray-text); line-height: 1.5; }

/* ── Expandable Facility Cards ────────────────────────────── */

/* Make the whole card a column layout when expanded */
.facility-card-expandable {
  cursor: pointer;
  padding: 0;            /* inner sections handle padding */
  overflow: hidden;
}

/* Top row: icon + name + chevron */
.facility-card-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
}

/* Push chevron to the right */
.facility-card-chevron {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--gray-text);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

/* Icon sits inline now — override block display from base rule */
.facility-card-expandable .facility-card-icon {
  margin-bottom: 0;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Name sits inline */
.facility-card-expandable .facility-card-name {
  margin-bottom: 0;
  flex: 1;
}

/* Details panel — hidden by default using max-height trick */
.facility-card-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, padding 0.22s ease;
  padding: 0 14px;
  border-top: 1px solid transparent;
}

.facility-detail-text {
  font-size: 0.78rem;
  color: var(--gray-text);
  line-height: 1.6;
  margin: 0;
  padding: 2px 0 12px;
}

/* ── EXPANDED state ── */
.facility-card-expandable[aria-expanded="true"] {
  border-color: rgba(123,29,30,0.3);
  background: var(--white);
  box-shadow: 0 4px 14px rgba(0,0,0,0.09);
}

.facility-card-expandable[aria-expanded="true"]::before {
  transform: scaleX(1);   /* shows the maroon top bar */
}

.facility-card-expandable[aria-expanded="true"] .facility-card-chevron {
  transform: rotate(180deg);  /* arrow flips up */
  color: var(--maroon);
}

.facility-card-expandable[aria-expanded="true"] .facility-card-details {
  max-height: 200px;       /* tall enough for any content */
  padding: 0 14px;
  border-top-color: var(--gray-mid);
}

.no-facilities {
  text-align: center;
  padding: 28px;
  color: var(--gray-text);
  font-size: 0.84rem;
  grid-column: 1/-1;
}

.no-facilities i { font-size: 2rem; opacity: 0.3; display: block; margin-bottom: 8px; }

.building-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--gray-light);
  border-top: 1px solid var(--gray-mid);
  padding: 10px 20px;
  gap: 8px;
  display: flex;
  align-items: center;
}

.footer-building-id {
  font-size: 0.69rem;
  color: var(--gray-text);
  font-family: monospace;
  background: var(--gray-mid);
  padding: 2px 8px;
  border-radius: 50px;
  margin-right: auto;
}

.btn-assistant {
  background: var(--yellow);
  color: var(--text-dark);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.btn-assistant:hover {
  background: var(--yellow-dark);
  color: var(--text-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(207,142,7,0.32);
}

/* ═══════════════════════════════════════════
   ASSISTANT MODAL
═══════════════════════════════════════════ */
.assistant-modal-content {
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  font-family: var(--font-body);
}

.assistant-modal-header {
  background: linear-gradient(135deg, var(--maroon-dark), var(--maroon));
  padding: 16px 20px;
  border-bottom: 3px solid var(--yellow);
  align-items: center;
}

.assistant-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.assistant-avatar {
  width: 40px;
  height: 40px;
  background: var(--yellow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--maroon-dark);
  flex-shrink: 0;
  animation: pulse-avatar 2.5s infinite;
}

@keyframes pulse-avatar {
  0%, 100% { box-shadow: 0 0 0 0 rgba(246,172,2,0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(246,172,2,0); }
}

.assistant-modal-header .modal-title { font-size: 0.98rem; color: var(--white); }
.assistant-modal-header small        { color: rgba(255,255,255,0.6); font-size: 0.74rem; }

.assistant-modal-body {
  padding: 18px 20px;
  background: var(--white);
  min-height: 180px;
}

.assistant-field  { margin-bottom: 16px; }

.assistant-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--maroon);
  margin-bottom: 7px;
}

.assistant-select {
  width: 100%;
  padding: 9px 32px 9px 12px;
  border: 1.5px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.87rem;
  color: var(--text-dark);
  background: var(--gray-light);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%237B1D1E' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.assistant-select:focus {
  border-color: var(--maroon);
  background-color: var(--white);
  box-shadow: 0 0 0 2px rgba(123,29,30,0.1);
}

.questions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.question-item {
  padding: 9px 13px;
  background: var(--gray-light);
  border: 1px solid var(--gray-mid);
  border-left: 3px solid var(--maroon);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-dark);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 9px;
}

.question-item i  { color: var(--yellow-dark); font-size: 0.78rem; flex-shrink: 0; }
.question-item:hover { background: #fdf5f5; border-left-color: var(--yellow); transform: translateX(3px); }
.question-item.selected { background: var(--maroon); color: var(--white); border-color: var(--maroon); }
.question-item.selected i { color: var(--yellow); }

.qa-empty { list-style: none; font-size: 0.82rem; color: var(--gray-text); padding: 8px 4px; }

.answer-area {
  background: var(--gray-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-mid);
  overflow: hidden;
  animation: fadeSlideIn 0.22s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

.answer-header {
  background: var(--maroon);
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.answer-text { padding: 13px 15px; font-size: 0.86rem; color: var(--text-dark); line-height: 1.7; }

.assistant-idle { text-align: center; padding: 28px 20px; color: var(--gray-text); }

.assistant-idle-icon {
  font-size: 2.2rem;
  color: var(--gray);
  display: block;
  margin-bottom: 10px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.assistant-idle p { font-size: 0.83rem; }

.assistant-modal-footer {
  background: var(--gray-light);
  border-top: 1px solid var(--gray-mid);
  padding: 10px 20px;
  gap: 8px;
}

.btn-clear-answer {
  background: none;
  border: 1px solid var(--gray-mid);
  color: var(--gray-text);
  border-radius: var(--radius-sm);
  font-size: 0.79rem;
  transition: all var(--transition);
  margin-right: auto;
}

.btn-clear-answer:hover { background: var(--white); color: var(--text-dark); border-color: var(--gray); }

.btn-close-assistant {
  background: var(--maroon);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.79rem;
  padding: 6px 14px;
  transition: background var(--transition), transform var(--transition);
}

.btn-close-assistant:hover { background: var(--maroon-dark); color: var(--white); transform: translateY(-1px); }

/* ═══════════════════════════════════════════
   FLOATING ASSISTANT BUTTON
═══════════════════════════════════════════ */
.floating-assistant-btn {
  position: fixed;
  bottom: calc(var(--footer-h) + 16px);
  right: 20px;
  z-index: 999;
  background: var(--yellow);
  color: var(--maroon-dark);
  border: none;
  border-radius: 50px;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(207,142,7,0.4);
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), background var(--transition), box-shadow var(--transition);
  animation: fab-pop 0.45s 0.5s both cubic-bezier(0.175,0.885,0.32,1.275);
  touch-action: manipulation;
}

@keyframes fab-pop {
  from { opacity: 0; transform: scale(0.5) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.floating-assistant-btn:hover  { background: var(--yellow-dark); transform: translateY(-5px) scale(1.03); box-shadow: 0 10px 26px rgba(207,142,7,0.48); }
.floating-assistant-btn:active { transform: translateY(-2px) scale(0.97); }
.floating-assistant-btn i      { font-size: 1rem; }
.fab-label                     { letter-spacing: 0.01em; }

/* ═══════════════════════════════════════════
   SITE FOOTER
═══════════════════════════════════════════ */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 900;
  height: var(--footer-h);
  background: #f7f6f4;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.footer-inner {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
}

/* Left — hint text */
.footer-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #9a9a9a;
  font-family: var(--font-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-self: start;
}

.footer-hint i {
  color: #c9a84c;
  font-size: 0.72rem;
  flex-shrink: 0;
  opacity: 0.8;
}

/* Center — system identity */
.footer-identity {
  font-size: 0.71rem;
  color: #ababab;
  font-family: var(--font-body);
  letter-spacing: 0.025em;
  white-space: nowrap;
  text-align: center;
  justify-self: center;
}

/* Right — stealth admin link
   Looks like dead muted text. No underline, no border.
   Reveals itself only on hover with a very subtle cue.  */
.footer-admin-link {
  font-size: 0.68rem;
  color: #c0bdb9;           /* nearly invisible — matches background */
  font-family: var(--font-body);
  text-decoration: none;
  letter-spacing: 0.03em;
  cursor: pointer;
  justify-self: end;
  user-select: none;
  transition: color 0.3s ease, letter-spacing 0.3s ease;
  white-space: nowrap;
}

/* On hover: text sharpens just enough to feel clickable */
.footer-admin-link:hover {
  color: #888;
  letter-spacing: 0.06em;
  text-decoration: none;
}

/* ═══════════════════════════════════════════
   SCROLLBARS
═══════════════════════════════════════════ */
.facility-list::-webkit-scrollbar,
.search-results::-webkit-scrollbar,
.building-modal-body::-webkit-scrollbar,
.assistant-modal-body::-webkit-scrollbar { width: 4px; }

.facility-list::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track,
.building-modal-body::-webkit-scrollbar-track,
.assistant-modal-body::-webkit-scrollbar-track { background: transparent; }

.facility-list::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb,
.building-modal-body::-webkit-scrollbar-thumb,
.assistant-modal-body::-webkit-scrollbar-thumb {
  background: var(--gray);
  border-radius: 10px;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 768px)
   Bottom-sheet sidebar · floating map toolbar
═══════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── Variables ── */
  :root {
    --header-h:       52px;
    --footer-h:       44px;
    --sheet-handle-h: 56px;
  }

  /* ── Header: compact, search-focused ── */
  .site-header  { padding: 0 12px; gap: 8px; }
  .header-right { display: none; }
  .brand-sub    { display: none; }
  .header-logo  { height: 30px; width: 30px; }
  .header-center { flex: 1; max-width: none; }

  /* ── Main wrapper: sidebar is position:fixed, so only map is in the flex flow ── */
  .main-wrapper {
    flex-direction: column;
    height: calc(100vh - var(--header-h) - var(--footer-h));
    overflow: hidden;
  }

  /* ── Map section: fills the entire wrapper height ── */
  .map-section {
    flex: 1;
    min-height: 0;
    position: relative;
    width: 100%;
    overflow: hidden;
  }

  /* ── Map toolbar: floating overlay, touch events pass through empty space ── */
  .map-toolbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 15;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10px 12px;
    pointer-events: none;
    align-items: flex-start;
  }

  .map-toolbar > * { pointer-events: auto; }

  .map-toolbar-label {
    background: rgba(255,255,255,0.92);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.73rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.14);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.6);
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  .map-toolbar-controls {
    flex-direction: column;
    gap: 4px;
    background: rgba(255,255,255,0.92);
    border-radius: 14px;
    padding: 4px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  /* 44×44px minimum tap target */
  .map-ctrl-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    border-radius: 10px;
    box-shadow: none;
    font-size: 1.05rem;
    color: var(--gray-text);
  }

  .map-ctrl-btn:hover {
    background: var(--maroon);
    color: var(--white);
    border-color: transparent;
    transform: none;
    box-shadow: none;
  }

  /* ── Bottom-sheet sidebar ──────────────────────────────────────
     Fixed above the footer. Slides down when collapsed so only
     the handle strip (--sheet-handle-h) peeks above the footer.  */
  .sidebar {
    position: fixed;
    left: 0; right: 0;
    bottom: var(--footer-h);
    width: 100% !important;
    height: 45vh;
    max-height: none !important;
    min-height: 0;
    border-right: none;
    border-bottom: none;
    border-top: 3px solid var(--yellow);
    border-radius: 20px 20px 0 0;
    z-index: 50;
    box-shadow: 0 -6px 28px rgba(0,0,0,0.28);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
    animation: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Drag-handle pill at the top of the sheet */
  .sidebar::before {
    content: '';
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 5px;
    background: rgba(255,255,255,0.55);
    border-radius: 100px;
    pointer-events: none;
    z-index: 1;
    transition: background 0.2s;
  }

  .sidebar:not(.collapsed)::before {
    background: rgba(255,255,255,0.75);
  }

  /* Collapsed: slide down, only the handle peeks above the footer.
     width:100%!important overrides the desktop .sidebar.collapsed{width:0}. */
  .sidebar.collapsed {
    width: 100% !important;
    transform: translateY(calc(100% - var(--sheet-handle-h)));
    max-height: none !important;
    border-bottom: none;
  }

  /* Sheet header: extra top-padding to clear the drag pill */
  .sidebar-header {
    cursor: pointer;
    padding-top: 26px;
    padding-bottom: 10px;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Chevron rotates based on state */
  .sidebar-collapse-btn i {
    transform: rotate(-90deg);
    transition: transform 0.3s;
  }
  .sidebar.collapsed .sidebar-collapse-btn i {
    transform: rotate(90deg);
  }

  /* Pull-tab hidden — tap the sheet header to expand */
  .sidebar-tab    { display: none !important; }
  .sidebar-footer { display: none; }

  /* ── Scrollable building list inside the sheet ── */
  .facility-list {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0 24px;
    gap: 0;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  /* Touch-friendly items (min 60px tap target) */
  .facility-list-item {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    border-radius: 0;
    padding: 14px 16px;
    background: transparent;
    min-width: unset;
    max-width: unset;
    min-height: 60px;
    transform: none;
    transition: background 0.15s, border-left-color 0.15s;
  }

  .facility-list-item:last-child { border-bottom: none; }

  .facility-list-item:active {
    background: rgba(var(--maroon-rgb, 101,6,6), 0.06);
  }

  .facility-list-item:hover,
  .facility-list-item.active {
    border-left-color: var(--maroon);
    border-bottom-color: rgba(0,0,0,0.06);
    background: #fdf3f3;
    transform: none;
  }

  .facility-list-item.active:last-child { border-bottom: none; }

  .facility-item-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
  }

  .facility-item-info { flex: 1; min-width: 0; }

  .facility-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    font-weight: 600;
  }

  .building-item-arrow { display: flex; flex-shrink: 0; }
  .building-item-count { display: flex; font-size: 0.74rem; }

  /* Map hint hidden — sheet handle occupies that zone */
  .map-hint { display: none; }

  /* ── Bottom-sheet modals ── */
  .modal-dialog {
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
  }

  .modal-dialog-centered {
    align-items: flex-end;
    min-height: 100%;
    position: relative;
  }

  .modal-dialog .modal-content {
    max-height: 82vh;
    height: auto !important;
    border-radius: 20px 20px 0 0 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -6px 40px rgba(0,0,0,0.28);
  }

  /* Drag handle pill on every modal header */
  .modal-header {
    position: relative;
    padding-top: 28px !important;
    flex-shrink: 0;
  }

  .modal-header::before {
    content: '';
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 40px; height: 5px;
    background: rgba(255,255,255,0.45);
    border-radius: 100px;
    pointer-events: none;
    z-index: 1;
  }

  /* Body scrolls, header + footer stay pinned */
  .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1;
    min-height: 0;
    padding: 16px !important;
  }

  .modal-footer { flex-shrink: 0; }

  /* Slide-up entrance — override Bootstrap's slide-down default */
  .modal.fade .modal-dialog {
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .modal.show .modal-dialog {
    transform: translateY(0);
  }

  /* Facility detail modal: same bottom-sheet, narrower max-height */
  .facility-detail-dialog {
    max-width: 100% !important;
  }

  .facility-detail-dialog .modal-content {
    max-height: 72vh;
  }

  .facilities-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  .building-modal-body  { padding: 14px 14px 20px !important; }
  .building-modal-footer { padding: 10px 14px !important; }
  .assistant-modal-body  { padding: 14px !important; }
  .assistant-modal-footer { padding: 10px 14px !important; }
  .facility-detail-body  { padding: 14px !important; }
  .facility-detail-footer { padding: 10px 14px !important; }

  .facility-card { padding: 10px 12px; }
  .facility-card-name { font-size: 0.8rem; }
  .facility-card-desc { font-size: 0.7rem; }

  /* ── Footer: single-line, minimal height ── */
  .site-footer    { padding: 0; }
  .footer-inner   { padding: 0 16px; gap: 8px; grid-template-columns: 1fr 1fr; }
  .footer-hint    { display: none; }
  .footer-identity { font-size: 0.62rem; justify-self: start; }
  .footer-admin-link { font-size: 0.62rem; }

  /* ── FAB: icon-only, sits above the peeking sheet handle ── */
  .floating-assistant-btn {
    padding: 12px 14px;
    border-radius: 50px;
    bottom: calc(var(--footer-h) + var(--sheet-handle-h) + 12px);
    right: 14px;
  }

  .fab-label { display: none; }

  /* ── Prevent iOS viewport zoom when search input is focused ── */
  .search-input { font-size: 1rem; }

  /* ── Stop sheet list scroll from bleeding to the page/map ── */
  .facility-list { overscroll-behavior: contain; }

  /* ── Dynamic viewport: upgrade 100vh → 100dvh when supported ──
     100vh on iOS Safari includes the collapsing browser chrome,
     making the wrapper too tall. 100dvh tracks the visible area. */
  @supports (height: 100dvh) {
    .main-wrapper {
      height: calc(100dvh - var(--header-h) - var(--footer-h));
    }
  }

  /* ── iPhone safe-area: keep footer and sheet above the home bar ── */
  @supports (padding-bottom: env(safe-area-inset-bottom)) {
    .site-footer {
      padding-bottom: env(safe-area-inset-bottom);
      height: calc(var(--footer-h) + env(safe-area-inset-bottom));
    }
    .sidebar {
      bottom: calc(var(--footer-h) + env(safe-area-inset-bottom));
    }
    .floating-assistant-btn {
      bottom: calc(var(--footer-h) + env(safe-area-inset-bottom) + var(--sheet-handle-h) + 12px);
    }
  }
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE (≤ 480px)
═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .facilities-grid    { grid-template-columns: 1fr; }
  .brand-title        { font-size: 0.88rem; }
  .search-input       { font-size: 0.82rem; }
  .sidebar            { height: 42vh; }
  .facility-list-item { padding: 10px 14px; min-height: 52px; }
  .facility-item-icon { width: 30px; height: 30px; font-size: 0.82rem; }
  .facility-item-name { font-size: 0.82rem; }
  .recommended-badge  { font-size: 0.66rem; }
}

/* ═══════════════════════════════════════════════════════════
   FACILITY CARD — clickable (opens second modal)
   ═══════════════════════════════════════════════════════════ */
.facility-card-clickable {
  cursor: pointer;
  position: relative;
}

/* "Details →" hint at the bottom of each card */
.facility-card-more {
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--maroon);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.facility-card-clickable:hover .facility-card-more {
  opacity: 1;
  transform: translateX(0);
}

/* Pulse the top bar on hover to signal clickability */
.facility-card-clickable:hover::before { transform: scaleX(1); }
.facility-card-clickable:active { transform: translateY(-1px) scale(0.98); }

/* ═══════════════════════════════════════════════════════════
   FACILITY DETAIL MODAL  (second modal, higher z-index)
   ═══════════════════════════════════════════════════════════ */

/* Sits above the building modal (Bootstrap default z-index is 1055) */
#facilityDetailModal { z-index: 1080; }

.facility-detail-dialog {
  max-width: 380px;
}

.facility-detail-content {
  border: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

/* Header */
.facility-detail-header {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-light) 100%);
  color: #fff;
  padding: 18px 20px 16px;
  border-bottom: none;
}

.facility-detail-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.facility-modal-big-icon {
  font-size: 1.7rem;
  color: rgba(255,255,255,0.9);
  flex-shrink: 0;
}

.facility-detail-header .modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  white-space: normal;
}

/* Body */
.facility-detail-body {
  padding: 20px;
  background: #fff;
}

.facility-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 12px;
}

.facility-detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.facility-detail-label .bi { color: var(--maroon); }

.facility-detail-value {
  font-size: 0.84rem;
  font-weight: 600;
  color: #1f2937;
  text-align: right;
}

.facility-detail-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 12px 0 10px;
}

.facility-detail-desc-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.facility-detail-desc {
  font-size: 0.83rem;
  color: #4b5563;
  line-height: 1.65;
  margin: 0;
}

/* Footer */
.facility-detail-footer {
  background: #f9fafb;
  border-top: 1px solid #f3f4f6;
  padding: 10px 16px;
  justify-content: flex-end;
}

.btn-close-facility {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  color: #374151;
  border-radius: 8px;
  font-size: 0.8rem;
  padding: 5px 14px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.btn-close-facility:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
/* ═══════════════════════════════════════════════════════════
   v2.0 ADDITIONS
   - Assistant search styles
   - Interaction-visited badge
   - Mobile sidebar improvements
════════════════════════════════════════════════════════════ */

/* SVG inside map-inner: JS sets explicit pixel width/height from viewBox;
   CSS transform (translate + scale) handles all zoom/pan positioning. */
.map-inner svg {
  position: absolute;
  top: 0;
  left: 0;
  /* width & height are set by JS to match viewBox pixel dimensions exactly */
}

/* ── ASSISTANT SEARCH (TASK 5) ─────────────────────────────── */
.assistant-search-wrap {
  position: relative;
}

/* Combo-box row: icon + input + caret */
.asst-combo-box {
  position: relative;
  display: flex;
  align-items: center;
}

.asst-combo-icon {
  position: absolute;
  left: 11px;
  color: var(--maroon);
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 1;
}

.asst-combo-caret {
  position: absolute;
  right: 11px;
  color: var(--gray-text);
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform var(--transition), color var(--transition);
  z-index: 1;
  user-select: none;
}

.asst-combo-caret.open {
  transform: rotate(180deg);
  color: var(--maroon);
}

.assistant-search-input {
  width: 100%;
  padding: 9px 36px 9px 34px;
  border: 1.5px solid var(--gray-mid);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.87rem;
  color: var(--text-dark);
  background: var(--gray-light);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.assistant-search-input:focus {
  border-color: var(--maroon);
  background-color: var(--white);
  box-shadow: 0 0 0 2px rgba(123,29,30,0.1);
}

.assistant-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--white);
  border: 1px solid var(--gray-mid);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}

.assistant-search-results.open { display: block; animation: dropdown-in 0.15s ease; }

.asst-search-item {
  padding: 9px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--gray-light);
  transition: background var(--transition);
}
.asst-search-item:last-child  { border-bottom: none; }
.asst-search-item:hover        { background: #fdf5f5; }
.asst-search-item.selected     { background: #f9eaea; font-weight: 600; }
.asst-search-item.selected i   { color: var(--maroon); }
.asst-search-item i            { color: var(--maroon); font-size: 0.82rem; flex-shrink: 0; }

/* Highlighted match text */
.asst-match {
  background: rgba(246,172,2,0.35);
  padding: 0 1px;
  border-radius: 2px;
  font-weight: 600;
}

.asst-no-results {
  padding: 14px;
  font-size: 0.82rem;
  color: var(--gray-text);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── VISITED BADGE (subtle variant of recommended-badge) ───── */
.recommended-badge.visited-badge {
  color: var(--gray-text);
}

/* ── HIGHLIGHTED BUILDING SHAPE ─────────────────────────────── */
/* Stronger pulse animation on highlighted buildings */
.map-inner svg .building-shape.highlighted {
  fill: #F6AC02 !important;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(246,172,2,0.9));
  animation: building-pulse 1.8s ease-in-out infinite;
}

@keyframes building-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(246,172,2,0.7)); }
  50%       { filter: drop-shadow(0 0 14px rgba(246,172,2,1)); }
}

:root {
  --radius-xl:    22px;
  --shadow-card:  0 2px 10px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-raise: 0 6px 22px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
}

.search-input {
  height: 40px;
  padding: 0 40px 0 38px;
  border-radius: 50px;
  font-size: 0.88rem;
}

.search-input:focus {
  box-shadow: 0 0 0 3px rgba(246,172,2,0.22), 0 4px 14px rgba(0,0,0,0.12);
}

.search-clear-btn {
  right: 12px;
  padding: 5px 7px;
  font-size: 0.8rem;
  border-radius: 50%;
}

.facility-list { padding: 4px 0 8px; }

.facility-list-item {
  padding: 11px 14px 11px 16px;
  margin: 0 8px;
  border-radius: 10px;
  border-left: none;
  border-bottom: none;
  gap: 12px;
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.facility-list-item + .facility-list-item { margin-top: 2px; }

.facility-list-item:hover {
  background: #fdf2f2;
  border-left: none;
  transform: translateX(0);
  box-shadow: 0 2px 10px rgba(123,29,30,0.08);
}

.facility-list-item.active {
  background: linear-gradient(135deg, #f9eaea, #fffafa);
  border-left: none;
  box-shadow: 0 2px 12px rgba(123,29,30,0.12);
}

.facility-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f5f5f5;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  font-size: 0.92rem;
}

.facility-list-item.active .facility-item-icon {
  box-shadow: 0 3px 10px rgba(123,29,30,0.25);
}

.facility-item-name {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.building-item-count {
  font-size: 0.71rem;
  margin-top: 3px;
  gap: 4px;
}

.recommended-badge {
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  margin-top: 2px;
  gap: 4px;
}

.building-item-arrow {
  opacity: 0.45;
  font-size: 0.72rem;
  transition: opacity 0.18s, transform 0.18s, color 0.18s;
}

.facility-list-item:hover .building-item-arrow,
.facility-list-item.active .building-item-arrow {
  opacity: 1;
  transform: translateX(2px);
  color: var(--maroon);
}

.facility-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.07);
  background: #fff;
  box-shadow: var(--shadow-card);
  padding: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.facility-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-raise);
  border-color: rgba(123,29,30,0.18);
  background: #fff;
}

.facility-card-name {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.facility-card-desc {
  font-size: 0.72rem;
  line-height: 1.55;
  color: #777;
}

.facility-card-icon { font-size: 1.25rem; margin-bottom: 8px; }

.building-modal-header { padding: 18px 20px 16px; }

.modal-building-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  font-size: 1.2rem;
}

.modal-title {
  font-size: 1.06rem;
  letter-spacing: -0.01em;
}

.modal-building-desc { font-size: 0.78rem; margin-top: 1px; }

.building-modal-body { padding: 18px 20px 22px; }

.facilities-section-label {
  font-size: 0.71rem;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  gap: 6px;
  color: var(--maroon);
}

.facilities-grid { gap: 10px; }

.building-modal-footer {
  padding: 10px 16px;
  background: #f9f9f9;
}

.btn-assistant {
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.82rem;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(207,142,7,0.25);
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.btn-assistant:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(207,142,7,0.35);
}

.btn-close-facility {
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 0.8rem;
  min-height: 36px;
}

.btn-close-assistant {
  border-radius: 8px;
  padding: 7px 18px;
  font-size: 0.8rem;
  min-height: 36px;
  letter-spacing: 0.01em;
}

.assistant-modal-body { padding: 18px 20px; }

.assistant-field { margin-bottom: 18px; }

.assistant-label {
  font-size: 0.73rem;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.assistant-search-input,
.assistant-select {
  border-radius: var(--radius-md);
  font-size: 0.87rem;
  min-height: 42px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.question-item {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  gap: 10px;
  min-height: 44px;
}

.answer-area { border-radius: var(--radius-md); }
.answer-text { font-size: 0.87rem; line-height: 1.72; padding: 14px 16px; }

.facility-detail-content { border-radius: 20px 20px 0 0; }

.facility-detail-header { padding: 18px 20px 14px; }
.facility-detail-body   { padding: 18px 20px; }

.facility-detail-row { padding: 10px 0; gap: 14px; }

.facility-detail-label { font-size: 0.72rem; gap: 6px; }

.facility-detail-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

.facility-detail-desc { font-size: 0.84rem; line-height: 1.7; }

.facility-detail-footer { padding: 10px 18px; }

.map-ctrl-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .search-input { height: 40px; border-radius: 50px; }

  .facility-list { padding: 6px 0 16px; }

  .facility-list-item {
    margin: 0 10px;
    padding: 13px 14px;
    border-radius: 12px;
    min-height: 62px;
    gap: 12px;
  }

  .facility-list-item + .facility-list-item { margin-top: 3px; }

  .facility-item-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 1rem;
  }

  .facility-item-name  { font-size: 0.9rem; }
  .building-item-count { font-size: 0.73rem; }
  .recommended-badge   { font-size: 0.68rem; }

  .modal-title         { font-size: 1rem; }
  .modal-building-desc { font-size: 0.77rem; }

  .building-modal-body { padding: 14px 14px 20px !important; }

  .facilities-section-label { font-size: 0.7rem; margin-bottom: 12px; }

  .facilities-grid { gap: 8px; }

  .facility-card      { padding: 12px; border-radius: 12px; }
  .facility-card-name { font-size: 0.82rem; }
  .facility-card-desc { font-size: 0.7rem; }

  .question-item {
    padding: 12px 14px;
    min-height: 48px;
    font-size: 0.86rem;
    border-radius: 10px;
  }

  .btn-assistant,
  .btn-close-assistant,
  .btn-close-facility {
    min-height: 40px;
    padding: 8px 18px;
    font-size: 0.83rem;
    border-radius: 10px;
  }

  .answer-text { font-size: 0.88rem; line-height: 1.7; padding: 13px 14px; }
}

@media (max-width: 480px) {
  .facility-list-item { margin: 0 6px; padding: 12px; min-height: 58px; }
  .facility-item-icon { width: 34px; height: 34px; border-radius: 9px; font-size: 0.9rem; }
  .facility-item-name { font-size: 0.86rem; }

  .modal-title        { font-size: 0.95rem; }

  .facility-card { padding: 10px 11px; border-radius: 10px; }

  .btn-assistant,
  .btn-close-assistant,
  .btn-close-facility { min-height: 42px; padding: 9px 16px; font-size: 0.82rem; }
}

.building-image-container {
  width: 100%;
  margin: 10px 0 15px;
}

#modalBuildingImg {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.building-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
}

.img-viewer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#viewerImg {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

#closeViewer {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  color: white;
  cursor: pointer;
}

#view360Btn { margin-right: auto; }

.building-modal-footer .btn { margin-left: 6px; }
.building-modal-footer .btn:not(#view360Btn) { margin-left: 8px; }

.video360-modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
}

.video360-modal video {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
}

.video360-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
}

#video360Modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.95);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#panoramaViewer {
  width: 100%;
  height: 100%;
}

#video360Player {
  max-width: 90%;
  max-height: 90%;
  cursor: grab;
  user-select: none;
  touch-action: none;
  will-change: transform;
  transform-origin: center center;
  transition: transform 0.08s ease;
}

#video360Player:active { cursor: grabbing; }
