*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── 로그인 모달 ── */
#login-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
#login-modal {
  background: #fff; border-radius: 16px;
  padding: 28px 28px 24px; width: 320px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#login-modal h3 { font-size: 17px; font-weight: 600; text-align: center; }
#login-modal input {
  width: 100%; padding: 10px 12px;
  border: 1px solid #d2d2d7; border-radius: 8px;
  font-size: 15px; outline: none;
}
#login-modal input:focus { border-color: #0071e3; }
#login-error { font-size: 13px; color: #ff3b30; text-align: center; }
.login-actions { display: flex; gap: 8px; margin-top: 4px; }
.login-actions button {
  flex: 1; padding: 10px;
  border-radius: 8px; border: none;
  font-size: 15px; cursor: pointer; font-weight: 500;
}
#btn-login-cancel { background: #e5e5ea; color: #1d1d1f; }
#btn-login-ok     { background: #0071e3; color: #fff; }
#btn-login-cancel:hover { background: #d2d2d7; }
#btn-login-ok:hover     { background: #0077ed; }
.login-guest-hint { font-size: 12px; color: #aeaeb2; text-align: center; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
}

#app { max-width: clamp(1200px, 96vw, 2000px); margin: 0 auto; padding: 0 16px; }

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 14px;
  border-bottom: 1px solid #d2d2d7;
}
header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; cursor: pointer; user-select: none; }

.header-right { display: flex; align-items: center; gap: 10px; }

#auth-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #6e6e73; }
#auth-user { font-weight: 500; color: #1d1d1f; }
#btn-login, #btn-logout {
  padding: 4px 10px; font-size: 12px;
  border: 1px solid #d2d2d7; border-radius: 6px;
  background: #f5f5f7; cursor: pointer;
  transition: background 0.15s;
}
#btn-login:hover, #btn-logout:hover { background: #e5e5ea; }

#btn-help {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid #d2d2d7;
  background: #f5f5f7;
  font-size: 14px; font-weight: 700;
  color: #6e6e73; cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
#btn-help:hover { background: #e5e5ea; }

.view-tabs { display: flex; gap: 4px; background: #e5e5ea; border-radius: 8px; padding: 3px; }

/* ── Help tooltip ── */
.help-wrap { position: relative; }

#help-tip {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  border: 1px solid #e5e5ea;
  z-index: 500;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}

.ht-section { display: flex; flex-direction: column; gap: 8px; }

.ht-label {
  font-size: 11px; font-weight: 700;
  color: #aeaeb2; text-transform: uppercase; letter-spacing: 0.5px;
}

.ht-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #3a3a3c; line-height: 1.4;
}

.ht-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  background: #f0f0f5;
  border-radius: 6px;
  font-size: 12px; font-weight: 600;
  color: #1d1d1f;
  min-width: 48px; text-align: center;
}

.ht-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 10px;
  font-size: 13px;
}

.ht-key {
  font-weight: 600; color: #1d1d1f;
  white-space: nowrap;
}

