/* PC: 네이버·카카오 지도처럼 왼쪽에 붙은 패널 + 오른쪽 전체 지도. 지도와 사진이 주인공이다. */
:root { --side: 392px; }
body.pc { overflow: hidden; background: var(--surface-2); }

/* ---------- 왼쪽 패널 ---------- */
.side { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side); z-index: 20; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border); box-shadow: 2px 0 12px rgba(0, 0, 0, .06);
  transition: transform .22s ease; }
body.side-closed .side { transform: translateX(-100%); }
.side-head { display: flex; align-items: center; padding: 14px 18px 10px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -.03em; }
.brand .brand-mark { width: 30px; height: 30px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--c, var(--primary)); color: #fff;
  font-weight: 700; cursor: pointer; font-size: 14px; }

.side-filters { display: flex; align-items: center; gap: 6px; padding: 10px 16px 2px; overflow-x: auto; scrollbar-width: none; }
.side-filters::-webkit-scrollbar { display: none; }
.pill-select { height: 32px; padding: 0 28px 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: 13px; color: var(--text); cursor: pointer; flex: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c877e' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; }
.people { display: flex; gap: 6px; }
.chip { height: 32px; font-size: 13px; }

.tabs { display: flex; padding: 0 16px; margin-top: 10px; border-bottom: 1px solid var(--border); }
.tabs button { height: 44px; padding: 0 4px; margin-right: 18px; border: 0; background: none; border-bottom: 2px solid transparent;
  font-weight: 700; font-size: 15px; color: var(--text-3); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--text); }
.side-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px 6px; font-size: 13px; color: var(--text-2); }
.side-summary .link { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; white-space: nowrap; }
.side-summary .link:hover { text-decoration: underline; }
.side-summary b { color: var(--primary); font-weight: 800; }
.side-body { flex: 1; overflow-y: auto; padding: 0 0 24px; }

.side-handle { position: fixed; top: 50%; left: var(--side); z-index: 19; width: 22px; height: 52px; margin-top: -26px; padding: 0;
  border: 1px solid var(--border); border-left: 0; border-radius: 0 8px 8px 0; background: var(--surface); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer; box-shadow: 3px 0 8px rgba(0, 0, 0, .08); transition: left .22s ease; }
.side-handle .icon { width: 16px; height: 16px; }
body.side-closed .side-handle { left: 0; }

/* 목록: 날짜별 묶음 + 한 줄에 사진·장소·지역·시각·기록 */
.day-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 8px; padding: 14px 18px 8px;
  background: var(--surface); }
.day-h b { font-size: 14px; font-weight: 800; }
.day-h span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; gap: 12px; width: 100%; padding: 10px 18px; border: 0; background: none; text-align: left; cursor: pointer;
  color: var(--text); align-items: center; }
.row:hover, .row.hl { background: var(--surface-2); }
.row.sel { background: var(--primary-soft); }
.row img { width: 68px; height: 68px; flex: none; border-radius: 10px; object-fit: cover; background: var(--surface-3); }
.row .tx { min-width: 0; flex: 1; display: grid; gap: 2px; }
.row .tx b { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .memo { font-size: 13px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who { display: inline-flex; align-items: center; gap: 4px; }
.more { display: block; width: calc(100% - 36px); margin: 12px 18px 0; }
.panel-empty { padding: 56px 24px; text-align: center; color: var(--text-2); font-size: 14px; line-height: 1.6; }
.panel-empty .icon { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 10px; }
.panel-empty .btn { margin-top: 14px; }

/* 다녀온 지역 */
.region { border-bottom: 1px solid var(--border); }
.region > button, .region .sub button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px;
  border: 0; background: none; cursor: pointer; text-align: left; color: var(--text); }
.region > button:hover, .region .sub button:hover { background: var(--surface-2); }
.region .nm { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; }
.region .nm small { display: block; font-weight: 400; font-size: 12px; color: var(--text-3); margin-top: 1px; }
.region .n { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-2); min-width: 34px; text-align: right; }
.region .meter { width: 72px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.region .meter i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.region .sub { padding-bottom: 6px; }
.region .sub button { padding: 8px 18px 8px 34px; }
.region .sub .nm { font-size: 14px; font-weight: 600; }
.region .caret { width: 16px; height: 16px; color: var(--text-3); transition: transform .15s; }
.region.open .caret { transform: rotate(180deg); }

/* ---------- 사진 상세 (패널 안) ---------- */
.detail { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--surface);
  animation: detail-in .18s ease-out; }
