/* ==========================================================================
   부산 맛집 지도 — app.css
   팔레트/타이포/카드 계열은 원본 부산_맛집_2박3일.html 에서 그대로 승계.
   ========================================================================== */

:root{
  --bg:#EEF2F1;
  --surface:#FFFFFF;
  --surface-2:#F6F9F8;
  --line:#D7E1DF;
  --line-soft:#E6EDEC;
  --text:#0F1A1E;
  --muted:#48605D;
  --faint:#6B807E;
  --teal:#0E6E6E;
  --teal-soft:#DCEBEA;
  --amber:#A96C06;
  --amber-soft:#F6EBD4;
  --tier-hi:#0E6E6E;
  --tier-hi-bg:#D8ECEA;
  --tier-mid:#3E7A5E;
  --tier-mid-bg:#E1EFE6;
  --tier-lo:#6A7A78;
  --tier-lo-bg:#E8EEED;
  --warn:#9A4B12;
  --warn-bg:#F7E7DA;
  --shadow:0 1px 2px rgba(15,26,30,.05),0 8px 24px -16px rgba(15,26,30,.28);

  --appbar-h:58px;
  --tabbar-h:56px;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#0B1315;
    --surface:#131F21;
    --surface-2:#18262A;
    --line:#24393B;
    --line-soft:#1D2F32;
    --text:#E7F0EE;
    --muted:#B2C7C4;
    --faint:#8CA3A0;
    --teal:#5FC9C4;
    --teal-soft:#123634;
    --amber:#E4B255;
    --amber-soft:#2F2716;
    --tier-hi:#5FC9C4;
    --tier-hi-bg:#123634;
    --tier-mid:#88C9A3;
    --tier-mid-bg:#16302A;
    --tier-lo:#93A9A6;
    --tier-lo-bg:#1C2C2E;
    --warn:#E9A06A;
    --warn-bg:#33231A;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 28px -18px rgba(0,0,0,.8);
  }
}
:root[data-theme="dark"]{
  --bg:#0B1315;
  --surface:#131F21;
  --surface-2:#18262A;
  --line:#24393B;
  --line-soft:#1D2F32;
  --text:#E7F0EE;
  --muted:#B2C7C4;
  --faint:#8CA3A0;
  --teal:#5FC9C4;
  --teal-soft:#123634;
  --amber:#E4B255;
  --amber-soft:#2F2716;
  --tier-hi:#5FC9C4;
  --tier-hi-bg:#123634;
  --tier-mid:#88C9A3;
  --tier-mid-bg:#16302A;
  --tier-lo:#93A9A6;
  --tier-lo-bg:#1C2C2E;
  --warn:#E9A06A;
  --warn-bg:#33231A;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 10px 28px -18px rgba(0,0,0,.8);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:"Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  font-size:16px;
  line-height:1.65;
  -webkit-text-size-adjust:100%;
  display:flex;
  flex-direction:column;
  height:100vh;
  height:100dvh;
  overflow:hidden;
}

.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
.skip{
  position:absolute;left:-9999px;top:0;z-index:2000;
  background:var(--teal);color:#fff;padding:10px 16px;border-radius:0 0 8px 0;
}
.skip:focus{left:0}

/* ---------- 앱바 ---------- */
.appbar{
  flex:none;display:flex;align-items:center;gap:14px;
  height:var(--appbar-h);padding:0 14px;
  background:var(--surface);border-bottom:1px solid var(--line);
  padding-top:env(safe-area-inset-top);
  height:calc(var(--appbar-h) + env(safe-area-inset-top));
}
.brand{display:flex;align-items:center;gap:9px;text-decoration:none;color:inherit;flex:none}
.brand-mark{
  width:26px;height:26px;border-radius:8px;flex:none;
  background:var(--teal);
  position:relative;
}
.brand-mark::after{
  content:"";position:absolute;left:50%;top:50%;
  width:8px;height:8px;margin:-6px 0 0 -4px;border-radius:50% 50% 50% 0;
  transform:rotate(-45deg);background:var(--surface);
}
.brand-txt{display:flex;flex-direction:column;line-height:1.15}
.brand-txt h1{
  margin:0;font-family:"Gothic A1","Noto Sans KR",sans-serif;
  font-size:16px;font-weight:700;letter-spacing:-.01em;line-height:1.15;
}
.brand-txt i{font-style:normal;font-family:"IBM Plex Mono",monospace;font-size:10.5px;color:var(--faint);letter-spacing:.02em}

