:root{
      --bg:#0b1220; --panel:#111a2c; --ink:#f7f9ff; --muted:#b8c4e7; --line:#25345b; --accent:#7aa2ff;
      --sheetH:42vh; --appbarH:56px; --cat-dining:#1d4ed8; --cat-shopping:#60a5fa; --cat-else:#a78bfa;
      --searchBarH:72px;
    }
    @media (prefers-color-scheme: light){
      :root{ --bg:#f8f9fc; --panel:#ffffff; --ink:#0b1220; --muted:#4a5a84; --line:#dde3f7; --accent:#335dff; }
    }
    *{ box-sizing:border-box; }
    html,body{ margin:0; height:100%; background:var(--bg); color:var(--ink); font:16px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif; }
    a{ color:var(--accent); }
    body.no-scroll{ overflow:hidden; }


    /* Header (desktop only) */
    .appbar{ position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:12px;
      padding:10px 12px; border-bottom:1px solid var(--line);
      background:linear-gradient(180deg, rgba(11,18,32,.98), rgba(11,18,32,.92));
      backdrop-filter: blur(6px); padding-top: calc(10px + env(safe-area-inset-top));
    }
    .links{ display:none; }
    .links a{ color:#fff; text-decoration:none; font-weight:600; margin-left:18px; font-size:15px; }
    .links a:hover{ text-decoration:underline; }

    /* Spotlight button */
    .hamburger{
      position:relative;
      display:inline-flex; width:44px; height:44px; align-items:center; justify-content:center;
      border:1px solid #0e1a33; border-radius:10px; background:#1d2d50; color:#fff; font-size:20px; cursor:pointer;
      transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .2s ease;
    }
    .hamburger:active{ transform: translateY(1px) scale(.98); }
    .hamburger.spotlight{
      background: radial-gradient(120% 140% at 20% -10%, rgba(122,162,255,.55), rgba(29,45,80,1) 45%) #1d2d50;
      border-color:#2a3d6e;
      box-shadow: 0 6px 20px rgba(122,162,255,.25);
    }
    @media (min-width: 900px){
      .links{ display:flex; margin-left:auto; }
      .appbar .hamburger{ display:inline-flex; margin-left:12px; }
      .mobilemenu{ display:none; }
      .hamburger.spotlight::after{
        content:"Spotlight";
        position:absolute; left: calc(100% + 10px); top:50%; transform: translateY(-50%);
        background:rgba(122,162,255,.15); color:#e6edff; border:1px solid rgba(122,162,255,.35);
        font-weight:800; letter-spacing:.2px; font-size:12px; padding:4px 8px; border-radius:999px;
        white-space:nowrap; pointer-events:none;
      }
    }
    @media (max-width: 899px){ .appbar{ display:none; } }

    /* Viewport */
    .viewport{ height: 100svh; position:relative; }
    @supports not (height: 100svh){ .viewport{ height: calc(100dvh - var(--appbarH)); } }
    .map{ position:absolute; inset:0; z-index:0; }

    /* Clickable logo with expand animation */
    .map-logo{ position:absolute; top:76px; left:12px; z-index:25; opacity:.9; cursor:pointer; transition: transform .28s ease, opacity .2s ease; }
    .map-logo img{ height:110px; width:auto; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); transition: height .28s ease, width .28s ease; }
    @media (max-width: 480px){ .map-logo{ top:64px; left:10px; } .map-logo img{ height:80px; } }
    .map-logo.expanded{ position:fixed; top:50%; left:50%; transform: translate(-50%,-50%); z-index:1001; opacity:1; }
    .map-logo.expanded img{ height:auto; width:min(92vw, 92vh); filter: drop-shadow(0 6px 22px rgba(0,0,0,.55)); }
    #logoBackdrop{ position:fixed; inset:0; background:rgba(0,0,0,.6); opacity:0; visibility:hidden; transition: opacity .25s ease; z-index:1000; }
    #logoBackdrop.open{ opacity:1; visibility:visible; }

    /* Search */
    .searchbar{
      position:absolute; left:12px; right:12px; top:12px; z-index:30;
      display:flex; gap:6px; align-items:center;
      background:var(--panel); border:1px solid var(--line); border-radius:12px;
      padding:6px 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25);
    }
    @media (max-width: 900px){ .searchbar input { font-size: 16px; } }
    @supports (-webkit-touch-callout: none){ .searchbar input { font-size: 16px !important; } }
    .searchbar input{ flex:1 1 auto; background:transparent; border:0; color:inherit; min-height:44px; border-radius:8px; padding:0 10px; transition: box-shadow .2s ease; }
    .searchbar input:focus, .searchbar input:hover{ box-shadow: 0 0 0 3px rgba(122,162,255,0.5); outline:none; }

    /* NEW: Category legend (replaces dropdown) */
    .legend{
      display:flex; align-items:center; gap:14px; padding:6px 8px;
      border:1px solid var(--line); border-radius:999px; background:rgba(122,162,255,.06);
      font-size:13px; white-space:nowrap; flex:0 0 auto;
    }
    .legend-item{ display:inline-flex; align-items:center; gap:6px; }
    .legend-dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }

    .btn{ background:var(--panel); color:var(--ink); border:1px solid var(--line); padding:10px 14px; border-radius:12px; cursor:pointer; font-weight:600; min-height:44px; touch-action: manipulation; }
    .fab{ position:absolute; z-index:31; right:12px; bottom:calc(12px + var(--sheetH)); display:flex; gap:10px; flex-direction:column; }

    /* Results sheet */
    .sheet{
      position:absolute; left:0; right:0; bottom:0; z-index:32;
      height: var(--sheetH); max-height:80dvh; background:var(--panel);
      border-top:1px solid var(--line); border-top-left-radius:16px; border-top-right-radius:16px;
      box-shadow: 0 -6px 30px rgba(0,0,0,.35); display:flex; flex-direction:column; overflow:hidden;
      padding-bottom: env(safe-area-inset-bottom); will-change: height; user-select: none;
      transition: height .22s cubic-bezier(.2,.8,.2,1);
    }

