/* 갤러리 방문자 화면 — 모바일 기준 (기획안 7.2~7.6) */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 320ms; animation-timing-function: cubic-bezier(0.2, 0, 0, 1); }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.lg-only { display: none; }
.icon-btn { min-width: 44px; height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 14px; cursor: pointer; border-radius: 10px; text-decoration: none; }
.icon-btn:active { background: rgba(0,0,0,.05); }

/* 머리글: 아래로 스크롤하면 숨고 위로 올리면 보임 (7.6.3) */
.g-header { transition: transform .2s var(--ease); }
.g-header.hide { transform: translateY(-100%); }

/* 카테고리 탭 + 보기 전환 (44px, 고정) */
.bars { position: sticky; top: 0; z-index: 9; background: var(--surface); }
.tabs-row { height: 44px; display: flex; align-items: stretch; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cat-tabs { flex: 1; min-width: 0; display: flex; overflow-x: auto; scrollbar-width: none; padding-left: 8px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tabs a { flex: none; height: 44px; padding: 0 12px; display: flex; align-items: center; font-size: 14px; color: var(--text-sub); text-decoration: none; white-space: nowrap; }
.cat-tabs a[aria-current] { color: var(--text); font-weight: 700; box-shadow: inset 0 -2px 0 var(--g-accent, var(--accent)); }
.view-toggle { flex: none; display: flex; align-items: center; padding: 0 4px; border-left: 1px solid var(--line); }
.view-toggle a { min-width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--text-sub); text-decoration: none; font-size: 14px; }
.view-toggle a[aria-current] { color: var(--g-accent, var(--accent)); }
.view-toggle a[aria-current] svg { background: var(--g-accent-soft); border-radius: 8px; padding: 6px; width: 34px; height: 30px; }
.year-row { height: 40px; display: flex; align-items: center; gap: 6px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--line); }
.year-row::-webkit-scrollbar { display: none; }
.pill { flex: none; height: 30px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; font: inherit; font-size: 13px; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--line); cursor: pointer; }
.pill[aria-current] { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.pill.off { color: #B5B1AA; }

.feed-wrap { max-width: 1280px; margin: 0 auto; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.g-desc { margin: 16px 16px 0; color: var(--text-sub); font-size: 14px; }
.empty { padding: 64px 16px; text-align: center; color: var(--text-sub); }

/* N년 전 오늘 */
.memories { margin: 12px 16px 4px; padding: 12px 0 14px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.mem-head { display: flex; justify-content: space-between; align-items: center; padding-right: 2px; }
.mem-head strong { font-size: 15px; margin-right: 8px; }
.mem-tabs { display: inline-flex; gap: 4px; }
.mem-tabs button { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 12px; cursor: pointer; }
.mem-tabs button[aria-selected="true"] { background: var(--g-accent-soft); border-color: var(--g-accent-soft); color: var(--accent); font-weight: 600; }
.mem-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-top: 8px; padding-right: 14px; align-items: flex-end; }
.mem-strip::-webkit-scrollbar { display: none; }
.mem-strip a { flex: none; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; }
.mem-strip img { width: 100%; height: 100%; object-fit: cover; }
.mem-date { flex: none; font-size: 12px; color: var(--text-sub); padding: 0 4px 2px; }

/* 그리드 (7.2) */
.grid { display: grid; }
.grid-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; row-gap: 16px; padding: 16px; }
.grid-all { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding-top: 12px; }
.grid-post { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.year-head { grid-column: 1 / -1; margin: 12px 0 0; padding: 0 16px; font-size: 16px; }
.grid-stack .year-head { padding: 0; }
.tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; }
.tile img, .front img { width: 100%; height: 100%; object-fit: cover; }
.dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 18px; }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 999px; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }

