/* 모바일 시트 · 카드 · 접힘 버튼 */
@media (max-width:767px),(max-height:500px){
 #panel{left:0;right:0;bottom:0;top:auto;width:auto;border-radius:16px 16px 0 0;box-shadow:none;height:calc(100vh - 56px);height:calc(100dvh - 56px);transform:translateY(calc(100% - 42vh));transform:translateY(calc(100% - 42dvh));transition:transform .3s cubic-bezier(.2,.8,.2,1),visibility 0s;will-change:transform}
 body.sheet-full #panel{transform:translateY(0)}
 body.sheet-fold #panel{transform:translateY(calc(100% + 12px));visibility:hidden;transition:transform .3s cubic-bezier(.2,.8,.2,1),visibility 0s .3s}
 body #panel.dragging{transition:none;visibility:visible}
 .handle{display:flex;justify-content:center;padding:8px 0;touch-action:none;cursor:grab}
 .handle i{width:36px;height:4px;border-radius:2px;background:var(--line2)}
 .p-head{padding:0 16px 12px}.brand .inven{height:20px}.brand .vi{height:18px;width:24px}.brand .bt{font-size:16px}
 #collapseBtn{display:none}
 .search{padding-bottom:8px}
 .chips{display:flex;gap:6px;overflow-x:auto;padding:0 16px 12px;scrollbar-width:none;flex:none}
 .chip{flex:none;display:flex;align-items:center;gap:4px;height:32px;padding:0 12px 0 10px;border-radius:16px;border:1px solid var(--line);color:var(--t3);font-size:13px;font-weight:600}
 .chip svg.f{width:16px;height:16px}
 .chip.on{background:var(--sel);border-color:var(--line2);color:var(--t1)}
 .rail{display:none}
 .p-body{padding:0 0 0 16px}
 .grp{display:none}.grp.active{display:block}
 .h-acts{display:flex;margin-right:-6px}
 body.sheet-half .list{overflow:hidden}
 .search{position:static}
 .sres{left:0;right:0;bottom:0;max-height:none;border:0;border-top:1px solid var(--div);border-radius:0;box-shadow:none;padding:4px 0 24px}
 #openBtn{left:50%;top:auto;bottom:24px;transform:translate(-50%,8px);display:flex;opacity:0;pointer-events:none;transition:opacity .15s,transform .15s}
 body.sheet-fold #openBtn{opacity:1;pointer-events:auto;transform:translate(-50%,0);transition:opacity .2s .2s,transform .2s .2s}
 body.sheet-full #ctrl{display:none}
 .hidefound span.l,.hidefound .sw{display:none}.hidefound{padding:0;width:42px;justify-content:center}
 .zoomgrp{display:none}
 .attr{right:auto;bottom:auto;left:8px;top:8px;border:1px solid var(--line);border-radius:6px;max-width:calc(100% - 76px)}
 .leaflet-popup-pane{display:none}
 #cardSheet{position:fixed;left:0;right:0;bottom:0;z-index:1500;background:var(--bg);border-radius:16px 16px 0 0;max-height:80vh;flex-direction:column}
 #cardSheet.on{display:flex}
 #cardSheetBody{overflow-y:auto;min-height:0}
 #locBtn{position:absolute;right:12px;top:-54px}#locBtn svg{width:22px;height:22px}
 #cardSheet .c-head,#cardSheet .c-found{margin-left:16px;margin-right:16px}#cardSheet .c-head{padding:12px 0 0}#cardSheet .c-found{width:calc(100% - 32px);height:44px}
 #cardSheet .c-guide{margin:10px 16px 0;width:calc(100% - 32px);height:44px}
 #cardSheet .c-title{gap:4px}#cardSheet .c-title .c-name{padding-top:8px}
 #cardSheet .hb{display:flex;flex:none;margin-right:-8px}
 #cardSheet .ib{width:40px;height:40px;display:grid;place-items:center;color:var(--t1);border-radius:20px}#cardSheet .ib svg{width:22px;height:22px}
 #cardSheet .ib[aria-pressed=true]{color:var(--t1)}#cardSheet .ib[aria-pressed=true] svg{fill:currentColor}
 #cardSheet .c-foot.m{display:flex;align-items:center;gap:8px;margin-top:12px;padding:0 16px 20px;background:none}
 #cardSheet .c-foot.m .pos{flex:1;padding:0;font-size:14px;font-weight:600;color:var(--t3)}#cardSheet .c-foot.m .pos b{color:var(--t1);font-weight:700}
 #cardSheet .c-foot.m .rb{width:40px;height:40px;display:grid;place-items:center;border-radius:20px;background:var(--sel);color:var(--t1)}#cardSheet .c-foot.m .rb svg{width:20px;height:20px}
 body.card-open #panel,body.card-open #openBtn{display:none}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}  #modeBtn .m-sun{display:none} html:not(.light) #modeBtn .m-sun{display:block} html:not(.light) #modeBtn .m-moon{display:none}
@property --ga{syntax:'<angle>';inherits:false;initial-value:0deg}
@keyframes gaspin{to{--ga:360deg}}
#openBtn.lb{gap:10px;padding:0 12px 0 16px;border:0;border-radius:12px;background:var(--float)}
#openBtn.lb::before{content:"";position:absolute;inset:0;border-radius:inherit;padding:2px;pointer-events:none;background:conic-gradient(from var(--ga),#FFAA01,#FD1090,#B80284,#5B37ED,#325FCF,#FFAA01);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box exclude,linear-gradient(#000 0 0);animation:gaspin 3.2s linear infinite}
#openBtn.lb .inven{height:20px;width:auto;flex:none}
#openBtn.lb .vdiv{width:1px;height:14px;background:var(--line2);flex:none}
#openBtn.lb .vi{height:18px;width:24px;flex:none}
#openBtn.lb .chev{width:16px;height:16px;color:var(--t3);margin-left:2px}
#openBtn.lb:hover .chev{color:var(--t1)}
@media (max-width:767px),(max-height:500px){#openBtn.lb .chev{transform:rotate(-90deg)}}
@media (prefers-reduced-motion:reduce){#openBtn.lb::before{animation:none}body.collapsed #openBtn.lb::before,body.sheet-fold #openBtn.lb::before{animation:gaspin 3.2s linear 1}}
.allrow{display:flex;align-items:center;gap:6px;padding:8px 4px 8px 8px;position:sticky;top:0;z-index:3;background:var(--bg);border-bottom:1px solid var(--div)}
.allrow h2{margin:0;flex:none;font-size:15px;line-height:20px;font-weight:700;color:var(--t1)}
.allrow button{display:flex;align-items:center;gap:6px;height:30px;padding:0 10px;border:1px solid var(--line2);border-radius:6px;font-size:12px;font-weight:700;color:var(--t1);background:var(--bg)}
.allrow button svg{width:16px;height:16px}
.allrow button:hover:not(:disabled){background:var(--sel)}
.allrow button:disabled{color:var(--t3);border-color:var(--line);cursor:default}
.allrow~.grp .ghead{top:43px}
.allck{display:flex;align-items:center;gap:8px;height:30px;padding:0 8px 0 0;font-size:13px;font-weight:700;color:var(--t1);border-radius:6px}
.allrow .cnt{font-size:12px;color:var(--t3)}
.allrow .cnt b{color:var(--t1)}
.ck{width:16px;height:16px;border:1.5px solid var(--t1);border-radius:3px;position:relative;flex:none;box-sizing:border-box}
.ck.on{background:var(--t1)}
.ck.on::after{content:"";position:absolute;left:4px;top:1px;width:4px;height:8px;border:solid var(--bg);border-width:0 2px 2px 0;transform:rotate(45deg)}
.chip.allchip{gap:6px}
.chip.allchip .ck{width:14px;height:14px}
.chip.allchip .ck.on::after{left:3.5px;top:.5px;width:3.5px;height:7px}
.alloff{margin:8px 8px 12px;padding:16px;border-radius:8px;background:var(--raised);display:flex;flex-direction:column;align-items:center;gap:10px;font-size:13px;line-height:18px;color:var(--t2);text-align:center}
.alloff button{height:28px;padding:0 10px;border:1px solid var(--line2);border-radius:6px;font-size:12px;font-weight:700;color:var(--t1);background:var(--bg)}
@media (max-width:767px),(max-height:500px){#cardSheet{max-height:calc(100dvh - 48px)}}
@media (min-width:768px) and (min-height:501px){.allrow{padding:6px 4px 6px 8px}}
.pattr{flex:none;padding:8px 16px 10px;font-size:11px;line-height:14px;color:var(--t3);border-top:1px solid var(--div)}
.pattr a,.pattr button{color:inherit;text-decoration:underline;font:inherit;padding:0;background:none}
.pattr a:hover,.pattr button:hover{color:var(--t1)}
.attr.pill{background:color-mix(in srgb,var(--float) 55%,transparent);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);border:1px solid var(--line);border-radius:6px;padding:3px 8px;color:var(--t2);text-shadow:none;box-shadow:none}
.lattr{display:none}
@media (min-width:768px) and (min-height:501px){#attr{display:none;right:8px;bottom:8px}body.collapsed #attr{display:block}}
@media (max-width:767px),(max-height:500px){
 #panel .pattr{display:none}
 .lattr{display:block;padding:14px 16px 20px;font-size:11px;line-height:14px;color:var(--t3);border-top:1px solid var(--div);margin-top:8px}
 .lattr a,.lattr button{color:inherit;text-decoration:underline;font:inherit;padding:0;background:none}
 #attr{display:none}body.sheet-fold:not(.card-open) #attr{display:block;left:8px;right:auto;top:auto;bottom:8px;font-size:11px;line-height:14px}
 body.sheet-fold #openBtn{bottom:38px}
}
.allrow .sp{flex:1}
.allrow .aeye,.allrow .afold{width:26px;height:26px;padding:0;border:0;display:grid;place-items:center;color:var(--t2);background:none;border-radius:4px;position:relative}
.allrow .aeye[aria-pressed=false]{color:var(--t3)}
.allrow .aeye svg{width:18px;height:18px}
.allrow .afold.shut svg{transform:rotate(180deg)}
@media (hover:hover){.allrow .aeye:hover,.allrow .afold:hover{background:var(--sel);color:var(--t1)}
 .allrow .aeye:hover::after,.allrow .afold:hover::after{content:attr(data-tip);position:absolute;right:0;top:calc(100% + 6px);white-space:nowrap;background:var(--raised);border:1px solid var(--line);padding:5px 8px;border-radius:4px;font-size:12px;font-weight:600;line-height:16px;color:var(--t1);z-index:10;pointer-events:none}}
.allrow.vb h2{flex:1;font-size:17px;line-height:24px}
.allrow.va,.allrow.vb{gap:6px;padding:8px 0 8px 8px}
@media (max-width:767px),(max-height:500px){.allrow .afold{display:none}.allrow.va,.allrow.vb{padding:8px 4px 8px 8px}}
.allrow+.grp,.alloff+.grp{margin-top:12px}
@media (max-width:767px),(max-height:500px){.allrow~.grp.active{margin-top:12px}}
#g-guide .ghead,#g-mine .ghead{min-height:38px}
/* 화면 아래 · 위 안전 영역(아이폰 홈 막대, 이를 알려 주는 앱 하단 바)만큼 띄움 — index.html의 viewport-fit=cover와 한 쌍 */
#ctrl{top:calc(12px + env(safe-area-inset-top,0px));right:calc(12px + env(safe-area-inset-right,0px))}
@media (max-width:767px),(max-height:500px){
 #panel,#cardSheet{padding-bottom:env(safe-area-inset-bottom,0px)}
 #openBtn{bottom:calc(24px + env(safe-area-inset-bottom,0px))}
 body.sheet-fold #openBtn{bottom:calc(38px + env(safe-area-inset-bottom,0px))}
 body.sheet-fold:not(.card-open) #attr{bottom:calc(8px + env(safe-area-inset-bottom,0px));left:calc(8px + env(safe-area-inset-left,0px))}
 #toast{bottom:calc(28px + env(safe-area-inset-bottom,0px))}
}
/* 가로 화면 좌우 안전 영역(아이폰 노치 쪽): 지도는 끝까지, 패널 · 카드 · 출처 줄은 안쪽으로 */
#panel{margin-left:env(safe-area-inset-left,0px)}
#openBtn{margin-left:env(safe-area-inset-left,0px)}
@media (max-width:767px),(max-height:500px){
 #panel,#openBtn{margin-left:0}
 #panel,#cardSheet{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
 #locBtn{right:calc(12px + env(safe-area-inset-right,0px))}
}
/* 모바일 가로 화면: 화면 높이가 낮아 오른쪽 위 버튼 세로줄이 패널 · 카드와 겹침 → 가로 한 줄로 */
@media (max-width:767px) and (orientation:landscape),(max-height:500px) and (orientation:landscape){
 #ctrl{flex-direction:row;align-items:flex-start}
 .langm{top:calc(100% + 8px);right:0}
}
/* 휴대폰 가로 화면: 높이가 낮아 위쪽 고정 영역(로고 · 검색 · 묶음 탭 · 고정 머리줄)이 목록을 다 가림
   → 로고 줄과 검색창을 한 줄로, 목록 머리줄은 고정하지 않고 같이 스크롤, 전체 단계는 화면 위까지 */
@media (max-width:767px) and (orientation:landscape),(max-height:500px) and (orientation:landscape){
 #panel{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto auto minmax(0,1fr) auto;height:calc(100vh - 8px);height:calc(100dvh - 8px)}
 #panel>.handle,#panel>.chips,#panel>.p-body,#panel>.pattr{grid-column:1/-1}
 #panel>.p-head{grid-column:1;padding-bottom:8px}
 #panel>.search{grid-column:2;padding-left:0}
 .ghead,.allrow{position:static}
}
/* 터치 기기: 작은 버튼 · 링크의 누르는 영역을 지도 버튼(40~42)에 맞춤 — 보이는 크기는 그대로, ::before로 영역만 넓힘 */
@media (pointer:coarse){
 .aeye,.allrow .afold,.ghead button,.hbtn,.chip,.blink,.brand .bt,.rbtn{position:relative}
 .aeye::before,.allrow .afold::before,.ghead button::before{content:"";position:absolute;inset:-7px}
 .allrow,.ghead{gap:14px}
 .hbtn::before{content:"";position:absolute;inset:-2px}
 .chips{padding-top:5px;margin-top:-5px}.chips .chip::before{content:"";position:absolute;inset:-5px 0}
 .c-stack{row-gap:14px}.c-stack .chip::before{content:"";position:absolute;inset:-7px 0}
 .blink::before,.brand .bt::before{content:"";position:absolute;inset:-8px -4px}
 .rbtn::before{content:"";position:absolute;inset:-3px 0}
}