.segs{display:none;gap:4px;margin:0 auto;background:var(--surface-2);border:1px solid var(--line-soft);border-radius:999px;padding:3px}
.seg{
  font:inherit;font-size:14px;font-weight:500;cursor:pointer;
  border:0;background:transparent;color:var(--muted);
  border-radius:999px;padding:5px 16px;
  transition:background .12s,color .12s;
}
.seg:hover{color:var(--text)}
.seg[aria-pressed="true"]{background:var(--teal);color:var(--surface);font-weight:600}
.seg:focus-visible{outline:2px solid var(--teal);outline-offset:2px}

.actions{display:flex;gap:7px;margin-left:auto;flex:none}
.iconbtn{
  font:inherit;font-size:14px;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:44px;min-width:44px;              /* 터치 타겟 */
  background:var(--surface);color:var(--muted);
  border:1px solid var(--line);border-radius:999px;padding:6px 12px;
  transition:border-color .12s,color .12s,background .12s;
}
.iconbtn[disabled]{opacity:.45;cursor:not-allowed}
.iconbtn[disabled]:hover{border-color:var(--line);color:var(--muted)}
.iconbtn:hover{border-color:var(--teal);color:var(--text)}
.iconbtn:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.iconbtn[aria-pressed="true"]{background:var(--teal-soft);border-color:var(--teal);color:var(--teal)}
.iconbtn.busy{opacity:.6;pointer-events:none}
.iconbtn .lbl{display:none}