@keyframes detail-in { from { transform: translateX(-12px); opacity: 0; } }
.d-top { display: flex; align-items: center; gap: 2px; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.d-top .ttl { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.d-top .pos { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; padding: 0 2px; }
.d-scroll { flex: 1; overflow-y: auto; }
.d-photo { position: relative; overflow: hidden; background: #111; width: 100%; aspect-ratio: var(--ar, 4 / 3); max-height: 360px;
  min-height: 200px; cursor: zoom-in; isolation: isolate; }
/* 사진 비율이 칸과 다를 때 남는 곳은 같은 사진을 흐리게 깔아 채운다 */
.d-photo .bg { position: absolute; inset: -24px; background: center / cover no-repeat; filter: blur(22px) brightness(.55);
  transform: scale(1.1); z-index: -1; }
.d-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.d-photo .nav { position: absolute; top: 50%; width: 36px; height: 36px; margin-top: -18px; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.d-photo:hover .nav { opacity: 1; }
.d-photo .nav.prev { left: 10px; } .d-photo .nav.next { right: 10px; }
.d-photo .zoom { position: absolute; right: 10px; bottom: 10px; padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, .5);
  color: #fff; font-size: 12px; pointer-events: none; }
.d-strip { display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.d-strip button { flex: none; width: 48px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: var(--surface-2); cursor: pointer; opacity: .7; }
.d-strip button[aria-current="true"] { border-color: var(--primary); opacity: 1; }
.d-strip img { width: 100%; height: 100%; object-fit: cover; }
.d-body { padding: 18px 20px 22px; display: grid; gap: 14px; }
.d-title h2 { margin: 0; font-size: 21px; letter-spacing: -.03em; line-height: 1.35; }
.d-title p { margin: 4px 0 0; color: var(--text-2); font-size: 14px; }
.d-info { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--text-2); }
.d-info li { display: flex; align-items: center; gap: 10px; }
.d-info .icon { width: 17px; height: 17px; color: var(--text-3); }
.d-content { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.7; padding: 14px 16px;
  background: var(--surface-2); border-radius: 12px; }
.d-content.empty { color: var(--text-3); font-size: 14px; }
.d-small { font-size: 12px; color: var(--text-3); }
.d-actions { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--border); }
.d-actions > * { display: grid; justify-items: center; gap: 4px; padding: 12px 4px; border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--text-2); text-decoration: none; }
.d-actions > *:hover { background: var(--surface-2); color: var(--text); }
.d-actions .icon { width: 20px; height: 20px; }
.d-actions .danger { color: var(--danger); }
.d-edit { display: grid; gap: 12px; }

/* 크게 보기 */
.lightbox { position: fixed; inset: 0; z-index: 900; background: rgba(8, 8, 8, .94); display: grid; place-items: center; animation: fade .15s; }
.lightbox img { max-width: calc(100vw - 120px); max-height: calc(100vh - 100px); object-fit: contain; }
.lightbox .cap { position: absolute; left: 0; right: 0; bottom: 20px; text-align: center; color: #eee; font-size: 14px; }
.lightbox button { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12);
  color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .22); }
.lightbox .x { top: 18px; right: 18px; } .lightbox .prev { left: 24px; top: 50%; margin-top: -24px; } .lightbox .next { right: 24px; top: 50%; margin-top: -24px; }

/* ---------- 지도 ---------- */
.map-area { position: fixed; top: 0; right: 0; bottom: 0; left: var(--side); transition: left .22s ease; }
body.side-closed .map-area { left: 0; }
#map { position: absolute; inset: 0; background: #f2efe9; }

