/* =====================================================
   SPARTA Campus Navigator - navigation-styles.css
   Clean, modern navigation UI. No overlap.
   ===================================================== */

:root {
  --sheet-peek: 72px;
  --sheet-mid:  52vh;
  --bottom-nav-h: 60px;
  --red:        #E6392F; --sparta-red: #E6392F;
  --red-dark:   #8B0000; --sparta-deep-red: #8B0000;
  --red-light:  rgba(201,48,48,0.08);
  --gold:       #F7C21B; --sparta-gold: #F7C21B;
  --gold-dark:  #D4B030;
  --evac:       #E67E22;
  --evac-dark:  #D35400;
  --evac-bg:    rgba(230,126,34,0.08);
  --green:      #22C55E;
  --blue:       #4A90E2;
  --sidebar-w:  300px;
  --topnav-h:   52px;
  --panel-gap:  12px;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 24px rgba(0,0,0,0.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.18);
  --border:     #E8EAED;
  --text-1:     #1a1a2e;
  --text-2:     #4a4a6a;
  --text-3:     #94a3b8;
  --bg-page:    #EDEEF2;
  --bg-card:    #ffffff;
  --font:       'Sora', sans-serif;
  --sheet-peek:    130px;   /* how much sheet peeks above bottom on mobile */
  --sheet-mid:     52vh;    /* mid-snap position */
  --bottom-nav-h:  58px;    /* mobile bottom nav height */
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { height:100%; }

body {
  font-family: var(--font);
  height: 100vh; height: 100dvh;
  overflow: hidden;
  background: var(--bg-page);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

/* Text inputs stay selectable */
input, textarea,
.info-content, .loc-panel-inner,
.evac-inner, .about-inner, .legend-inner {
  -webkit-user-select: text;
  user-select: text;
}

/* =====================================================
   MOBILE-ONLY ELEMENTS (hidden on desktop)
   ===================================================== */
.m-float-search { display: none; }
.m-map-fab      { display: none; }
.mobile-bottom-sheet { display: none; }
.mobile-bottom-nav   { display: none; }

/* =====================================================
   LAYOUT
   ===================================================== */

.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh; height: 100dvh;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  z-index: 1000;
  display: flex; flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.map-container {
  position: fixed;
  top: 0; right: 0;
  left: var(--sidebar-w);
  bottom: 0;
  display: flex; flex-direction: column;
  transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
}
.map-container.expanded { left: 0; }

/* =====================================================
   SIDEBAR HEADER
   ===================================================== */

.sidebar-header {
  background: linear-gradient(160deg, var(--red) 0%, var(--red-dark) 100%);
  padding: 1rem 1rem 0.85rem;
  color: #fff;
  text-align: center;
  flex-shrink: 0;
  position: relative;
}
.sidebar-header .logo-wrap {
  width: 58px; height: 58px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.sidebar-header .logo-wrap img {
  width: 48px; height: 48px;
  border-radius: 50%; object-fit: cover;
}
.sidebar-header h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem; letter-spacing: 3px;
}
.sidebar-header p {
  font-size: 0.68rem; opacity: 0.8; margin-top: 1px;
}

.close-sb {
  position: absolute; right: 0.65rem; top: 0.65rem;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  display: none; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem; color: #fff;
  transition: background 0.2s;
}
.close-sb:hover { background: rgba(255,255,255,0.32); }

/* =====================================================
   SEARCH
   ===================================================== */

.search-section {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.search-wrap { position: relative; }
.search-input {
  width: 100%;
  padding: 0.56rem 2.6rem 0.56rem 2.1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem; font-family: var(--font);
  background: #fafbfc; color: var(--text-1);
  transition: all 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201,48,48,0.1);
}
.search-icon {
  position: absolute; left: 0.6rem; top: 50%;
  transform: translateY(-50%);
  font-size: 0.82rem; color: var(--text-3); pointer-events: none;
}
.search-clear {
  position: absolute; right: 0.5rem; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 0.78rem; padding: 4px;
  transition: color 0.2s;
}
.search-clear:hover { color: var(--red); }

.search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: #fff; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 200px; overflow-y: auto;
  display: none; z-index: 1001;
  border: 1px solid var(--border);
}
.search-results.show { display: block; }
.sr-item {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #f2f2f5;
  cursor: pointer; transition: background 0.15s;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--red-light); }
.sr-name { font-weight: 600; color: var(--text-1); font-size: 0.79rem; }
.sr-sub  { font-size: 0.67rem; color: var(--text-3); margin-top: 1px; }

/* =====================================================
   TABS
   ===================================================== */

