/* 필터 칩 */
.chips {
  position: relative;
  z-index: 500;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 14px 11px 17px;
  border-bottom: 1px dashed var(--ink-soft);
  background: var(--paper);
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  font-weight: 500;
  white-space: nowrap;
}
.chip small { font-size: calc(11px * var(--fs)); color: var(--ink-soft); }
.chip em { font-style: normal; font-size: calc(11px * var(--fs)); font-weight: 700; color: var(--ink-soft); }
.chip.on { background: var(--ink); color: var(--paper); }
.chip.on small, .chip.on em { color: var(--paper-2); }
.chip-study.on { background: var(--study); border-color: var(--study); }
.chip-mood.on { background: var(--mood); border-color: var(--mood); }

.lines { display: flex; gap: 2px; }
.lines i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  font: 700 10px/1 'IBM Plex Sans KR', sans-serif;
}

/* 지도 */
#map { flex: 1; background: var(--paper-2); }
.leaflet-container { font-family: inherit; }
.leaflet-tile-pane { filter: sepia(.35) saturate(.7) contrast(.96); }
.leaflet-control-attribution {
  font-size: 10px;
  background: rgba(236, 229, 216, .85) !important;
}

.pin, .stn { width: 0; height: 0; }
.pin b {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  padding: 3px 7px 4px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, calc(-100% - 9px));
  transition: transform .15s;
}
.pin b::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -11px;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 9px solid var(--ink);
}
.pin-study b { background: var(--study); }
.pin-mood b { background: var(--mood); }
.pin-both b { background: linear-gradient(90deg, var(--study) 50%, var(--mood) 50%); }
.pin.is-on b {
  background: var(--hi);
  color: var(--ink);
  transform: translate(-50%, calc(-100% - 9px)) scale(1.2) rotate(-3deg);
}

.stn span {
  position: absolute;
  padding: 1px 5px 2px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
  transform: translate(-50%, 5px);
}
.stn span::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  background: var(--ink);
  vertical-align: 1px;
}

.locate {
  position: fixed;
  right: 13px;
  bottom: calc(var(--peek) + 15px);
  z-index: 550;
  transition: bottom .28s cubic-bezier(.3, .7, .2, 1);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
}

/* 하단 목록 */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  display: flex;
  flex-direction: column;
  height: var(--peek);
  border-top: 2px solid var(--ink);
  background: var(--paper);
  transition: height .28s cubic-bezier(.3, .7, .2, 1);
}
/* 목록은 세 단계: 손잡이만(peek) → 절반(half) → 화면 가득(full) */
body[data-sheet="half"] .sheet { height: var(--half); }
body[data-sheet="full"] .sheet { height: var(--full); }
body[data-sheet="half"] .locate { bottom: calc(var(--half) + 15px); }
body[data-sheet="full"] .locate { visibility: hidden; }
.handle {
  flex: none;
  display: flex;
  align-items: center;
  gap: 13px;
  height: 52px;
  padding: 0 17px;
  border-bottom: 1px solid var(--ink);
  touch-action: none;
  user-select: none;
}
.handle small { margin-left: auto; font-size: calc(11.5px * var(--fs)); color: var(--ink-soft); }
body:not([data-sheet="peek"]) .handle small { display: none; }
.handle span { width: 34px; height: 5px; background: var(--ink); transform: rotate(-3deg); }
.handle em { font-style: normal; font-weight: 700; font-size: calc(13px * var(--fs)); }

.list {
  flex: 1;
  overflow-y: auto;
  padding: 0 0 calc(env(safe-area-inset-bottom) + 22px);
  list-style: none;
}
.list li { border-bottom: 1px dashed #b9ad9c; }
.item { display: block; width: 100%; padding: 13px 17px 15px 19px; text-align: left; }
.item:active { background: var(--paper-2); }
.item strong { display: block; margin: 5px 0 1px; font-size: calc(17px * var(--fs)); letter-spacing: -.02em; }
.item small { font-size: calc(12.5px * var(--fs)); color: var(--ink-soft); }
.item p { margin-top: 6px; font-size: calc(13.5px * var(--fs)); line-height: 1.5; color: #3d342d; }
.empty { padding: 27px 19px; color: var(--ink-soft); }

.tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px 2px;
  color: var(--paper);
  font: 700 calc(11px * var(--fs))/1.4 'IBM Plex Sans KR', sans-serif;
}
.tag-study { background: var(--study); }
.tag-mood { background: var(--mood); }