.map-top { position: absolute; top: 14px; right: 14px; z-index: 10; display: flex; gap: 8px; align-items: center; }
.map-top .avatar { width: 40px; height: 40px; font-size: 15px; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.map-bottom { position: absolute; right: 14px; bottom: 28px; z-index: 10; display: flex; align-items: flex-end; gap: 8px; }
.map-menu-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.map-menu-btn:hover { background: var(--primary-hover); }
.map-menu-btn .icon { width: 20px; height: 20px; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: none; font-weight: 600; font-size: 13px;
  color: var(--text-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); }

.map-ctrl { display: grid; gap: 8px; }
.map-ctrl .grp { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12); overflow: hidden; }
.map-ctrl button { width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center; cursor: pointer; color: var(--text); }
.map-ctrl button:hover { background: var(--surface-2); }
.map-ctrl button:disabled { opacity: .5; cursor: progress; }
.map-ctrl .grp button + button { border-top: 1px solid var(--border); }
.map-ctrl .icon { width: 19px; height: 19px; }

.map-note { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: calc(100% - 120px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px 14px 18px; box-shadow: var(--shadow-2); }
.map-note > .icon { width: 28px; height: 28px; color: var(--primary); flex: none; }
.map-note .tx b { display: block; font-size: 15px; }
.map-note .tx span { font-size: 13px; color: var(--text-2); }
.map-note code { font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.map-note.err > .icon { color: var(--warn); }
.map-note .btn { flex: none; }

/* 사진 마커: 한 장 = 사진 + 꼬리, 여러 장 = 겹친 사진 + 장수. 올리면 이름표 */
.pm { position: relative; display: block; width: 54px; height: 64px; padding: 0; border: 0; background: none; cursor: pointer;
  transform-origin: 50% 100%; transition: transform .15s ease-out; }
.pm .frame { position: absolute; left: 0; top: 0; width: 54px; height: 54px; border-radius: 12px; overflow: hidden;
  border: 3px solid #fff; background: #ddd; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); z-index: 2; }
.pm .frame img { width: 100%; height: 100%; object-fit: cover; }
.pm .tail { position: absolute; left: 50%; bottom: 3px; width: 12px; height: 12px; margin-left: -6px; background: #fff;
  transform: rotate(45deg); box-shadow: 2px 2px 3px rgba(0, 0, 0, .2); z-index: 1; }
.pm .who { position: absolute; left: -3px; bottom: 7px; z-index: 3; width: 12px; height: 12px; border-radius: 50%; background: var(--c);
  border: 2px solid #fff; }
.pm .sheet { position: absolute; left: 0; top: 0; width: 54px; height: 54px; border-radius: 12px; background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .3); }
.pm .sheet.s1 { transform: rotate(8deg) translate(5px, -2px); }
.pm .sheet.s2 { transform: rotate(-7deg) translate(-4px, -1px); }
.pm .count { position: absolute; top: -8px; right: -10px; z-index: 3; min-width: 24px; height: 24px; padding: 0 7px;
  border-radius: 12px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px;
  border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); font-variant-numeric: tabular-nums; }
.pm .tip { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); z-index: 4; padding: 5px 10px;
  border-radius: 8px; background: #1f1f1f; color: #fff; font: 600 12px/1.35 var(--font); white-space: nowrap; pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); opacity: 0; transition: opacity .12s; }
.pm .tip small { display: block; font-weight: 400; color: #bbb; font-size: 11px; }
.pm:hover, .pm.hl { transform: scale(1.1); }
.pm:hover .tip, .pm.hl .tip, .pm.sel .tip { opacity: 1; }
.pm.sel { transform: scale(1.22); }
.pm.sel .frame { border-color: var(--primary); }
.pm.sel .tail { background: var(--primary); }

/* 내 위치 · 검색 핀 */
.me-dot { position: relative; width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .45); }
.me-dot::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; background: rgba(26, 115, 232, .22);
  animation: me-pulse 2s ease-out infinite; z-index: -1; }
@keyframes me-pulse { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }
.search-pin { display: flex; flex-direction: column; align-items: center; pointer-events: none; animation: pin-drop .25s ease-out; }
.search-pin .lbl { margin-bottom: 4px; padding: 5px 11px; border-radius: 999px; background: #1f1f1f; color: #fff;
  font: 700 12.5px/1.3 var(--font); white-space: nowrap; box-shadow: var(--shadow-2); }
.search-pin svg { width: 30px; height: 39px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
@keyframes pin-drop { from { transform: translateY(-14px); opacity: 0; } }

/* ---------- 검색창 (패널 맨 위, 지도 앱처럼 크게) ---------- */
.map-search { position: relative; margin: 2px 16px 0; }
.map-search .field { height: 46px; padding: 0 40px 0 44px; border-radius: 12px; border: 2px solid var(--primary);
  background: var(--surface); font-size: 15px; }
.map-search .field:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.map-search .field::-webkit-search-cancel-button { display: none; }
.map-search > .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px;
  color: var(--primary); pointer-events: none; }
.map-search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 600 11px/1 var(--font);
  color: var(--text-3); border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; background: var(--surface); }