.ht-grid span:not(.ht-key) { color: #6e6e73; }

.ht-desc { font-size: 13px; color: #6e6e73; line-height: 1.6; }

.ht-divider { height: 1px; background: #f0f0f0; }
.view-tabs .tab {
  padding: 7px 22px; border: none; background: transparent;
  border-radius: 6px; font-size: 14px; cursor: pointer; font-weight: 500; color: #666;
  transition: all 0.15s;
}
.view-tabs .tab.active { background: #fff; color: #1d1d1f; box-shadow: 0 1px 3px rgba(0,0,0,.15); }

#map-prefetch-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #0071e3;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
  animation: prefetchPulse 1s ease-in-out infinite;
}
@keyframes prefetchPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Filter panel ── */
.filter-panel {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Filter fields grid (label + inputs) ── */
.filter-fields {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ff-row {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  min-height: 44px;
  gap: 0;
}

.ff-label {
  font-size: 12px;
  color: #8e8e93;
  font-weight: 500;
  white-space: nowrap;
  padding-right: 8px;
  user-select: none;
}

.ff-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.ff-sep {
  color: #aeaeb2;
  font-size: 13px;
  flex-shrink: 0;
}

.ff-vsep {
  width: 1px;
  height: 22px;
  background: #d2d2d7;
  flex-shrink: 0;
  margin: 0 6px;
  align-self: center;
}

.fp-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 4px 0;
}

.filter-panel input,
.filter-panel select {
  padding: 9px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fafafa;
  color: #1d1d1f;
  transition: border-color 0.15s;
  min-height: 40px;
}
.filter-panel input:focus,
.filter-panel select:focus { border-color: #0071e3; background: #fff; }

/* combo-wrap: input + ✕ 버튼 */
.combo-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.combo-wrap input { padding-right: 28px; }
.combo-clear {
  position: absolute; right: 6px;
  background: none; border: none; padding: 0;
  font-size: 12px; color: #aeaeb2; cursor: pointer;
  line-height: 1;
}
.combo-clear:hover { color: #6e6e73; }
#btn-time-clear { position: static; margin-left: 2px; font-size: 14px; }
#btn-date-range-clear { position: static; margin-left: 2px; font-size: 14px; }
.ff-select { width: auto; min-width: 0; padding: 9px 8px !important; }
.ff-select[id*="year"] { width: 78px; }
.ff-select[id*="month"] { width: 62px; }
.ff-select-day { width: 54px; }

/* ── 커스텀 드롭다운 ── */
.custom-dd {
  position: fixed;
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.14);
  max-height: 240px;
  overflow-y: auto;
  z-index: 9999;
  padding: 4px 0;
}
.dd-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  color: #1d1d1f;
  white-space: nowrap;
}
.dd-item:hover,
.dd-item.dd-focused { background: #f0f0f5; }
.dd-item.dd-selected { color: #0071e3; font-weight: 500; }

/* ── 커스텀 셀렉트 (앨범) ── */
.cs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 10px 9px 12px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  background: #fafafa;
  color: #1d1d1f;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  min-height: 40px;
  transition: border-color 0.15s;
}
.cs-btn:hover,
.cs-btn:focus { border-color: #0071e3; background: #fff; outline: none; }
.cs-btn .cs-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.cs-btn .cs-arrow { font-size: 10px; color: #8e8e93; flex-shrink: 0; }

/* 인풋 너비 */
#f-trip    { min-width: 200px; max-width: 100%; }
#cs-trip   { min-width: 200px; max-width: 100%; }
#cs-radius { flex: none; width: auto; min-width: 0; padding-right: 8px; }
#f-year    { min-width: 80px; }
#f-month   { min-width: 80px; }
#f-province { min-width: 90px; }
#f-city    { min-width: 90px; }
#f-district { min-width: 90px; }
#f-time-from,
#f-time-to { width: 76px; }
#f-near    { flex: 1; min-width: 160px; }

/* 숫자 입력 spinner 제거 */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { display: none; }

#f-radius {
  padding: 0 8px;
  height: 40px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  background: #fafafa;
  font-size: 13px;
  color: #1d1d1f;
  cursor: pointer;
  flex-shrink: 0;
}

.tag-filter-row { padding: 0 4px 4px; }
.tag-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
  overflow: hidden; max-height: 36px;
  padding: 2px 0 4px;
  transition: max-height 0.25s ease;
}
.tag-chips.expanded { max-height: 400px; }
.tag-actions-row {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 2px;
}
.tags-toggle-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: #636366; padding: 2px 8px;
}
.tags-toggle-btn:hover { color: #1d1d1f; }
.tag-match-btn {
  font-size: 11px; padding: 2px 10px; border-radius: 100px;
  border: 1px solid #636366; background: none; color: #636366;
  cursor: pointer; font-weight: 600; letter-spacing: 0.3px;
}
.tag-match-btn.or-mode { border-color: #1d1d1f; color: #1d1d1f; background: #f0f0f0; }
.tag-match-btn:hover { border-color: #1d1d1f; color: #1d1d1f; }
.tag-chip {
  padding: 5px 14px;
  border: 1px solid #d2d2d7; border-radius: 20px;
  background: #fafafa; font-size: 13px; cursor: pointer;
  transition: all 0.15s; white-space: nowrap; flex-shrink: 0;
}
.tag-chip:hover  { background: #e9e9eb; }
.tag-chip.active { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.tag-chip.all-chip.active { background: #636366; border-color: #636366; }
.tag-chip-label { cursor: pointer; }
.tag-chip-del {
  display: none; margin-left: 4px; padding: 0 2px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: inherit; opacity: 0.6; line-height: 1;
}
.tag-chip:hover .tag-chip-del { display: inline; }
.tag-chip-del:hover { opacity: 1; }

.toggle-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.toggle-btn {
  padding: 6px 14px;
  background: #f0f0f5; color: #444;
  border: 1px solid #d2d2d7; border-radius: 100px;
  font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
}
.toggle-btn:hover { background: #e5e5ea; }
.toggle-btn.active { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }

.media-type-seg {
  display: flex;
  border: 1px solid #d2d2d7;
  border-radius: 100px;
  overflow: hidden;
  background: #f0f0f5;
}
.seg-btn {
  padding: 6px 12px;
  background: none; color: #444;
  border: none; border-radius: 0;
  font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
}
.seg-btn + .seg-btn { border-left: 1px solid #d2d2d7; }
.seg-btn:hover { background: #e5e5ea; }
.seg-btn.active { background: #1d1d1f; color: #fff; }

#btn-reset.reset-link {
  margin-left: auto;
  background: none; border: none;
  color: #888; font-size: 13px;
  cursor: pointer; padding: 4px 6px;
  text-decoration: underline; text-underline-offset: 2px;
  transition: color 0.15s;
}
#btn-reset.reset-link:hover { color: #333; }

/* ── Detect bar ── */
.detect-bar { margin: 0 0 10px; display: flex; gap: 10px; flex-wrap: wrap; }

#btn-import {
  padding: 8px 18px;
  background: linear-gradient(135deg, #55efc4, #00b894);
  color: #fff; border: none; border-radius: 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity 0.15s;
}
#btn-import:hover { opacity: 0.85; }

#btn-edit-mode {
  padding: 8px 18px;
  background: #fff; border: 1.5px solid #c7c7cc;
  color: #1d1d1f; border-radius: 20px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
#btn-edit-mode:hover { background: #f0f0f2; }
#btn-edit-mode.active { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }

/* ── Edit action bar ── */
#edit-action-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #1d1d1f; color: #fff;
  padding: 10px 16px; border-radius: 12px; margin-bottom: 12px;
}
#edit-selected-count { font-size: 14px; font-weight: 600; flex: 1; }
#edit-action-bar button {
  padding: 7px 16px; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
#btn-select-all  { background: rgba(255,255,255,.15); color: #fff; }
#btn-remove-from-current-album { background: #ff9f0a; color: #1d1d1f; }
#btn-new-album   { background: #0a84ff; color: #fff; }
#btn-add-to-album { background: #30d158; color: #fff; }
#btn-bulk-tag     { background: #636366; color: #fff; }
#btn-bulk-delete  { background: #ff3b30; color: #fff; }
#btn-edit-cancel  { background: rgba(255,255,255,.15); color: #fff; }

/* ── 벌크 태그 바 ── */
#bulk-tag-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 300;
  display: flex; align-items: center; gap: 8px;
  background: #2c2c2e; padding: 8px 16px; border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
#bulk-tag-input {
  flex: 1; padding: 7px 12px; border-radius: 8px;
  border: 1px solid #48484a; background: #1c1c1e; color: #fff;
  font-size: 14px; outline: none; max-width: 260px;
}
#bulk-tag-input:focus { border-color: #636366; }
#bulk-tag-input::placeholder { color: #636366; }
#btn-bulk-tag-add    { background: #636366; color: #fff; padding: 7px 14px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
#btn-bulk-tag-remove { background: #3a3a3c; color: #ff453a; padding: 7px 14px; border: 1px solid #ff453a; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
#btn-bulk-tag-close  { background: none; border: none; color: #8e8e93; font-size: 16px; cursor: pointer; padding: 4px 6px; }

/* Photo selection overlay */
.photo-card.selected::after {
  content: '✓';
  position: absolute; inset: 0;
  background: rgba(10,132,255,.35);
  display: flex; align-items: flex-start; justify-content: flex-end;
  padding: 8px; font-size: 20px; font-weight: 700; color: #fff;
  border-radius: 12px;
  pointer-events: none;
}
.photo-card { position: relative; }

/* ── New album / pick album modals ── */
#new-album-overlay, #pick-album-overlay, #album-edit-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 3000;
  display: flex; align-items: center; justify-content: center;
}
#new-album-modal, #pick-album-modal {
  background: #fff; border-radius: 16px;
  padding: 24px; width: 320px;
  display: flex; flex-direction: column; gap: 14px;
}
#new-album-modal h3, #pick-album-modal h3 { margin: 0; font-size: 17px; }
#new-album-name,
#new-album-description {
  width: 100%; padding: 10px 12px; border: 1px solid #d2d2d7;
  border-radius: 10px; font-size: 15px; box-sizing: border-box;
}
#new-album-description {
  resize: vertical; min-height: 58px; font-family: inherit; font-weight: 400;
}
.new-album-actions { display: flex; gap: 8px; justify-content: flex-end; }
.new-album-actions button {
  padding: 9px 20px; border: none; border-radius: 10px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.new-album-actions button:first-child { background: #f0f0f2; color: #1d1d1f; }
.new-album-actions button:last-child  { background: #0a84ff; color: #fff; }

#pick-album-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.pick-album-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid #e5e5ea; transition: border-color 0.15s;
}
.pick-album-item.selected { border-color: #0a84ff; background: #f0f6ff; }
.pick-album-item-name { font-size: 14px; font-weight: 600; flex: 1; }
.pick-album-item-count { font-size: 12px; color: #6e6e73; }

/* ── Album edit modal ── */
#album-edit-modal {
  background: #fff; border-radius: 16px;
  padding: 24px; width: min(92vw, 780px);
  max-height: 85vh; display: flex; flex-direction: column; gap: 12px;
}
.album-edit-header { display: flex; align-items: center; justify-content: space-between; }
.album-edit-header h3 { margin: 0; font-size: 17px; }
#btn-album-edit-close {
  background: none; border: none; font-size: 18px; cursor: pointer; color: #6e6e73;
}
.album-edit-name-row {
  margin: 8px 0 4px;
  display: flex; flex-direction: column; gap: 8px;
}
.album-edit-name-input,
.album-edit-description-input {
  width: 100%; box-sizing: border-box;
  font-size: 15px; font-weight: 600;
  padding: 6px 10px; border: 1px solid #d2d2d7; border-radius: 8px;
  outline: none; font-family: inherit;
}
.album-edit-description-input {
  resize: vertical; min-height: 54px; font-size: 14px; font-weight: 400;
}
.album-edit-name-input:focus,
.album-edit-description-input:focus { border-color: #1d1d1f; }
.album-edit-scope-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.album-edit-hint { margin: 0; font-size: 13px; color: #6e6e73; }
.album-edit-toggle-btn { font-size: 12px; padding: 4px 10px; border: 1px solid #ccc; border-radius: 6px; background: #f5f5f7; cursor: pointer; white-space: nowrap; }
.album-edit-toggle-btn:hover { background: #e5e5ea; }
#album-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  grid-auto-rows: 110px;
  gap: 6px; overflow-y: auto; flex: 1;
  max-height: 55vh;
}
.album-edit-cover-btn {
  display: none; position: absolute; top: 3px; right: 3px; z-index: 2;
  background: rgba(0,0,0,.45); border: none; border-radius: 4px;
  font-size: 13px; padding: 1px 3px; cursor: pointer; line-height: 1;
}
.album-edit-thumb:hover .album-edit-cover-btn { display: block; }
.album-edit-thumb.cover .album-edit-cover-btn { display: block; background: rgba(255,200,0,.85); }
.album-edit-thumb {
  border-radius: 8px; overflow: hidden;
  position: relative; cursor: pointer; height: 100%;
  border: 3px solid transparent; transition: border-color 0.15s;
}
.album-edit-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-edit-thumb.selected { border-color: #0a84ff; }
.album-edit-thumb.selected::after {
  content: '✓';
  position: absolute; top: 4px; right: 6px;
  font-size: 16px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}

/* ── Import modal ── */
.import-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
}
.import-modal {
  position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(480px, 92vw);
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  z-index: 1001;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.import-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.import-header h2 { font-size: 17px; font-weight: 700; }
.import-header button { background: none; border: none; font-size: 18px; cursor: pointer; color: #999; padding: 4px 8px; }
.import-body {
  padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.import-body label { font-size: 13px; font-weight: 600; color: #1d1d1f; }
.import-body input {
  padding: 10px 12px;
  border: 1px solid #d2d2d7; border-radius: 8px;
  font-size: 13px; font-family: monospace;
  outline: none;
}
.import-body input:focus { border-color: #0071e3; }
.import-date-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.import-date-row input[type=date] {
  padding: 8px 10px; border: 1px solid #d2d2d7; border-radius: 8px;
  font-size: 13px; font-family: inherit; outline: none; background: #fafafa;
}
.import-date-row input[type=date]:focus { border-color: #0071e3; }
.import-date-sep { color: #aeaeb2; font-size: 13px; }
.import-date-clear {
  cursor: pointer; color: #aeaeb2; font-size: 13px; padding: 2px 4px;
}
.import-date-clear:hover { color: #6e6e73; }
.import-check-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #3a3a3c; cursor: pointer;
}
.import-check-label input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.import-hint { font-size: 12px; color: #aeaeb2; line-height: 1.6; margin: 0; }
.import-footer {
  padding: 14px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex; flex-direction: column; gap: 10px;
}
.import-actions { display: flex; gap: 10px; justify-content: flex-end; }
#btn-import-run {
  padding: 9px 22px;
  background: #00b894; color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
#btn-import-run:disabled { opacity: 0.5; cursor: default; }
#btn-fix-dates {
  padding: 9px 16px;
  background: #6c5ce7; color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
#btn-fix-dates:disabled { opacity: 0.5; cursor: default; }
#btn-import-cancel {
  padding: 9px 16px; background: transparent;
  border: 1px solid #d2d2d7; border-radius: 8px;
  font-size: 14px; cursor: pointer;
}
.import-success { font-size: 13px; font-weight: 600; color: #00b894; }
.import-error   { font-size: 13px; font-weight: 600; color: #e17055; }

/* ── Detect modal ── */
.detect-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1000;
}
.detect-modal {
  position: fixed;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(480px, 92vw);
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2);
  z-index: 1001;
  overflow: hidden;
}
.detect-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.detect-header h2 { font-size: 17px; font-weight: 700; }
.detect-header button {
  background: none; border: none; font-size: 18px;
  cursor: pointer; color: #999; padding: 4px 8px;
}
.detect-settings {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex; flex-direction: column; gap: 12px;
}
.ds-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ds-item label { font-size: 13px; font-weight: 600; color: #1d1d1f; min-width: 90px; }
.ds-desc { font-size: 12px; color: #aeaeb2; }
.ds-btns { display: flex; gap: 4px; }
.ds-btn {
  padding: 5px 12px; border: 1px solid #d2d2d7; border-radius: 6px;
  background: #fafafa; font-size: 13px; cursor: pointer; transition: all 0.12s;
}
.ds-btn.active  { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }
.ds-btn:hover:not(.active) { background: #e9e9eb; }
#btn-run-detect {
  align-self: flex-start;
  padding: 8px 20px; background: #6c5ce7; color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; margin-top: 4px;
}
#btn-run-detect:disabled { opacity: 0.5; cursor: default; }

/* ── Result bar ── */
.result-bar {
  font-size: 14px; color: #6e6e73;
  margin-bottom: 12px;
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
}
#result-count { font-weight: 600; color: #1d1d1f; transition: opacity .15s; }
#result-count.loading {
  opacity: 0.4;
  position: relative;
}
#result-count.loading::after {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  border: 2px solid #999;
  border-top-color: #333;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
#search-desc  { color: #aeaeb2; font-size: 13px; }
.btn-sort-toggle {
  padding: 4px 10px; font-size: 12px; font-weight: 500;
  background: none; border: 1px solid #d2d2d7;
  border-radius: 8px; cursor: pointer; color: #6e6e73;
  white-space: nowrap;
}
.btn-sort-toggle:hover { background: #f0f0f5; color: #1d1d1f; }
.result-bar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
}
#btn-make-album-from-filter {
  padding: 5px 12px; font-size: 12px; font-weight: 500;
  background: #f0f0f5; border: 1px solid #d2d2d7;
  border-radius: 8px; cursor: pointer; color: #1d1d1f;
}
#btn-make-album-from-filter:hover { background: #e5e5ea; }
#album-from-filter-dialog {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 10px;
  background: #f5f5f7; border-radius: 10px;
  flex-wrap: wrap;
}
#album-from-filter-name,
#album-from-filter-description {
  flex: 1; min-width: 160px;
  padding: 7px 10px; border: 1px solid #d2d2d7;
  border-radius: 8px; font-size: 14px;
}
#album-from-filter-description { flex: 1.2; }
#btn-aff-confirm {
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  background: #0071e3; color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
}
#btn-aff-confirm:hover { background: #0077ed; }
#btn-aff-cancel {
  padding: 7px 14px; font-size: 13px;
  background: none; border: 1px solid #d2d2d7;
  border-radius: 8px; cursor: pointer; color: #6e6e73;
}

/* ── Location modal ── */
.location-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; }
.location-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(420px, 92vw); background: #fff; border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.2); z-index: 1001;
  display: flex; flex-direction: column; overflow: hidden;
}
.location-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 14px; border-bottom: 1px solid #f0f0f0;
}
.location-header h2 { font-size: 17px; font-weight: 700; }
.location-header button { background: none; border: none; font-size: 18px; cursor: pointer; color: #999; padding: 4px 8px; }
.location-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.location-body label { font-size: 13px; font-weight: 600; color: #1d1d1f; }
.location-input-row { display: flex; gap: 8px; }
.location-input-row input {
  flex: 1; padding: 10px 12px; border: 1px solid #d2d2d7;
  border-radius: 8px; font-size: 14px; outline: none;
}
.location-input-row input:focus { border-color: #0071e3; }
.location-input-row button {
  padding: 10px 16px; background: #f0f0f5; border: none;
  border-radius: 8px; font-size: 14px; cursor: pointer;
}
.location-input-row button:hover { background: #e5e5ea; }
#location-preview { font-size: 13px; color: #6e6e73; min-height: 18px; }
.location-footer {
  padding: 14px 20px; border-top: 1px solid #f0f0f0;
  display: flex; gap: 10px; justify-content: flex-end;
}
#btn-location-save {
  padding: 9px 22px; background: #0071e3; color: #fff;
  border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
#btn-location-save:disabled { opacity: 0.4; cursor: default; }
#btn-location-cancel {
  padding: 9px 16px; background: transparent;
  border: 1px solid #d2d2d7; border-radius: 8px;
  font-size: 14px; cursor: pointer;
}

/* ── Library (timeline) view ── */
#view-library { padding-bottom: 40px; }

.timeline-section { margin-bottom: 36px; }

.timeline-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 0;
  border-bottom: 2px solid #e5e5ea;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-left: -12px; margin-right: -12px;
}
#album-detail .timeline-header {
  top: var(--album-detail-sticky-offset, 52px);
  z-index: 80;
}
.timeline-header-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timeline-header-prev,
.timeline-header-next {
  font-size: 13px; font-weight: 500; color: #0071e3;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.timeline-header-prev { padding-right: 8px; }
.timeline-header-next { padding-left: 8px; }
.timeline-header-prev:hover,
.timeline-header-next:hover { text-decoration: underline; }
#album-detail { position: relative; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

#undated-note {
  text-align: center;
  padding: 12px 0 4px;
  font-size: 13px;
  color: #aeaeb2;
}
#undated-note #btn-show-undated {
  background: none; border: none;
  color: #0071e3; font-size: 13px;
  cursor: pointer; padding: 0 2px;
  text-decoration: underline; text-underline-offset: 2px;
}

.load-more-bar {
  display: flex;
  justify-content: center;
  padding: 8px 0 16px;
}

#btn-load-more {
  padding: 11px 40px;
  background: #fff;
  border: 1px solid #d2d2d7;
  border-radius: 10px;
  font-size: 15px; font-weight: 600;
  color: #1d1d1f;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
  max-width: 320px;
}
#btn-load-more:hover { background: #f0f0f2; }

/* ── Album grid ── */
#photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding-bottom: 40px;
}

.photo-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  transition: transform 0.15s, box-shadow 0.15s;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }

.card-thumb {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}
.card-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Justified grid */
.justified-grid { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.justified-row  { display: flex; gap: 4px; overflow: hidden; }
.justified-row .photo-card {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: none;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.justified-row .photo-card:hover { transform: none; box-shadow: none; opacity: 0.88; }
.btn-add-location {
  position: absolute; bottom: 6px; right: 6px;
  background: rgba(0,0,0,.55); color: #fff;
  border: none; border-radius: 6px;
  font-size: 14px; padding: 3px 6px;
  cursor: pointer; z-index: 1;
  opacity: 0; transition: opacity 0.15s;
}
.photo-card:hover .btn-add-location { opacity: 1; }

.btn-remove-from-album {
  position: absolute; top: 6px; right: 6px;
  background: rgba(220,40,40,.75); color: #fff;
  border: none; border-radius: 50%;
  width: 22px; height: 22px; line-height: 20px; text-align: center;
  font-size: 12px; padding: 0;
  cursor: pointer; z-index: 2;
  opacity: 0; transition: opacity 0.15s;
}
.photo-card:hover .btn-remove-from-album { opacity: 1; }

.card-body   { padding: 12px; }
.card-region { font-weight: 600; font-size: 14px; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-date   { font-size: 13px; color: #6e6e73; margin-bottom: 3px; }
.card-camera { font-size: 12px; color: #aeaeb2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.loc-subheader {
  font-size: 13px; font-weight: 600;
  color: #6e6e73;
  margin: 14px 0 8px;
  padding-left: 2px;
  cursor: pointer;
  display: inline-block;
}
.loc-subheader:hover { color: #1d1d1f; }
.loc-subheader:first-of-type { margin-top: 4px; }

.card-time {
  position: absolute; bottom: 6px; left: 8px;
  font-size: 11px; font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
  pointer-events: none;
  z-index: 1;
}

#empty-msg { text-align: center; padding: 80px 0; color: #aeaeb2; font-size: 16px; }

/* ── Map view ── */
#view-map { position: relative; padding-bottom: 40px; }
#map {
  height: calc(100vh - 260px);
  min-height: 400px;
  border-radius: 12px;
  overflow: hidden;
}
#btn-mylocation {
  position: absolute;
  top: 16px; right: 16px;
  z-index: 1000;
  width: 44px; height: 44px;
  background: #fff; border: none; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
#btn-mylocation:hover    { background: #f0f0f5; }
#btn-mylocation.locating { animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
#map-hint {
  position: absolute; bottom: 48px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.6); color: #fff; font-size: 13px;
  padding: 8px 16px; border-radius: 20px; pointer-events: none;
  white-space: nowrap;
}
#map-key-hint {
  position: absolute; bottom: 12px; right: 16px;
  background: rgba(0,0,0,.45); color: rgba(255,255,255,.85); font-size: 12px;
  padding: 5px 12px; border-radius: 12px; pointer-events: none;
  white-space: nowrap;
  opacity: 0; transition: opacity 0.2s;
}
#view-map:hover #map-key-hint { opacity: 1; }
#map-key-hint kbd {
  background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
  border-radius: 4px; padding: 1px 5px; font-family: inherit; font-size: 12px;
}
/* 미니맵·라이트박스 맵 hover 힌트 */
.map-zoom-hint-wrap { position: relative; }
.map-zoom-hint-wrap::after {
  content: '+ 확대  − 축소';
  position: absolute; bottom: 6px; right: 8px;
  background: rgba(0,0,0,.45); color: rgba(255,255,255,.85); font-size: 11px;
  padding: 3px 9px; border-radius: 10px; pointer-events: none;
  white-space: nowrap;
  opacity: 0; transition: opacity 0.2s;
}
.map-zoom-hint-wrap:hover::after { opacity: 1; }

/* ── 포토 마커 ── */
.photo-marker { background: transparent; border: none; }
.photo-marker-dot { background: transparent; border: none; }
.pm-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #0071e3;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.pm-wrap {
  width: 60px; height: 60px;
  border-radius: 10px;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  overflow: hidden;
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  position: relative;
}
.pm-wrap::after {
  /* 말풍선 꼬리 */
  content: '';
  position: absolute;
  bottom: -10px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}
.pm-wrap img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.pm-wrap.pm-no-img::before {
  content: '📷';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
}
.pm-wrap.pm-no-img img { display: none; }

/* ── 지도 클러스터 썸네일 ── */
.photo-cluster { background: transparent; border: none; }
.pc-outer {
  position: relative;
  width: 64px; height: 64px;
}
.pc-thumb {
  width: 100%; height: 100%;
  border-radius: 10px;
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
  overflow: hidden;
  background: #e8e8e8;
  box-sizing: border-box;
  position: relative;
}
.pc-thumb::after {
  content: '';
  position: absolute;
  bottom: -10px; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}
.pc-thumb img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}
.pc-spinner {
  position: absolute;
  inset: 0;
  background: #e8e8e8;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.pc-spinner::after {
  content: '';
  width: 18px; height: 18px;
  border: 2px solid #ccc;
  border-top-color: #666;
  border-radius: 50%;
  animation: pcSpin 0.7s linear infinite;
}
@keyframes pcSpin { to { transform: rotate(360deg); } }
.pc-outer:not(.pc-loading) .pc-spinner { display: none; }
.pc-count {
  position: absolute;
  top: -8px; right: -8px;
  background: #e74c3c;
  color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  border: 2px solid #fff;
  min-width: 22px;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  white-space: nowrap;
}

/* ── Leaflet popup ── */
.leaflet-popup-content { font-size: 13px; line-height: 1.7; min-width: 160px; padding: 2px 0; }
.popup-thumb  { margin: -8px -12px 10px; height: 140px; overflow: hidden; border-radius: 4px 4px 0 0; background: #f0f0f0; }
.popup-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popup-region { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.popup-date   { color: #555; }
.popup-camera { color: #999; font-size: 12px; }

/* ── Color palette ── */
.color-0 { background: linear-gradient(135deg, #74b9ff, #0984e3); }
.color-1 { background: linear-gradient(135deg, #fd79a8, #e84393); }
.color-2 { background: linear-gradient(135deg, #55efc4, #00b894); }
.color-3 { background: linear-gradient(135deg, #fdcb6e, #e17055); }
.color-4 { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.color-5 { background: linear-gradient(135deg, #ffeaa7, #fdcb6e); }
.color-6 { background: linear-gradient(135deg, #81ecec, #00cec9); }
.color-7 { background: linear-gradient(135deg, #fab1a0, #e17055); }

/* ── 태블릿 (768px 이하) ── */
@media (max-width: 768px) {
  header h1 { font-size: 18px; }
  .view-tabs .tab { padding: 7px 16px; }

  #f-trip { width: 100%; }
  #f-near { width: 100%; min-width: unset; flex: 1; }
  .toggle-row { flex-wrap: wrap; }

  #map { height: calc(100vh - 340px); }
  #map-hint { font-size: 12px; padding: 6px 12px; bottom: 48px; }
}

/* ── 모바일 (480px 이하) ── */
@media (max-width: 480px) {
  /* 기본 폰트 기준 상향 */
  body { font-size: 18px; }

  #app { padding: 0 12px; }
  header { padding: 16px 0 12px; }
  header h1 { font-size: 24px; }

  /* 탭 크기 */
  .view-tabs { padding: 4px; }
  .view-tabs .tab { padding: 10px 18px; font-size: 19px; }

  /* 헤더 우측 */
  #btn-help { width: 38px; height: 38px; font-size: 18px; }
  #btn-login, #btn-logout { padding: 7px 14px; font-size: 16px; }
  #auth-status { font-size: 16px; gap: 8px; }
  #auth-user { font-size: 16px; }

  /* 결과 카운트 바 */
  .result-bar { font-size: 17px; gap: 10px; }
  #result-count { font-size: 20px; }
  #search-desc  { font-size: 16px; }
  .btn-sort-toggle { font-size: 15px; padding: 7px 14px; min-height: 40px; }
  #btn-make-album-from-filter { font-size: 15px; padding: 7px 14px; }
  .result-bar-right { gap: 6px; }

  /* 타임라인 섹션 헤더 */
  .timeline-header { font-size: 22px; margin-bottom: 14px; }

  /* 포토 카드 본문 */
  .card-region { font-size: 18px; }
  .card-date   { font-size: 16px; }
  .card-camera { font-size: 15px; }
  .card-body   { padding: 12px; }
  .card-time   { font-size: 14px; }
  .card-dur-badge { font-size: 14px; padding: 2px 7px; }
  .card-fav-badge { font-size: 17px; }

  /* 필터 패널 */
  .filter-panel { padding: 14px; gap: 10px; }

  /* iOS 자동 줌 방지 + 가독성 */
  .filter-panel input,
  .filter-panel select,
  .cs-btn { font-size: 17px; min-height: 46px; }

  /* ff-row 레이블 */
  .ff-row { grid-template-columns: 46px 1fr; min-height: 50px; }
  .ff-label { font-size: 15px; }

  /* 토글 버튼 */
  .toggle-btn { font-size: 16px; padding: 9px 18px; }
  .seg-btn { font-size: 16px; padding: 9px 16px; }

  /* 태그 칩 */
  .tag-chip { font-size: 16px; padding: 8px 18px; }
  .tags-toggle-btn { font-size: 15px; }
  .tag-match-btn { font-size: 14px; padding: 5px 14px; }

  /* 콤보 인풋: flex:1로 공간 균등 분배 */
  .combo-wrap:has(#f-province),
  .combo-wrap:has(#f-city),
  .combo-wrap:has(#f-district) { flex: 1; min-width: 0; }
  #f-province, #f-city, #f-district { min-width: 0 !important; width: 100%; }

  .combo-wrap:has(#f-year),
  .combo-wrap:has(#f-month) { flex: 1; min-width: 0; max-width: 120px; }
  #f-year, #f-month { min-width: 0 !important; width: 100%; }

  /* 앨범 셀렉트 */
  #cs-trip { min-width: 0; }

  /* 커스텀 드롭다운 아이템 */
  .dd-item { font-size: 18px; padding: 13px 16px; }

  /* 포토 그리드 */
  #photo-grid, .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  .card-thumb { height: 120px; }

  /* 지도 */
  #map { height: calc(100vh - 380px); min-height: 300px; }
  #map-hint { display: none; }

  .album-mini-map-wrap {
    display: block;
    width: auto;
    position: static;
  }
  #album-mini-map,
  #btn-minimap-reset,
  .album-mini-map-hint,
  .album-location-chips,
  .album-side-panel {
    display: none;
  }
  .album-date-jump-wrap.visible {
    position: fixed;
    right: 18px;
    bottom: 24px;
    z-index: 300;
    width: auto;
    margin: 0;
  }
  #btn-date-jump.visible {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    padding: 0;
    font-size: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  }
  #btn-date-jump .date-jump-label { display: none; }
  #date-jump-popover {
    position: fixed;
    top: auto;
    right: 18px;
    bottom: 80px;
    width: auto;
    min-width: 170px;
    max-width: 220px;
    max-height: 60vh;
  }

  /* 앨범 탭 */
  .album-tab { font-size: 19px; padding: 13px 18px; }
  .album-detect-btn { font-size: 16px; padding: 9px 16px; }
  .album-empty { font-size: 17px; }

  /* 앨범 제안 */
  .alb-sug-name { font-size: 19px; }
  .alb-sug-meta { font-size: 16px; }
  .alb-sug-place { font-size: 14px; padding: 3px 10px; }
  .btn-make-album, .btn-sug-toggle, .btn-sug-ignore {
    font-size: 16px; padding: 10px 18px; min-height: 46px;
  }
  .alb-sug-thumbs img { width: 64px; height: 64px; }

  /* 앨범 상세 */
  #album-detail-back { font-size: 17px; }
  #album-detail-title { font-size: 22px; }
  .album-detail-count { font-size: 16px; }

  /* Trip 카드 */
  .trip-name { font-size: 19px; }
  .trip-meta { font-size: 15px; }

  /* 라이트박스 정보 */
  #lightbox-info { font-size: 17px; }
  .lb-info-date { font-size: 19px; }
  .lb-info-region { font-size: 16px; }
  .lb-tag-chip { font-size: 15px; padding: 6px 14px; }
  #lb-tag-input { font-size: 16px; padding: 7px 18px; width: 210px; }
  #lightbox-counter { font-size: 16px; }

  /* 라이트박스 내비·컨트롤 버튼 */
  #lightbox-prev, #lightbox-next {
    width: 48px; height: 48px; font-size: 28px;
  }
  #lightbox-close, #lightbox-favorite, #lightbox-delete, #lightbox-slideshow {
    width: 46px; height: 46px; font-size: 20px;
  }

  /* 더 불러오기 버튼 */
  #btn-load-more { font-size: 18px; padding: 14px 40px; }

  /* 빈 화면 메시지 */
  #empty-msg { font-size: 20px; }

  /* 스크롤 상단 버튼 */
  #btn-scroll-top { width: 52px; height: 52px; font-size: 22px; top: 50%; transform: translateY(-50%); right: 20px; }

  /* 위치 추가 버튼 */
  .btn-add-location { font-size: 16px; padding: 6px 10px; }

  /* 위치 검색 modal */
  .location-header h2 { font-size: 22px; }
  .location-body label { font-size: 16px; }
  .location-input-row input { font-size: 17px; }
  #location-preview { font-size: 16px; }
  #btn-location-save, #btn-location-cancel { font-size: 17px; }

  /* 편집 모드 바 */
  #edit-selected-count { font-size: 17px; }
  #edit-action-bar button { font-size: 16px; padding: 9px 18px; }
}

/* ── Lightbox ── */
#lightbox-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 2000;
}
#lightbox-overlay::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
  pointer-events: none;
}
#lightbox-modal {
  position: fixed; inset: 0;
  z-index: 2001;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 72px 20px 20px;
  pointer-events: none;
  gap: 24px;
}
#lb-photo-side {
  display: flex; flex-direction: column;
  align-items: center;
}
#lb-map-side {
  display: none;
  position: fixed;
  top: 68px;
  right: 16px;
  z-index: 2010;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.6);
  pointer-events: all;
  border: 1px solid rgba(255,255,255,.15);
}
#lb-map-panel { width: clamp(200px, 16vw, 300px); height: clamp(155px, 12vw, 230px); }
@media (min-width: 1200px) {
  #lb-map-side { display: block; }
}
/* Lightbox map markers */
.lb-marker {
  width: 10px; height: 10px;
  background: rgba(255,255,255,.7);
  border: 2px solid #888;
  border-radius: 50%;
}
.lb-marker.current {
  width: 16px; height: 16px;
  background: #ff3b30;
  border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(255,59,48,.45);
}
#lightbox-close {
  position: fixed; top: 16px; right: 20px; z-index: 2015;
  background: rgba(255,255,255,.15);
  border: none; border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 18px; color: #fff;
  cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#lightbox-close:hover { background: rgba(255,255,255,.3); }
#lightbox-favorite {
  position: fixed; top: 16px; right: 120px; z-index: 2015;
  background: rgba(255,255,255,.15);
  border: none; border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 18px; color: #fff;
  cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#lightbox-favorite:hover { background: rgba(255,255,255,.3); }
#lightbox-favorite.fav-active { background: rgba(255,200,0,.3); }
#lightbox-delete {
  position: fixed; top: 16px; right: 70px; z-index: 2015;
  background: rgba(255,255,255,.15);
  border: none; border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 16px; color: #fff;
  cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#lightbox-delete:hover { background: rgba(220,50,50,.6); }
#lightbox-slideshow {
  position: fixed; top: 16px; right: 170px; z-index: 2015;
  background: rgba(255,255,255,.15);
  border: none; border-radius: 50%;
  width: 40px; height: 40px;
  font-size: 16px; color: #fff;
  cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
#lightbox-slideshow:hover { background: rgba(255,255,255,.3); }
#lightbox-prev, #lightbox-next {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none; border-radius: 50%;
  width: 48px; height: 48px;
  font-size: 28px; color: #fff; line-height: 1;
  cursor: pointer; pointer-events: all;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  user-select: none;
}
#lightbox-prev { left: 16px; }
#lightbox-next { right: 16px; }
#lightbox-prev:hover, #lightbox-next:hover { background: rgba(255,255,255,.3); }
#lightbox-counter {
  color: rgba(255,255,255,.6); font-size: 12px;
  margin-top: 6px; pointer-events: none;
}
#lightbox-img-wrap {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: min(80vh, calc(100vh - 100px));
  display: flex; align-items: center; justify-content: center;
  pointer-events: all;
}
#lightbox-img {
  max-width: 100%; max-height: min(80vh, calc(100vh - 100px));
  border-radius: 8px;
  object-fit: contain;
  display: block;
  box-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.slideshow-active #lightbox-img { cursor: pointer; }
#lightbox-spinner {
  position: absolute;
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.lb-video-error {
  color: rgba(255,255,255,.7); font-size: 14px;
  padding: 40px 20px; text-align: center;
}
@keyframes spin { to { transform: rotate(360deg); } }
#lb-top-info {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 8px 14px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
  color: #fff; font-size: 13px; font-weight: 500;
  border-radius: 8px 8px 0 0;
  pointer-events: none;
  z-index: 2;
}
#lightbox-info {
  position: fixed; bottom: 48px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  font-size: 13px; text-align: center;
  pointer-events: all;
  white-space: nowrap;
  z-index: 2;
}
.lb-info-row {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.lb-info-date { font-size: 14px; font-weight: 500; }
.lb-info-region { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 3px; }
.lb-camera-wrap {
  position: relative; cursor: default;
  font-size: 13px; opacity: 0.5;
  transition: opacity .15s;
}
.lb-camera-wrap:hover { opacity: 1; }
.lb-camera-tip {
  display: none;
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; white-space: nowrap;
  pointer-events: none;
}
.lb-camera-wrap:hover .lb-camera-tip { display: block; }

#lb-tags-wrap {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 2; pointer-events: all;
  max-width: min(600px, 90vw);
}
#lb-tags-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px;
}
.lb-tag-chip {
  display: inline-flex; align-items: center; gap: 3px;
  background: rgba(255,255,255,.15); color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 100px; padding: 3px 10px;
  font-size: 12px; backdrop-filter: blur(4px);
}
.lb-tag-del {
  background: none; border: none; color: rgba(255,255,255,.6);
  cursor: pointer; font-size: 13px; padding: 0 0 0 2px; line-height: 1;
}
.lb-tag-del:hover { color: #fff; }
#lb-tag-input {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  border-radius: 100px; color: #fff;
  padding: 4px 14px; font-size: 12px; outline: none; width: 180px;
  backdrop-filter: blur(4px);
}
#lb-tag-input::placeholder { color: rgba(255,255,255,.4); }

.photo-card { cursor: pointer; }

/* Slideshow progress bar */
#lb-progress {
  position: fixed; bottom: 0; left: 0;
  height: 3px;
  background: rgba(255,255,255,.75);
  width: 0;
  display: none;
  z-index: 2010;
  transform-origin: left;
}
#lb-progress.running {
  display: block;
  animation: lb-fill var(--lb-duration, 3s) linear forwards;
}
@keyframes lb-fill { from { width: 0 } to { width: 100% } }

/* Lightbox peek (next photo preview on right) */
#lb-peek {
  position: fixed;
  right: 16px; bottom: 48px;
  width: 140px;
  max-height: 200px;
  z-index: 2002;
  pointer-events: none;
  border-radius: 10px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.25s;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
#lb-peek.show { opacity: 0.55; }
#lb-peek img {
  width: 100%; max-height: 200px;
  object-fit: cover; display: block;
}
@media (max-width: 768px) {
  #lb-peek {
    width: 80px;
    max-height: 130px;
    right: 12px;
    top: auto;
    bottom: 40px;
    transform: none;
  }
}

/* Lightbox slide animation — next slides in from the peek area */
@keyframes lb-slide-right {
  from { transform: translateX(80px) scale(0.88); opacity: 0.2; }
  to   { transform: translateX(0)    scale(1);    opacity: 1; }
}
@keyframes lb-slide-left {
  from { transform: translateX(-80px) scale(0.88); opacity: 0.2; }
  to   { transform: translateX(0)     scale(1);    opacity: 1; }
}
#lightbox-img.slide-right { animation: lb-slide-right 0.32s ease; }
#lightbox-img.slide-left  { animation: lb-slide-left  0.32s ease; }
#lightbox-img { cursor: zoom-in; }
.slideshow-active #lightbox-img { cursor: pointer; }

/* ── 원본 크기 보기 오버레이 ── */
#lb-zoom-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 3000;
  background: #000;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
#lb-zoom-overlay.active { display: block; }
#lb-zoom-overlay.lbz-dragging { cursor: grabbing; }
#lb-zoom-img {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  -webkit-user-drag: none;
  pointer-events: none;
  box-shadow: 0 4px 60px rgba(0,0,0,.8);
}
#lb-zoom-close {
  position: fixed; top: 14px; right: 18px;
  z-index: 3001;
  background: rgba(255,255,255,.15); color: #fff;
  border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 20px; line-height: 1;
  cursor: pointer; transition: background .15s;
}
#lb-zoom-close:hover { background: rgba(255,255,255,.35); }
#lb-zoom-spinner {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ── Album tab ── */
#view-album {
  display: flex; flex-direction: column; gap: 0;
  padding: 0 20px 40px;
}
.album-tabs {
  display: flex; align-items: center;
  border-bottom: 1px solid #e5e5ea;
  margin-bottom: 20px;
}
.album-tab {
  padding: 10px 18px;
  font-size: 15px; font-weight: 500;
  background: none; border: none; cursor: pointer;
  color: #aeaeb2;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
}
.album-tab.active { color: #1d1d1f; border-bottom-color: #1d1d1f; font-weight: 600; }
.album-tab:hover:not(.active) { color: #6e6e73; }
.album-detect-btn {
  margin-left: auto;
  font-size: 13px; font-weight: 500;
  padding: 5px 12px;
  background: #f0f0f5; border: 1px solid #d2d2d7;
  border-radius: 8px; cursor: pointer; color: #1d1d1f;
}
.album-detect-btn:hover { background: #e5e5ea; }
.album-tab-panel { }
.album-content-layout {
  display: flex; gap: 16px; align-items: flex-start;
}
.album-content-main { flex: 1; min-width: 0; }
.album-mini-map-wrap {
  width: 300px; flex-shrink: 0;
  position: sticky; top: 110px;
  align-self: flex-start;
}
#btn-minimap-reset {
  position: absolute; top: 8px; right: 8px; z-index: 500;
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,0.9); border: 1px solid #d1d1d6;
  font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
#album-mini-map {
  width: 100%; height: 320px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid #e5e5ea;
  background: #f0f0f5;
}
.album-mini-map-hint {
  text-align: center; font-size: 12px;
  color: #aeaeb2; padding: 8px 0;
}
.album-location-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
}
.album-loc-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 14px;
  background: #f0f0f5;
  border: 1.5px solid transparent;
  font-size: 12px;
  color: #3a3a3c;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.album-loc-chip:hover { background: #e5e5ea; }
.album-loc-chip.active {
  background: #e8f0fe;
  border-color: #0071e3;
  color: #0071e3;
  font-weight: 600;
}
.album-loc-chip .chip-count { color: #8e8e93; font-size: 11px; }
.album-loc-chip.active .chip-count { color: #5a9fe3; }
.album-date-jump-wrap {
  display: none;
  position: relative;
  margin-top: 10px;
}
.album-date-jump-wrap.visible { display: block; }
.album-side-panel {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #e5e5ea;
  max-height: max(170px, calc(100vh - 500px));
  overflow-y: auto;
  padding-right: 2px;
}
.album-side-title {
  font-size: 12px;
  font-weight: 700;
  color: #6e6e73;
  margin-bottom: 8px;
}
.album-year-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.album-year-link {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.album-year-link:hover,
.album-year-link.active {
  border-color: #0a84ff;
  background: #f3f8ff;
}
.album-year-link-title {
  font-size: 13px;
  font-weight: 700;
  color: #1d1d1f;
  white-space: nowrap;
}
.album-year-link-count {
  font-size: 11px;
  color: #8e8e93;
  text-align: right;
}
.album-side-desc {
  font-size: 12px;
  line-height: 1.45;
  color: #3a3a3c;
  margin-bottom: 10px;
}
.album-side-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f2f2f7;
  font-size: 12px;
  color: #8e8e93;
}
.album-side-stat strong {
  font-size: 12px;
  color: #1d1d1f;
  font-weight: 600;
  text-align: right;
}
.album-empty { color: #aeaeb2; font-size: 14px; padding: 20px 0; }

.album-trip-grid {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.album-year-section {
  scroll-margin-top: 84px;
}
.album-year-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 9px;
  margin-bottom: 12px;
  border-bottom: 1px solid #e5e5ea;
}
.album-year-title {
  font-size: 18px;
  font-weight: 700;
  color: #1d1d1f;
}
.album-year-meta {
  font-size: 12px;
  color: #8e8e93;
  white-space: nowrap;
}
.album-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.trip-card {
  position: relative;
  background: #fff; border-radius: 14px;
  border: 1px solid #e5e5ea;
  overflow: hidden; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.trip-card-place { border-color: #d7dbe2; }
.trip-kind-badge {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: rgba(72,72,74,.78); color: #fff;
  border-radius: 10px;
  padding: 3px 8px; font-size: 11px; font-weight: 700;
}
.trip-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.trip-cover {
  height: 140px; background: #f0f0f5;
  overflow: hidden; position: relative;
}
.trip-cover img { width: 100%; height: 100%; object-fit: cover; }
.trip-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #c7c7cc;
}
.trip-cover-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 14px 0;
}
.trip-cover-meta .trip-date-range {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trip-photo-count {
  flex: 0 0 auto;
  color: #8e8e93;
  white-space: nowrap;
}
.trip-info { padding: 6px 14px 12px; }
.trip-name { font-size: 15px; font-weight: 600; color: #1d1d1f; margin-bottom: 4px; }
.trip-desc {
  font-size: 13px; color: #6e6e73; line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.trip-desc-layer {
  position: absolute;
  left: 10px; right: 10px; bottom: 10px;
  z-index: 2;
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(132,132,138,.94);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .14s, transform .14s;
}
.trip-card:hover .trip-desc-layer,
.trip-card:focus-within .trip-desc-layer,
.trip-card.show-desc .trip-desc-layer {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.trip-meta { font-size: 12px; color: #6e6e73; }
.trip-date-range { cursor: pointer; border-bottom: 1px dashed #aaa; }
.trip-date-range:hover { color: #0a84ff; border-bottom-color: #0a84ff; }
.btn-trip-desc {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: rgba(132,132,138,.78); color: #fff;
  border: none; border-radius: 10px;
  padding: 3px 8px; font-size: 11px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.btn-trip-desc:hover,
.trip-card.show-desc .btn-trip-desc { background: rgba(118,118,124,.95); }
.trip-card-place .btn-trip-desc { left: 50px; }
.btn-trip-delete {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.45); color: #fff;
  border: none; border-radius: 50%;
  width: 24px; height: 24px; font-size: 12px;
  cursor: pointer; display: none; align-items: center; justify-content: center;
  line-height: 1;
}
.btn-trip-edit {
  position: absolute; top: 8px; right: 38px;
  background: rgba(0,0,0,.45); color: #fff;
  border: none; border-radius: 10px;
  padding: 3px 8px; font-size: 11px; font-weight: 600;
  cursor: pointer; display: none; align-items: center; justify-content: center;
}
.btn-trip-hist {
  position: absolute; top: 8px; right: 80px;
  background: rgba(0,0,0,.45); color: #fff;
  border: none; border-radius: 10px;
  padding: 3px 8px; font-size: 11px; font-weight: 600;
  cursor: pointer; display: none; align-items: center; justify-content: center;
}
.trip-card { position: relative; }
.trip-card:hover .btn-trip-delete,
.trip-card:hover .btn-trip-edit,
.trip-card:hover .btn-trip-hist { display: flex; }

/* 앨범 상세 보기 */
.album-detail-header {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0 12px;
  border-bottom: 1px solid #e5e5ea;
  margin-bottom: 14px;
  background: #f5f5f7;
  box-shadow: 0 8px 16px rgba(245,245,247,0.92);
}
#album-detail-back {
  background: none; border: none; color: #0071e3;
  font-size: 14px; font-weight: 500; cursor: pointer;
  padding: 6px 0; white-space: nowrap;
}
#album-detail-back:hover { text-decoration: underline; }
#album-detail-title {
  font-size: 17px; font-weight: 600; flex: 1;
}
.album-detail-count {
  font-size: 13px; color: #6e6e73;
}
#album-detail-sort-btn { margin-left: 8px; }
.album-visit-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 14px;
  margin: -2px 0 14px;
  border-bottom: 1px solid #f2f2f7;
}
.visit-filter-btn {
  border: 1px solid #d2d2d7;
  background: #fff;
  color: #3a3a3c;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.visit-filter-btn span {
  color: #8e8e93;
  font-weight: 500;
  margin-left: 4px;
}
.visit-filter-btn:hover { background: #f5f5f7; }
.visit-filter-btn.active {
  border-color: #0a84ff;
  background: #f0f7ff;
  color: #0071e3;
}
.album-media-filter {
  display: flex; gap: 2px;
  background: rgba(120,120,128,.1); border-radius: 8px; padding: 2px;
  flex-shrink: 0;
}
.media-filter-btn {
  background: none; border: none; color: #6e6e73;
  padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: background .15s, color .15s; white-space: nowrap;
}
.media-filter-count {
  margin-left: 4px;
  color: #8e8e93;
  font-variant-numeric: tabular-nums;
}
.media-filter-btn.active { background: #fff; color: #1c1c1e; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.media-filter-btn.active .media-filter-count { color: #6e6e73; }
.album-detail-grid {
  display: flex; flex-direction: column; gap: 0;
}
.photo-card.active {
  outline: 3px solid #0071e3;
  outline-offset: -3px;
}
/* 날짜 점프 */
#btn-date-jump {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d2d2d7;
  color: #1d1d1f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
#btn-date-jump.visible { display: flex; }
#date-jump-popover {
  position: absolute;
  right: 0;
  bottom: 42px;
  z-index: 520;
  background: #fff; border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  border: 1px solid #e5e5ea;
  max-height: min(320px, calc(100vh - 180px));
  overflow-y: auto;
  width: 100%;
  min-width: 180px;
  padding: 8px 0;
}
.dj-year {
  font-size: 11px; font-weight: 700; color: #8e8e93;
  padding: 6px 16px 2px; letter-spacing: 0.5px; text-transform: uppercase;
}
.dj-item {
  padding: 9px 16px; font-size: 14px; cursor: pointer;
  color: #1c1c1e; white-space: nowrap;
}
.dj-item:hover, .dj-item:active { background: #f2f2f7; }
.dj-item.active { color: #0071e3; font-weight: 600; }


.album-detail-card {
  position: relative; cursor: pointer;
  border-radius: 8px; overflow: hidden;
  aspect-ratio: 1;
  background: #e5e5ea;
}
.album-detail-card .card-thumb {
  width: 100%; height: 100%; background: none;
}
.album-detail-card .card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.album-detail-card:hover { opacity: 0.88; }
.album-detail-card.active {
  outline: 3px solid #0071e3;
  outline-offset: -3px;
  opacity: 1;
}
.album-detail-card .card-dur-badge,
.album-detail-card .card-fav-badge {
  opacity: 0;
  transition: opacity 0.15s;
}
.album-detail-card:hover .card-dur-badge,
.album-detail-card:hover .card-fav-badge,
.album-detail-card.active .card-dur-badge,
.album-detail-card.active .card-fav-badge { opacity: 1; }

/* 히스토리 모달 */
#trip-history-overlay {
  position: fixed; inset: 0; z-index: 3100;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
#trip-history-modal {
  background: #fff; border-radius: 16px;
  width: min(480px, 92vw); max-height: 70vh;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.trip-history-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e5e5ea;
}
.trip-history-header h3 { margin: 0; font-size: 16px; }
#btn-trip-history-close {
  background: none; border: none; font-size: 18px; cursor: pointer; color: #666;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
#trip-history-list { overflow-y: auto; padding: 8px 0; flex: 1; }
.th-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; border-bottom: 1px solid #f2f2f7;
  gap: 12px;
}
.th-row:last-child { border-bottom: none; }
.th-info { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.th-type { font-size: 13px; font-weight: 600; color: #1d1d1f; }
.th-count { font-size: 12px; color: #6e6e73; }
.th-date { font-size: 11px; color: #aeaeb2; }
.th-restore-btn {
  background: #0071e3; color: #fff; border: none; border-radius: 8px;
  padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.th-restore-btn:hover { background: #005bbf; }
.th-loading, .th-empty { padding: 24px; text-align: center; color: #888; font-size: 14px; }

.album-suggestion-list {
  display: flex; flex-direction: column; gap: 10px;
}
.alb-sug-card {
  background: #f9f9fb; border: 1px solid #e5e5ea;
  border-radius: 12px; padding: 14px 16px;
  display: flex; align-items: center; gap: 16px;
}
.alb-sug-thumbs {
  display: flex; gap: 4px; flex-shrink: 0;
}
.alb-sug-thumbs img {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 6px; background: #e5e5ea;
}
.alb-sug-body { flex: 1; min-width: 0; }
.alb-sug-name {
  width: 100%; font-size: 15px; font-weight: 600;
  border: none; border-bottom: 1px dashed #c7c7cc;
  background: transparent; outline: none;
  color: #1d1d1f; margin-bottom: 4px;
  cursor: text;
}
.alb-sug-name:hover { border-bottom-color: #8e8e93; }
.alb-sug-name:focus {
  background: #fff; border-radius: 4px;
  padding: 2px 6px; border: 1px solid #0071e3;
}
.alb-sug-meta { font-size: 12px; color: #6e6e73; margin-bottom: 6px; }
.alb-sug-places { display: flex; flex-wrap: wrap; gap: 4px; }
.alb-sug-place {
  font-size: 11px; color: #3a3a3c;
  background: #e9e9ef; border-radius: 4px;
  padding: 2px 7px;
}
.alb-sug-actions { flex-shrink: 0; }
.btn-make-album {
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  background: #0071e3; color: #fff;
  border: none; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.btn-make-album:hover { background: #0077ed; }
.btn-sug-toggle {
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  background: #f0f0f5; color: #1d1d1f;
  border: 1px solid #d2d2d7; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.btn-sug-toggle:hover { background: #e5e5ea; }
.btn-sug-ignore {
  padding: 7px 14px; font-size: 13px; font-weight: 500;
  background: none; color: #8e8e93;
  border: 1px solid #d2d2d7; border-radius: 8px; cursor: pointer;
  white-space: nowrap;
}
.btn-sug-ignore:hover { color: #1d1d1f; border-color: #aeaeb2; }

.alb-sug-wrap { display: flex; flex-direction: column; gap: 0; }
.alb-sug-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 4px;
  padding: 8px 0 4px;
}
.alb-sug-photo-thumb {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; border-radius: 6px;
  cursor: pointer; transition: opacity 0.15s;
}
.alb-sug-photo-thumb:hover { opacity: 0.85; }

#btn-scroll-top {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1c1c1e;
  color: #fff;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 900;
}
#btn-scroll-top.visible {
  opacity: 0.85;
  pointer-events: auto;
}
#btn-scroll-top:hover { opacity: 1; }

/* 비디오 배지 */
.card-video-badge {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; pointer-events: none;
}
.card-fav-badge {
  position: absolute; top: 4px; right: 4px;
  font-size: 14px; line-height: 1; pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
}
.card-dur-badge {
  position: absolute; bottom: 4px; right: 4px;
  background: rgba(0,0,0,.6); color: #fff;
  font-size: 11px; font-weight: 600;
  padding: 1px 5px; border-radius: 4px;
  pointer-events: none; letter-spacing: 0.3px;
}

/* 라이트박스 비디오 */
#lightbox-video {
  max-width: 100%; max-height: min(80vh, calc(100vh - 100px));
  border-radius: 8px;
  background: #000;
}
