/* ===== sojutrip — 귀여운 네오브루탈리즘 ===== */

:root {
  --ink: #1d1d1f;
  --paper: #FFF9F0;
  --pink: #FFD6E8;
  --pink-deep: #FFB3D1;
  --mint: #C9F2C7;
  --yellow: #FFF3B0;
  --blue: #BFD7FF;
  --lilac: #E3D0FF;
  --border: 3px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 14px;
  --font-head: 'Jua', 'Apple SD Gothic Neo', sans-serif;
  --font-body: 'Gowun Dodum', 'Apple SD Gothic Neo', sans-serif;
  /* 숫자용. 손글씨 느낌의 Jua 는 한글은 예쁘지만 숫자(0·1·6·9)가 들쭉날쭉해서
     시계·날짜·배속처럼 자릿수가 흔들리면 안 되는 곳에는 따로 쓴다. */
  --font-num: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html, body { height: 100%; }
/* 휴대폰 브라우저는 주소창·하단바가 화면을 덮는다. 100% 는 덮이기 전 높이라
   아래쪽 버튼이 잘린다. dvh 는 지금 실제로 보이는 높이라 잘리지 않는다. */
@supports (height: 100dvh) { html, body { height: 100dvh; } }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 상단 바 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--pink);
  border-bottom: var(--border);
  flex-wrap: wrap;
  z-index: 1200;
  position: relative;
}

.logo { display: flex; align-items: center; gap: 8px; }

.logo-emoji {
  font-size: 30px;
  background: #fff;
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 2px 7px;
  transform: rotate(-4deg);
}

.logo-text h1 {
  font-family: var(--font-head);
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.5px;
}

.logo-text p { font-size: 12px; color: #444; }

.search {
  position: relative;
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 180px;
  max-width: 460px;
}

.search input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 9px 14px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  background: #fff;
  outline: none;
  min-width: 0;
}

.search input:focus { background: var(--yellow); }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1300;
}

.search-results h4 {
  font-family: var(--font-head);
  font-size: 13px;
  padding: 8px 12px 4px;
  background: var(--lilac);
  border-bottom: 2px solid var(--ink);
}

.search-results button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  padding: 12px;
  border: none;
  border-bottom: 2px dashed #ddd;
  background: none;
  cursor: pointer;
}

.search-results button:hover { background: var(--yellow); }

.search-results .no-result { padding: 12px; font-size: 14px; text-align: center; }

/* ---------- 버튼 ---------- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  font-family: var(--font-head);
  font-size: 16px;
  padding: 10px 15px;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  transition: transform .08s, box-shadow .08s;
  display: inline-block;
  background: #fff;
  color: var(--ink);
}

.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

.btn-pink   { background: var(--pink-deep); }
.btn-blue   { background: var(--blue); }
.btn-mint   { background: var(--mint); }
.btn-yellow { background: var(--yellow); }
.btn-lilac  { background: var(--lilac); }

/* ---------- 레이아웃 ---------- */
.layout {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

.map-wrap { flex: 1; position: relative; min-width: 0; }

#map { position: absolute; inset: 0; background: var(--blue); }

/* 플로팅 버튼 */
.fabs {
  position: absolute;
  right: 14px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.fab {
  /* 아이콘 svg 가 block 이라 그냥 두면 왼쪽 위에 붙는다 — 격자로 가운데에 놓는다 */
  display: grid;
  place-items: center;
  padding: 0;
  width: 52px;
  height: 52px;
  font-size: 22px;
  border: var(--border);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}

.fab:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.fab.on { background: var(--mint); box-shadow: 2px 2px 0 var(--ink), inset 0 0 0 3px var(--ink); }

/* 전체화면 버튼은 손으로 쓰는 기기에서만 의미가 있다 —
   창을 마음대로 키울 수 있는 데스크톱에서는 자리만 차지한다 */
.only-touch { display: none; }
@media (max-width: 1023px), (pointer: coarse) { .only-touch { display: grid; } }

/* ---------- 재생 바 ---------- */
.playbar {
  position: absolute;
  left: 14px;
  bottom: 22px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;   /* 한 줄 — 날짜·캐릭터는 오른쪽 모달로 옮겼다 */
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 7px 9px;
  max-width: min(520px, calc(100% - 76px));
}

/* 태블릿 폭에서는 지도가 좁아져(갤러리가 360px 을 가져간다) 재생바가 넘친다 */
@media (max-width: 1023px) {
  .playbar { max-width: calc(100% - 62px); gap: 7px; }
  .play-clock { min-width: 58px; padding: 5px 7px; }
}

.play-btn { font-size: 18px; padding: 8px 16px; }

/* 기간 재생을 켜면 날짜 칸이 하나 더 늘어난다.
 * 줄바꿈을 허용하고 날짜 칸을 줄어들 수 있게 해야 좁은 화면에서 재생바 밖으로 삐져나가지 않는다. */
/* 시작 ~ 끝을 한 줄로. 좁아지면 날짜 칸만 줄고 ◀▶ 은 그대로 남는다.
   예전에는 통째로 flex-wrap 이라 360px 에서 ◀ 와 ▶ 이 각자 딴 줄로 떨어졌다. */
.date-pick {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.date-pick input[type="date"] { width: 100%; min-width: 0; }
.date-pick .mini-btn { width: 38px; }

.date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 10px;
}
.date-row .btn { flex: 1 1 46%; justify-content: center; }
.date-row .btn.wide { flex: 1 1 100%; }

.date-row input[type="date"] {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 7px 8px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--yellow);
  color: var(--ink);
  min-width: 0;
  flex: 1 1 128px;
  max-width: 100%;
}

.mini-btn {
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  font-family: var(--font-head);
  font-size: 14px;
  min-width: 38px;
  min-height: 38px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: var(--blue);
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
}

.mini-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

#playSlider {
  /* 한 줄로 만들었으니 좁아지면 줄어드는 건 슬라이더뿐이다 —
     버튼과 시계는 못 줄이니 여기서 양보해야 한 줄이 유지된다 */
  flex: 1 1 60px;
  min-width: 48px;
  accent-color: #FF7BAC;
  height: 22px;
}

