:root{
  --ink:#123040; --line:#d9d2c2;
  --beach:#2f8fd0; --nature:#2e8b57; --kids:#7b53c6; --food:#e07b39; --bike:#12a3a3;
  --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);overscroll-behavior:none}
#app{display:flex;flex-direction:column;height:100vh;height:100dvh}
header{background:linear-gradient(180deg,#eaf3fb,#f4efe4);border-bottom:1px solid var(--line);padding:calc(10px + var(--safe-t)) 16px 10px;display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;flex:0 0 auto;z-index:5}
header h1{margin:0;font-size:1.05rem;font-weight:600}
header .sub{color:#5a6b76;font-size:.8rem}
header .dates{margin-left:auto;background:#123040;color:#fff;border-radius:999px;padding:4px 11px;font-size:.78rem;font-weight:600;white-space:nowrap}
#wrap{flex:1;position:relative;min-height:0}
#map{position:absolute;inset:0}
.leaflet-control-attribution{font-size:9px}

.panel{position:absolute;top:12px;right:12px;width:318px;max-height:calc(100% - 24px);display:flex;flex-direction:column;background:rgba(255,255,255,.98);border:1px solid var(--line);border-radius:16px;box-shadow:0 6px 24px rgba(20,48,64,.18);z-index:1000;overflow:hidden}
.grip{display:none}
.phead{padding:12px 15px 4px;flex:0 0 auto}
.phead h2{margin:0;font-size:.95rem;font-weight:600}
.phead .house{font-size:.78rem;color:#5a6b76;margin-top:2px}
.modebar{padding:8px 15px 10px;flex:0 0 auto}
.modebar .lbl{font-size:.68rem;text-transform:uppercase;letter-spacing:.05em;color:#7a8993;margin-bottom:6px}
.segs{display:flex;gap:6px}
.seg{flex:1;border:1px solid var(--line);background:#fff;border-radius:9px;padding:8px 4px;font-size:.74rem;font-weight:600;color:#41525c;cursor:pointer;text-align:center;transition:.12s;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:46px;justify-content:center}
.seg .g{font-size:1rem;line-height:1}
.seg.active{background:#123040;color:#fff;border-color:#123040}
.hint{padding:2px 15px 8px;font-size:.72rem;color:#8a97a0;flex:0 0 auto}
.scroll{flex:1 1 auto;overflow-y:auto;-webkit-overflow-scrolling:touch}
.item{display:flex;gap:11px;align-items:flex-start;padding:11px 15px;border-top:1px solid #efe9db;cursor:pointer;border-left:3px solid transparent;min-height:52px}
.item:active{background:#f3f8fd}
.item.active{background:#eef6fd;border-left-color:#123040}
.dot{width:12px;height:12px;border-radius:50%;margin-top:3px;flex:0 0 auto}
.item .nm{font-size:.88rem;font-weight:600;line-height:1.25}
.item .must{display:inline-block;background:#ffe8cf;color:#b4571b;font-size:.62rem;font-weight:700;border-radius:4px;padding:1px 5px;margin-left:6px;vertical-align:middle}
.item .meta{font-size:.76rem;color:#6b7b85;margin-top:3px;display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.stay{font-size:.66rem;font-weight:700;border-radius:4px;padding:1px 6px}
.stay.long{background:#e5f0e8;color:#2c6a42}
.stay.quick{background:#eef0f2;color:#5a6b76}
.keyline{display:flex;gap:14px;padding:8px 15px;border-top:1px solid #efe9db;flex-wrap:wrap;flex:0 0 auto}
.keyline span{display:flex;align-items:center;gap:5px;font-size:.72rem;color:#5a6b76}
.safety{padding:10px 15px calc(10px + var(--safe-b));font-size:.75rem;color:#8a5a1a;background:#fff8ef;border-top:1px solid #efe9db;flex:0 0 auto}
.leaflet-popup-content{margin:12px 14px;font-size:.84rem;line-height:1.42}
.leaflet-popup-content .pt{font-weight:700;font-size:.92rem;margin-bottom:3px}
.leaflet-popup-content .pm{color:#2f6fb0;font-weight:600;font-size:.79rem;margin:2px 0 5px}
.leaflet-popup-content .pn{color:#41525c}
.leaflet-popup-content .sup{margin-top:6px;font-size:.77rem;color:#6a5a2a;background:#fbf6ea;border-radius:6px;padding:6px 8px}

@media(max-width:680px){
  header .sub{display:none}
  .panel{top:auto;right:0;left:0;bottom:0;width:100%;max-height:none;height:calc(158px + var(--safe-b));border-radius:18px 18px 0 0;border-bottom:none;transition:height .28s ease}
  .panel.open{height:76dvh}
  .grip{display:flex;align-items:center;justify-content:center;gap:8px;padding:9px 0 5px;flex:0 0 auto;cursor:pointer;color:#5a6b76;font-size:.76rem;font-weight:600;position:relative}
  .grip .bar{position:absolute;top:7px;left:50%;transform:translateX(-50%);width:40px;height:5px;border-radius:3px;background:#cfd6da}
  .phead .house{display:none}
  .keyline{display:none}
  .panel:not(.open) .safety{display:none}
  .seg{min-height:50px;font-size:.78rem}
}