/* ---------- 필터 바 ---------- */
.filterbar{
  flex:none;background:var(--bg);
  padding:10px 14px 10px;border-bottom:1px solid var(--line-soft);
  max-height:40vh;overflow:auto;
}
.filterbar[hidden]{display:none}
.frow{display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.frow + .frow{margin-top:8px}
.flabel{
  font-family:"IBM Plex Mono",monospace;font-size:12px;font-weight:700;
  color:var(--faint);width:40px;flex:none;
}
.srch{flex:1;min-width:170px}
.srch input{
  font:inherit;font-size:14px;width:100%;min-height:44px;
  background:var(--surface);color:var(--text);
  border:1px solid var(--line);border-radius:999px;padding:8px 15px;
}
.srch input:focus-visible{outline:2px solid var(--teal);outline-offset:1px}
.sortwrap{margin-left:auto}
.sortwrap select{
  font:inherit;font-size:13.5px;cursor:pointer;
  background:var(--surface);color:var(--muted);
  border:1px solid var(--line);border-radius:999px;padding:7px 12px;
}
.sortwrap select:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.chip{
  font:inherit;font-size:14px;font-weight:500;cursor:pointer;
  background:var(--surface);color:var(--muted);
  border:1px solid var(--line);border-radius:999px;padding:7px 15px;
  transition:background .12s,color .12s,border-color .12s;
}
.chip:hover{border-color:var(--teal);color:var(--text)}
.chip[aria-pressed="true"]{background:var(--teal);border-color:var(--teal);color:var(--surface);font-weight:500}
.chip:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.count{margin-left:auto;font-family:"IBM Plex Mono",monospace;font-size:12px;color:var(--muted);white-space:nowrap}

/* ---------- 무대(본문 + 패널) ---------- */
.stage{flex:1;min-height:0;display:flex}
main{flex:1;min-width:0;position:relative}
.view{position:absolute;inset:0;overflow:auto;-webkit-overflow-scrolling:touch}
.view[hidden]{display:none}
.pad{max-width:1080px;margin:0 auto;padding:18px 16px 40px}

/* ---------- 지도 ---------- */
#view-map{display:flex;flex-direction:column;overflow:hidden}
#view-map[hidden]{display:none}   /* id 규칙이 .view[hidden] 보다 우선하므로 명시한다 */
#map{flex:1;min-height:0;background:var(--surface-2)}
.map-down{
  flex:1;min-height:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:10px;
  padding:28px;text-align:center;background:var(--surface-2);color:var(--muted);
}
.map-down p{margin:0;max-width:46ch;font-size:14.5px;line-height:1.7}
.map-down-t{
  font-family:"Gothic A1","Noto Sans KR",sans-serif;
  font-size:18px;font-weight:700;color:var(--text);
}
.map-down .ghost{margin-left:0;margin-top:4px}
.mapnote{
  flex:none;display:flex;align-items:flex-start;gap:8px;
  padding:8px 14px;background:var(--warn-bg);color:var(--warn);
  border-top:1px solid var(--line);font-size:12.5px;line-height:1.5;
}
.mapnote[hidden]{display:none}
.mapnote p{margin:0;flex:1}
.mapnote b{font-weight:700}
.notex{
  font:inherit;font-size:13px;line-height:1;cursor:pointer;flex:none;
  background:transparent;border:0;color:inherit;padding:2px 4px;border-radius:5px;
}
.notex:hover{background:rgba(0,0,0,.06)}
.notex:focus-visible{outline:2px solid var(--warn);outline-offset:1px}
.mapfoot{
  flex:none;display:flex;align-items:center;gap:10px;
  padding:9px 14px;background:var(--surface);border-top:1px solid var(--line);
  font-family:"IBM Plex Mono",monospace;font-size:12.5px;color:var(--muted);
}
.ghost{
  font:inherit;font-size:13px;font-weight:600;cursor:pointer;margin-left:auto;
  background:transparent;color:var(--teal);border:1px solid var(--line);
  border-radius:999px;padding:5px 13px;
}
.ghost:hover{border-color:var(--teal)}
.ghost:focus-visible{outline:2px solid var(--teal);outline-offset:2px}

/* ---------- 마커 (divIcon) ---------- */
.pin-wrap{background:transparent;border:0}

/* 라벨형 마커: 28×28 앵커 박스 위에 점 + 옆으로 흐르는 라벨.
   박스 크기를 고정해야 줌 단계가 바뀌어도 좌표 위치가 흔들리지 않는다. */
.mk-wrap{
  background:transparent;border:0;
  position:relative;width:28px;height:28px;
}
.mk-dot{
  position:absolute;left:50%;top:50%;
  display:flex;align-items:center;justify-content:center;
  width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;
  background:var(--pin,#0E6E6E);border:2px solid var(--surface);
  box-shadow:0 1px 4px rgba(0,0,0,.4);
  /* 줌 단계 전환에 transition 을 걸지 않는다 — 렌더가 멈춘 상태에서 중간값으로 고착된다 */
}
.mk-dot.is-hi{box-shadow:0 0 0 2px var(--pin,#0E6E6E),0 1px 5px rgba(0,0,0,.45)}
.mk-dot.is-approx{border-style:dashed}
.mk-emoji{display:none;font-style:normal;font-size:13px;line-height:1}

.mk-lab{
  display:none;position:absolute;top:50%;left:24px;
  transform:translateY(-50%);
  align-items:center;gap:5px;white-space:nowrap;
  padding:2px 8px 2px 7px;border-radius:999px;
  background:var(--surface);border:1px solid var(--line);
  box-shadow:0 1px 5px rgba(0,0,0,.22);
}
/* 라벨 자리 4방향 — JS 의 posRect() 오프셋(가로 ±10, 세로 ±12)과 값을 맞춘다 */
.mk-wrap.pos-l .mk-lab{left:auto;right:24px;flex-direction:row-reverse}
.mk-wrap.pos-t .mk-lab{left:50%;right:auto;top:auto;bottom:26px;transform:translateX(-50%)}
.mk-wrap.pos-b .mk-lab{left:50%;right:auto;top:26px;bottom:auto;transform:translateX(-50%)}
.mk-name{
  font-family:"Gothic A1","Noto Sans KR",sans-serif;
  font-size:12px;font-weight:700;color:var(--text);letter-spacing:-.01em;
  max-width:112px;overflow:hidden;text-overflow:ellipsis;
}
.mk-cat{
  /* --faint 는 라벨 바탕(--surface) 위에서 4.19:1 로 AA 미달 → --muted 사용 */
  display:none;font-style:normal;font-size:11px;color:var(--muted);
  max-width:70px;overflow:hidden;text-overflow:ellipsis;
}
.mk-score{
  font-family:"IBM Plex Mono",monospace;font-style:normal;
  font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;
  padding:1px 5px;border-radius:5px;
}

/* 줌 단계 — far: 점만 / mid: 아이콘 / near: 이름+별점 / max: +카테고리 */
#map[data-tier="mid"] .mk-dot,
#map[data-tier="near"] .mk-dot,
#map[data-tier="max"] .mk-dot{width:22px;height:22px;margin:-11px 0 0 -11px}
#map[data-tier="mid"] .mk-emoji,
#map[data-tier="near"] .mk-emoji,
#map[data-tier="max"] .mk-emoji{display:block}
#map[data-tier="near"] .mk-lab,
#map[data-tier="max"] .mk-lab{display:inline-flex}
#map[data-tier="max"] .mk-cat{display:inline}
/* 충돌 제거로 접힌 라벨 — id 선택자를 이겨야 하므로 #map 을 붙인다 */
#map .mk-wrap.lab-off .mk-lab{display:none}
/* 고평점은 라벨도 강조 */
#map[data-tier="near"] .leaflet-marker-icon:hover .mk-lab,
#map[data-tier="max"] .leaflet-marker-icon:hover .mk-lab{border-color:var(--teal)}
.pin-place{
  display:flex;align-items:center;justify-content:center;
  width:22px;height:22px;border-radius:7px;
  background:var(--surface);border:2px solid var(--teal);color:var(--teal);
  font-size:11px;font-weight:700;line-height:1;
}
.me-dot{
  display:block;width:14px;height:14px;border-radius:50%;
  background:#1f6feb;border:3px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.25);
}
.leaflet-container{font:inherit;background:var(--surface-2)}
.leaflet-container a{color:var(--teal)}
.leaflet-bar a,.leaflet-control-attribution{background:var(--surface);color:var(--muted)}
.leaflet-bar a{color:var(--text);border-bottom-color:var(--line)}
:root[data-theme="dark"] .leaflet-tile-pane{filter:brightness(.82) contrast(1.05)}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .leaflet-tile-pane{filter:brightness(.82) contrast(1.05)}
}

/* ---------- 카드 ---------- */
.grid{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(276px,1fr))}
.card{
  background:var(--surface);border:1px solid var(--line);border-radius:13px;
  padding:17px 17px 15px;display:flex;flex-direction:column;gap:9px;
  box-shadow:var(--shadow);text-align:left;
}
button.card{font:inherit;color:inherit;cursor:pointer;width:100%}
button.card:hover{border-color:var(--teal)}
button.card:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.card-top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.name{font-family:"Gothic A1","Noto Sans KR",sans-serif;font-size:19px;font-weight:700;line-height:1.35;margin:0}
.yt{
  display:block;margin-top:10px;padding:9px 12px;
  background:var(--surface-2);border:1px solid var(--line-soft);border-radius:9px;
  text-decoration:none;transition:border-color .12s;
}
.yt:hover{border-color:var(--teal)}
.yt:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.yt-ch{display:block;font-size:11.5px;font-weight:700;color:var(--teal);margin-bottom:4px}
.yt-t{display:block;font-size:13.5px;color:var(--muted);line-height:1.45}
.badge{
  display:inline-flex;align-items:center;gap:5px;margin-top:7px;margin-right:5px;
  font-size:12.5px;font-weight:700;letter-spacing:-.01em;
  padding:4px 10px 4px 8px;border-radius:6px;
}
.badge::before{content:"";width:5px;height:5px;border-radius:50%;background:currentColor;flex:none}
.b-official{background:var(--amber-soft);color:var(--amber)}
.b-mention{background:var(--surface-2);color:var(--muted);border:1px solid var(--line)}
.b-social{background:var(--tier-mid-bg);color:var(--tier-mid)}
.tags{display:flex;flex-wrap:wrap;gap:5px;margin-top:5px}
.tag{
  font-size:12.5px;padding:3px 9px;border-radius:5px;
  background:var(--surface-2);color:var(--muted);border:1px solid var(--line-soft);
}
.tag.area{color:var(--teal);background:var(--teal-soft);border-color:transparent}
.tag.shut{color:var(--warn);background:var(--warn-bg);border-color:transparent;font-weight:600}
.tag.approx{color:var(--faint);font-style:normal}
.score{
  flex:none;text-align:right;font-family:"IBM Plex Mono",monospace;
  border-radius:8px;padding:6px 9px;line-height:1.15;
}
.score .s{display:block;font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}
.score .v{display:block;font-size:10.5px;opacity:.8;font-variant-numeric:tabular-nums}
.score .d{display:block;font-size:10.5px;font-weight:600;margin-top:3px;font-variant-numeric:tabular-nums}
.t-hi{background:var(--tier-hi-bg);color:var(--tier-hi)}
.t-mid{background:var(--tier-mid-bg);color:var(--tier-mid)}
.t-lo{background:var(--tier-lo-bg);color:var(--tier-lo)}
.rows{display:flex;flex-direction:column;gap:5px;font-size:13.5px;color:var(--muted);margin-top:2px}
.rows div{display:grid;grid-template-columns:54px 1fr;gap:8px}
/* 11.5px 라벨이라 --faint(라이트 4.19:1)는 AA 미달 → --muted(7:1대) 사용 */
.rows dt{font-size:11.5px;font-weight:600;color:var(--muted);padding-top:3px;white-space:nowrap}
.rows dd{margin:0}
.rows .hours{color:var(--text);font-family:"IBM Plex Mono",monospace;font-size:12.5px;font-variant-numeric:tabular-nums}
.closed{color:var(--warn);font-weight:600}
.note{font-size:14px;color:var(--muted);margin:2px 0 0;line-height:1.5}
.go{
  margin-top:auto;padding-top:11px;
  display:flex;flex-wrap:wrap;align-items:center;gap:7px;
  border-top:1px solid var(--line-soft);
}
.go a{
  font-size:13px;font-weight:700;color:var(--teal);text-decoration:none;
  display:inline-flex;align-items:center;gap:5px;
  border:1px solid var(--line);border-radius:999px;padding:6px 12px;
  transition:border-color .12s,background .12s;
}
.go a:hover{border-color:var(--teal);background:var(--teal-soft)}
.go a:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.empty{padding:40px 0;color:var(--muted);text-align:center;display:none}

/* ---------- 상세 시트 / 패널 ---------- */
.sheet{
  position:fixed;left:0;right:0;bottom:0;z-index:1100;
  height:var(--sheet-h,60vh);max-height:92vh;
  background:var(--surface);border-top:1px solid var(--line);
  border-radius:16px 16px 0 0;
  box-shadow:0 -8px 32px -12px rgba(0,0,0,.35);
  display:flex;flex-direction:column;
  transition:height .18s ease;
}
.sheet[hidden]{display:none}
.sheet.dragging{transition:none}
.sheet-grab{padding:9px 0 5px;display:flex;justify-content:center;cursor:grab;touch-action:none}
.sheet-grab span{display:block;width:42px;height:4px;border-radius:99px;background:var(--line)}
.sheet-head{
  display:flex;align-items:center;gap:10px;padding:2px 14px 10px;
  border-bottom:1px solid var(--line-soft);
}
.sheet-head strong{
  font-family:"Gothic A1","Noto Sans KR",sans-serif;font-size:15px;font-weight:700;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.sheet-head .iconbtn{margin-left:auto;padding:4px 10px}
.sheet-body{flex:1;min-height:0;overflow:auto;padding:14px}
.sheet-body .card{box-shadow:none;border:0;padding:0}

/* ---------- 일정 ---------- */
.days{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.day{
  background:var(--surface);border:1px solid var(--line);border-radius:14px;
  padding:20px;box-shadow:var(--shadow);
}
.day-head{display:flex;align-items:baseline;gap:10px;padding-bottom:14px;border-bottom:1px solid var(--line-soft)}
.day-n{
  font-family:"IBM Plex Mono",monospace;font-size:11px;font-weight:600;
  letter-spacing:.1em;color:var(--surface);background:var(--teal);
  border-radius:5px;padding:3px 7px;
}
.day-date{font-family:"Gothic A1","Noto Sans KR",sans-serif;font-size:17px;font-weight:600}
.day-note{margin-left:auto;font-size:12px;color:var(--muted)}
.slot{display:grid;grid-template-columns:52px 1fr;gap:12px;padding:13px 0;border-bottom:1px dashed var(--line-soft)}
.slot:last-of-type{border-bottom:0}
.slot time{font-family:"IBM Plex Mono",monospace;font-size:12.5px;color:var(--teal);font-weight:600;padding-top:1px}
.slot .what{font-size:12.5px;color:var(--faint);font-weight:500}
.slot .pick{margin-top:2px}
.linkish{
  font:inherit;font-weight:600;cursor:pointer;padding:0;
  background:none;border:0;border-bottom:1px solid var(--line);color:inherit;
}
.linkish:hover{border-color:var(--teal);color:var(--teal)}
.linkish:focus-visible{outline:2px solid var(--teal);outline-offset:2px}
.slot .alt{font-size:13px;color:var(--muted);margin-top:3px;display:flex;flex-wrap:wrap;gap:6px;align-items:baseline}
.slot .alt .linkish{font-size:13px;font-weight:500}
.flag{
  display:inline-block;margin-top:8px;padding:3px 9px;border-radius:6px;
  background:var(--warn-bg);color:var(--warn);font-size:12.5px;font-weight:500;
}
.day-foot{margin-top:14px;padding-top:12px;border-top:1px solid var(--line-soft);display:flex}

/* ---------- 정보 뷰 (원본 문서 스타일 승계) ---------- */
.doc h2{
  font-family:"Gothic A1","Noto Sans KR",sans-serif;font-weight:600;
  font-size:26px;margin:0 0 8px;letter-spacing:-.005em;
}
.doc h2.mt{margin-top:52px}
.sub{margin:0 0 22px;color:var(--muted);font-size:15px;max-width:64ch}
.sub.mt-s{margin-top:14px}
.criteria{
  margin-top:26px;padding:16px 18px;
  background:var(--teal-soft);border-radius:12px;
  display:flex;flex-wrap:wrap;gap:14px 26px;align-items:baseline;
}
.criteria.mt{margin-top:26px}
.criteria.mb{margin:0 0 20px}
.criteria.warnbox{background:var(--warn-bg)}
.criteria .warntxt{color:var(--warn)}
.criteria strong{font-weight:600}
.criteria .num{font-family:"IBM Plex Mono",monospace;color:var(--teal);font-weight:600}
.criteria p{margin:0;font-size:14.5px;line-height:1.7;color:var(--muted);max-width:62ch}
.board{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
.stat{
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:15px 16px;box-shadow:var(--shadow);
  display:flex;flex-direction:column;gap:5px;
  border-left:4px solid var(--warn);
}
.stat.ok{border-left-color:var(--tier-mid)}
.sv{font-size:27px;font-weight:800;line-height:1;color:var(--warn);font-variant-numeric:tabular-nums}
.stat.ok .sv{color:var(--tier-mid)}
.sv em{font-style:normal;font-size:15px;font-weight:700;color:var(--faint)}
.sl{font-size:13px;color:var(--muted);font-weight:500}
.src{
  background:var(--surface);border:1px solid var(--line);border-radius:14px;
  padding:20px;margin-bottom:16px;box-shadow:var(--shadow);
}
.src > summary{
  list-style:none;cursor:pointer;display:flex;align-items:center;gap:12px;
  margin:-20px;padding:20px;border-radius:14px;
}
.src > summary::-webkit-details-marker{display:none}
.src[open] > summary{margin-bottom:0;padding-bottom:14px}
.src > summary:hover .stitle{color:var(--teal)}
.src > summary:focus-visible{outline:2px solid var(--teal);outline-offset:-2px}
.stitle{
  font-family:"Gothic A1","Noto Sans KR",sans-serif;
  font-size:19.5px;font-weight:700;letter-spacing:-.005em;flex:1;
}
.schev{
  flex:none;font-size:12.5px;font-weight:700;color:var(--teal);
  background:var(--teal-soft);border-radius:999px;padding:5px 12px;
}
.src[open] .schev{font-size:0;padding:5px 12px}
.src[open] .schev::before{content:"접기";font-size:12.5px}
.srcmeta{margin:0 0 14px;font-size:13px;color:var(--faint);font-family:"IBM Plex Mono",monospace}
.srcmeta a{color:var(--teal)}
.verdict{margin:14px 0 0;font-size:14.5px;line-height:1.7;color:var(--muted)}
.verdict.mt-s{margin-top:22px}
.verdict b{color:var(--text)}
.verdict a{color:var(--teal)}
.src blockquote{
  margin:10px 0 0;padding:11px 15px;
  background:var(--surface-2);border-left:3px solid var(--teal);border-radius:0 8px 8px 0;
  font-size:14.5px;color:var(--text);line-height:1.65;
}
.src blockquote a{color:var(--teal)}
.q{color:var(--text);font-style:italic}
.amber{color:var(--amber)}
td.pass{color:var(--tier-mid);font-weight:600}
.tablewrap{overflow-x:auto;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
table{border-collapse:collapse;width:100%;min-width:560px;font-size:14.5px}
th,td{padding:11px 14px;text-align:left;border-bottom:1px solid var(--line-soft)}
th{
  font-family:"IBM Plex Mono",monospace;letter-spacing:.08em;
  color:var(--faint);font-weight:700;background:var(--surface-2);font-size:12px;
}
tr:last-child td{border-bottom:0}
td.n{font-family:"IBM Plex Mono",monospace;font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap}
td.why{color:var(--warn)}
.doc footer{
  margin-top:56px;padding-top:24px;border-top:1px solid var(--line);
  font-size:14px;line-height:1.7;color:var(--muted);
}
.doc footer p{margin:0 0 8px;max-width:70ch}
.doc footer a{color:var(--teal)}
.doc footer code{font-family:"IBM Plex Mono",monospace;font-size:12px;background:var(--surface-2);padding:1px 5px;border-radius:4px}

/* ---------- 하단 탭바 ---------- */
.tabbar{
  flex:none;display:flex;background:var(--surface);border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom);
}
.tab{
  flex:1;font:inherit;font-size:11.5px;font-weight:600;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;
  height:var(--tabbar-h);background:transparent;border:0;color:var(--faint);
}
.tab span{font-size:17px;line-height:1}
.tab[aria-pressed="true"]{color:var(--teal)}
.tab:focus-visible{outline:2px solid var(--teal);outline-offset:-3px}

/* ---------- 토스트 · 치명적 오류 ---------- */
.toast{
  position:fixed;left:50%;bottom:calc(var(--tabbar-h) + 18px);transform:translateX(-50%);
  z-index:1300;max-width:min(92vw,460px);
  background:var(--text);color:var(--bg);
  padding:11px 18px;border-radius:999px;font-size:13.5px;line-height:1.5;
  box-shadow:0 8px 28px -10px rgba(0,0,0,.5);text-align:center;
}
.toast[hidden]{display:none}
.toast-act{
  font:inherit;font-size:13px;font-weight:700;cursor:pointer;
  margin-left:10px;padding:5px 12px;min-height:32px;
  background:var(--bg);color:var(--text);border:0;border-radius:999px;
}
.toast-act:hover{background:var(--surface)}
.toast-act:focus-visible{outline:2px solid var(--bg);outline-offset:2px}
.fatal{
  position:fixed;inset:0;z-index:1500;display:flex;align-items:center;justify-content:center;
  background:var(--bg);color:var(--text);padding:28px;text-align:center;font-size:15px;line-height:1.7;
}
.fatal[hidden]{display:none}

/* ---------- 반응형 ---------- */
@media (min-width:768px){
  .tabbar{display:none}
  .segs{display:flex}
  .iconbtn .lbl{display:inline}
  .toast{bottom:26px}
  .filterbar{padding:12px 20px}
  .pad{padding:24px 20px 48px}
}
@media (min-width:1024px){
  .stage{position:relative}
  .sheet{
    position:static;flex:0 0 380px;height:auto;max-height:none;
    border-top:0;border-left:1px solid var(--line);border-radius:0;
    box-shadow:none;
  }
  .sheet-grab{display:none}
  .sheet-head{padding:14px 16px 12px}
}
@media (max-width:767px){
  /* 폰에서는 라벨 하나가 화면 절반을 먹으면 자리 경합이 심해 이름이 자주 접힌다 → 라벨을 좁게.
     카테고리 텍스트는 접고 이모지·색으로만 종류를 전한다(데스크톱은 텍스트 유지). */
  .mk-lab{padding:2px 6px 2px 5px;gap:4px}
  .mk-name{max-width:84px;font-size:11.5px}
  .mk-score{font-size:10.5px;padding:1px 4px}
  #map[data-tier="max"] .mk-cat{display:none}

  /* 좁은 화면에서 칩이 여러 줄로 접히면 필터바가 지도를 다 먹는다 → 한 줄 가로 스크롤 */
  .filterbar{padding:8px 12px}
  .frow{flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
  .frow::-webkit-scrollbar{display:none}
  .frow > *{flex:none}
  .srch{flex:1 1 auto;min-width:0}
}
@media (max-width:620px){
  .doc h2{font-size:22px}
  .doc h2.mt{margin-top:40px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