.map-search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: none; color: var(--text-3); display: grid; place-items: center; cursor: pointer; }
.map-search .clear:hover { background: var(--surface-2); color: var(--text); }
.map-search .clear .icon { width: 16px; height: 16px; }
.search-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: calc(100vh - 140px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; z-index: 40; }
.search-group + .search-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 2px; }
.search-group h3 { margin: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.search-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none;
  border-radius: 10px; text-align: left; cursor: pointer; color: var(--text); }
.search-item[aria-selected="true"] { background: var(--surface-2); }
.search-item img, .search-item .ic { width: 40px; height: 40px; flex: none; border-radius: 9px; object-fit: cover;
  background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.search-item[aria-selected="true"] .ic { background: var(--surface-3); }
.search-item .ic .icon { width: 18px; height: 18px; }
.search-item .tx { min-width: 0; flex: 1; }
.search-item b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item .tx > span { display: block; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item .n { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.search-item mark { background: color-mix(in srgb, var(--primary) 24%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 12px; color: var(--text-2); font-size: 14px; }
.search-empty.small { font-size: 12px; color: var(--text-3); padding-top: 4px; }

/* ---------- 사진 추가 창 ---------- */
.modal-scrim { position: fixed; inset: 0; z-index: 700; background: var(--scrim); display: grid; place-items: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(1040px, 94vw); height: min(820px, 90vh); display: flex; flex-direction: column; background: var(--bg);
  border-radius: 18px; box-shadow: var(--shadow-2); overflow: hidden; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head p { margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.modal-head .grow { flex: 1; }
.modal-body { flex: 1; overflow-y: auto; padding: 20px; }
.modal-foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: var(--surface); border-top: 1px solid var(--border); }
.modal-foot .sum { flex: 1; font-size: 14px; color: var(--text-2); }
.modal-foot .sum b { color: var(--text); }
.modal-foot .sum .warn { color: var(--warn); font-weight: 600; }
.dropzone { display: grid; place-items: center; text-align: center; gap: 6px; padding: 48px 20px; border: 2px dashed var(--border);
  border-radius: 16px; background: var(--surface); color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .icon { width: 40px; height: 40px; color: var(--primary); }
.dropzone b { font-size: 16px; color: var(--text); }
.dropzone small { font-size: 12px; color: var(--text-3); }
.dropzone.compact { display: flex; justify-content: center; align-items: center; padding: 14px; gap: 10px; }
.dropzone.compact .icon { width: 22px; height: 22px; }
.dropzone.compact b { font-size: 14px; }
.u-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 12px; margin-top: 16px; }

.drop-hint { position: fixed; inset: 0; z-index: 650; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 22%, transparent);
  backdrop-filter: blur(2px); pointer-events: none; }
.drop-hint > div { display: grid; justify-items: center; gap: 6px; padding: 32px 48px; background: var(--surface); border-radius: 20px;
  border: 2px dashed var(--primary); box-shadow: var(--shadow-2); }
.drop-hint .icon { width: 40px; height: 40px; color: var(--primary); }
.drop-hint b { font-size: 18px; }
.drop-hint span { color: var(--text-2); font-size: 14px; }

/* 좁은 화면: 패널이 지도 위에 겹친다 */
@media (max-width: 1000px) {
  :root { --side: 360px; }
  .map-area, body.side-closed .map-area { left: 0; }
  .map-bottom .seg { display: none; }
}