.play-clock {
  font-family: var(--font-head);
  font-size: 16px;
  background: var(--mint);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  padding: 5px 10px;
  min-width: 64px;
  text-align: center;
}

/* 걷는 캐릭터 — 투명 배경, 캐릭터만 움직인다 */
.walker {
  width: var(--walk-size, 46px);
  height: var(--walk-size, 46px);
  background: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* 캐릭터는 두 겹으로 나눠 서로의 움직임을 끊지 않게 한다.
 *  .face — 진행 방향(좌우 반전). 방향이 바뀔 때 툭 뒤집히지 않고 스르륵 돌아간다.
 *  .body — 뒤뚱뒤뚱 걸음(그림 파일). 속도는 설정(--waddle-sec)에서 조절.
 * 한 겹으로 합치면 방향을 바꿀 때 걸음 애니메이션이 처음부터 다시 시작돼 툭 끊긴다. */
.walker .face {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(1);
  transition: transform .26s cubic-bezier(.2, .9, .25, 1);
}

.walker .face.flip { transform: scaleX(-1); }

.walker .body {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: 50% 90%;
  animation: waddle var(--waddle-sec, 1.2s) ease-in-out infinite;
  -webkit-user-drag: none;
  /* 어떤 배경에서도 잘 보이게: 외곽선 + 은은한 그림자.
     캐릭터가 이모지 글자에서 그림 파일로 바뀌어 text-shadow 가 안 먹는다.
     drop-shadow 는 글자가 아니라 알파를 따라가므로 같은 테두리가 나오고,
     설정의 외곽선 색도 그대로 살아 있다. */
  filter:
    drop-shadow(1.5px 0 0 #fff) drop-shadow(-1.5px 0 0 #fff)
    drop-shadow(0 1.5px 0 #fff) drop-shadow(0 -1.5px 0 #fff)
    drop-shadow(2px 4px 3px rgba(29, 29, 31, .35));
}

body[data-outline="black"] .walker .body {
  filter:
    drop-shadow(1.5px 0 0 #1d1d1f) drop-shadow(-1.5px 0 0 #1d1d1f)
    drop-shadow(0 1.5px 0 #1d1d1f) drop-shadow(0 -1.5px 0 #1d1d1f)
    drop-shadow(2px 4px 3px rgba(29, 29, 31, .35));
}

body[data-outline="none"] .walker .body { filter: drop-shadow(2px 4px 3px rgba(29, 29, 31, .35)); }

@keyframes waddle {
  0%   { transform: translate(-2px, 0)  rotate(-9deg); }
  25%  { transform: translate(0, -3px)  rotate(0deg); }
  50%  { transform: translate(2px, 0)   rotate(9deg); }
  75%  { transform: translate(0, -3px)  rotate(0deg); }
  100% { transform: translate(-2px, 0)  rotate(-9deg); }
}

/* 프레임이 떨어져도 캐릭터가 튀지 않게 두 프레임 사이를 이어준다.
 * 지도 확대/축소 중에는 Leaflet이 마커를 다시 배치하므로 잠시 끈다. */
.walker-marker { transition: transform .085s linear; }

.leaflet-zoom-anim .walker-marker,
.leaflet-pan-anim .walker-marker { transition: none; }

.photo-marker.pop { animation: pop .7s ease; }

@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35) rotate(-4deg); }
  100% { transform: scale(1); }
}

/* 드래그 앤 드롭 힌트 */
.drop-hint {
  position: absolute;
  inset: 0;
  z-index: 1100;
  background: rgba(255, 214, 232, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-card {
  font-family: var(--font-head);
  font-size: 22px;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 34px;
  transform: rotate(-2deg);
}

/* ---------- 사이드 패널 ---------- */
.panel {
  /* flex 축소를 막아야 설정한 폭이 그대로 지켜진다.
     (기본값이면 지도가 자리를 뺏어 끌어 놓은 폭보다 좁아진다) */
  flex: 0 0 auto;
  width: var(--panel-w, 360px);
  max-width: 70vw;
  position: relative;
  background: var(--paper);
  border-left: var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 1000;
}

.panel-handle { display: none; }

.panel-head {
  padding: 14px 14px 8px;
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 5;
}

.panel-head h2 {
  font-family: var(--font-head);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

/* 제목은 남는 폭만큼만 쓰고, 모자라면 말줄임 (버튼에 밀려 잘리지 않게) */
.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.panel-title .ico { font-size: 15px; line-height: 1; flex: 0 0 auto; }

.panel-title .txt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clear-btn {
  font-family: var(--font-head);
  font-size: 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 4px 8px;
  cursor: pointer;
}

.clear-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

/* 프로필 전환 메뉴 */
.profile-wrap {
  position: relative;
  display: inline-block;
  margin: 6px 8px 0 0;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
  overflow: hidden;
}

.profile-row { display: flex; align-items: stretch; border-bottom: 2px dashed #ddd; }

.profile-pick {
  flex: 1;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 11px 12px;
  border: none;
  background: none;
  cursor: pointer;
}

.profile-pick:hover { background: var(--yellow); }

.profile-del {
  border: none;
  border-left: 2px dashed #ddd;
  background: none;
  padding: 0 10px;
  cursor: pointer;
  font-size: 14px;
}

.profile-del:hover { background: var(--pink); }

.profile-add {
  display: block;
  width: 100%;
  font-family: var(--font-head);
  font-size: 14px;
  padding: 11px 12px;
  border: none;
  background: var(--mint);
  cursor: pointer;
}

.stats {
  margin-top: 6px;
  font-size: 13.5px;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 5px 9px;
  /* inline-block + 한 줄 텍스트였을 때는 좁은 폭에서 글자가 테두리 밖으로 삐져나갔다.
     칸마다 감싸고 줄바꿈을 허용해야 항상 상자 안에 머문다. */
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  max-width: 100%;
}

.stats .stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.stats .stat .ico { width: 15px; height: 15px; }

/* 빈 상태 안내 */
.empty { padding: 10px 14px 20px; }

.empty-card {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 14px;
  text-align: center;
  font-size: 14.5px;
  line-height: 1.8;
  display: grid;
  gap: 10px;
}


.empty-tip {
  background: var(--yellow);
  border: 2px dashed var(--ink);
  border-radius: 10px;
  padding: 6px;
}

.empty-privacy { font-size: 12.5px; color: #555; }

/* 갤러리 — 날짜별 큰 카테고리 */
.gallery {
  display: grid;
  gap: 14px;
  padding: 6px 14px 16px;
}

/* 위치 없는 사진도 날짜별 작은 묶음으로 들어간다 */
#nogpsGallery { display: block; }

.day-sub + .day-sub { margin-top: 12px; }
.day-sub-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-head);
  font-size: 13px;
  margin-bottom: 6px;
  opacity: .8;
}

.day-group {
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}

.day-title {
  font-family: var(--font-head);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  min-width: 0;
}

.day-title .day-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-num {
  font-size: 12px;
  background: var(--lilac);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 6px;
}

.day-count {
  font-size: 12px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 6px;
}

.day-play {
  font-family: var(--font-head);
  font-size: 12.5px;
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  background: var(--mint);
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 4px 8px;
  cursor: pointer;
}

.day-play:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

.day-grid {
  display: grid;
  grid-template-columns: var(--gal-cols, repeat(auto-fill, minmax(var(--thumb-min, 84px), 1fr)));
  /* 칸 수를 직접 고르면 칸이 썸네일보다 넓어져 좌우가 들쭉날쭉해진다 —
     그때는 썸네일 폭 그대로의 칸을 만들어 줄째로 가운데에 모은다. */
  justify-content: center;
  gap: 12px;
}

.thumb {
  position: relative;
  /* 트랙은 1fr 이라 칸 수가 폭에 맞춰 늘어나고, 썸네일은 이 한계까지만 커진다.
     (한계가 없으면 360px 패널에서 84px 설정이 144px로 부풀어 "다시 커졌다"가 된다) */
  max-width: var(--thumb-max, 110px);
  width: 100%;
  justify-self: center;
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  background: #fff;
  padding: 0;
  transition: transform .08s, box-shadow .08s;
}

.thumb:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb .badge {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 5px;
}

.thumb .date {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 11.5px;
  background: rgba(255,255,255,.95);
  border-top: 2px solid var(--ink);
  border-radius: 0 0 9px 9px; /* 썸네일 둥근 모서리(12-테두리3)를 따라가 잘림 방지 */
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb.highlight { outline: 4px solid var(--pink-deep); }

/* 위치 없는 사진 */
.nogps { border-top: 3px dashed var(--ink); margin-top: 8px; padding-top: 10px; }

.nogps h3 { font-family: var(--font-head); font-size: 15px; padding: 0 14px; }

.nogps-tip { font-size: 13px; color: #555; padding: 4px 14px 8px; line-height: 1.6; }
/* 위치 없는 이유 설명 옆에 그림 한 장. 글만 있으면 안 읽힌다. */
.nogps-tip-row { display: flex; align-items: flex-start; gap: 2px; padding-left: 10px; }
.nogps-tip-row img { flex: none; object-fit: contain; margin-top: 6px; }

/* ---------- 지도 마커 / 팝업 ---------- */
.photo-marker {
  display: grid;
  place-items: center;
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  background: #fff;
  width: 52px !important;
  height: 52px !important;
}

.photo-marker img { width: 100%; height: 100%; object-fit: cover; }

.photo-marker.estimated { border-style: dashed; }

.visit-marker {
  width: 18px !important;
  height: 18px !important;
  background: var(--pink-deep);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
}

.search-pin {
  font-size: 30px;
  width: 34px !important;
  height: 34px !important;
  text-align: center;
  filter: drop-shadow(2px 2px 0 var(--ink));
}

.leaflet-popup-content-wrapper {
  border: var(--border);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow);
  font-family: var(--font-body);
}

.leaflet-popup-tip { border: 2px solid var(--ink); }

/* 숫자는 폭이 같은 자형으로 — 재생 중 시계가 1분마다 덜컹거리지 않는다 */
.num, .play-clock, .play-days, #speedBtn, .stat, .thumb .date,
.date-row input[type="date"], .range-sep {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
  letter-spacing: 0;
}

/* 말풍선 안의 부연 한 줄 (분류·"이름 찾는 중") */
.pop-sub { font-size: .82em; opacity: .68; }

.popup-photo img {
  width: 100%;
  max-width: 220px;
  margin-inline: auto;
  border: 2px solid var(--ink);
  border-radius: 10px;
  display: block;
}


.popup-photo .cap { font-size: 13.5px; margin-top: 8px; line-height: 1.6; }

.popup-photo .tag {
  font-family: var(--font-head);
  font-size: 11px;
  background: var(--lilac);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 6px;
  display: inline-block;
  margin-top: 4px;
}

/* 추천 스팟 (제휴 콘텐츠 — 앱 콘텐츠와 같은 결로, 배지로만 구분) */
.spot-marker {
  position: relative;      /* 광고 배지를 모서리에 붙이기 위해 */
  display: grid;
  place-items: center;
  overflow: visible;
  /* 사진 썸네일과 같은 크기·테두리. 안에 든 것은 사진이 아니라 분류 아이콘이라
     나란히 놓아도 내 사진과 헷갈리지 않는다. */
  width: 52px !important;
  height: 52px !important;
  background: #fff;
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-size: 17px;
}

.popup-spot b { font-family: var(--font-head); font-size: 15px; }

.popup-spot p { font-size: 13px; line-height: 1.6; margin: 6px 0 8px; }

.spot-link {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 5px 10px;
  text-decoration: none;
}

.spot-link:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

/* 광고 배지.
   말풍선 생김새는 사진과 똑같이 두고 이 배지 하나로 광고임을 밝힌다.
   공정위 지침이 요구하는 "쉽게 인식할 수 있는 위치·크기·색"에 맞춰
   맨 위, 본문과 같은 크기, 배경과 뚜렷이 구분되는 색으로 둔다. */
.ad-badge {
  display: inline-block;
  vertical-align: 1px;
  margin-right: 5px;
  padding: 0 6px;
  font-family: var(--font-head);
  font-size: 10.5px;
  line-height: 15px;
  letter-spacing: .02em;
  color: var(--ink);
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}

/* 지도 위 표시에도 작게 — 열어 보기 전에도 광고인 줄 알 수 있게 */
.spot-ad {
  position: absolute;
  right: -5px;
  top: -5px;
  padding: 0 3px;
  font-family: var(--font-head);
  font-size: 8.5px;
  line-height: 12px;
  color: var(--ink);
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap;
}

/* 진짜 고지는 이 한 줄이다.
 * 배지는 작게 줄였으니(눈에 거슬리지 않게) 대신 이 문장을 본문만 하게 키운다.
 * 광고 표시는 소비자가 쉽게 알아볼 수 있는 크기여야 하는데, 둘 다 작으면
 * 그 요건을 못 채운다. 하나는 작아도 되지만 둘 다 작으면 안 된다. */
.spot-disclosure {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: #555;
  margin-top: 7px;
}

/* 광고 슬롯 (비어 있으면 숨김 — 애드센스/애드몹 코드가 들어오면 노출) */
.ad-slot {
  flex: none;
  background: #fff;
  border-top: var(--border);
  padding: 4px;
  text-align: center;
  min-height: 54px;
}

.ad-slot:empty { display: none; }

/* 지도 기본 컨트롤도 브루탈리즘으로 */
.leaflet-control-zoom {
  border: none !important;
  background: transparent !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-sm) !important;
  /* overflow:hidden 을 쓰면 안쪽 버튼의 각진 테두리가 잘려 보인다 → 각 버튼에 라운드를 준다 */
  overflow: visible !important;
}

.leaflet-control-zoom a {
  border: 2.5px solid var(--ink) !important;
  background: var(--yellow) !important;
  color: var(--ink) !important;
  font-weight: bold;
  border-radius: 0 !important;
  background-clip: padding-box;
}

.leaflet-control-zoom a.leaflet-control-zoom-in {
  border-radius: 12px 12px 0 0 !important;
}

.leaflet-control-zoom a.leaflet-control-zoom-out {
  border-radius: 0 0 12px 12px !important;
  border-top: 0 !important;   /* 위 버튼과 테두리가 겹쳐 두꺼워지는 것 방지 */
}

.leaflet-control-zoom a:hover { background: var(--pink) !important; }
.leaflet-control-zoom a.leaflet-disabled { background: #ececec !important; color: #aaa !important; }

.leaflet-control-attribution { font-size: 9px; }

/* ---------- 시네마 모드 (재생 시 UI 최소화) ---------- */
.topbar, .panel {
  transition: transform .3s cubic-bezier(.2, .9, .25, 1), opacity .24s ease;
  will-change: transform;
}

body.cinema .topbar { transform: translateY(-115%) scale(.96); opacity: 0; pointer-events: none; }
body.cinema .panel  { transform: translateX(112%) scale(.96); opacity: 0; pointer-events: none; }
body.cinema-gone .topbar, body.cinema-gone .panel { display: none; }

/* 최소화 독 아이콘 */
.dock {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 1500;
  display: flex;
  gap: 8px;
}

.dock-btn {
  /* 아이콘 svg 가 block 이라 그냥 두면 왼쪽 위에 붙는다 (fab 과 같은 문제) */
  display: grid;
  place-items: center;
  padding: 0;
  width: 46px;
  height: 46px;
  font-size: 21px;
  background: #fff;
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  animation: dock-pop .25s ease;
  transition: transform .08s, box-shadow .08s;
}

.dock-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }

@keyframes dock-pop {
  from { transform: translateY(-16px) scale(.7); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ---------- 원본 보기 라이트박스 ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(29, 29, 31, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  /* 툭 나타나지 않도록 페이드 — .open 은 JS가 한 프레임 뒤에 붙인다 */
  opacity: 0;
  transition: opacity .19s ease;
}

.lightbox.open { opacity: 1; }

/* 갤러리와 같은 자리(오른쪽)에 붙는 모달 — 지도를 가리지 않고 옆으로 밀려난다 */
.lightbox.dock-right { justify-content: flex-end; align-items: stretch; padding: 0; }
.lightbox.dock-right .sheet {
  position: relative;
  transform: translateX(18px);
  width: min(var(--sheet-w, 380px), 94vw);
  max-height: 100%;
  height: 100%;
  border-radius: 0;
  border-right: 0;
  box-shadow: -6px 0 0 var(--ink);
}
.lightbox.dock-right.open .sheet { transform: none; }
@media (max-width: 599px) {
  .lightbox.dock-right { align-items: flex-end; }
  .lightbox.dock-right .sheet {
    width: 100%;
    height: auto;
    max-height: 82vh;
    border-right: var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(18px);
  }
}

/* 자동 가져오기 — 값이 아니라 동작이라 드롭다운 대신 버튼과 목록이 들어간다 */
/* 목록과 버튼이 들어가니 라벨 옆이 아니라 한 줄을 통째로 쓴다 */
.folder-box { display: grid; gap: 8px; min-width: 0; flex: 1 1 100%; }
.folder-list { display: grid; gap: 6px; }
.folder-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 8px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
}
.folder-row .ico { width: 16px; height: 16px; flex: none; }
.folder-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.folder-btns .btn { flex: 1 1 46%; justify-content: center; }
.set-note { font-size: 12.5px; line-height: 1.6; color: #555; }
.track-btn.on { background: var(--mint); box-shadow: 2px 2px 0 var(--ink), inset 0 0 0 3px var(--ink); }

/* 기간·여행 고르개 — 작은 알약 버튼을 줄줄이 늘어놓는다.
   드롭다운보다 손이 덜 가고, 지금 무엇이 골라져 있는지 한눈에 보인다. */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 6px 11px;
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .15s;
}
.chip:hover { background: var(--yellow); }
.chip:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.chip.on { background: var(--mint); box-shadow: 2px 2px 0 var(--ink), inset 0 0 0 3px var(--ink); }

.trip-chip { border-radius: 14px; padding: 7px 12px; max-width: 100%; }
.trip-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-sub { font-size: 11px; opacity: .7; }

/* 찾아 둔 여행이 있으면 날짜 버튼에 개수를 달아 눈에 띄게 한다 */
#dateBtn { position: relative; overflow: visible; }
#dateBtn[data-count]:not([data-count="0"])::after {
  content: attr(data-count);
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  padding: 0 3px;
  font-family: var(--font-num);
  font-size: 10.5px;
  line-height: 15px;
  text-align: center;
  color: var(--ink);           /* --pink-deep 은 연한 분홍이라 흰 글씨는 안 보인다 */
  background: var(--pink-deep);
  border: 2px solid var(--ink);
  border-radius: 999px;
}

/* 창 폭 조절 손잡이 — 갤러리 것과 같은 방식 */
.sheet-resizer {
  position: absolute;
  left: -7px;
  top: 0;
  bottom: 0;
  width: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: ew-resize;
  z-index: 5;
  touch-action: none;
}
.sheet-resizer::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  width: 4px;
  height: 46px;
  margin-top: -23px;
  background: var(--ink);
  border-radius: 3px;
  opacity: .45;
}
.sheet-resizer:hover::before, .sheet-resizer:focus-visible::before { opacity: 1; }
@media (max-width: 599px) { .sheet-resizer { display: none; } }

/* 눌러서 날짜를 바꿀 수 있는 자리 */
.day-title.clickable { cursor: pointer; }
.day-title.clickable:hover { background: var(--yellow); }
.play-clock, .play-days { cursor: pointer; }
.play-clock:hover, .play-days:hover { background: var(--yellow); }

.date-sec { border-top: 3px dashed var(--ink); padding-top: 12px; margin-top: 4px; }
.date-sec h3 {
  font-family: var(--font-head);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* 닫히는 중에는 클릭을 가로채지 않는다 */
.lightbox:not(.open) { pointer-events: none; }

.lightbox .lightbox-card,
.lightbox .report-card,
.lightbox .sheet {
  transform: translateY(14px) scale(.97);
  opacity: .6;
  transition: transform .24s cubic-bezier(.2, .9, .25, 1), opacity .18s ease;
}

.lightbox.open .lightbox-card,
.lightbox.open .report-card,
.lightbox.open .sheet {
  transform: none;
  opacity: 1;
}

.lightbox-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 #000;
  padding: 12px;
  max-width: 94vw;
}

.lightbox-card img {
  display: block;
  margin-inline: auto;
  max-width: 100%; /* 카드 테두리 밖으로 삐져나가지 않게 */
  max-height: 68vh;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  image-rendering: auto;
}

.lightbox-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* 팝업 하단 버튼 */
.popup-actions { display: flex; gap: 8px; margin-top: 8px; }

.popup-actions .mini-btn { font-size: 12.5px; padding: 5px 9px; min-height: 34px; min-width: auto; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-family: var(--font-head);
  font-size: 14.5px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 3px solid #fff;
  box-shadow: var(--shadow);
  z-index: 3000;
  max-width: 86vw;
  text-align: center;
  /* 알림일 뿐이므로 아래 버튼의 클릭을 가로채지 않는다 */
  pointer-events: none;
  animation: toast-rise .22s cubic-bezier(.2, .9, .25, 1);
}

@keyframes toast-rise {
  from { transform: translateX(-50%) translateY(10px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ---------- 모바일 ---------- */
@media (max-width: 767px) {
  .topbar { padding: 8px 10px; gap: 8px; }
  .logo-text p { display: none; }
  .logo-text h1 { font-size: 20px; }
  /* 검색이 한 줄을 통째로 차지해 상단바가 세 줄(218px)이 되고 지도가 눌렸다.
     로고·검색·버튼을 한 줄에 나란히 놓아 한 줄로 줄인다. */
  .search { order: 0; flex: 1 1 120px; min-width: 0; max-width: none; }
  .actions { flex: 0 0 auto; gap: 6px; }
  .btn { font-size: 15px; padding: 9px 12px; }
  .logo { flex: 0 0 auto; gap: 6px; }

  .layout { flex-direction: column; }

  .panel {
    width: 100%;
    /* 데스크톱에서 지도 자리를 지키려고 걸어 둔 70vh 제한이 여기서는
       갤러리를 화면의 70%로 잘라 버린다 (412px 화면에서 288px). */
    max-width: none;
    border-left: none;
    border-top: var(--border);
    height: 42dvh;
    flex: none;
    transition: height .25s ease;
  }

  .panel.collapsed { height: 46px; overflow: hidden; }

  /* 보여 줄 사진이 없으면 빈 칸으로 화면 절반을 먹지 않게 — 내용만큼만 */
  .panel.empty { height: auto; max-height: 42dvh; }

  .panel-handle {
    display: block;
    width: 100%;
    background: var(--lilac);
    border: none;
    border-bottom: 2px solid var(--ink);
    padding: 10px 0;
    cursor: pointer;
    flex: none;
  }

  .handle-bar {
    display: block;
    width: 52px;
    height: 7px;
    background: var(--ink);
    border-radius: 4px;
    margin: 0 auto;
  }

  .fabs { bottom: 88px; }

  body.cinema .panel { transform: translateY(112%) scale(.96); }

  .playbar {
    left: 8px;
    right: 8px;
    bottom: 8px;
    max-width: none;
    padding: 8px 10px;
    gap: 8px;
  }

  .date-row { width: 100%; }
  .date-row input[type="date"] { font-size: 16px; flex: 1 1 118px; }

  .play-clock { font-size: 15px; }
  .day-grid, #nogpsGallery { gap: 10px; }
}

/* ---------- 언어 전환 ---------- */
.lang-wrap { position: relative; display: inline-block; }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1400;
  overflow: hidden;
  min-width: 150px;
}

.lang-menu button {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  padding: 11px 14px;
  border: none;
  border-bottom: 2px dashed #ddd;
  background: none;
  cursor: pointer;
}

.lang-menu button:last-child { border-bottom: none; }
.lang-menu button:hover { background: var(--yellow); }

/* 갤러리 헤더 버튼 묶음 */
.head-btns { display: inline-flex; gap: 6px; flex: 0 0 auto; }

/* ---------- 여행 리포트 카드 ---------- */
.report-card {
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 #000;
  padding: 12px;
  max-width: 94vw;
  max-height: 92vh;
  overflow-y: auto;
  animation: dock-pop .2s ease;
}

.report-card canvas {
  display: block;
  width: 100%;
  max-width: 360px;
  height: auto;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
}

/* ---------- 다국어 대응 레이아웃 안정화 ----------
 * 언어에 따라 라벨 길이가 달라져도 상단바가 줄바꿈으로 부풀지 않게,
 * 좁은 화면에서는 아이콘만 남기고 라벨을 숨긴다. */
.btn .ico, .clear-btn .ico { margin-right: 5px; }
.btn .lbl, .clear-btn .lbl { white-space: nowrap; }

/* ---------- 기기별 크기 ----------
 * 데스크톱: 글자 라벨까지 보여 줄 여유가 있다
 * 태블릿  : 버튼이 여덟 개라 라벨을 붙이면 줄이 넘친다 → 아이콘만, 대신 크게
 * 모바일  : 손가락으로 누르는 크기(44px)를 지키고, 보조 기능은 설정 안으로 접는다
 * 아이콘만 남으면 뜻을 아이콘이 다 짊어지므로 라벨이 있을 때보다 키운다. */
@media (max-width: 1099px) {
  /* 상단바와 갤러리 머리글만 아이콘으로 접는다.
     설정·사용법 시트 안의 버튼까지 접으면 '사진 폴더 연결'과 '지금 확인'이
     똑같이 생긴 아이콘 두 개가 되어 무엇을 누르는지 알 수 없다. */
  .topbar .btn .lbl, .panel-head .clear-btn .lbl { display: none; }
  .topbar .btn .ico, .panel-head .clear-btn .ico { margin-right: 0; }
  .topbar .btn, .panel-head .clear-btn { gap: 0; }
  .topbar .btn { padding: 10px; }
  .topbar .btn .ico { width: 22px; height: 22px; }
  #searchForm .btn[data-icon] { width: 44px; height: 44px; }
  .panel-head .clear-btn { padding: 6px 9px; }
}

@media (max-width: 899px) {
  /* 상단바에는 자주 쓰는 것만 남기고 나머지는 설정 안에서 연다.
     여덟 개를 다 두면 줄이 넘쳐 상단바가 부풀고 지도가 눌린다
     (768px 태블릿 세로에서 130px, 360px 휴대폰에서 218px까지 갔다). */
  .only-wide { display: none !important; }
  .btn { padding: 9px; min-width: 44px; min-height: 44px; }
  .btn .ico { width: 21px; height: 21px; }
  #searchForm .btn[data-icon] { width: 44px; height: 44px; }
  .fab[data-icon] > svg { width: 24px; height: 24px; }
  .logo-emoji { width: 38px; height: 38px; padding: 4px; }
}

/* 넓은 화면에서는 상단바에 다 있으므로 설정 안의 중복 버튼을 감춘다 */
@media (min-width: 900px) {
  .only-narrow { display: none !important; }
}

/* 하단 컨트롤(플로팅 버튼 + 재생바): 데스크톱은 기존 절대배치 유지,
 * 모바일에서는 세로로 쌓아 서로 겹치지 않게 한다. */
.map-bottom { display: contents; }

@media (max-width: 767px) {
  .map-bottom {
    display: flex;
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 1000;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
  }

  .map-bottom > * { pointer-events: auto; }

  .fabs {
    position: static;
    flex-direction: row;
    gap: 8px;
  }

  .fab { width: 46px; height: 46px; font-size: 20px; }

  .playbar {
    position: static;
    width: 100%;
    max-width: none;
    padding: 8px 9px;
    gap: 7px;
  }

  .play-btn { padding: 8px 13px; }
  .date-row { gap: 4px; }
  .date-row input[type="date"] { padding: 6px 5px; }
  .mini-btn { min-width: 36px; min-height: 36px; }
  .play-clock { min-width: 56px; padding: 5px 7px; }
}


/* ---------- 설정 · 사용법 시트 ---------- */
.sheet {
  width: min(560px, 94vw);
  /* vh 는 주소창에 덮이기 전 높이라 시트 머리·발이 화면 밖으로 나간다 */
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 3px solid var(--ink);
  background: var(--pink);
}

.sheet-head h2 {
  font-family: var(--font-head);
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sheet-head .ico { font-size: 16px; }

.sheet-body {
  padding: 12px 14px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet-foot {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 3px solid var(--ink);
  background: #fff;
}

.set-group {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}

.set-group h3 {
  font-family: var(--font-head);
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-top: 1.5px dashed #ddd;
  flex-wrap: wrap;
}

.set-group .set-row:first-of-type { border-top: 0; }

.set-label { font-size: 13.5px; flex: 1 1 auto; min-width: 0; }

.set-select {
  font-family: inherit;
  font-size: 13px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 9px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 5px 8px;
  cursor: pointer;
  flex: 0 0 auto;
  max-width: 60%;
}

.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 6px;
  width: 100%;
  margin-top: 4px;
}

.char-pick {
  font-size: 22px;
  line-height: 1;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 0;
  cursor: pointer;
}

.char-pick.on { background: var(--mint); box-shadow: 2px 2px 0 var(--ink); }

.char-pick-img { width: 34px; height: 34px; object-fit: contain; display: block; }

/* 재생바의 캐릭터 버튼과 그 격자 -------------------------------------- */

.char-btn {
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--yellow);
}

/* 크기를 안 잡으면 그림 원본(160px)이 그대로 들어가 재생바를 밀어낸다 */
.char-thumb { width: 30px; height: 30px; object-fit: contain; display: block; }

.char-picker {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  max-height: min(46vh, 320px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.char-picker[hidden] { display: none; }

.char-opt {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 62px;
  padding: 6px 2px 4px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid transparent;
  border-radius: 10px;
  cursor: pointer;
}

.char-opt span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-opt-img { width: 40px; height: 40px; object-fit: contain; }

.char-opt:hover { background: var(--pink); }
.char-opt:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.char-opt.on { border-color: var(--ink); background: var(--yellow); box-shadow: 2px 2px 0 var(--ink); }

@media (max-width: 520px) {
  .char-picker { grid-template-columns: repeat(4, 1fr); left: 8px; right: 8px; }
  .char-opt { width: auto; }
}

.help-sec {
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 11px 13px;
  margin-bottom: 12px;
  font-size: 13.5px;
  line-height: 1.75;
}

.help-sec h3 {
  font-family: var(--font-head);
  font-size: 15px;
  margin-bottom: 6px;
}

.help-sec ol, .help-sec ul { padding-left: 18px; margin: 4px 0; }

.help-sec li { margin: 3px 0; }

.help-sec code {
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  padding: 0 4px;
  font-size: 12.5px;
}

.help-sec a { color: #1450b4; }

/* 기간 재생 */
.range-sep { font-family: var(--font-head); font-size: 13px; padding: 0 1px; }

.mini-btn.on { background: var(--mint); }

.play-days {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 11.5px;
  background: var(--lilac);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* 비슷한 사진 스트립 */
.similar-strip {
  margin-top: 10px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 9px 11px;
  max-width: 100%;
}

.similar-strip h4 { font-family: var(--font-head); font-size: 13.5px; margin-bottom: 6px; }

.similar-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.similar-item {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.similar-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.search-tip {
  font-size: 11.5px;
  color: #666;
  padding: 4px 10px 6px;
  line-height: 1.5;
}


/* ---------- 나머지 움직임도 전부 부드럽게 ---------- */

/* 드롭다운(언어·프로필)과 검색 결과: 살짝 내려오며 나타난다 */
.lang-menu, .profile-menu, .search-results {
  animation: menu-drop .16s cubic-bezier(.2, .9, .25, 1);
  transform-origin: top center;
}

@keyframes menu-drop {
  from { transform: translateY(-6px) scale(.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* 기간 재생 날짜 칸이 나타날 때 */
.date-row input[type="date"], .range-sep, .play-days {
  animation: menu-drop .18s cubic-bezier(.2, .9, .25, 1);
}

/* 갤러리 썸네일·스팟 마커의 눌림 반응을 부드럽게 */
.thumb, .btn, .mini-btn, .clear-btn, .fab, .dock-btn, .day-play, .char-pick, .set-select {
  transition: transform .12s cubic-bezier(.2, .9, .25, 1), box-shadow .12s ease, background .15s ease;
}

/* 사진 마커: 팝업이 열릴 때 커지는 동작을 더 말랑하게 */
.photo-marker { transition: transform .18s cubic-bezier(.2, .9, .25, 1); }

/* 지도 팝업이 뜰 때도 톡 튀지 않게 */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  animation: popup-rise .18s cubic-bezier(.2, .9, .25, 1);
}

@keyframes popup-rise {
  from { transform: translateY(6px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* 비슷한 사진 스트립이 펼쳐질 때 */
.similar-strip { animation: menu-drop .2s cubic-bezier(.2, .9, .25, 1); }

/* 움직임을 줄이는 설정을 켠 사용자에게는 애니메이션을 최소화한다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ---------- 직접 그린 아이콘 (icons.js) ---------- */
[data-icon] > svg, .ico > svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* 버튼 안의 아이콘 자리 */
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.btn, .clear-btn, .day-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 아이콘만 있는 버튼 — 크기가 이미 정해진 것들만 여백을 없앤다.
   상단바 버튼까지 여기 넣으면 아이콘 크기로 쪼그라들어(28px) 옆 버튼(47px)과 어긋난다. */
.fab[data-icon], .dock-btn[data-icon], .mini-btn[data-icon],
.play-btn[data-icon], .clear-btn[data-icon] {
  padding: 0;
}

/* 상단바의 아이콘 전용 버튼(검색)은 라벨 있는 버튼과 같은 높이의 정사각형으로 */
#searchForm .btn[data-icon] {
  padding: 0;
  width: 47px;
  height: 47px;
  flex: 0 0 auto;
}

#searchForm .btn[data-icon] > svg { width: 23px; height: 23px; }
.fab[data-icon] > svg { width: 26px; height: 26px; }
.dock-btn[data-icon] > svg { width: 26px; height: 26px; }
.mini-btn[data-icon] > svg { width: 20px; height: 20px; }
.play-btn[data-icon] > svg { width: 24px; height: 24px; }
.clear-btn[data-icon] > svg { width: 17px; height: 17px; }

/* 상단 로고 */
.logo-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 5px;
}

.logo-emoji > svg { width: 100%; height: 100%; }

/* 설정 그룹 제목 */
.set-group h3 .ico { width: 18px; height: 18px; }

/* 추천 스팟 마커 */
.spot-marker > svg { width: 27px; height: 27px; display: block; }

/* 빈 화면 안내 그림 -- 아이콘 두 개 대신 그림 한 장으로 바꿨다.
   처음 들어온 사람이 가장 먼저 보는 자리라 여기가 앱의 첫인상이다. */
.empty-line {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  line-height: 1.5;
  margin: 0;
}

.empty-line img { flex: none; object-fit: contain; }

/* 프로필 버튼 */
#profileBtn { display: inline-flex; align-items: center; gap: 5px; }
#profileBtn .pname { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 위치 없는 사진 제목 */
.nogps h3 { display: flex; align-items: center; gap: 6px; }
.nogps h3 .ico { width: 17px; height: 17px; }

/* 드롭 힌트 */
.drop-card { display: inline-flex; align-items: center; gap: 8px; }
.drop-card .ico { width: 22px; height: 22px; }

/* 480px 이하에서는 라벨을 숨기므로 아이콘 여백만 정리 */
@media (max-width: 480px) {
  .btn .ico, .clear-btn .ico { margin-right: 0; }
  .btn, .clear-btn { gap: 0; }
}


/* ---------- 갤러리 폭 조절 손잡이 ---------- */
/* 데스크톱에서 패널 왼쪽 모서리를 잡아 끌면 갤러리 폭이 바뀐다.
   칸 수는 auto-fill 이라 폭을 바꾸면 알아서 따라온다. */
.panel-resizer {
  position: absolute;
  left: -5px;
  top: 0;
  bottom: 0;
  width: 11px;
  cursor: col-resize;
  z-index: 20;
  background: transparent;
  border: 0;
  padding: 0;
  touch-action: none;
}

.panel-resizer::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 46px;
  border-radius: 3px;
  background: var(--ink);
  opacity: 0;
  transition: opacity .15s ease;
}

.panel-resizer:hover::before,
.panel-resizer:focus-visible::before,
body.resizing .panel-resizer::before { opacity: .45; }

body.resizing { cursor: col-resize; user-select: none; }

/* 폭을 끄는 동안에는 지도 위 마우스 이벤트를 막아 끌기가 끊기지 않게 한다 */
body.resizing #map { pointer-events: none; }

@media (max-width: 767px) {
  .panel-resizer { display: none; } /* 모바일은 시트라서 폭 개념이 없다 */
}


/* 문장 안에 섞이는 아이콘 — 글줄 높이에 맞춰 정렬한다.
   이모지는 글꼴마다 베이스라인이 달라 같은 줄에서도 위아래로 튀었다. */
.ico-inline {
  display: inline-flex;
  width: 1.05em;
  height: 1.05em;
  vertical-align: -0.17em;
  margin-right: 4px;
}

.ico-inline > svg { width: 100%; height: 100%; }

/* 검색 결과 줄: 아이콘과 글자를 같은 줄에 맞춘다 */
.search-results button, .search-results h4 {
  display: flex;
  align-items: center;
  gap: 7px;
}

.search-results h4 .ico-inline, .search-results button .ico-inline {
  flex: 0 0 auto;
  margin-right: 0;
}

/* 기간 필터가 켜져 있음을 알리는 표시 */
/* 켜져 있는 상태를 눈에 띄게 — 이제 둘 다 큰 버튼이다.
   (아이콘 색이 고정이라 배경을 어둡게 하면 아이콘이 묻힌다 → 안쪽 테두리로 표시) */
#rangeBtn.on, #rangeOnly.on {
  background: var(--mint);
  box-shadow: 2px 2px 0 var(--ink), inset 0 0 0 3px var(--ink);
}

/* 지나온 자취 — 지도(파스텔 크림·초록·하늘)와 겹치지 않는 진한 분홍.
   원래 파란 선은 바다·강 색과 섞여 잘 안 보였다. */
.leaflet-pane path.trail-dot { transition: none; }
/* 발자국 전용 팬 — 캐릭터(마커 팬)보다 아래에 깔린다 */
.leaflet-trail-pane { pointer-events: none; }


/* 아주 좁은 화면(360px 전후)에서는 앱 이름을 접고 사진기 아이콘만 남긴다.
   이름까지 두면 검색창이 눌려 글자를 못 읽는다. */
/* 아주 좁은 화면(430px 전후)에서는 앱 이름을 접고 사진기 아이콘만 남긴다.
   검색창도 그대로 두면 46px까지 눌려 글자가 안 보이므로, 평소엔 돋보기 버튼만
   두고 누르면 상단바를 덮으며 펼쳐지게 한다. */
@media (max-width: 479px) {
  .logo-text { display: none; }
  .topbar { padding: 7px 8px; gap: 6px; position: relative; }
  .search { flex: 0 0 auto; }
  .search input { display: none; }

  .topbar.search-open .search {
    position: absolute;
    left: 8px; right: 8px; top: 7px;
    z-index: 40;
    display: flex;
    gap: 6px;
    flex: 1 1 auto;
  }

  .topbar.search-open .search input {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px; /* 16px 미만이면 iOS가 화면을 확대해 버린다 */
    padding: 10px 12px;
  }

  .topbar.search-open .search-results { top: calc(100% + 6px); }
}