/* 묶음 겹침 표현 (7.3) */
.stack { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; }
.stack-box { position: relative; display: block; aspect-ratio: 1; }
.stack .card, .stack .front { position: absolute; inset: 0; border-radius: var(--radius-sm); }
.stack.multi .card, .stack.multi .front { inset: 6%; border: 2px solid #fff; }
.stack .card.c1 { background: #E4E0DA; transform: rotate(-3deg) translate(-3px, -4px); }
.stack .card.c2 { background: #D6D1C9; transform: rotate(4deg) translate(4px, -6px); }
.stack .card, .stack .front { transition: transform .2s var(--ease); }
.stack .front { overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.stack.single .front { box-shadow: none; }
.count { position: absolute; top: 8px; right: 8px; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.cap { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.cap strong { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap small { font-size: 12px; color: var(--text-sub); }
@media (hover: hover) {
  .stack.multi:hover .c1 { transform: rotate(-6deg) translate(-5px, -5px); }
  .stack.multi:hover .c2 { transform: rotate(6deg) translate(6px, -7px); }
  .stack:hover .front { transform: scale(1.02); }
}

.more-wrap { padding: 24px 16px; }
.more-btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.to-top { position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 8; width: 44px; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.12); display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* 묶음 화면 (U-03) */
.post-head { display: flex; gap: 4px; padding: 12px 16px 16px 8px; }
.post-info { flex: 1; min-width: 0; }
.post-info h1 { margin: 2px 0 6px; font-size: 20px; }
.lb-meta-light { margin: 10px 0 0; font-size: 12px; color: var(--text-sub); }
.post-content { margin: 0; font-size: 14px; color: var(--text-sub); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-btn { min-height: 32px; padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.reveal { animation: fadeUp .32s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 월 선택 시트 (7.10) */
.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border: 0; padding: 0; border-radius: 16px 16px 0 0; background: var(--surface); }
.sheet::backdrop { background: rgba(20,20,19,.45); }
.sheet-body { padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet-grip, .lb-grip { width: 36px; height: 4px; border-radius: 999px; background: var(--line-strong); margin: 0 auto; }
.sheet h2 { margin: 0; font-size: 18px; }
.month-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.month-grid .pill { justify-content: center; height: 44px; }

/* 크게 보기 (U-04, 7.6.4) */
body.lb-open { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; background: var(--lightbox-bg); color: #fff; display: flex; flex-direction: column; height: 100dvh; touch-action: none; }
.lb[hidden] { display: none; }
.lb-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 4px 0; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(rgba(0,0,0,.45), transparent); transition: opacity .2s; }
.lb-btn { width: 44px; height: 44px; border: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.lb-count { font-size: 13px; color: #D6D1C9; }
.lb-stage { position: relative; flex: 1; overflow: hidden; }
.lb-track { position: absolute; inset: 0; display: flex; will-change: transform; }
.lb-slide { flex: none; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transform-origin: center center; }
/* 영상 (기획안 7.9.3) */
.lb-slide.is-video { position: relative; }
.lb-slide video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; }
.lb-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 72px; height: 72px; padding: 0 18px; border: 0; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; cursor: pointer; }
.lb-play:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.lb-nav { position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 999px; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: opacity .2s; }
.lb-nav.prev { left: 4px; }
.lb-nav.next { right: 4px; }
.lb-nav[disabled] { opacity: 0; pointer-events: none; }
.lb-sheet { position: relative; z-index: 3; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: #1A1A19; max-height: 60vh; overflow-y: auto; transition: opacity .2s, transform .2s var(--ease); }
.lb-sheet[hidden] { display: none; }
.lb-meta { margin: 10px 0 4px; font-size: 12px; color: #A8A39B; }
.lb-title { margin: 0 0 6px; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .15s; }
.lb-content { margin: 0; font-size: 14px; line-height: 1.6; color: #D6D1C9; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lb-sheet.open .lb-content { -webkit-line-clamp: unset; display: block; }
.lb-sheet.open .lb-title { white-space: normal; }
.lb-more { margin-top: 6px; min-height: 32px; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lb.ui-off .lb-top, .lb.ui-off .lb-nav { opacity: 0; pointer-events: none; }
.lb.ui-off .lb-sheet { opacity: 0; transform: translateY(100%); pointer-events: none; }
@media (orientation: landscape) and (max-height: 500px) { .lb-sheet { display: none; } }

@media (min-width: 600px) {
  .grid-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-all, .grid-post { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .lg-only { display: inline; }
  .g-header .inner { height: 72px; padding: 0 40px; }
  .g-header .g-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
  .g-logo { font-size: 20px; }
  .bars .tabs-row { height: 52px; max-width: 1280px; margin: 0 auto; padding: 0 40px; border: 0; }
  .bars { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .cat-tabs a { height: 52px; padding: 0 16px; font-size: 15px; }
  .view-toggle { border: 0; gap: 4px; }
  .view-toggle a { height: 36px; padding: 0 12px; border-radius: 8px; }
  .view-toggle a[aria-current] { background: var(--g-accent-soft); font-weight: 600; }
  .view-toggle a[aria-current] svg { background: none; padding: 0; width: 16px; height: 16px; }
  .year-row { max-width: 1280px; margin: 0 auto; padding: 0 40px; border: 0; background: transparent; }
  .feed-wrap { padding: 0 40px 64px; }
  .g-desc { margin: 24px 0 0; font-size: 15px; }
  .memories { margin: 20px 0 4px; }
  .grid-stack { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 12px; row-gap: 28px; padding: 24px 0; }
  .grid-all { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding-top: 24px; }
  .grid-post { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .tile { border-radius: var(--radius-sm); }
  .grid-all .year-head { padding: 0; }
  .more-wrap { display: flex; justify-content: center; padding-top: 40px; }
  .more-btn { width: 240px; }
  .post-head { padding: 24px 0; }
  .post-info h1 { font-size: 26px; }
  /* 크게 보기: 오른쪽 360px 패널 */
  .lb { flex-direction: row; }
  .lb-sheet { width: 360px; flex: none; max-height: none; border-radius: 0; padding: 72px 24px 24px; }
  .lb-grip { display: none; }
  .lb-content { -webkit-line-clamp: unset; display: block; }
  .lb-more { display: none; }
  .lb-top { right: 360px; }
  .lb.ui-off .lb-sheet { transform: none; opacity: 1; pointer-events: auto; }
}

/* =====================================================================
 * 2차 디자인 "가족 앨범 에디토리얼" (기획안_2차 4장)
 * ===================================================================== */
/* 대표색 옅은 색(--g-accent-soft)·글자·막대 색은 갤러리 테마(GalleryTheme)가 :root 에 넣는다 */

/* 머리글: 표지 위에서는 투명 + 흰 글자 (휴대폰·태블릿) */
.g-header { transition: transform .2s var(--ease), background-color .2s var(--ease); }
.g-header .g-logo { font-size: 17px; letter-spacing: -0.01em; }
@media (max-width: 1023px) {
  .g-header.on-cover { background: transparent; }
  .g-header.on-cover .g-logo, .g-header.on-cover .icon-btn { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
  .g-header.on-cover .g-mark { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
}

/* 표지 */
.g-cover { position: relative; height: 56vh; height: min(56svh, 480px); min-height: 300px; overflow: hidden; margin-top: calc(-56px - env(safe-area-inset-top)); }
.g-cover img { width: 100%; height: 100%; object-fit: cover; animation: coverIn .48s var(--ease-out) both; }
.g-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 45%, rgba(0,0,0,0) 65%), linear-gradient(to bottom, rgba(0,0,0,.28), rgba(0,0,0,0) 30%); pointer-events: none; }
.g-cover-text { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 20px; z-index: 1; color: #fff; animation: fadeUp .48s var(--ease-out) .08s both; }
.g-cover-label { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: rgba(255,255,255,.22); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: var(--t-label); font-weight: 600; letter-spacing: .04em; }
.g-cover h1 { margin: 10px 0 4px; font-size: var(--t-display); font-weight: 700; line-height: 1.15; letter-spacing: -0.03em; text-shadow: 0 1px 12px rgba(0,0,0,.25); }
.g-cover p { margin: 0; font-size: var(--t-cap); font-weight: 500; font-variant-numeric: tabular-nums; opacity: .92; }
@keyframes coverIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

/* 소개 */
.g-desc { max-width: 680px; margin: 20px var(--gutter) 4px; font-size: var(--t-body); line-height: 1.65; color: var(--text-sub); }

/* 고정 막대: 선 4줄 → 1줄 */
.bars { background: var(--g-bar, var(--bg)); box-shadow: 0 1px 0 var(--line); }
.tabs-row { border: 0; }
.view-toggle { border-left: 0; }
.cat-tabs a { font-size: 15px; }
.cat-tabs a[aria-current] { box-shadow: inset 0 -2px 0 var(--g-accent, var(--accent)); }
.year-row { border-bottom: 0; background: transparent; padding: 0 var(--gutter) 8px; height: 44px; }
.pill { height: 32px; font-size: 14px; font-variant-numeric: tabular-nums; gap: 6px; background: var(--surface); }
.pill.off { color: var(--text-mute); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.2); }

/* 시간의 장: 큰 연도 숫자 + 월 머리글 */
.chapter { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; margin: var(--s-section) 0 0; padding: 0; line-height: 1; }
.grid > .chapter:first-child { margin-top: 8px; }
.chapter-year { font-size: var(--t-chapter); font-weight: 300; letter-spacing: -0.04em; color: var(--g-accent, var(--accent)); font-variant-numeric: tabular-nums; }
.chapter-count { font-size: var(--t-meta); font-weight: 500; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.month-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; margin: 16px 0 0; font-size: var(--t-h2); font-weight: 700; letter-spacing: -0.02em; }
.month-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.chapter + .month-head { margin-top: 12px; }
.grid-all .chapter { padding: 0 var(--gutter); }
.grid-all .chapter:not(:first-child) { margin-bottom: 12px; }

/* 묶어서 보기: 인화지 카드 */
.grid-stack { padding: 8px var(--gutter) 0; column-gap: 12px; row-gap: 24px; }
.stack .front { border-radius: 2px; box-shadow: var(--shadow-print); }
.stack.multi .card, .stack.multi .front { border: 3px solid #fff; border-radius: 2px; }
.stack .card.c1 { background: color-mix(in srgb, var(--dc, #D3CBBE) 45%, var(--surface, #fff)); box-shadow: 0 1px 2px rgba(40,30,20,.06); }
.stack .card.c2 { background: color-mix(in srgb, var(--dc, #D3CBBE) 25%, var(--surface, #fff)); box-shadow: 0 1px 2px rgba(40,30,20,.06); }
@supports not (color: color-mix(in srgb, red, red)) {
  .stack .card.c1 { background: #E4E0DA; }
  .stack .card.c2 { background: #D6D1C9; }
}
.cap { gap: 3px; padding: 2px 2px 0; }
.cap strong { font-size: var(--t-cap); font-weight: 600; }
.cap small { font-size: var(--t-meta); color: var(--text-sub); font-variant-numeric: tabular-nums; }
.count { background: rgba(20,18,15,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); font-variant-numeric: tabular-nums; }

/* 펼쳐서 보기: 사진 사이 숨 쉴 공간 */
.grid-all { gap: 3px; padding-top: 8px; }

/* 사진이 불러와지면 서서히 (대표색 칸이 먼저 보임) */
.tile img, .front img, .print img { transition: opacity .24s var(--ease); }
.js-fade img.is-loading { opacity: 0; }

/* N년 전 오늘: 인화 사진 */
.memories { margin: 20px var(--gutter) 0; padding: 16px 0 18px 16px; border: 0; border-radius: 16px; background: var(--paper-2); }
.mem-head { align-items: flex-start; padding-right: 4px; }
.mem-label, .mem-tabs button { font-size: var(--t-meta); font-weight: 700; color: var(--g-accent, var(--accent)); }
.mem-tabs { flex-wrap: wrap; gap: 6px; }
.mem-tabs button { height: 30px; padding: 0 12px; border: 1px solid transparent; background: transparent; }
.mem-tabs button[aria-selected="true"] { background: var(--surface); border-color: var(--surface); color: var(--g-accent, var(--accent)); box-shadow: 0 1px 2px rgba(40,30,20,.08); }
.mem-tabs button[aria-selected="false"] { color: var(--text-sub); font-weight: 600; }
.mem-when { margin: 4px 16px 0 0; font-size: var(--t-body); font-weight: 700; letter-spacing: -0.01em; }
.mem-strip { gap: 12px; margin-top: 12px; padding: 4px 16px 10px 2px; align-items: stretch; }
.mem-strip .print { flex: none; width: 136px; aspect-ratio: 4 / 5; height: auto; border: 3px solid #fff; border-radius: 2px; box-shadow: var(--shadow-print); transform: rotate(var(--tilt, 0deg)); overflow: hidden; }
.mem-strip .print img { width: 100%; height: 100%; object-fit: cover; }
.mem-more { flex: none; width: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--t-meta); font-weight: 600; color: var(--text); text-decoration: none; }
.mem-more span { font-size: 18px; color: var(--g-accent, var(--accent)); }

/* 더보기 */
.more-wrap { padding: 32px var(--gutter) 8px; }
.more-btn { height: 52px; background: var(--surface); border-color: var(--line-strong); }

/* 묶음 화면 글자 */
.post-info h1 { font-size: var(--t-h1); letter-spacing: -0.02em; }
.lb-meta-light { font-size: var(--t-meta); color: var(--g-accent, var(--accent)); font-weight: 600; }
.post-content { font-size: var(--t-body); }

@media (min-width: 600px) {
  .grid-stack { column-gap: 20px; row-gap: 32px; }
  .mem-strip .print { width: 160px; }
}

@media (min-width: 1024px) {
  .g-cover { max-width: calc(1280px - 80px); margin: 8px auto 0; height: 520px; border-radius: 4px; }
  .g-cover-text { left: 40px; bottom: 36px; }
  .g-desc { margin: 28px auto 0; max-width: calc(1280px - 80px); padding: 0; font-size: 17px; }
  .bars { box-shadow: 0 1px 0 var(--line); border: 0; }
  .feed-wrap { padding: 0 40px 72px; }
  .grid-stack { padding: 16px 0 0; column-gap: 20px; row-gap: 36px; }
  .grid-all { gap: 8px; }
  .grid-all .chapter { padding: 0; }
  .memories { margin: 28px 0 0; padding: 24px 0 24px 28px; }
  .mem-when { font-size: 20px; }
  .mem-strip { gap: 16px; }
  .mem-strip .print { width: 176px; }
  .more-wrap { padding-top: 48px; }
}

/* =====================================================================
 * 2차 디자인 E: 원본 비율 그리드 (펼쳐서 보기·묶음 화면) — 기획안_2차 4.4
 * 한 줄 높이를 맞추고 사진은 자르지 않는다. 사진 크기는 서버가 --r(가로÷세로)로 넘겨 화면이 흔들리지 않는다
 * ===================================================================== */
.grid-all, .grid-post { --row-h: 104px; display: flex; flex-wrap: wrap; gap: 3px; padding-top: 8px; }
.grid-all::after, .grid-post::after { content: ''; flex-grow: 9999; }
.grid-all .tile, .grid-post .tile { flex: calc(var(--r, 1) * 100) 1 calc(var(--r, 1) * var(--row-h)); max-width: calc(var(--r, 1) * var(--row-h) * 1.8); aspect-ratio: var(--r, 1); }
.grid-all .tile img, .grid-post .tile img { width: 100%; height: 100%; object-fit: cover; }
.grid-all .chapter, .grid-all .month-head { flex: 0 0 100%; }
.grid-all .chapter { margin-bottom: 8px; }
/* 사진 적은 묶음은 조금 크게. 휴대폰은 200px 이면 한 줄에 한 장씩만 들어가 세로 사진 옆이 비므로 두 장씩 들어가는 120px.
   화면이 좁으면(갤럭시 360px 등) 가로 사진(3:2) 두 장 + 간격이 폭을 넘지 않게 화면 폭에 맞춰 낮춘다 */
.grid-post.few { --row-h: min(120px, calc((100vw - 8px) / 3.1)); }
@media (min-width: 600px) {
  .grid-all, .grid-post { --row-h: 180px; gap: 6px; }
  .grid-post.few { --row-h: 280px; }
}
@media (min-width: 1024px) {
  .grid-all, .grid-post { --row-h: 240px; gap: 8px; }
  .grid-post.few { --row-h: 360px; }
  .grid-all .tile, .grid-post .tile { border-radius: 2px; }
}

/* 묶음 화면 2차 (기획안_2차 4.4): 대표 사진 → 제목 → 사진 → 이전·다음 묶음 */
.post-page { max-width: 1280px; margin: 0 auto; padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
.post-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 var(--gutter); color: var(--text-sub); font-size: var(--t-cap); font-weight: 600; text-decoration: none; }
.post-hero { position: relative; display: block; width: 100%; max-height: 70vh; max-height: 70svh; aspect-ratio: var(--r, 1); overflow: hidden; margin: 0 auto; }
.post-hero img { width: 100%; height: 100%; object-fit: contain; }
.post-title { padding: 20px var(--gutter) 8px; display: grid; gap: 12px; }
.post-date { margin: 0; font-size: var(--t-meta); font-weight: 600; color: var(--g-accent, var(--accent)); font-variant-numeric: tabular-nums; }
.post-title h1 { margin: 6px 0 4px; font-size: var(--t-h1); line-height: 1.3; letter-spacing: -0.025em; }
.post-count { margin: 0; font-size: var(--t-meta); color: var(--text-sub); font-variant-numeric: tabular-nums; }
.post-text .post-content { margin: 0; color: var(--text); line-height: 1.7; }
.grid-post { padding: 12px 0 0; }
.post-nav { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 32px var(--gutter) 0; }
.post-nav-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(40,30,20,.06); color: var(--text); text-decoration: none; min-width: 0; }
.post-nav-item.empty { display: none; }
.post-nav-thumb { flex: none; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; }
.post-nav-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-nav-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.post-nav-text small { font-size: var(--t-label); font-weight: 700; color: var(--g-accent, var(--accent)); }
.post-nav-text strong { font-size: var(--t-cap); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-nav-text span { font-size: var(--t-meta); color: var(--text-sub); }
.post-end { display: flex; justify-content: center; padding: 24px var(--gutter) 0; }
.post-end .btn { width: 100%; max-width: 360px; }

@media (min-width: 1024px) {
  .post-back { padding: 0 40px; margin-top: 8px; }
  .post-hero { max-width: calc(1280px - 80px); max-height: 640px; border-radius: 4px; }
  .post-title { grid-template-columns: minmax(0, 1fr) 520px; gap: 48px; align-items: end; padding: 32px 40px 16px; }
  .post-title h1 { font-size: 32px; }
  .grid-post { padding: 16px 40px 0; }
  .post-nav { grid-template-columns: 1fr 1fr; gap: 20px; padding: 48px 40px 0; }
  .post-nav-item.empty { display: block; background: transparent; box-shadow: none; }
  .post-nav-item.older { text-align: right; flex-direction: row-reverse; }
  .post-nav-item.older .post-nav-text { align-items: flex-end; }
}

/* 촬영 위치 (기획안 7.8.3) */
.lb-loc { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 2px 0 2px -2px; padding: 0 2px; border: 0; background: none; color: #E9E4DC; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; max-width: 100%; }
.lb-loc span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-map { position: absolute; inset: 0; z-index: 10; display: flex; align-items: flex-end; background: rgba(0,0,0,.5); touch-action: auto; }
.lb-map-card { width: 100%; max-height: 80vh; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; background: var(--surface); color: var(--text); display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.lb-map-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lb-map-head strong { font-size: var(--t-h2); letter-spacing: -0.02em; }
.lb-map-head .lb-btn { color: var(--text); }
.lb-map-frame { aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.lb-map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.lb-map-note { margin: -4px 0 0; font-size: var(--t-meta); color: var(--text-sub); }
.lb-map-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lb-map-links .btn { min-height: 52px; padding: 0 12px; font-size: 15px; }
/* 묶음 전체 ZIP (8차 기획안 10.4) */
.post-zip { margin-top: 6px; }
.post-zip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--t-cap); font-weight: 600; cursor: pointer; }
.post-zip-panel { display: grid; gap: 10px; margin-top: 4px; padding: 14px; border-radius: 14px; background: var(--paper-2, rgba(0,0,0,.04)); }
.post-zip-choices { display: grid; gap: 8px; }
.post-zip-status { margin: 0; font-size: 15px; }
.post-zip-status:empty { display: none; }
.post-zip-progress { width: 100%; height: 8px; accent-color: var(--g-accent, #2F5D50); }
.post-zip-get, .post-zip-ext { min-height: 48px; }
.post-zip-note { margin: 0; font-size: var(--t-meta); color: var(--text-sub); }
/* 사진 내려받기 시트 (8차 기획안 6장) */
.lb-dl-choices { display: grid; gap: 8px; }
.lb-dl-choice { display: flex; flex-direction: column; gap: 4px; width: 100%; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lb-dl-choice strong { font-size: 16px; }
.lb-dl-choice span { font-size: var(--t-meta); color: var(--text-sub); }
.lb-dl-tag { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: var(--g-accent, #2F5D50); color: #fff !important; font-size: 11px !important; vertical-align: 2px; }
.lb-dl-status { margin: 0; min-height: 1.4em; font-size: 15px; }
.lb-dl-status:empty { display: none; }
.lb-dl-save { min-height: 52px; }
.lb-dl-inapp { display: grid; gap: 10px; }
.lb-dl-inapp img { width: 100%; max-height: 40vh; object-fit: contain; border-radius: 12px; background: var(--paper-2); -webkit-touch-callout: default; user-select: auto; }
.lb-dl-inapp p { margin: 0; font-size: 14px; color: var(--text-sub); }
.lb-dl-inapp .btn { min-height: 48px; }
@media (min-width: 1024px) {
  .lb-map { left: auto; width: 360px; align-items: stretch; background: transparent; }
  .lb-map-card { max-height: none; border-radius: 0; padding: 72px 20px 24px; }
  .lb-map-card .lb-grip { display: none; }
}

/* 묶음 화면 장소 줄·지도 시트 */
.post-place { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 2px; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: var(--t-cap); font-weight: 600; cursor: pointer; text-align: left; }
.post-place svg { flex: none; color: var(--g-accent, var(--accent)); }
.place-sheet .place-map { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: var(--paper-2); }
.place-sheet .place-map img { width: 100%; height: 100%; object-fit: cover; }
.place-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.place-list li { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: var(--bg); }
.place-list strong { font-size: 15px; }
.place-list .place-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.place-list .place-links .btn { min-height: 44px; font-size: 14px; padding: 0 8px; }
@media (min-width: 1024px) {
  .place-sheet { width: 520px; margin: auto; border-radius: 20px; }
}

/* =====================================================================
 * 3차: 표지 한 장 / 배너형 (큰 사진 + 썸네일 2~3장), 글자 그늘 자동 — 기획안_3차 3장
 * 표지는 그냥 이미지다 (링크 없음)
 * ===================================================================== */
.g-cover::after { content: none; }
.g-cover-main { position: relative; height: 100%; overflow: hidden; }
.g-cover-main::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.55) 0%, rgba(0,0,0,.18) 45%, rgba(0,0,0,0) 65%), linear-gradient(to bottom, rgba(0,0,0,.28), rgba(0,0,0,0) 30%); pointer-events: none; }
/* 사진 아래쪽이 밝으면 그늘을 진하게 (이름이 잘 읽히게) */
.g-cover.shade-strong .g-cover-main::after { background: linear-gradient(to top, rgba(0,0,0,.74) 0%, rgba(0,0,0,.42) 42%, rgba(0,0,0,0) 72%), linear-gradient(to bottom, rgba(0,0,0,.32), rgba(0,0,0,0) 30%); }
.g-cover-sub { margin: 0 0 4px !important; font-size: var(--t-body) !important; font-weight: 600 !important; opacity: 1 !important; }
.g-cover-thumbs span { position: relative; display: block; overflow: hidden; }
.g-cover-thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* 배너형: 휴대폰은 큰 사진 아래 썸네일 한 줄 */
.g-cover.is-banner { height: auto; min-height: 0; overflow: visible; }
.g-cover.is-banner .g-cover-main { height: 48vh; height: min(48svh, 400px); min-height: 280px; }
.g-cover.is-banner .g-cover-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-top: 3px; }
.g-cover.is-banner.thumbs-2 .g-cover-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-cover.is-banner .g-cover-thumbs span { aspect-ratio: 1; }
.g-cover.is-banner.thumbs-2 .g-cover-thumbs span { aspect-ratio: 4 / 3; }

@media (min-width: 1024px) {
  .g-cover.is-banner { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 8px; height: 520px; border-radius: 0; background: transparent; }
  .g-cover.is-banner .g-cover-main { height: 100%; min-height: 0; border-radius: 4px; }
  .g-cover.is-banner .g-cover-thumbs { grid-template-columns: 1fr; grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; height: 100%; min-height: 0; }
  .g-cover.is-banner .g-cover-thumbs img { display: block; }
  .g-cover.is-banner.thumbs-2 .g-cover-thumbs { grid-template-columns: 1fr; grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .g-cover.is-banner .g-cover-thumbs span, .g-cover.is-banner.thumbs-2 .g-cover-thumbs span { aspect-ratio: auto; min-height: 0; border-radius: 4px; }
}

/* 사진 정보 (촬영 정보) */
.lb-exif { display: flex; align-items: center; gap: 6px; min-height: 40px; margin: -4px 0 2px -2px; padding: 0 2px; border: 0; background: none; color: #CFC9BF; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; max-width: 100%; text-align: left; font-variant-numeric: tabular-nums; }
.lb-exif span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-exif .chev { flex: none; transition: transform .2s var(--ease-out); }
.lb-exif[aria-expanded="true"] .chev { transform: rotate(180deg); }
.lb-exif-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 2px 0 10px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.07); font-size: 13px; line-height: 1.45; }
.lb-exif-list dt { color: #A9A397; white-space: nowrap; }
.lb-exif-list dd { margin: 0; color: #F1EDE6; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* ---------- 좋아요·베스트 (4차 기획안) ---------- */
.lb-top-r { display: flex; align-items: center; }
.lb-like { display: inline-flex; align-items: center; gap: 4px; min-width: 44px; height: 44px; padding: 0 10px; border: 0; background: none; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; font-variant-numeric: tabular-nums; }
.lb-like .h-on { display: none; }
.lb-like[aria-pressed="true"] .h-on { display: block; }
.lb-like[aria-pressed="true"] .h-off { display: none; }
.lb-like.pop svg { animation: likePop .32s var(--ease-out); }
.lb-heart-pop { position: absolute; left: 50%; top: 50%; z-index: 2; width: 96px; height: 96px; margin: -48px 0 0 -48px; pointer-events: none; opacity: 0; filter: drop-shadow(0 4px 18px rgba(0,0,0,.35)); }
.lb-heart-pop.show { animation: heartPop .8s var(--ease-out); }
@keyframes likePop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes heartPop { 0% { opacity: 0; transform: scale(.4); } 20% { opacity: .95; transform: scale(1.1); } 45% { transform: scale(.95); } 70% { opacity: .95; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .lb-heart-pop.show, .lb-like.pop svg { animation: none; } }

/* 목록 칸의 작은 하트 */
.like-badge { position: absolute; right: 6px; bottom: 6px; z-index: 1; display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(20,18,15,.58); color: #fff; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; pointer-events: none; }
.like-badge svg { color: #FF8A99; }
.like-badge[hidden] { display: none; }

/* 베스트 탭 */
.cat-tabs a.cat-best { gap: 4px; color: var(--g-accent, var(--accent)); font-weight: 700; }
.cat-tabs a.cat-best svg { color: #FF5A6E; }
/* 원본 비율 그대로 줄 맞춤 (일반 '펼쳐서 보기'와 같은 방식, 줄 높이만 크게). 1~3위는 자기 줄에서 더 크게 */
.grid-best { --row-h: 132px; --row-top: 200px; display: flex; flex-wrap: wrap; gap: 4px; padding: 10px var(--gutter) 0; }
.grid-best::after { content: ''; flex-grow: 9999; }
.best-row-top { flex: 0 0 100%; display: flex; flex-wrap: wrap; gap: 4px; }
.best-row-top::after { content: ''; flex-grow: 9999; }
.grid-best .best-tile { flex: calc(var(--r, 1) * 100) 1 calc(var(--r, 1) * var(--row-h)); max-width: calc(var(--r, 1) * var(--row-h) * 1.8); aspect-ratio: var(--r, 1); border-radius: 6px; }
.grid-best .best-top3 { flex-basis: calc(var(--r, 1) * var(--row-top)); max-width: calc(var(--r, 1) * var(--row-top) * 1.8); }
.grid-best .best-tile img { width: 100%; height: 100%; object-fit: cover; }
.grid-best .like-badge { right: 8px; bottom: 8px; height: 26px; padding: 0 9px; font-size: 13px; }
.grid-best .like-badge svg { width: 14px; height: 14px; }
.rank { position: absolute; left: 8px; top: 8px; z-index: 1; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
.rank-1 { background: #C99A2E; }
.rank-2 { background: #8E9299; }
.rank-3 { background: #A86B42; }
.best-top3 .rank { min-width: 34px; height: 34px; font-size: 16px; }
@media (min-width: 600px) {
  .grid-best { --row-h: 230px; --row-top: 320px; gap: 8px; }
  /* 태블릿·PC: 1~3위를 한 줄에, 원본 비율대로 나눠 같은 높이로 폭을 꽉 채운다 */
  .best-row-top { gap: 8px; flex-wrap: nowrap; }
  .best-row-top::after { content: none; }
  .grid-best .best-row-top .best-top3 { flex: var(--r, 1) 1 0; max-width: none; min-width: 0; }
}
@media (min-width: 1024px) {
  .grid-best { --row-h: 320px; --row-top: 420px; gap: 12px; max-width: calc(1280px - 80px); margin: 0 auto; padding: 24px 0 0; }
  .best-row-top { gap: 12px; }
}

/* 좋아요 하트 여러 개 (인스타그램처럼 떠올랐다 사라짐) */
.lb-burst { position: absolute; z-index: 4; margin: 0; pointer-events: none; transform: translate(-50%, -50%); animation: heartBurst 1s var(--ease-out) forwards; opacity: 0; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.lb-burst svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes heartBurst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(0deg); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(var(--rot)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.85) rotate(var(--rot)); }
}

/* 베스트: 스크립트가 줄 높이를 계산했을 때는 그 크기 그대로 (원본 비율, 자르지 않음) */
.grid-best.is-justified .best-tile, .grid-best.is-justified .best-row-top .best-top3 { flex: none; max-width: none; aspect-ratio: auto; }
.grid-best.is-justified .best-row-top { flex-wrap: wrap; justify-content: center; }

/* 최신순·오래된순 전환 */
.order-toggle { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; color: var(--text-sub); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.order-toggle:hover { color: var(--text); }
@media (max-width: 599px) { .order-toggle span { display: none; } }
/* 붙는 연·월 제목 */
.sticky-ym { position: absolute; left: 50%; top: calc(100% + 8px); transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: rgba(20, 18, 15, .72); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: -0.01em; pointer-events: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.15); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-variant-numeric: tabular-nums; }
.sticky-ym[hidden] { display: none; }
/* 날짜 미지정 */
.chapter-nodate .chapter-year { font-size: 22px; letter-spacing: -0.02em; }
/* 펼쳐서 보기 월 제목: 연도 제목과 같은 여백 */
.grid-all .month-head { padding: 0 var(--gutter); margin: 10px 0 6px; }
@media (min-width: 1024px) { .grid-all .month-head { padding: 0; } }

/* 카테고리·연도 줄 다듬기 (디자인 개선)
 * - 카테고리(1차)와 연도(2차)의 위계를 분명히: 카테고리는 밑줄 탭, 연도는 가벼운 외곽선 칩
 * - 두 줄 사이에 가는 구분선과 위아래 여백, 연도 줄 앞에 작은 이름표
 * - 선택 표시는 갤러리 대표색으로 통일 (검은 칩 대신). 글자는 배경색 — 대표색 글자는 배경과 4.5:1 이상이라 어두운 테마에서도 읽힌다 */
.tabs-row { position: relative; box-shadow: inset 0 -1px 0 var(--line); }
.cat-tabs a { position: relative; letter-spacing: -0.01em; transition: color .15s var(--ease); }
.cat-tabs a:hover { color: var(--text); }
.cat-tabs a[aria-current] { box-shadow: none; }
.cat-tabs a[aria-current]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--g-accent, var(--accent)); }
.year-row { height: auto; min-height: 56px; gap: 8px; padding: 12px var(--gutter); }
.year-row .row-label { flex: none; margin-right: 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text-mute); }
.year-row .pill { height: 32px; padding: 0 14px; font-size: 13px; font-weight: 500; color: var(--text-sub); background: transparent; border-color: var(--line-strong); transition: border-color .15s var(--ease), color .15s var(--ease), background-color .15s var(--ease); }
.year-row .pill:hover { color: var(--text); border-color: var(--text-sub); }
.year-row .pill[aria-current] { color: var(--bg); background: var(--g-accent, var(--accent)); border-color: var(--g-accent, var(--accent)); font-weight: 600; }
.year-row .pill svg { opacity: .85; }
@media (min-width: 1024px) {
  .cat-tabs a[aria-current]::after { left: 16px; right: 16px; }
  .year-row { min-height: 60px; padding: 14px 40px; gap: 10px; }
}

/* SnapStory 홍보 띠 (10차) — 갤러리 색을 해치지 않게 차분하게 */
.promo-band { margin: 8px 16px 32px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.promo-band p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.promo-brand { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-mute); }
.promo-btn { flex: none; min-height: 40px; padding: 0 16px; font-size: 14px; font-weight: 600; }
@media (min-width: 1024px) { .promo-band { max-width: 1200px; margin: 8px auto 40px; } }

/* 갤러리 소개 (10차 디자인 정리): 떠 있는 회색 글 → 표지에 이어지는 머리말
   갤러리 색 세로줄 + 본문색 글, 아래 탭과 간격을 두어 '표지 → 소개 → 목록' 순서가 보이게 */
.g-intro { padding: 20px var(--gutter) 22px; }
.g-intro .g-desc { position: relative; max-width: 680px; margin: 0; padding: 2px 0 2px 16px; font-size: 15px; line-height: 1.7; font-weight: 500; color: var(--text); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.g-intro .g-desc::before { content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px; background: var(--g-accent, var(--accent)); }
@media (min-width: 1024px) {
  .g-intro { max-width: calc(1280px - 80px); margin: 0 auto; padding: 32px 0 36px; }
  .g-intro .g-desc { max-width: 760px; margin: 0; padding-left: 20px; font-size: 18px; line-height: 1.7; }
}

/* ---------- 잠긴 사진 (11차): 목록은 자물쇠 칸, 크게 보기는 암호 입력 ---------- */
.lock-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #6B6862;
  background: repeating-linear-gradient(135deg, #E7E3DC 0 10px, #EFEBE5 10px 20px); }
.lock-cover small { font-size: 12px; font-weight: 600; letter-spacing: -.01em; }
.lock-cover.is-small { gap: 0; }
.lock-cover .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.post-nav-thumb { position: relative; }
.lb-slide.is-locked { padding: 24px; }
.lb-lock { width: min(320px, 100%); display: grid; justify-items: center; gap: 8px; color: #fff; text-align: center; }
.lb-lock svg { opacity: .9; margin-bottom: 4px; }
.lb-lock-title { margin: 0; font-size: 18px; font-weight: 700; }
.lb-lock-sub { margin: 0 0 8px; font-size: 14px; color: rgba(255,255,255,.72); }
.lb-lock-row { display: flex; gap: 8px; width: 100%; }
.lb-lock-row input { flex: 1; min-width: 0; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.1); color: #fff; font-size: 18px; letter-spacing: .12em; text-align: center; }
.lb-lock-row input:focus { outline: 2px solid #fff; outline-offset: 1px; }
.lb-lock-row button { height: 48px; padding: 0 18px; border: 0; border-radius: 12px; background: #fff; color: #1C1C1A; font-size: 16px; font-weight: 700; cursor: pointer; }
.lb-lock-row button:disabled { opacity: .6; }
.lb-lock-err { min-height: 20px; margin: 0; font-size: 14px; color: #FFB4B4; }

/* ---------- 12차: 태그 뱃지 · 태그 줄 · 갤러리 검색 ---------- */
.g-header-r { display: flex; align-items: center; gap: 4px; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 30px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--g-accent-soft, #E6EFEA); color: var(--g-accent, var(--accent)); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tag-chip small { font-weight: 500; opacity: .7; }
.tag-chip[aria-current] { background: var(--g-accent, var(--accent)); color: #fff; }
.tag-chip.is-cat { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.tag-chip.is-more { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.tag-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 16px 8px; scrollbar-width: none; flex-wrap: nowrap; }
.tag-row::-webkit-scrollbar { display: none; }
.tag-head { display: flex; align-items: center; gap: 10px; padding: 6px 16px 10px; font-size: 15px; }
.tag-head strong { font-size: 18px; color: var(--g-accent, var(--accent)); }
.tag-head span { color: var(--text-sub, #6B6862); }
.tag-clear { margin-left: auto; font-size: 13px; color: var(--text-sub, #6B6862); text-decoration: none; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.lb-tags .tag-chip { background: rgba(255,255,255,.14); color: #fff; height: 28px; }
.g-search { display: flex; align-items: center; gap: 8px; margin: 4px 16px 8px; padding: 0 12px; height: 44px; border-radius: 12px; background: var(--g-accent-soft, #F1EEE8); color: var(--text-sub, #6B6862); }
.g-search[hidden] { display: none; }
.g-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; color: var(--text, #1C1C1A); outline: none; }
.g-search-x { color: inherit; text-decoration: none; padding: 6px; }
.search-head { padding: 8px 16px 4px; }
.search-head p { margin: 0 0 6px; font-weight: 600; }
.search-head .tag-row { padding-left: 0; padding-right: 0; flex-wrap: wrap; }
/* 고정 막대 안의 태그 줄·선택한 태그 머리: 카테고리 탭·연도 줄과 같은 폭(가운데 1280px)과 왼쪽 선에 맞춘다 */
.tag-row-bar { align-items: center; gap: 8px; padding: 12px var(--gutter) 0; }
.tag-row-bar .row-label { flex: none; margin-right: 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text-mute); }
.tag-row-bar .tag-chip { height: 32px; padding: 0 14px; }
.tag-head { padding: 12px var(--gutter) 0; }
.g-search { margin-left: var(--gutter); margin-right: var(--gutter); }
@media (min-width: 1024px) {
  .search-head { padding-left: 40px; padding-right: 40px; }
  .tag-row-bar, .tag-head { max-width: 1280px; margin: 0 auto; padding: 14px 40px 0; gap: 10px; }
  .g-search { max-width: 560px; margin-top: 12px; margin-left: max(40px, calc((100% - 1280px) / 2 + 40px)); }
}

/* 연도 줄: 지금 화면에 보이는 해 (스크롤을 따라 바뀐다). 그 해 칩을 강조색으로 채우고, 그동안 '전체'는 테두리만 */
.year-row .pill.is-seen:not([aria-current]) { color: #fff; border-color: var(--g-accent, var(--accent)); background: var(--g-accent, var(--accent)); font-weight: 700; }
.year-row.has-seen .pill[aria-current]:not([data-year-pill]) { color: var(--text-sub); background: transparent; border-color: var(--line-strong); font-weight: 500; }

/* ---------- 14차: 휴대폰·태블릿 하단 앱바 (홈 · 찾기 · 보기 · 공유) ---------- */
.g-appbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); height: calc(60px + env(safe-area-inset-bottom)); padding: 4px 8px env(safe-area-inset-bottom); background: var(--surface); background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.g-appbar a, .g-appbar button { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; background: none; padding: 0; color: var(--text-sub); font: inherit; font-size: 11px; line-height: 1.3; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.g-appbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-appbar [aria-current] { color: var(--g-accent, var(--accent)); font-weight: 700; }
.g-appbar a:active, .g-appbar button:active { opacity: .6; }
body.lb-open .g-appbar { display: none; }
@media (max-width: 1023px) {
  /* 앱바와 겹치는 것: 머리글의 찾기·공유 단추, 둥근 [맨 위로], 필터 줄의 정렬·보기 방식 단추 */
  .has-appbar .g-header [data-search-open], .has-appbar .g-header [data-share], .has-appbar .to-top,
  .has-appbar .order-toggle, .has-appbar .view-toggle { display: none !important; }
  .has-appbar .feed-wrap, .has-appbar .post-page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1024px) { .g-appbar { display: none; } }

/* '보기' 시트 */
.view-sheet-group { display: flex; flex-direction: column; gap: 8px; }
.view-sheet-label { font-size: 13px; font-weight: 600; color: var(--text-sub); }
.view-sheet-note { margin: 0; color: var(--text-sub); font-size: 15px; line-height: 1.6; }
.view-sheet-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.view-sheet-opts a { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); text-decoration: none; font-size: 15px; }
.view-sheet-opts.is-big a { min-height: 108px; }
.view-sheet-opts small { font-size: 12px; color: var(--text-sub); }
.view-sheet-opts a[aria-current] { border: 2px solid var(--g-accent, var(--accent)); background: var(--g-accent-soft, var(--accent-soft)); color: var(--g-accent, var(--accent)); font-weight: 700; }

/* ---------- 14차: 가족 간단 올리기 화면 ---------- */
.up-page { min-height: 100dvh; background: var(--bg); }
.up-top { position: sticky; top: 0; z-index: 10; height: 56px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 4px; padding: 0 12px 0 4px; background: var(--surface); border-bottom: 1px solid var(--line); }
.up-top h1 { margin: 0; font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-who { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.up-wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 0; }
.up-form { display: flex; flex-direction: column; gap: 20px; padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
.up-pick-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.up-pick-btn { min-height: 136px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-align: center; padding: 8px; }
.up-pick-btn strong { font-size: 16px; }
.up-pick-btn small { font-size: 12px; color: var(--text-sub); }
.up-pick-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.up-drop { display: none; }
.up-note { margin: 10px 0 0; font-size: 13px; color: var(--text-sub); line-height: 1.6; }
.up-list-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.up-list-head span { color: var(--text-sub); font-size: 13px; text-align: right; }
.up-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.up-tile, .up-more { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--paper-2); }
.up-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-name { display: none; position: absolute; inset: 6px 6px 18px; font-size: 11px; color: var(--text-sub); word-break: break-all; overflow: hidden; }
.up-tile.no-preview .up-name { display: block; }
.up-progress { display: none; position: absolute; left: 6px; right: 6px; bottom: 6px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.55); }
.up-progress span { display: block; height: 100%; width: 0; border-radius: 2px; background: #fff; transition: width .2s; }
.up-tile.is-wait .up-progress, .up-tile.is-up .up-progress { display: block; }
.up-tile.is-wait img, .up-tile.is-up img { opacity: .6; }
.up-x { position: absolute; right: 2px; top: 2px; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.up-retry { display: none; position: absolute; inset: 0; border: 0; background: rgba(163,58,58,.85); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.up-tile.is-fail .up-retry { display: block; }
.up-tile.is-cover::before { content: '대표'; position: absolute; left: 4px; top: 4px; z-index: 1; padding: 1px 6px; border-radius: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; }
.up-more label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1.5px dashed var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text-sub); font-size: 12px; cursor: pointer; }
.up-field { margin: 0; padding: 0; border: 0; min-width: 0; }
.up-field legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.up-opt { font-size: 12px; font-weight: 400; color: var(--text-sub); }
.up-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.up-chips span { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; cursor: pointer; }
.up-chips input:checked + span { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.up-chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.up-counter { align-self: flex-end; font-size: 12px; font-weight: 400; color: var(--text-sub); }
.up-form textarea.input { min-height: 100px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
.up-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.up-bar .btn { max-width: 688px; min-height: 52px; font-size: 16px; }
.up-bar small { font-size: 12px; color: var(--text-sub); }
@media (min-width: 1024px) {
  .up-wrap { padding-top: 32px; }
  .up-pick-btns { display: none; }
  .up-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 220px; border: 2px dashed var(--line-strong); border-radius: 16px; background: var(--surface); color: var(--accent); transition: background-color .15s, border-color .15s; }
  .up-drop span { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; }
  .up-drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
  .up-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* 앱바 가운데 [+ 올리기], 머리글 계정 메뉴·PC [사진 올리기], 알림 띠 */
.g-appbar .ab-plus { color: var(--g-accent, var(--accent)); font-weight: 700; }
.g-appbar .ab-plus i { width: 44px; height: 30px; border-radius: 10px; background: var(--g-accent, var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; }
.g-upload-btn { display: none; }
@media (min-width: 1024px) {
  .g-upload-btn { display: inline-flex; height: 40px; padding: 0 16px; border-radius: 10px; background: var(--g-accent, var(--accent)); color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; align-items: center; gap: 6px; border: 0; cursor: pointer; font-family: inherit; }
}
.g-me { position: relative; }
.g-me > summary { list-style: none; width: 34px; height: 34px; margin: 5px; border-radius: 999px; background: var(--g-accent-soft, var(--accent-soft)); color: var(--g-accent, var(--accent)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; cursor: pointer; }
.g-me > summary::-webkit-details-marker { display: none; }
.g-me-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 200px; padding: 6px; border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 8px 28px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.g-me-menu p { margin: 0; padding: 8px 10px; font-size: 13px; color: var(--text-sub); }
.g-me-menu a, .g-me-menu button { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; font-size: 15px; text-align: left; text-decoration: none; display: flex; align-items: center; cursor: pointer; }
.g-me-menu a:hover, .g-me-menu button:hover { background: var(--paper-2); }
.g-me-menu form { margin: 0; }
.g-flash { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: rgba(20,18,15,.88); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 4px 16px rgba(0,0,0,.2); animation: gFlash 4s forwards; pointer-events: none; }
@keyframes gFlash { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (min-width: 1024px) { .g-flash { bottom: 32px; } }
@media (prefers-reduced-motion: reduce) { .g-flash { animation-duration: 6s; } }
.member-sheet .sheet-body { padding-top: 10px; }
/* 묶음 화면: 올린 사람, 내 묶음 고치기·지우기 */
.post-author { color: var(--g-accent, var(--accent)); font-weight: 600; }
.post-mine { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; }
.post-mine .btn { min-height: 36px; font-size: 14px; }

/* ---------- 15차: 휴대폰에서 필터 줄 접기 ----------
 * 내려 볼 때는 카테고리 탭만 붙어 있고, 태그 줄은 처음 화면에만 있다.
 * 위로 올리면(머리글이 다시 나올 때) 연도 줄도 카테고리 탭 아래로 다시 내려온다. */
@media (max-width: 1023px) {
  .has-appbar .bars { display: contents; }
  .has-appbar .tabs-row { position: sticky; top: var(--bars-top, 0px); z-index: 9; background: var(--g-bar, var(--bg)); box-shadow: 0 1px 0 var(--line); transition: top .2s var(--ease); }
  .has-appbar .year-row[data-year-row] { position: relative; z-index: 8; background: var(--g-bar, var(--bg)); }
  .has-appbar.bars-full .year-row[data-year-row] { position: sticky; top: calc(var(--bars-top, 0px) + 44px); box-shadow: 0 1px 0 var(--line); animation: yearRowIn .2s var(--ease); }
  .has-appbar .sticky-ym { position: fixed; top: var(--ym-top, 52px); z-index: 9; }
}
@keyframes yearRowIn { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .has-appbar.bars-full .year-row[data-year-row] { animation: none; } }
/* '보기' 시트: 연도 바로 가기 */
.view-sheet-years { display: flex; flex-wrap: wrap; gap: 8px; }
.view-sheet-years .pill { height: 40px; padding: 0 16px; font-size: 15px; }
.view-sheet-years .pill[aria-current] { border: 2px solid var(--g-accent, var(--accent)); background: var(--g-accent-soft, var(--accent-soft)); color: var(--g-accent, var(--accent)); font-weight: 700; }

/* ---------- 15차: 홈 화면에 추가 안내 띠 ---------- */
.g-install { position: fixed; left: 12px; right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 35; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 10px 32px rgba(0,0,0,.22), 0 0 0 1px var(--line); animation: gInstallIn .3s var(--ease-out); }
.g-install[hidden] { display: none; }
.g-install-icon { width: 48px; height: 48px; border-radius: 12px; }
.g-install-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g-install-text strong { font-size: 15px; line-height: 1.35; }
.g-install-text span { font-size: 13px; color: var(--text-sub); line-height: 1.45; }
.g-install-steps { grid-column: 1 / -1; margin: 0; padding: 10px 12px 10px 30px; border-radius: 10px; background: var(--paper-2); font-size: 14px; line-height: 1.7; }
.g-install-steps svg { vertical-align: -3px; color: var(--g-accent, var(--accent)); }
.g-install-steps[hidden] { display: none; }
.g-install-btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.g-install-btns .btn { min-height: 44px; }
body.lb-open .g-install { display: none; }
@keyframes gInstallIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .g-install { animation: none; } }
@media (min-width: 1024px) { .g-install { display: none !important; } }
/* 15차 보완: 가족 올리기 새 카테고리 */
.up-chip-new span { border-style: dashed; color: var(--g-accent, var(--accent)); }
.up-newcat { display: block; margin-top: 10px; }
.up-newcat .input { width: 100%; box-sizing: border-box; }
.up-newcat[hidden] { display: none; }

/* 사진 적은 묶음(6장 이하): 화면 가장자리에 붙지 않게 양옆 여백을 두고 가운데로 모은다.
 * 한 장뿐이면 크게(가로 사진은 폭에 맞춰, 세로 사진은 화면 높이의 70%까지) 가운데에 */
.grid-post.few { justify-content: center; padding-left: var(--gutter); padding-right: var(--gutter); --row-h: min(120px, calc((100vw - 2 * var(--gutter) - 4px) / 3.1)); }
.grid-post.few::after { display: none; }
.grid-post.few .tile { border-radius: 4px; overflow: hidden; }
.grid-post.one .tile { flex: none; max-width: none; width: min(100%, calc(70svh * var(--r, 1))); margin: 0 auto; }
@media (min-width: 600px) { .grid-post.few { --row-h: 280px; } }
@media (min-width: 1024px) { .grid-post.few { --row-h: 360px; padding-left: 40px; padding-right: 40px; } .grid-post.one .tile { width: min(100%, calc(75vh * var(--r, 1))); } }