/* Never allow horizontal overflow on narrow iPhones */
html, body { max-width: 100vw; overflow-x: hidden; }

/* Make all major containers respect viewport width */
.viewport, .map, .sheet, .searchbar, .sheet .list { max-width: 100vw; }

/* Let flex children shrink instead of forcing overflow */
.searchbar { overflow: hidden; }
.searchbar > * { min-width: 0; }          /* critical: lets the input/legend shrink */
.searchbar input { min-width: 0; }        /* extra safety on Safari */

/* Guard the list & items */
.sheet, .sheet .list, .sheet .item { max-width: 100%; overflow-x: hidden; }

/* Long text/URLs should wrap instead of stretching */
.sheet .item, .sheet .item a { word-break: break-word; overflow-wrap: anywhere; }

/* Compact the legend on small screens so it never forces overflow */
@media (max-width: 430px){
  .legend {
    gap: 10px;
    padding: 4px 8px;
    max-width: 48vw;              /* keeps it from dominating the row */
    overflow: hidden;
  }
  .legend-item { font-size: 0; }  /* hide the text labels, keep dots */
  .legend-item .legend-dot {
    width: 10px; height: 10px; display: inline-block;
  }
  .legend-item::after { content: ""; }    /* avoid trailing text spacing */
}

/* Also trim padding on very narrow devices to gain a few px */
@media (max-width: 390px){
  .searchbar { padding: 6px 8px; gap: 6px; }
  .clear-btn { width: 32px; height: 32px; }
}
    
/* Bigger, easier-to-hit grab area */
.grab{
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  /* Much larger touch target */
  padding: 12px 0;
  min-height: 56px;
  touch-action: none;
  cursor: grab;
}
.grab .handle{
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.25), inset 0 -1px 0 rgba(255,255,255,.06);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.grab:active{ cursor: grabbing; }

/* Make *header* also count as part of the grab area visually */
.sheet header{
  padding: 6px 12px 10px;          /* a bit more bottom padding for a bigger zone */
  position: relative;
}

/* Visual feedback when the sheet is being dragged */
.sheet.dragging .grab .handle{
  transform: scale(1.08);
  background: rgba(122,162,255,.55);
  box-shadow: 0 0 0 6px rgba(122,162,255,.15);
}