.tab-bar {
  display: flex; flex-shrink: 0;
  background: #f8f9fb;
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.tab-btn {
  flex: 1; padding: 0.56rem 0;
  border: none; border-bottom: 2.5px solid transparent;
  background: transparent;
  font-family: var(--font); font-size: 0.58rem; font-weight: 700;
  color: var(--text-3); cursor: pointer;
  transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.4px;
  line-height: 1;
}
.tab-btn:hover { color: var(--red); background: rgba(201,48,48,0.04); }
.tab-btn.active { color: var(--red); border-bottom-color: var(--red); background: #fff; }
.tab-btn.evac-tab:hover  { color: var(--evac); }
.tab-btn.evac-tab.active { color: var(--evac); border-bottom-color: var(--evac); }
.tab-btn .t-icon { display: block; font-size: 0.88rem; margin-bottom: 2px; }

/* =====================================================
   TAB PANELS
   ===================================================== */

.tab-panel {
  display: none; flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-panel.active { display: flex; flex-direction: column; }

/* ---- Viewing strip ---- */
.viewing-strip {
  margin: 0.5rem 0.75rem 0;
  padding: 0.42rem 0.6rem;
  background: linear-gradient(135deg, rgba(201,48,48,0.06), rgba(163,32,32,0.02));
  border: 1.5px solid rgba(201,48,48,0.18);
  border-radius: var(--radius-sm);
  display: none; align-items: center; gap: 0.42rem;
  flex-shrink: 0;
}
.viewing-strip.show { display: flex; }
.vs-icon  { font-size: 0.82rem; flex-shrink: 0; }
.vs-text  { flex: 1; min-width: 0; }
.vs-label { font-size: 0.56rem; color: var(--red); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.vs-name  { font-size: 0.74rem; color: var(--text-1); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-sub   { font-size: 0.61rem; color: var(--text-3); }
.vs-close { cursor: pointer; font-size: 0.82rem; color: var(--text-3); flex-shrink: 0; transition: color 0.2s; }
.vs-close:hover { color: var(--red); }

/* ---- Filter pills ---- */
.filter-bar {
  display: flex; gap: 0.28rem; flex-wrap: nowrap;
  padding: 0.52rem 0.75rem 0.38rem;
  overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
/* Desktop grab cursor hint */
.filter-bar { cursor: grab; }
.filter-bar:active { cursor: grabbing; }
.filter-pill {
  padding: 0.24rem 0.55rem;
  border-radius: 20px; border: 1.5px solid #dce0e8;
  background: #fff; font-size: 0.62rem; font-weight: 700;
  color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: all 0.18s; font-family: var(--font);
}
.filter-pill:hover { border-color: var(--red); color: var(--red); }
.filter-pill.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- Floor pills ---- */
.floor-bar {
  display: flex; gap: 0.28rem;
  padding: 0 0.75rem 0.48rem;
  overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.floor-bar::-webkit-scrollbar { display: none; }
.floor-bar { cursor: grab; }
.floor-bar:active { cursor: grabbing; }
.floor-pill {
  padding: 0.2rem 0.48rem;
  border-radius: 14px; border: 1.5px solid #dce0e8;
  background: #fff; font-size: 0.6rem; font-weight: 700;
  color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: all 0.18s; font-family: var(--font); flex-shrink: 0;
}
.floor-pill:hover { border-color: var(--red); color: var(--red); }
.floor-pill.active { background: var(--red); color: #fff; border-color: var(--red); }

/* ---- Location list ---- */
.loc-panel-inner { padding: 0.42rem 0.75rem 0.85rem; }
.building-group { margin-bottom: 0.8rem; }
.building-label {
  font-size: 0.61rem; font-weight: 800; color: var(--red);
  text-transform: uppercase; letter-spacing: 0.6px;
  padding: 0.28rem 0.52rem;
  background: rgba(201,48,48,0.07);
  border-radius: 6px; margin-bottom: 0.3rem;
}
.loc-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.52rem; border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.17s;
  border: 1.5px solid transparent; margin-bottom: 0.2rem;
}
.loc-item:hover { background: rgba(201,48,48,0.05); border-color: rgba(201,48,48,0.15); }
.loc-item.active {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(201,48,48,0.28);
}
.loc-item.active .loc-sub, .loc-item.active .loc-name,
.loc-item.active .loc-icon { color: #fff !important; opacity: 1; }
.loc-icon { font-size: 0.95rem; flex-shrink: 0; }
.loc-name { font-size: 0.75rem; font-weight: 600; color: var(--text-1); line-height: 1.3; }
.loc-sub  { font-size: 0.61rem; color: var(--text-3); margin-top: 1px; }
.loc-fav  { margin-left: auto; font-size: 0.8rem; cursor: pointer; opacity: 0.3; transition: all 0.2s; flex-shrink: 0; }
.loc-fav:hover, .loc-fav.active { opacity: 1; }

.nearby-label { font-size: 0.59rem; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 0.5px; padding: 0.32rem 0 0.14rem 0.75rem; }
.a11y-badge { display: inline-flex; align-items: center; gap: 0.16rem; background: rgba(34,197,94,0.1); color: #16a34a; border-radius: 4px; padding: 0.07rem 0.28rem; font-size: 0.57rem; font-weight: 700; margin-left: 0.28rem; flex-shrink: 0; }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--text-3); }
.empty-state .es-icon { font-size: 1.8rem; opacity: 0.3; margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.76rem; }
.empty-state .es-sub { font-size: 0.67rem; margin-top: 0.22rem; }

/* ---- Legend ---- */
.legend-inner { padding: 0.6rem 0.75rem 1rem; }
.legend-card { background: #f8f9fb; border-radius: var(--radius-sm); padding: 0.65rem; margin-bottom: 0.45rem; border: 1px solid var(--border); }
.legend-card-title { font-size: 0.6rem; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.42rem; }
.legend-row { display: flex; align-items: center; gap: 0.55rem; padding: 0.3rem 0; border-bottom: 1px solid #eef0f4; }
.legend-row:last-child { border-bottom: none; }
.legend-dot { width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; }
.legend-dot.green { background: var(--green); }
.legend-dot.blue  { background: var(--blue); }
.legend-dot.evac  { background: var(--evac); }
.legend-line { width: 26px; height: 3px; border-radius: 2px; flex-shrink: 0; background-image: repeating-linear-gradient(90deg, var(--gold) 0, var(--gold) 5px, transparent 5px, transparent 8px); }
.legend-line.evac { background-image: repeating-linear-gradient(90deg, var(--evac) 0, var(--evac) 5px, transparent 5px, transparent 8px); }
.legend-emoji { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.legend-label { font-size: 0.73rem; color: var(--text-1); font-weight: 600; }
.legend-desc  { font-size: 0.61rem; color: var(--text-3); }

/* ---- About ---- */
.about-inner { padding: 0.6rem 0.75rem 1rem; }
.about-hero { background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; border-radius: var(--radius-sm); padding: 0.8rem; margin-bottom: 0.6rem; text-align: center; }
.about-hero h3 { font-family: 'Bebas Neue', sans-serif; font-size: 1.15rem; letter-spacing: 1px; }
.about-hero p  { font-size: 0.68rem; opacity: 0.82; margin-top: 2px; }
.about-section { margin-bottom: 0.55rem; }
.about-section-title { font-size: 0.6rem; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.32rem; }
.about-item { display: flex; align-items: flex-start; gap: 0.38rem; padding: 0.3rem 0; border-bottom: 1px solid #f0f2f5; font-size: 0.72rem; color: var(--text-2); line-height: 1.4; }
.about-item:last-child { border-bottom: none; }
.ab-bullet { color: var(--red); flex-shrink: 0; margin-top: 1px; font-weight: 700; }

/* ---- Evacuation tab ---- */
.evac-inner { padding: 0.6rem 0.75rem 1rem; }
.evac-alert { background: linear-gradient(135deg, var(--evac), var(--evac-dark)); color: #fff; border-radius: var(--radius-sm); padding: 0.82rem; margin-bottom: 0.65rem; text-align: center; }
.evac-alert .ea-icon { font-size: 1.7rem; margin-bottom: 0.25rem; }
.evac-alert h3 { font-family: 'Bebas Neue', sans-serif; font-size: 1.05rem; letter-spacing: 1px; }
.evac-alert p  { font-size: 0.68rem; opacity: 0.9; margin-top: 2px; }
.evac-section  { margin-bottom: 0.7rem; }
.evac-section-title { font-size: 0.6rem; font-weight: 800; color: var(--evac); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.38rem; display: flex; align-items: center; gap: 0.28rem; }
.evac-exit-item { display: flex; align-items: flex-start; gap: 0.55rem; padding: 0.55rem; border-radius: var(--radius-sm); margin-bottom: 0.38rem; background: var(--evac-bg); border: 1.5px solid rgba(230,126,34,0.14); transition: all 0.2s; cursor: pointer; }
.evac-exit-item:hover { background: rgba(230,126,34,0.12); border-color: rgba(230,126,34,0.28); }
.evac-exit-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--evac); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; }
.evac-exit-name    { font-size: 0.76rem; font-weight: 600; color: var(--text-1); margin-bottom: 0.1rem; }
.evac-exit-details { font-size: 0.65rem; color: var(--text-2); line-height: 1.4; }
.evac-info-box { background: #fff8f3; border-left: 3px solid var(--evac); padding: 0.62rem; border-radius: 0 6px 6px 0; margin-top: 0.45rem; }
.evac-info-box p { font-size: 0.69rem; color: var(--text-2); line-height: 1.55; margin-bottom: 0.35rem; }
.evac-info-box p:last-child { margin-bottom: 0; }
.evac-info-box strong { color: var(--evac-dark); }

/* =====================================================
   EVACUATION MODAL
   ===================================================== */

.evac-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 1rem; }
.evac-overlay.show { display: flex; }
.evac-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: slideUp 0.28s ease; }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
.evac-modal-header { background: linear-gradient(135deg, var(--evac), var(--evac-dark)); padding: 1rem 1.2rem; border-radius: 16px 16px 0 0; display: flex; align-items: center; justify-content: space-between; }
.evac-modal-header-left { display: flex; align-items: center; gap: 0.55rem; }
.evac-modal-header-left .emh-icon { font-size: 1.4rem; }
.evac-modal-header-left h2 { font-family: 'Bebas Neue', sans-serif; color: #fff; font-size: 1.15rem; letter-spacing: 1px; }
.evac-modal-header-left p { font-size: 0.65rem; color: rgba(255,255,255,0.82); margin-top: 1px; }
.evac-modal-close { cursor: pointer; font-size: 1.2rem; color: rgba(255,255,255,0.75); transition: color 0.2s; }
.evac-modal-close:hover { color: #fff; }
.evac-modal-body { padding: 0.9rem 1.1rem 1.1rem; }
.evac-step { display: flex; gap: 0.65rem; padding: 0.55rem 0; border-bottom: 1px solid #f0f2f5; align-items: flex-start; }
.evac-step:last-of-type { border-bottom: none; }
.evac-step-num { width: 24px; height: 24px; border-radius: 50%; min-width: 24px; background: linear-gradient(135deg, var(--evac), var(--evac-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }
.evac-step-title { font-size: 0.76rem; font-weight: 700; color: var(--text-1); }
.evac-step-desc  { font-size: 0.67rem; color: var(--text-3); margin-top: 0.08rem; line-height: 1.45; }
.evac-exits-title { font-size: 0.6rem; font-weight: 800; color: var(--evac); text-transform: uppercase; letter-spacing: 0.5px; margin: 0.65rem 0 0.38rem; }
.evac-exit-card { display: flex; align-items: center; gap: 0.5rem; background: #fef7f0; border: 1.5px solid rgba(230,126,34,0.2); border-radius: var(--radius-sm); padding: 0.48rem 0.62rem; margin-bottom: 0.32rem; cursor: pointer; transition: all 0.2s; }
.evac-exit-card:hover { border-color: var(--evac); background: rgba(230,126,34,0.1); }
.evac-exit-name { font-size: 0.76rem; font-weight: 600; color: var(--text-1); }
.evac-exit-sub  { font-size: 0.63rem; color: var(--text-3); margin-top: 2px; }
.evac-exit-pin  { margin-left: auto; font-size: 0.68rem; color: var(--evac); font-weight: 700; flex-shrink: 0; }
.evac-exit-pin:hover { text-decoration: underline; }
.evac-warning { background: #fef7f0; border: 1.5px solid rgba(230,126,34,0.22); border-radius: var(--radius-sm); padding: 0.55rem 0.65rem; margin-top: 0.6rem; display: flex; gap: 0.45rem; align-items: flex-start; }
.evac-warning-icon { font-size: 0.95rem; flex-shrink: 0; }
.evac-warning-text { font-size: 0.66rem; color: #9a3412; line-height: 1.45; }

/* -- New evac tab branding - matches Locations layout, orange accent -- */
.evac-compact-banner {
  display: flex; align-items: center; gap: 0.6rem;
  background: linear-gradient(135deg, var(--evac), var(--evac-dark));
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.6rem;
  color: #fff;
}
.evac-compact-icon { font-size: 1.4rem; flex-shrink: 0; }
.evac-compact-title { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.02em; }
.evac-compact-sub   { font-size: 0.62rem; opacity: 0.88; margin-top: 1px; }

.evac-contacts-row {
  display: flex; gap: 0.4rem; flex-wrap: wrap;
  margin-bottom: 0.65rem;
}
.evac-contact-chip {
  display: flex; align-items: center; gap: 0.38rem;
  background: var(--evac-bg);
  border: 1.5px solid rgba(230,126,34,0.2);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.55rem;
  flex: 1; min-width: 120px;
}
.evac-contact-chip > span { font-size: 0.95rem; flex-shrink: 0; }
.ecc-label { font-size: 0.58rem; font-weight: 800; color: var(--evac-dark); text-transform: uppercase; letter-spacing: 0.4px; }
.ecc-val   { font-size: 0.62rem; color: var(--text-2); margin-top: 1px; }

.evac-list-label {
  font-size: 0.6rem; font-weight: 800;
  color: var(--evac); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 0.38rem;
  padding: 0 0.05rem;
}

/* Evac exit items - loc-item style with orange accents */
.evac-loc-item { cursor: pointer; }
.evac-loc-item:hover { border-color: rgba(230,126,34,0.35); background: var(--evac-bg); }
.evac-loc-item:active { opacity: 0.75; }
.evac-loc-item.active {
  background: linear-gradient(135deg, var(--evac), var(--evac-dark));
  border-color: transparent;
}
.evac-loc-item.active .loc-name,
.evac-loc-item.active .loc-sub { color: #fff; }

/* Numbered circle for evac items */
.evac-exit-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--evac);
  color: #fff;
  font-size: 0.72rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.evac-loc-item.active .evac-exit-num { background: rgba(255,255,255,0.25); }

/* Primary / Secondary badges */
.evac-primary-badge {
  font-size: 0.62rem; font-weight: 700;
  color: var(--evac-dark);
}
.evac-secondary-badge { color: var(--text-3); }

/* =====================================================
   TOP NAV
   ===================================================== */

.top-nav {
  height: var(--topnav-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0.9rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0; z-index: 10; position: relative;
  gap: 0.5rem;
}
.nav-left { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.toggle-sb {
  width: 34px; height: 34px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border: none; border-radius: var(--radius-sm);
  color: #fff; cursor: pointer; font-size: 0.95rem;
  display: none; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.toggle-sb:hover { box-shadow: 0 3px 10px rgba(201,48,48,0.3); }

.breadcrumb {
  display: flex; align-items: center; gap: 0.28rem;
  font-size: 0.74rem; color: var(--text-3);
  overflow: hidden; min-width: 0;
}
.breadcrumb span { white-space: nowrap; }
.breadcrumb .bc-active { color: var(--red); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }

.nav-actions { display: flex; gap: 0.38rem; flex-shrink: 0; }
.action-btn {
  padding: 0.36rem 0.78rem;
  border: 1.5px solid var(--red);
  background: #fff; color: var(--red);
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.72rem;
  cursor: pointer; transition: all 0.2s;
  font-family: var(--font); white-space: nowrap;
  text-decoration: none; display: inline-flex; align-items: center;
}
.action-btn:hover { background: var(--red); color: #fff; }
.chatbot-nav-btn { background: var(--text-1); color: #fff; border-color: transparent; }
.chatbot-nav-btn:hover { background: #2d2d4e; color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,0.2); }

/* =====================================================
   MAP VIEWER
   ===================================================== */

.map-viewer {
  flex: 1; position: relative; overflow: hidden;
  background: #d8dce6;
}
.map-iframe { width: 100%; height: 100%; border: none; display: block; }
.map-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #f0f2f8 0%, #e8eaef 100%);
  z-index: 50;
}

.map-loading-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 1.2rem; padding: 2rem;
  animation: loadFadeIn 0.5s ease;
}
@keyframes loadFadeIn { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }

/* Mascot */
.loading-mascot-wrap {
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
}
.loading-mascot {
  width: 180px; height: 180px;
  object-fit: contain;
  animation: mascotBob 2s ease-in-out infinite;
  filter: drop-shadow(0 12px 28px rgba(201,48,48,0.25));
  position: relative; z-index: 1;
}
@keyframes mascotBob {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}
.loading-mascot-shadow {
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 14px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.18) 0%, transparent 70%);
  border-radius: 50%;
  animation: shadowPulse 2s ease-in-out infinite;
}
@keyframes shadowPulse {
  0%,100% { transform: translateX(-50%) scaleX(1);   opacity: 0.6; }
  50%      { transform: translateX(-50%) scaleX(0.7); opacity: 0.3; }
}

/* Text */
.loading-text-wrap { text-align: center; }
.loading-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem; letter-spacing: 4px;
  color: var(--red); line-height: 1;
}
.loading-subtitle {
  font-size: 0.72rem; font-weight: 600;
  color: var(--text-3); letter-spacing: 1.5px;
  text-transform: uppercase; margin-top: 2px; margin-bottom: 1rem;
}

/* Progress bar */
.loading-bar-wrap {
  width: 180px; height: 4px;
  background: rgba(201,48,48,0.12);
  border-radius: 99px; overflow: hidden;
  margin: 0 auto 0.55rem;
}
.loading-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  border-radius: 99px;
  transition: width 0.3s ease;
  position: relative;
}
.loading-bar::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5));
  border-radius: 99px;
}

.loading-status {
  font-size: 0.7rem; color: var(--text-3);
  font-weight: 500; letter-spacing: 0.2px;
}

/* Mobile */
@media (max-width: 480px) {
  .loading-mascot { width: 140px; height: 140px; }
  .loading-title { font-size: 1.3rem; }
  .loading-bar-wrap { width: 150px; }
}

/* =====================================================
   MAP CONTROLS - bottom right, stacked
   ===================================================== */

.map-controls {
  position: absolute;
  bottom: 1.1rem; right: 0.9rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  z-index: 100;
}
.ctrl-btn {
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: var(--radius-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.18s; color: var(--text-2);
  backdrop-filter: blur(8px);
}
.ctrl-btn:hover { background: var(--red); color: #fff; border-color: transparent; transform: scale(1.06); }

/* =====================================================
   IDLE HINT - bottom center, above controls
   ===================================================== */

.map-idle-hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%; transform: translateX(-50%);
  background: rgba(26,26,46,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.92);
  font-size: 0.78rem; font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.12);
  pointer-events: none;
  white-space: nowrap;
  z-index: 90;
  display: flex; align-items: center; gap: 0.45rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.map-idle-hint.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
}

/* =====================================================
   INFO PANEL - left side, below topnav
   No overlap with controls (they're on right)
   ===================================================== */

.info-panel {
  position: absolute;
  top: calc(var(--topnav-h) + var(--panel-gap));
  left: var(--panel-gap);
  width: 272px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: none;
  max-height: calc(100% - var(--topnav-h) - var(--panel-gap)*2);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: panelIn 0.26s cubic-bezier(0.34,1.56,0.64,1);
}
.info-panel.show { display: block; }
@keyframes panelIn { from{opacity:0;transform:translateX(-14px) scale(0.97)} to{opacity:1;transform:translateX(0) scale(1)} }

.info-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 0.85rem 0.85rem 0.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; z-index: 1;
  border-radius: var(--radius) var(--radius) 0 0;
}
.info-header-left { display: flex; align-items: flex-start; gap: 0.5rem; min-width: 0; }
.info-type-badge { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.info-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem; color: var(--red);
  letter-spacing: 0.5px; line-height: 1.2;
}
.close-info {
  cursor: pointer; font-size: 1.1rem; color: var(--text-3);
  transition: all 0.2s; line-height: 1; flex-shrink: 0;
  background: none; border: none; padding: 2px;
  border-radius: 50%; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
}
.close-info:hover { color: var(--red); background: var(--red-light); }

/* Info content fields */
.info-content {
  display: flex; flex-direction: column; gap: 0;
  padding: 0.6rem 0.85rem;
}
.info-row {
  display: flex; align-items: flex-start; gap: 0.42rem;
  padding: 0.38rem 0;
  border-bottom: 1px solid #f4f6f8;
}
.info-row:last-child { border-bottom: none; }
.info-row-icon { font-size: 0.82rem; color: var(--red); margin-top: 1px; flex-shrink: 0; }
.info-label { font-size: 0.57rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.35px; margin-bottom: 1px; }
.info-value { font-size: 0.74rem; color: var(--text-1); font-weight: 500; line-height: 1.4; }

.desc-formatted { display: flex; flex-direction: column; gap: 0.25rem; }
.desc-sentence { font-size: 0.72rem; color: var(--text-2); line-height: 1.5; padding: 0.2rem 0; border-bottom: 1px solid #f4f6f8; }
.desc-sentence:last-child { border-bottom: none; }
.desc-role-row { display: flex; flex-direction: column; gap: 0.06rem; padding: 0.22rem 0.38rem; background: #fafafa; border-left: 3px solid var(--red); border-radius: 0 5px 5px 0; margin-bottom: 0.15rem; }
.desc-role-label { font-size: 0.56rem; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: 0.4px; }
.desc-role-name  { font-size: 0.71rem; color: var(--text-1); font-weight: 600; }

/* No-route message */
.no-route-msg {
  margin-top: 0.55rem;
  padding: 0.65rem 0.75rem;
  background: #fff8f3;
  border: 1.5px solid rgba(230,126,34,0.28);
  border-radius: var(--radius-sm);
  font-size: 0.73rem; color: #92400e; line-height: 1.5;
}
.no-route-msg strong { display: block; margin-bottom: 3px; color: var(--evac-dark); }

/* ---- Route info card (inside panel) ---- */
.route-info-card {
  margin: 0 0.85rem 0;
  padding: 0.6rem 0.7rem;
  background: linear-gradient(135deg, #fffdf0, #fefce8);
  border: 1.5px solid rgba(244,208,63,0.4);
  border-radius: var(--radius-sm);
  display: none;  /* shown by JS after route drawn */
  animation: fadeSlideIn 0.3s ease;
}
.route-info-card.show { display: block; }
@keyframes fadeSlideIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.route-info-title {
  font-size: 0.6rem; font-weight: 800; color: #92720a;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.42rem;
}
.route-stats-row {
  display: flex; gap: 0.3rem;
}
.route-stat {
  flex: 1; text-align: center;
  background: rgba(255,255,255,0.65);
  border-radius: 7px; padding: 0.38rem 0.2rem;
  border: 1px solid rgba(244,208,63,0.3);
}
.rs-icon  { font-size: 0.9rem; display: block; margin-bottom: 2px; }
.rs-label { font-size: 0.55rem; color: #92720a; display: block; margin-bottom: 2px; }
.rs-value { font-size: 0.72rem; font-weight: 700; color: var(--text-1); display: block; }

/* ---- Action buttons ---- */
.info-actions {
  display: flex; gap: 0.45rem;
  padding: 0.55rem 0.85rem 0.85rem;
}
.directions-btn {
  flex: 1; padding: 0.6rem 0.5rem;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.74rem;
  cursor: pointer; transition: all 0.2s;
  font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 0.38rem;
}
.directions-btn:hover { box-shadow: 0 4px 14px rgba(201,48,48,0.35); transform: translateY(-1px); }
.directions-btn:disabled { opacity: 0.65; transform: none; cursor: not-allowed; }
.clear-btn {
  padding: 0.6rem 0.65rem;
  background: #f1f3f7; color: var(--text-2);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.7rem;
  cursor: pointer; transition: all 0.2s;
  font-family: var(--font); white-space: nowrap;
  display: none; /* shown after route drawn */
}
.clear-btn:hover { background: #e8eaed; color: var(--text-1); }
.clear-btn.show { display: block; }

/* Direction steps */
.directions-steps { margin-top: 0.45rem; padding: 0 0.85rem; }
.dir-step { display: flex; gap: 0.45rem; padding: 0.38rem 0; border-bottom: 1px solid #f4f6f8; align-items: flex-start; }
.dir-step:last-child { border-bottom: none; }
.dir-step-num { width: 20px; height: 20px; border-radius: 50%; min-width: 20px; background: linear-gradient(135deg, var(--red), var(--red-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.58rem; font-weight: 700; }
.dir-step-text { font-size: 0.7rem; color: var(--text-2); line-height: 1.4; padding-top: 2px; }

/* =====================================================
   SIDEBAR EDGE TAB (collapsed state)
   ===================================================== */

.sidebar-edge-tab {
  display: none;
  position: fixed; left: 0; top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem;
  width: 34px; padding: 0.8rem 0.16rem;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff; border: none; border-radius: 0 10px 10px 0;
  box-shadow: 3px 0 16px rgba(0,0,0,0.18);
  cursor: pointer; font-family: var(--font);
  transition: width 0.2s ease, box-shadow 0.2s;
  overflow: hidden; white-space: nowrap;
}
.sidebar-edge-tab.edge-tab-visible { display: flex; }
.sidebar-edge-tab:hover { width: 68px; box-shadow: 4px 0 20px rgba(201,48,48,0.36); }
.edge-tab-icon  { font-size: 1.05rem; line-height: 1; flex-shrink: 0; }
.edge-tab-label {
  font-size: 0.53rem; font-weight: 800; letter-spacing: 0.55px;
  text-transform: uppercase; writing-mode: vertical-rl; transform: rotate(180deg);
  opacity: 0; max-height: 0; overflow: hidden; transition: opacity 0.15s, max-height 0.15s;
}
.sidebar-edge-tab:hover .edge-tab-label { opacity: 1; max-height: 60px; }



/* =====================================================
   BOTTOM SHEET - hidden on desktop, shown by JS on mobile
   ===================================================== */
.mobile-bottom-sheet { display: none; flex-direction: column; }
.mobile-bottom-nav   { display: none; }

.sheet-panel { display: none; }
.sheet-panel.active { display: block; }

/* Ensure bottom nav doesn't show on desktop */
@media (min-width: 769px) {
  .mobile-bottom-sheet { display: none !important; }
  .mobile-bottom-nav   { display: none !important; }
}

/* =====================================================
   NEARBY - sticky bottom card inside locations tab
   ===================================================== */

.nearby-bottom-card {
  flex-shrink: 0;
  background: #fff;
  border-top: 1.5px solid var(--border);
  padding: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.07);
  animation: slideUpCard 0.28s cubic-bezier(0.34,1.2,0.64,1);
}
@keyframes slideUpCard {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}

.nearby-bottom-header {
  display: flex; align-items: center; gap: 0.42rem;
  padding: 0.55rem 0.75rem 0.42rem;
  border-bottom: 1px solid var(--border);
}
.nearby-bottom-icon {
  font-size: 0.85rem; flex-shrink: 0;
}
.nearby-bottom-title {
  font-size: 0.62rem; font-weight: 800;
  color: var(--red); text-transform: uppercase;
  letter-spacing: 0.5px; flex: 1;
}
.nearby-bottom-close {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 0.78rem; padding: 2px 4px;
  border-radius: 4px; transition: all 0.18s;
  line-height: 1;
}
.nearby-bottom-close:hover { color: var(--red); background: var(--red-light); }

/* Horizontal scroll row of nearby items */
.nearby-scroll {
  display: flex; gap: 0.55rem;
  padding: 0.55rem 0.75rem 0.7rem;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8px, black calc(100% - 8px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 8px, black calc(100% - 8px), transparent 100%);
}
.nearby-scroll::-webkit-scrollbar { display: none; }
.nearby-scroll { cursor: grab; }
.nearby-scroll:active { cursor: grabbing; }

/* Nearby items as horizontal cards */
.nearby-scroll .loc-item {
  flex-shrink: 0;
  flex-direction: column; align-items: flex-start;
  width: 130px; gap: 0.22rem;
  padding: 0.58rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #fafbfc;
  scroll-snap-align: start;
  margin-bottom: 0;
}
.nearby-scroll .loc-item:hover {
  border-color: rgba(230,57,47,0.28);
  background: var(--red-light);
}
.nearby-scroll .loc-item.active {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  border-color: transparent;
}
.nearby-scroll .loc-icon { font-size: 1.15rem; }
.nearby-scroll .loc-name {
  font-size: 0.7rem; font-weight: 700; line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  color: var(--text-1);
}
.nearby-scroll .loc-item.active .loc-name { color: #fff; }
.nearby-scroll .loc-sub { font-size: 0.62rem; color: var(--text-3); }
.nearby-scroll .loc-item.active .loc-sub { color: rgba(255,255,255,0.75); }

/* Mobile - touch-friendly */
@media (max-width: 768px) {
  .nearby-scroll .loc-item { width: 120px; padding: 0.52rem 0.58rem; }
  .nearby-scroll .loc-name { font-size: 0.68rem; }
  .nearby-bottom-card { box-shadow: 0 -6px 24px rgba(0,0,0,0.1); }
}

/* =====================================================
   RESPONSIVE - TABLET (<=1024px)
   ===================================================== */

@media (max-width: 1024px) {
  :root { --sidebar-w: 280px; }
}

/* =====================================================
   RESPONSIVE - MOBILE (<=768px)
   Bottom-sheet layout: map fills screen, panel slides up from bottom
   ===================================================== */

@media (max-width: 768px) {

  /* ===================================================
     BASE LAYOUT - sidebar gone, map fills screen
     =================================================== */
  .sidebar, .sidebar-edge-tab, .toggle-sb { display: none !important; }
  .map-container { left: 0 !important; }

  /* Top nav - completely hidden on mobile; floating search replaces it */
  .top-nav { display: none !important; }

  /* Idle hint - hide on mobile (search float handles this) */
  .map-idle-hint { display: none !important; }

  /* Desktop info panel - hidden; replaced by sheet detail */
  .info-panel { display: none !important; }

  /* ===================================================
     FLOATING SEARCH BAR - top left, on the map
     Like Parzellary's "Search location on map..." pill
     =================================================== */
  .m-float-search {
    position: fixed;
    top: max(0.75rem, env(safe-area-inset-top, 0px) + 0.75rem);
    left: 0.75rem;
    right: 3.8rem; /* leave room for map controls */
    z-index: 400;
    background: rgba(255,255,255,0.97);
    border-radius: 50px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.14);
    display: flex; align-items: center;
    padding: 0 0.75rem 0 0.85rem;
    height: 42px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .m-float-search-icon {
    font-size: 0.88rem; color: #94a3b8;
    flex-shrink: 0; margin-right: 0.45rem;
    pointer-events: none;
  }
  .m-float-search-input {
    flex: 1; border: none; background: transparent;
    font-size: 0.82rem; font-family: var(--font); color: var(--text-1);
    outline: none; min-width: 0;
  }
  .m-float-search-input::placeholder { color: #94a3b8; }
  .m-float-search-clear {
    background: none; border: none;
    color: #94a3b8; font-size: 0.78rem;
    cursor: pointer; padding: 0 0.2rem;
    flex-shrink: 0;
  }
  /* Search results dropdown anchored to float search */
  .m-float-search .search-results {
    position: absolute;
    top: calc(100% + 6px); left: 0; right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    max-height: 240px; overflow-y: auto;
    border: 1px solid #e2e8f0;
  }

  /* ===================================================
     MAP CONTROLS - right side stacked, like Parzellary
     =================================================== */
  .map-controls {
    position: fixed;
    right: 0.65rem;
    top: max(0.75rem, env(safe-area-inset-top, 0px) + 0.75rem);
    bottom: auto; /* override desktop bottom positioning */
    flex-direction: column;
    gap: 0.3rem;
    z-index: 400;
  }
  .ctrl-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: #1a2e2e; /* dark teal like Parzellary */
    color: #a0c8b8;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.22);
    font-size: 1rem;
  }
  .ctrl-btn:hover {
    background: #22403e;
    color: #fff;
    transform: none;
  }

  /* ===================================================
     FLOATING FAB - "Reset View" like "Hide Parcels"
     Centered at bottom of map, above sheet peek
     =================================================== */
  .m-map-fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + var(--sheet-peek) + 0.6rem);
    left: 50%; transform: translateX(-50%);
    background: #1a2e2e;
    color: #e0f0ec;
    border: none; border-radius: 50px;
    padding: 0.52rem 1.1rem;
    font-size: 0.76rem; font-weight: 700;
    font-family: var(--font); letter-spacing: 0.3px;
    box-shadow: 0 3px 16px rgba(0,0,0,0.22);
    cursor: pointer; white-space: nowrap;
    z-index: 390;
    display: flex; align-items: center; gap: 0.38rem;
    transition: all 0.18s;
  }
  .m-map-fab:active { background: #0d1f1f; transform: translateX(-50%) scale(0.97); }

  /* ===================================================
     BOTTOM SHEET
     Parzellary: white card slides up, pill handle,
     filled-pill active tabs, borderless search, card list
     =================================================== */
  .mobile-bottom-sheet {
    position: fixed;
    left: 0; right: 0;
    bottom: var(--bottom-nav-h);
    z-index: 500;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 28px rgba(0,0,0,0.10);
    /* Fixed height like Parzellary so offsetHeight is reliable for drag math */
    height: calc(85vh - var(--bottom-nav-h));
    height: calc(85dvh - var(--bottom-nav-h));
    transform: translateY(calc(100% - var(--sheet-peek)));
    transition: transform 0.34s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: auto;
  }
  .mobile-bottom-sheet.expanded { transform: translateY(0); }
  .mobile-bottom-sheet.mid      { transform: translateY(calc(100% - var(--sheet-mid))); }

  /* Drag handle - centered pill */
  .sheet-handle-bar {
    flex-shrink: 0;
    display: flex; justify-content: center; align-items: center;
    padding: 0.6rem 0 0.38rem;
    cursor: grab;
  }
  .sheet-handle-bar:active { cursor: grabbing; }
  .sheet-handle {
    width: 36px; height: 3.5px;
    background: #cbd5e1; border-radius: 99px;
  }

  /* Tab bar - FILLED PILL style like Parzellary
     Active = dark filled pill; Inactive = plain text */
  .sheet-tab-bar {
    flex-shrink: 0;
    display: flex; align-items: center;
    gap: 0.35rem;
    padding: 0 0.85rem 0.65rem;
    overflow-x: auto; scrollbar-width: none;
    border-bottom: none; /* no underline - pills instead */
  }
  .sheet-tab-bar::-webkit-scrollbar { display: none; }
  .sheet-tab-btn {
    padding: 0.38rem 0.9rem;
    border-radius: 50px;
    border: 1.5px solid transparent;
    background: transparent;
    font-family: var(--font); font-size: 0.75rem;
    font-weight: 700; color: #64748b;
    cursor: pointer; white-space: nowrap;
    transition: all 0.18s; line-height: 1.3;
    flex-shrink: 0;
  }
  .sheet-tab-btn:hover { background: #f1f5f9; color: var(--text-1); }
  .sheet-tab-btn.active {
    background: #1a2e2e; /* dark teal - matches Parzellary active pill */
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(26,46,46,0.22);
  }
  .sheet-tab-btn.evac-tab.active {
    background: var(--evac);
    box-shadow: 0 2px 8px rgba(230,126,34,0.28);
  }

  /* Sheet scrollable content - scroll freely, no drag interference */
  .sheet-content {
    flex: 1; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  /* Filter chips row - like Parzellary's status chips
     "All  Available  Sold  Reserved  Encumbered  Pending" */
  .sheet-pills-row {
    display: flex; gap: 0.32rem;
    padding: 0.52rem 0.85rem 0.38rem;
    overflow-x: auto; scrollbar-width: none;
    cursor: grab; flex-wrap: nowrap;
  }
  .sheet-pills-row:active { cursor: grabbing; }
  .sheet-pills-row::-webkit-scrollbar { display: none; }

  /* Override pill styles for inside sheet */
  .sheet-pills-row .filter-pill,
  .sheet-pills-row .floor-pill {
    padding: 0.22rem 0.65rem;
    border-radius: 50px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 0.69rem; font-weight: 600;
    color: #475569; white-space: nowrap;
    transition: all 0.14s; cursor: pointer;
    font-family: var(--font); flex-shrink: 0;
  }
  .sheet-pills-row .filter-pill.active {
    background: #1a2e2e; color: #fff; border-color: #1a2e2e;
  }
  .sheet-pills-row .floor-pill.active {
    background: #1a2e2e; color: #fff; border-color: #1a2e2e;
  }

  /* Location list - Parzellary card rows */
  .sheet-loc-list {
    padding: 0 0.85rem 1rem;
  }
  .sheet-loc-item {
    display: flex; align-items: center; gap: 0.72rem;
    padding: 0.82rem 0;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: none;
  }
  .sheet-loc-item:last-child { border-bottom: none; }
  .sheet-loc-item:active { opacity: 0.7; }

  /* Icon square - like Parzellary's property icon */
  .sheet-loc-item .loc-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    background: #f0faf6;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    border: 1px solid #e0f0e8;
  }
  .sheet-loc-item .loc-name {
    font-size: 0.82rem; font-weight: 700;
    color: #0f172a; line-height: 1.35;
  }
  .sheet-loc-item .loc-sub {
    font-size: 0.64rem; color: #94a3b8;
    margin-top: 2px; line-height: 1.3;
  }
  .sheet-loc-item .loc-fav {
    margin-left: auto; font-size: 1rem;
    color: #cbd5e1; flex-shrink: 0;
    transition: color 0.18s;
  }
  .sheet-loc-item .loc-fav.active { color: #f59e0b; }

  /* Location detail panel */
  .sheet-location-detail {
    display: none;
    padding: 0 0.85rem 1rem;
    animation: fadeSlideIn 0.22s ease;
  }
  .sheet-detail-header {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.65rem 0 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.5rem;
  }
  .sheet-detail-back {
    width: 34px; height: 34px; flex-shrink: 0;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    color: #475569; font-size: 0.9rem; font-weight: 700;
    cursor: pointer; font-family: var(--font);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
  }
  .sheet-detail-back:active {
    background: #fef2f2; border-color: var(--red); color: var(--red);
  }
  .sheet-detail-name {
    font-size: 0.88rem; font-weight: 800;
    color: #0f172a; line-height: 1.3; flex: 1;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  }
  .sheet-detail-sub { font-size: 0.64rem; color: #94a3b8; margin-top: 1px; }

  /* Route card inside detail */
  .sheet-route-card {
    background: linear-gradient(135deg, #fffdf0, #fefce8);
    border: 1.5px solid rgba(244,208,63,0.38);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.65rem;
    display: none;
    animation: fadeSlideIn 0.25s ease;
  }
  .sheet-route-card.show { display: block; }

  /* ===================================================
     BOTTOM NAV - clean icon nav like Parzellary
     =================================================== */
  .mobile-bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--bottom-nav-h);
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #e8edf2;
    display: flex; align-items: stretch;
    z-index: 600;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav-btn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px; padding: 0.32rem 0.2rem;
    border: none; background: none;
    cursor: pointer; font-family: var(--font);
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
    position: relative;
  }
  .bottom-nav-btn:active { opacity: 0.6; }

  /* SVG icon */
  .bn-svg {
    width: 22px; height: 22px;
    stroke: #94a3b8;
    transition: stroke 0.15s;
    flex-shrink: 0;
  }
  .bottom-nav-btn.active .bn-svg { stroke: #1a2e2e; }
  .bottom-nav-btn.evac-btn.active .bn-svg { stroke: var(--evac); }

  .bn-label {
    font-size: 0.55rem; font-weight: 700;
    color: #94a3b8; white-space: nowrap;
    letter-spacing: 0.15px;
    transition: color 0.15s;
  }
  .bottom-nav-btn.active .bn-label { color: #1a2e2e; }
  .bottom-nav-btn.evac-btn.active .bn-label { color: var(--evac); }

  /* Active indicator dot above icon - subtle like Parzellary */
  .bottom-nav-btn::before {
    content: '';
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 3px;
    border-radius: 0 0 4px 4px;
    background: #1a2e2e;
    opacity: 0; transition: opacity 0.2s;
  }
  .bottom-nav-btn.active::before { opacity: 1; }
  .bottom-nav-btn.evac-btn.active::before { background: var(--evac); }
}

/* =====================================================
   RESPONSIVE - SMALL (<=480px)
   ===================================================== */

@media (max-width: 480px) {
  .info-panel { max-height: 50vh; padding: 0; border-radius: 11px; }
  .ctrl-btn { width: 36px; height: 36px; font-size: 0.92rem; }
  .action-btn { font-size: 0.62rem; padding: 0.28rem 0.42rem; }
}

/* =====================================================
   LANDSCAPE MOBILE
   ===================================================== */

@media (max-width: 768px) and (orientation: landscape) {
  .info-panel {
    max-height: 72vh;
    top: max(46px, env(safe-area-inset-top, 0px) + 46px);
    max-width: 300px;
    right: auto;
  }
  .map-controls { bottom: 0.65rem; }
  .map-idle-hint { bottom: 4.5rem; }
}

/* =====================================================
   TOUCH TARGETS
   ===================================================== */

@media (hover: none) and (pointer: coarse) {
  .loc-item    { padding: 0.56rem 0.58rem; }
  .filter-pill { padding: 0.28rem 0.58rem; }
  .floor-pill  { padding: 0.24rem 0.5rem; }
  .tab-btn     { padding: 0.6rem 0; }
  .ctrl-btn    { width: 44px; height: 44px; }
  .directions-btn { min-height: 44px; }
}

/* =====================================================
   VERY SMALL (<=360px)
   ===================================================== */

@media (max-width: 360px) {
  .sidebar-header h1 { font-size: 1.08rem; }
  .breadcrumb { display: none; }
  .action-btn { font-size: 0.6rem; padding: 0.26rem 0.36rem; }
  .tab-btn    { font-size: 0.52rem; }
  .ctrl-btn   { width: 34px; height: 34px; }
}

/* =====================================================
   SAFE AREA (notched devices)
   ===================================================== */

@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    .top-nav {
      padding-top: max(0.38rem, env(safe-area-inset-top));
      padding-left: max(0.7rem, env(safe-area-inset-left));
      padding-right: max(0.7rem, env(safe-area-inset-right));
    }
    .map-controls { bottom: max(1rem, env(safe-area-inset-bottom)); }
    .sidebar-edge-tab { left: max(0px, env(safe-area-inset-left)); }
  }
}

/* =====================================================
   MOBILE UI REVAMP - all rules scoped to <=768px
   Desktop layout is completely unaffected.
   ===================================================== */

/* -- 1. Mobile top bar -- */
.mobile-top-bar { display: none; }

@media (max-width: 768px) {
  :root { --mobile-header-h: 54px; }

  .mobile-top-bar {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--mobile-header-h);
    padding: 0 0.9rem;
    padding-top: max(0px, env(safe-area-inset-top));
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--red), var(--red-dark));
    z-index: 650;
    box-shadow: 0 2px 12px rgba(0,0,0,0.22);
  }

  .mtb-left {
    display: flex; align-items: center; gap: 0.55rem;
  }
  .mtb-logo {
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.35);
    object-fit: cover;
  }
  .mtb-title {
    font-family: var(--font); font-weight: 800;
    font-size: 0.88rem; color: #fff; letter-spacing: 0.02em; line-height: 1.2;
  }
  .mtb-sub {
    font-size: 0.6rem; color: rgba(255,255,255,0.72); font-weight: 500;
  }

  .mtb-bell {
    position: relative;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer;
    transition: background 0.18s;
    -webkit-tap-highlight-color: transparent;
  }
  .mtb-bell:active { background: rgba(255,255,255,0.28); }

  .mtb-bell-badge {
    position: absolute; top: -3px; right: -3px;
    background: var(--gold); color: #7a0000;
    font-size: 0.6rem; font-weight: 900;
    width: 17px; height: 17px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--red);
    font-family: var(--font);
  }

  /* Shift map container below header */
  .map-container {
    top: var(--mobile-header-h) !important;
  }

  /* -- 2. Hide injected floating bell -- */
  #spNotifBell { display: none !important; }

  /* -- 3. Hide floating search pill on mobile -- */
  .m-float-search { display: none !important; }

  /* -- 4. Hide Reset View FAB -- */
  .m-map-fab { display: none !important; }

  /* -- 5. Hide sheet tab bar (bottom nav handles switching) -- */
  .sheet-tab-bar { display: none !important; }

  /* -- 6. Map controls - lower right, above sheet peek -- */
  .map-controls {
    top: auto !important;
    bottom: calc(var(--bottom-nav-h) + var(--sheet-peek) + 0.65rem) !important;
    right: 0.65rem !important;
  }

  /* -- 7. Mobile sheet search -- */
  .sheet-search-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem 0.5rem;
    border-bottom: 1px solid #f1f5f9;
  }
  .sheet-search-icon {
    font-size: 0.85rem; color: #94a3b8; flex-shrink: 0;
  }
  .sheet-search-input {
    flex: 1; border: none; background: transparent;
    font-size: 0.85rem; font-family: var(--font);
    color: var(--text-1); outline: none; min-width: 0;
  }
  .sheet-search-input::placeholder { color: #94a3b8; }
  .sheet-search-clear {
    background: none; border: none; color: #94a3b8;
    font-size: 0.78rem; cursor: pointer; padding: 0 0.2rem;
    flex-shrink: 0;
  }

  /* -- 8. Reset filters row -- */
  .sheet-reset-row {
    display: none;
    padding: 0.3rem 0.85rem 0.2rem;
    justify-content: flex-end;
  }
  .sheet-reset-btn {
    font-size: 0.68rem; font-weight: 700;
    font-family: var(--font); color: var(--red);
    background: rgba(230,57,47,0.07);
    border: 1.5px solid rgba(230,57,47,0.2);
    border-radius: 50px; padding: 0.22rem 0.7rem;
    cursor: pointer; transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .sheet-reset-btn:active { background: rgba(230,57,47,0.14); }

  /* -- 9. Sheet content auto-sizing -- */
  .sheet-loc-list {
    min-height: 60px; /* allow small content without forced height */
  }
  .empty-state {
    padding: 2rem 1rem; /* consistent empty state padding */
  }

  /* -- 10. Sheet hidden when card is open -- */
  .mobile-bottom-sheet.card-open {
    transform: translateY(100%) !important;
    transition: transform 0.26s cubic-bezier(0.4,0,0.2,1) !important;
    pointer-events: none !important;
  }

  /* -- 11. Floating location card (Parzellary style) -- */
  .mobile-loc-card {
    display: none;
    position: fixed;
    left: 0.75rem; right: 0.75rem;
    bottom: calc(var(--bottom-nav-h) + 0.65rem);
    background: #fff;
    border-radius: 18px;
    box-shadow:
      0 -2px 8px rgba(0,0,0,0.06),
      0 8px 32px rgba(0,0,0,0.14),
      0 20px 60px rgba(0,0,0,0.12);
    z-index: 560;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
  }
  .mobile-loc-card.show {
    display: flex;
    animation: mlcSlideUp 0.3s cubic-bezier(0.34,1.2,0.64,1) both;
  }
  @keyframes mlcSlideUp {
    from { transform: translateY(18px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .mlc-header {
    display: flex; align-items: flex-start;
    justify-content: space-between;
    padding: 0.85rem 1rem 0.6rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.5rem;
  }
  .mlc-title-group {
    display: flex; align-items: flex-start; gap: 0.55rem; flex: 1; min-width: 0;
  }
  .mlc-icon { font-size: 1.35rem; flex-shrink: 0; margin-top: 1px; }
  .mlc-name-wrap { flex: 1; min-width: 0; }
  .mlc-name {
    font-size: 0.9rem; font-weight: 800; color: #0f172a;
    line-height: 1.3; word-break: break-word;
  }
  .mlc-sub {
    font-size: 0.68rem; color: #94a3b8; margin-top: 2px; line-height: 1.4;
  }
  .mlc-close {
    width: 28px; height: 28px; border-radius: 50%;
    background: #f1f5f9; border: none; cursor: pointer;
    font-size: 0.78rem; color: #64748b; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mlc-close:active { background: #e2e8f0; }

  .mlc-body {
    padding: 0.65rem 1rem;
    display: flex; flex-direction: column; gap: 0.4rem;
  }
  .mlc-row {
    display: flex; align-items: flex-start; gap: 0.55rem;
  }
  .mlc-row-icon { font-size: 0.95rem; flex-shrink: 0; margin-top: 1px; }
  .mlc-row-label {
    font-size: 0.6rem; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.4px;
  }
  .mlc-row-val {
    font-size: 0.8rem; font-weight: 600; color: #0f172a; margin-top: 1px;
  }

  .mlc-route {
    display: flex; gap: 0.5rem;
    padding: 0.55rem 1rem;
    background: #fffdf0;
    border-top: 1px solid rgba(244,208,63,0.3);
    border-bottom: 1px solid rgba(244,208,63,0.3);
  }
  .mlc-route-stat {
    display: flex; align-items: center; gap: 0.3rem;
    font-size: 0.72rem; font-weight: 600; color: #475569;
    flex: 1; justify-content: center;
  }

  .mlc-actions {
    display: flex; gap: 0.5rem;
    padding: 0.65rem 1rem max(0.65rem, env(safe-area-inset-bottom));
    border-top: 1px solid #f1f5f9;
  }
  .mlc-dir-btn {
    flex: 1; background: linear-gradient(135deg, var(--red), var(--red-dark));
    color: #fff; border: none; border-radius: 10px;
    padding: 0.7rem 1rem; font-size: 0.82rem; font-weight: 700;
    font-family: var(--font); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    transition: opacity 0.18s;
    -webkit-tap-highlight-color: transparent;
  }
  .mlc-dir-btn:active { opacity: 0.85; }
  .mlc-clear-btn {
    padding: 0.7rem 0.9rem; background: #f8fafc;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 0.78rem; font-weight: 700; font-family: var(--font);
    color: #64748b; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
  }
  .mlc-clear-btn:active { background: #eef2f7; }
}

/* =====================================================
   MOBILE UI REVAMP v2 - all scoped to <=768px
   Fixes: container centering, drag, sticky filters,
   z-index, legend overflow, card minimize, peek height
   ===================================================== */

@media (max-width: 768px) {

  /* -- 1. Map container - bottom stops at sheet peek so campus centres -- */
  .map-container {
    bottom: var(--bottom-nav-h) !important;
  }

  /* -- 2. Sheet peek height - 300px shows ~2.5 rows on load -- */
  :root { --sheet-peek: 300px !important; }

  /* -- 3. Map controls - above sheet and floating card -- */
  .map-controls {
    z-index: 580 !important;
    /* Position in lower-right, above sheet peek level */
    bottom: calc(var(--bottom-nav-h) + var(--sheet-peek) + 0.6rem) !important;
  }

  /* -- 4. Sheet search row - sticky at top of scroll area -- */
  .sheet-search-row {
    position: sticky;
    top: 0;
    z-index: 20;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: 0.6rem 0.85rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .sheet-search-icon { font-size: 0.85rem; color: #94a3b8; flex-shrink: 0; }
  .sheet-search-input {
    flex: 1; border: none; background: transparent;
    font-size: 0.85rem; font-family: var(--font);
    color: var(--text-1); outline: none; min-width: 0;
  }
  .sheet-search-input::placeholder { color: #94a3b8; }
  .sheet-search-clear {
    background: none; border: none; color: #94a3b8;
    font-size: 0.78rem; cursor: pointer; padding: 0 0.2rem;
    flex-shrink: 0;
  }

  /* -- 5. Filter pills - sticky below search row -- */
  .sheet-pills-row {
    position: sticky;
    top: 47px;  /* search height */
    z-index: 19;
    background: #fff;
    padding-top: 0.42rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #f8fafc;
  }
  /* Floor pills row (second sibling) */
  .sheet-pills-row + .sheet-pills-row {
    top: 87px; /* search + type pills */
    z-index: 18;
  }

  /* -- 6. Reset filters button - sticky below pills -- */
  .sheet-reset-row {
    position: sticky;
    top: 127px;
    z-index: 17;
    background: #fff;
    padding: 0.3rem 0.85rem 0.2rem;
    justify-content: flex-end;
    border-bottom: 1px solid #f8fafc;
  }
  .sheet-reset-btn {
    font-size: 0.68rem; font-weight: 700;
    font-family: var(--font); color: var(--red);
    background: rgba(230,57,47,0.07);
    border: 1.5px solid rgba(230,57,47,0.2);
    border-radius: 50px; padding: 0.22rem 0.7rem;
    cursor: pointer;
  }

  /* -- 7. Legend panel - must scroll -- */
  .sheet-panel#sheet-panel-legend {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-panel#sheet-panel-legend .legend-inner {
    padding: 0.6rem 0.75rem 1.5rem;
  }

  /* -- 8. Floating card minimized state - strip only -- */
  .mobile-loc-card.minimized .mlc-body { display: none !important; }
  .mobile-loc-card.minimized .mlc-header {
    border-bottom: none;
    padding-bottom: 0.6rem;
  }
  .mobile-loc-card.minimized .mlc-actions {
    border-top: none;
    padding-top: 0;
  }
  /* "Now Showing" label in minimized state */
  .mobile-loc-card.minimized .mlc-name::before {
    content: 'Navigating to: ';
    font-size: 0.65rem;
    font-weight: 500;
    color: #94a3b8;
    display: block;
    margin-bottom: 1px;
  }

  /* -- 9. Evac collapsible info -- */
  .evac-collapsible {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    background: rgba(230,126,34,0.06);
    border-bottom: 1px solid rgba(230,126,34,0.15);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }
  .evac-coll-icon { font-size: 0.9rem; flex-shrink: 0; }
  .evac-coll-label { font-size: 0.72rem; font-weight: 700; color: var(--evac-dark); flex: 1; }
  .evac-coll-arrow {
    font-size: 0.9rem; color: var(--evac);
    transition: transform 0.2s;
  }
  .evac-collapsible.open .evac-coll-arrow { transform: rotate(90deg); }
  .evac-collapsible-body { display: none; }
  .evac-list-label {
    font-size: 0.6rem; font-weight: 800;
    color: var(--evac); text-transform: uppercase;
    letter-spacing: 0.5px; padding: 0.5rem 0.85rem 0.25rem;
  }

  /* -- 10. Sheet loc list - no forced min height -- */
  .sheet-loc-list {
    min-height: 0;
    padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.5rem));
  }

  /* -- 11. Fav list reuses sheet-loc-list styles -- */
  #sheetFavList {
    padding: 0 0.85rem max(1.5rem, calc(env(safe-area-inset-bottom) + 0.5rem));
  }
  #sheetExitsList {
    padding-bottom: max(1.5rem, calc(env(safe-area-inset-bottom) + 0.5rem));
  }

  /* -- 12. Ensure map container not obscured by bottom-sheet when card-open -- */
  /* -- 12b. card-open handled by line 1548 (translateY 100%) -- */

  /* -- 13. Remove old sheet tab bar (bottom nav only on mobile) -- */
  .sheet-tab-bar { display: none !important; }

  /* -- 14. Floating card - no route stats section (removed from HTML) -- */
  .mlc-route { display: none !important; }

}

/* =====================================================
   PARZELLARY-PATTERN DRAG FIX
   touch-action:none on every drag zone tells the browser
   those elements do NOT scroll - events fire cleanly.
   ===================================================== */

@media (max-width: 768px) {

  /* -- Handle pill -- */
  .sheet-handle-bar,
  .sheet-handle {
    touch-action: none;
    cursor: grab;
    user-select: none;
  }
  .sheet-handle-bar:active,
  .sheet-handle:active { cursor: grabbing; }

  /* -- Drag-top zone (search row + pills) -- */
  /* Same as Parzellary's .sbar-top - touch-action:none makes it a drag zone */
  .sheet-drag-top {
    touch-action: none;
    flex-shrink: 0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  /* Search row sits inside drag-top - input still tappable (pointer events fine) */
  .sheet-drag-top .sheet-search-row {
    position: static; /* drag-top handles sticky */
  }

  /* Pills rows inside drag-top */
  .sheet-drag-top .sheet-pills-row {
    position: static;
    touch-action: pan-x; /* allow horizontal scroll of pills */
  }

  /* Reset row inside drag-top */
  .sheet-drag-top .sheet-reset-row {
    position: static;
  }

  /* -- Scroll content - normal touch, no drag-top override -- */
  .sheet-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* Remove touch-action restriction so list scrolls freely */
    touch-action: auto;
  }

  /* -- Sheet itself - overscroll-behavior stops page from bouncing -- */
  .mobile-bottom-sheet {
    overscroll-behavior: none;
    /* Remove touch-action:none from sheet so content inside can scroll */
    touch-action: auto;
  }

  /* -- Sheet snaps - exact Parzellary naming and values -- */
  /* peek = no class (default transform in base CSS) */
  /* mid  = .mid */
  /* full = .expanded */
}

/* -- Mobile card save button -- */
@media (max-width: 768px) {
  .mlc-save-btn {
    width: 46px; height: 46px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.2rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
  }
  .mlc-save-btn:active { transform: scale(0.92); }
  .mlc-save-btn.mlc-save-active {
    background: rgba(247,194,27,0.12);
    border-color: rgba(247,194,27,0.5);
  }
}

/* -- Minimized card: hide actions, show nav strip -- */
@media (max-width: 768px) {

  .mlc-nav-strip {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem max(0.6rem, env(safe-area-inset-bottom));
    border-top: 1px solid #f1f5f9;
    gap: 0.5rem;
  }

  .mlc-nav-strip-left {
    display: flex; align-items: center; gap: 0.5rem;
  }

  .mlc-nav-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--red);
    animation: navPulse 1.4s ease-in-out infinite;
    flex-shrink: 0;
  }
  @keyframes navPulse {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.5; transform: scale(0.75); }
  }

  .mlc-nav-label {
    font-size: 0.78rem; font-weight: 700;
    color: var(--red); font-family: var(--font);
  }

  .mlc-nav-clear {
    background: #f1f5f9; border: none;
    border-radius: 8px; padding: 0.38rem 0.75rem;
    font-size: 0.72rem; font-weight: 700;
    font-family: var(--font); color: #64748b;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mlc-nav-clear:active { background: #e2e8f0; }

  /* Minimized state - hide body + normal actions, show nav strip */
  .mobile-loc-card.minimized .mlc-body    { display: none !important; }
  .mobile-loc-card.minimized #mlcActions  { display: none !important; }
  .mobile-loc-card.minimized .mlc-nav-strip { display: flex !important; }
  .mobile-loc-card.minimized .mlc-header {
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.65rem;
  }

  /* Remove the old ::before "Navigating to:" label - strip handles it */
  .mobile-loc-card.minimized .mlc-name::before { display: none !important; }
}

/* -- Evac panel info sections -- */
@media (max-width: 768px) {
  .evac-info-section { margin-bottom: 0.6rem; }
  .evac-info-section-title {
    font-size: 0.65rem; font-weight: 800;
    color: var(--evac); text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.4rem 0.75rem 0.2rem;
  }

  /* Evac filter pills - orange accent */
  #evacFilterBar .filter-pill.evac-pill { border-color: rgba(230,126,34,0.3); }
  #evacFilterBar .filter-pill.evac-pill.active {
    background: var(--evac);
    border-color: var(--evac);
    color: #fff;
  }
  .evac-reset-btn { color: var(--evac) !important; border-color: rgba(230,126,34,0.3) !important; background: rgba(230,126,34,0.07) !important; }

  /* Fav filter/floor pills inherit .sheet-pills-row styles */
}

/* -- Row heart button on each list item -- */
@media (max-width: 768px) {
  .row-heart {
    background: none;
    border: none;
    font-size: 1.1rem;
    padding: 0.35rem 0.2rem 0.35rem 0.6rem;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 40px; min-height: 40px;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s;
    border-radius: 50%;
  }
  .row-heart:active { transform: scale(0.82); }

  /* loc-fav spans (desktop sidebar) remain unchanged */
}
