
*{box-sizing:border-box}
html,body{margin:0;height:100%;font-family:system-ui,-apple-system,"Hiragino Kaku Gothic ProN",sans-serif}
#mapwrap{position:fixed;inset:0}
#map{width:100%;height:100%}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:4px}
/* ---- desktop components (hidden on small screens) ---- */
#side,#timeline{display:none}
/* ---- mobile components ---- */
#topbar{position:fixed;top:0;left:0;right:0;z-index:1000;background:rgba(255,255,255,.94);padding:calc(6px + env(safe-area-inset-top)) 12px 6px;border-bottom:1px solid #ddd}
#topbar .t{font-size:13px;font-weight:700}
#topbar .c{font-size:12px;color:#444;margin-left:8px}
#tlbtn{float:right;font-size:13px;padding:7px 12px;border:1px solid #bbb;border-radius:8px;background:#fff;cursor:pointer}
#chips{position:fixed;left:0;right:0;bottom:calc(86px + env(safe-area-inset-bottom));z-index:1000;display:flex;gap:6px;overflow-x:auto;padding:6px 10px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
#chips::-webkit-scrollbar{display:none}
.chip{flex:0 0 auto;font-size:13px;padding:7px 12px;border-radius:999px;border:1.5px solid #999;background:rgba(255,255,255,.92);cursor:pointer}
.chip.on{color:#fff;border-color:transparent}
#controls{position:fixed;left:0;right:0;bottom:0;z-index:1000;background:rgba(255,255,255,.96);border-top:1px solid #ddd;padding:8px 12px calc(8px + env(safe-area-inset-bottom));display:flex;align-items:center;gap:8px}
#yearM{font-size:24px;font-weight:700;min-width:70px}
#yearM small{font-size:13px;font-weight:400}
#playM{font-size:19px;width:50px;height:50px;border-radius:50%;border:1px solid #bbb;background:#fff;cursor:pointer;flex:0 0 auto}
.navbtn{font-size:12px;width:42px;height:50px;border-radius:10px;border:1px solid #bbb;background:#fff;cursor:pointer;flex:0 0 auto}
#sliderM{flex:1;height:36px;min-width:60px}
#listbtn{font-size:14px;padding:12px 10px;border-radius:10px;border:1px solid #bbb;background:#fff;cursor:pointer;flex:0 0 auto}
#sheet{position:fixed;left:0;right:0;bottom:0;z-index:1100;background:#fff;border-radius:16px 16px 0 0;box-shadow:0 -4px 24px rgba(0,0,0,.25);max-height:62vh;overflow-y:auto;padding:6px 16px calc(14px + env(safe-area-inset-bottom));transform:translateY(105%);transition:transform .25s ease;-webkit-overflow-scrolling:touch}
#sheet.open{transform:translateY(0)}
#sheet .grab{width:44px;height:5px;border-radius:3px;background:#ccc;margin:4px auto 8px}
#sheet h2{font-size:16px;margin:2px 0 4px}
#sheet .meta{font-size:12px;color:#555;margin:0 0 8px}
#sheet table{border-collapse:collapse;width:100%;font-size:12.5px}
#sheet td,#sheet th{border:1px solid #e5e5e5;padding:4px 6px;text-align:left;vertical-align:top}
#sheet ul{font-size:12.5px;padding-left:18px}
#sheetclose{float:right;font-size:15px;padding:8px 12px;border:1px solid #bbb;border-radius:8px;background:#fff;cursor:pointer}
#listsheet,#tlsheet{position:fixed;inset:0;z-index:1200;background:#fff;overflow:auto;padding:calc(10px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));display:none;-webkit-overflow-scrolling:touch}
#listsheet.open,#tlsheet.open{display:block}
#listsheet h2,#tlsheet h2{font-size:16px;margin:4px 0 10px}
#listsheet div.row{padding:11px 2px;border-bottom:1px solid #eee;font-size:14px;cursor:pointer}
.sheetbtn{float:right;font-size:15px;padding:8px 12px;border:1px solid #bbb;border-radius:8px;background:#fff;cursor:pointer}
.note{font-size:11.5px;color:#666;margin-top:10px}
@media (max-width: 400px){
  #controls{gap:5px;padding-left:8px;padding-right:8px}
  #yearM{min-width:56px;font-size:20px}
  .navbtn{width:36px;height:46px}
  #playM{width:44px;height:46px}
  #sliderM{min-width:36px}
  #listbtn{padding:12px 8px}
}
.leaflet-bar a{width:34px!important;height:34px!important;line-height:34px!important}
.leaflet-top{top:52px}
/* ---- desktop layout ---- */
@media (min-width: 861px) and (min-height: 521px){
  #topbar,#chips,#controls,#sheet,#listsheet,#tlsheet{display:none!important}
  .leaflet-top{top:0}
  #side{display:block;position:fixed;left:0;top:0;bottom:0;width:360px;overflow-y:auto;padding:14px 16px;border-right:1px solid #ddd;background:#fafafa;z-index:1000}
  #side h1{font-size:17px;margin:0 0 4px}
  #side .sub{font-size:12px;color:#555;margin:0 0 12px}
  #yearD{font-size:32px;font-weight:700}
  #playD{font-size:15px;padding:6px 14px;cursor:pointer}
  #prevD,#nextD{font-size:13px;padding:6px 10px;cursor:pointer}
  #sliderD{width:100%}
  #countsD{font-size:14px;margin:8px 0}
  #filtersD label{display:inline-block;margin:2px 8px 2px 0;font-size:13px}
  #listD{margin-top:10px;font-size:13px}
  #listD div{padding:3px 0;border-bottom:1px solid #eee;cursor:pointer}
  #listD div:hover{background:#eef}
  #detailD{margin-top:12px;font-size:13px;background:#fff;border:1px solid #ddd;padding:10px}
  #detailD h2{font-size:15px;margin:0 0 6px}
  #detailD table{border-collapse:collapse;width:100%}
  #detailD td,#detailD th{border:1px solid #e5e5e5;padding:3px 5px;text-align:left;vertical-align:top}
  #detailD .meta{font-size:12px;color:#555;margin:0 0 8px}
  #mapwrap{left:360px;bottom:212px}
  #timeline{display:block;position:fixed;left:360px;right:0;bottom:0;height:212px;border-top:1px solid #ccc;background:#fff;overflow-y:auto;padding:6px 10px;z-index:900}
}


#popbar{position:fixed;left:10px;bottom:calc(140px + env(safe-area-inset-bottom));z-index:1000;background:rgba(255,255,255,.95);border:1px solid #ddd;border-radius:10px;padding:7px 10px;font-size:12px;max-width:min(94vw,460px);box-shadow:0 2px 8px rgba(0,0,0,.12)}
#popbar .lg{display:inline-block;margin:2px 5px 0 0;white-space:nowrap}
#popbar .lg i{display:inline-block;width:11px;height:11px;margin-right:2px;border:1px solid #bbb;vertical-align:-1px}
#popnote{color:#92400e;font-size:11.5px;margin-top:3px}
.v2btn{font-size:13px;padding:8px 12px;border:1px solid #bbb;border-radius:8px;background:#fff;cursor:pointer}
.modal{position:fixed;inset:0;z-index:2000;background:rgba(0,0,0,.45);display:none;overflow:auto;-webkit-overflow-scrolling:touch}
.modal.open{display:block}
.modal .box{background:#fff;max-width:760px;margin:20px auto;padding:18px 20px 26px;border-radius:12px}
.modal h2{font-size:18px;margin:2px 0 8px}
.modal h3{font-size:15px;margin:18px 0 6px}
.modal p,.modal li{font-size:13.5px;line-height:1.75}
.modal .mclose{float:right;font-size:14px;padding:8px 12px;border:1px solid #bbb;border-radius:8px;background:#fff;cursor:pointer}
@media (min-width: 861px) and (min-height: 521px){
  #popbar{left:372px;bottom:224px}
}
#tourlabel{position:fixed;top:54px;left:50%;transform:translateX(-50%);z-index:1100;background:rgba(30,41,59,.85);color:#fff;font-size:12.5px;padding:6px 14px;border-radius:999px;white-space:nowrap;pointer-events:none;box-shadow:0 2px 8px rgba(0,0,0,.2)}
@media (min-width: 861px) and (min-height: 521px){
  #tourlabel{top:12px;left:calc(50% + 186px)}
}