/* Optional subtle hover on larger screens */
@media (hover:hover){
  .grab:hover .handle{
    background: rgba(122,162,255,.45);
  }
}
    
    .sheet header{ padding:6px 12px 8px; display:flex; gap:8px; align-items:center; }
    .list{ overflow:auto; -webkit-overflow-scrolling: touch; }
    .item{ padding:12px; border-top:1px solid var(--line); cursor:pointer; }
    .item h3{ margin:0 0 6px; font-size:16px; }
    .item:focus{ outline:2px solid var(--accent); }
    .chip{ display:inline-block; border:1px solid var(--line); padding:3px 8px; border-radius:999px; font-size:13px; margin:2px 4px 0 0; color:#b8c4e7; }

    /* description style */
    .item .desc{
      color: var(--muted);
      margin-top: 6px;
      line-height: 1.35;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }
    
/* Prevent list from overflowing horizontally */
.sheet, .sheet .list, .sheet .item {
  max-width: 100%;
  overflow-x: hidden;
}

/* Force long URLs or text to wrap instead of stretching */
.sheet .item a,
.sheet .item {
  word-break: break-word;
  overflow-wrap: anywhere;
}

    @media (min-width: 900px){ :root{ --sheetH:32vh; } .searchbar{ left: calc(50% - 340px); right:auto; width:680px; } }

    .leaflet-container{ background:#0a0f1e; }
    .marker{ width:26px; height:26px; transform: translate(-13px,-26px); }

    .leaflet-top.leaflet-right{ margin-top: calc(var(--searchBarH, 72px) + 12px); margin-right: clamp(8px, 2vw, 12px); }
    @media (max-width: 480px){ .leaflet-top.leaflet-right{ margin-top: calc(var(--searchBarH, 60px) + 8px); } }
    .leaflet-control-zoom.at-bottom{ position:absolute; right:12px; bottom:12px; top:auto; }

    /* Spotlight menu */
    .menu{
      position:fixed; z-index:70; min-width:220px;
      background:#1d2d50; border:1px solid #0e1a2c; border-radius:12px;
      box-shadow:0 10px 30px rgba(0,0,0,.35); display:none; color:#fff;
    }
    .menu.open{ display:block; }
    .menu .menu-head{ padding:10px 12px; font-weight:800; border-bottom:1px solid rgba(14,26,51,.6); background:linear-gradient(180deg, rgba(122,162,255,.12), transparent); }
    .menu a{ display:block; padding:10px 12px; color:#fff; text-decoration:none; border-top:1px solid rgba(14,26,51,.6); font-weight:600; }
    .menu a:first-child{ border-top:0; }
    .menu a:hover{ background:rgba(255,255,255,.08); }

    /* Spotlight toast */
    .toast{
      position:fixed; left:12px; right:12px; bottom:calc(12px + var(--sheetH)); z-index:65;
      display:flex; align-items:center; gap:10px;
      padding:10px 12px; border-radius:12px; border:1px solid rgba(122,162,255,.4);
      background:rgba(17,26,44,.96); color:#eaf0ff; box-shadow:0 10px 30px rgba(0,0,0,.35);
      transform: translateY(16px); opacity:0; pointer-events:none;
      transition: transform .25s ease, opacity .25s ease;
    }
    .toast.show{ transform: translateY(0); opacity:1; pointer-events:auto; }
    .toast .cta{ background:#1d2d50; border:1px solid #2a3d6e; color:#eaf0ff; border-radius:10px; padding:8px 10px; font-weight:800; cursor:pointer; }
    .toast .close{ margin-left:auto; background:transparent; border:0; color:#bcd0ff; font-size:18px; cursor:pointer; }

    /* Popup share controls (icon-only lives in link row) */
    .popup-tools{ display:flex; align-items:center; gap:10px; margin-top:8px; }
    .share-btn{ background:#1d2d50; border:1px solid #2a3d6e; color:#eaf0ff; padding:6px 10px; border-radius:999px; font-weight:800; cursor:pointer; }
    .share-note{ color:#b8c4e7; font-size:12px; }

/* --- Split from WalkNewHope.html --- */

@media (max-width: 899px){
      :root{ --btnH: clamp(40px, calc(var(--searchBarH, 56px) - 12px), 56px); }
      .mobilemenu{
        display:block; position:absolute; z-index:120;
        left: max(12px, env(safe-area-inset-left) + 12px);
        top: calc(12px + (var(--searchBarH, 56px) - var(--btnH)) / 2);
      }
      .mobilemenu .hamburger{ width: var(--btnH); height: var(--btnH); border-radius: 12px; }
      .searchbar{
        left: calc(max(12px, env(safe-area-inset-left) + 12px) + var(--btnH) + 8px);
        right: max(12px, env(safe-area-inset-right) + 12px);
      }
    }
    @media (max-width: 380px){
      :root{ --btnH: clamp(38px, calc(var(--searchBarH, 56px) - 12px), 52px); }
      .mobilemenu{
        left: max(8px, env(safe-area-inset-left) + 8px);
        top: calc(8px + (var(--searchBarH, 56px) - var(--btnH)) / 2);
      }
      .searchbar{
        left: calc(max(8px, env(safe-area-inset-left) + 8px) + var(--btnH) + 8px);
        right: max(8px, env(safe-area-inset-right) + 8px);
      }
    }

/* --- Split from WalkNewHope.html --- */

.menu { max-width: min(92vw, 420px); }
    .menu .menu-head, .menu a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Split from WalkNewHope.html --- */

.inline-links{ margin-top:8px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .share-inline{
      display:inline-flex; align-items:center; justify-content:center;
      width:34px; height:34px; border-radius:999px;
      background:#1d2d50; border:1px solid #2a3d6e; color:#eaf0ff; cursor:pointer;
    }
    .share-inline:hover{ background:#213761; }
    .share-inline svg{ width:16px; height:16px; }

/* --- Split from WalkNewHope.html --- */

.sheet, .sheet .list{
      will-change: transform;
      transform: translateZ(0);
      backface-visibility: hidden;
      -webkit-transform: translateZ(0);
    }

/* --- Split from WalkNewHope.html --- */

.clear-btn{
      display:none; align-items:center; justify-content:center;
      width:34px; height:34px; border-radius:999px; flex:0 0 auto;
      background:#1d2d50; border:1px solid #2a3d6e; color:#eaf0ff; cursor:pointer;
    }
    .clear-btn:hover{ background:#213761; }
    .clear-btn svg{ width:14px; height:14px; }
    .searchbar.has-text .clear-btn{ display:inline-flex; }
    @media (max-width:380px){ .clear-btn{ width:32px; height:32px; } }

/* --- Split from WalkNewHope.html --- */

.leaflet-marker-icon img{ transition: transform .18s ease; }
    .leaflet-marker-icon.bump img{ transform: translateY(-2px) scale(1.08); }

/* --- Split from WalkNewHope.html --- */

@media (prefers-reduced-motion: reduce){
      *{ animation-duration:0.001ms !important; animation-iteration-count:1 !important; transition-duration:0.001ms !important; scroll-behavior:auto !important; }
    }

/* --- Split from WalkNewHope.html --- */

.item:hover{ background: rgba(122,162,255,.05); }
    .item:active{ background: rgba(122,162,255,.08); }

/* --- Split from WalkNewHope.html --- */

/* Floating Feedback button */
  .wnh-feedback-btn {
    position: fixed; right: 16px; bottom: 16px; z-index: 1000;
    padding: 10px 14px; border-radius: 999px; background: #0ea5e9; color: #fff;
    font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.2); border: none; cursor: pointer;
  }
  .wnh-feedback-btn:hover { filter: brightness(1.05); }

  /* Modal */
  .wnh-modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: none; align-items: center; justify-content: center; z-index: 2000;
  }
  .wnh-modal {
    width: min(92vw, 560px); background: #fff; border-radius: 14px; padding: 18px;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
  }
  .wnh-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
  .wnh-row > * { width: 100%; }
  .wnh-modal h3 { margin: 0 0 10px; font-size: 20px; }
  .wnh-input, .wnh-textarea {
    width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 10px 12px; font-size: 14px;
  }
  .wnh-textarea { min-height: 130px; resize: vertical; }
  .wnh-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
  .wnh-btn {
    padding: 10px 14px; border-radius: 10px; border: 1px solid #e5e7eb; cursor: pointer; background: #f9fafb;
  }
  .wnh-btn.primary { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }
  .wnh-note { font-size: 12px; color: #6b7280; margin-top: 6px; }
  /* hide honeypot field from humans */
  .wnh-hp { position:absolute; left:-9999px; top:auto; width:1px; height:1px; overflow:hidden; }
  .wnh-toast {
    position: fixed; right: 16px; bottom: 76px; background: #111827; color: #fff;
    padding: 10px 12px; border-radius: 10px; font-size: 14px; display: none; z-index: 3000;
  }
  
  /* Hide the legend dots + labels in the search bar */
.searchbar .legend {
  display: none !important;
}

/* ——— Events (active) ——— */
.event-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  font-size: 14px;
  line-height: 1;
}

/* Optional */
.event-line { color: var(--ink); }
.popup-event { border: 1px solid var(--line); border-radius: 10px; background: rgba(122,162,255,.08); padding: 8px 10px; }
.popup-event strong { display:block; }