/* ══════════════════════════════════════════════════════════
   안 2 — 인스타그램
   하단 5탭 + 프로필/탐색 레이아웃
   ══════════════════════════════════════════════════════════ */

:root {
  --app-w: 430px;

  --page:      #f2f2f2;                 /* 앱 카드 바깥 여백 */
  --bg:        #fff;
  --ink:       #000;
  --sub:       #737373;
  --line:      #dbdbdb;
  --line-soft: #efefef;
  --fill:      #fafafa;
  --blue:      #0095f6;
  --rose:      #e0698a;

  --glass:     rgba(255, 255, 255, .95); /* 플로팅 탭바 — blur 를 쓰지 않으므로 거의 불투명하게 */
  --glass-sh:  0 6px 26px rgba(0, 0, 0, .13), 0 0 0 .5px rgba(0, 0, 0, .06);
  --tab-on:    rgba(0, 0, 0, .06);
  --dim:       rgba(0, 0, 0, .42);       /* 시트 뒤 어둡게 */
  --toast-bg:  rgba(0, 0, 0, .85);
  --toast-ink: #fff;

  /* 사진 자리 표시. 다크에서는 밝기를 낮추고 무늬를 밝은 쪽으로 뒤집는다 */
  --ph-s1: 24%;
  --ph-s2: 20%;
  --ph-l1: 91%;
  --ph-l2: 82%;
  --ph-weave: rgba(0, 0, 0, .014);
  --ph-ink: rgba(0, 0, 0, .28);

  --tabbar-h: 58px;
  /* 커버 영상의 캔버스 비율과, 영상 밖으로 남는 여백(레터박스) 색.
     카톡 인앱 브라우저는 상태바가 페이지와 별개인 자체 UI라 어떤 CSS로도 그 뒤까지
     영상을 확장할 수 없다(안드로이드·사파리도 마찬가지로 취급해 기준을 통일한다).
     그래서 화면을 억지로 채우지 않고, 릴스 표준 규격인 9:16으로 고정해 contain 시킨다.
     요즘 폰은 화면비가 9:16보다 더 길쭉해서, 이 방식이면 위아래에 자동으로 여백이
     생기고 그 자리가 대략 상태바·하단 UI가 필요로 하는 공간과 맞아떨어진다. */
  /* 한 곳에서만 고치도록 가로·세로를 따로 둔다 — 폭 역산 계산에도 쓰인다 */
  --reel-ratio-w: 9;
  --reel-ratio-h: 16;
  --reel-ratio: var(--reel-ratio-w) / var(--reel-ratio-h);
  --reel-letterbox: linear-gradient(170deg, hsl(20 22% 86%), hsl(340 18% 74%));

  /* 영상 위아래로 반드시 비워 두는 여백.
     표지·영상·초대장이 한 화면씩 딱 끊어져 스냅되므로(아래 .snap-pages) 이 여백이
     화면 밖으로 밀려나거나 다음 내용이 비칠 일이 없다. 아래쪽을 넉넉히 잡는 이유는
     그 자리에 "아래로 밀어서 계속 보기" 안내가 들어가기 때문. */
  --reel-gap-top: 44px;
  --reel-gap-bottom: 96px;
  /* 레터박스는 다크 모드에서도 밝은 톤이라 안내 글자는 고정된 어두운 색을 쓴다 */
  --reel-hint-ink: rgba(58, 48, 50, .72);

  --sans: 'Pretendard', 'Apple SD Gothic Neo', system-ui, -apple-system, sans-serif;
  --script: 'Snell Roundhand', 'Apple Chancery', cursive;
}

/* ═══ 다크 모드 ═══
   인스타그램이 지원하므로 "인스타 같다"는 인식에도 관계된다.
   밤에 카톡으로 링크를 여는 하객이 흰 화면에 눈부시지 않게 하는 것이 본래 목적.
   색은 전부 위 토큰으로 흐르므로 여기서는 토큰만 갈아끼운다. */
@media (prefers-color-scheme: dark) {
  :root {
    --page:      #000;
    --bg:        #000;
    --ink:       #f5f5f5;
    --sub:       #a8a8a8;
    --line:      #363636;
    --line-soft: #262626;
    --fill:      #1a1a1a;

    --glass:     rgba(26, 26, 26, .95);
    --glass-sh:  0 6px 26px rgba(0, 0, 0, .5), 0 0 0 .5px rgba(255, 255, 255, .08);
    --tab-on:    rgba(255, 255, 255, .1);
    --dim:       rgba(0, 0, 0, .62);
    --toast-bg:  rgba(255, 255, 255, .92);
    --toast-ink: #000;

    --ph-s1: 10%;
    --ph-s2: 8%;
    --ph-l1: 26%;
    --ph-l2: 17%;
    --ph-weave: rgba(255, 255, 255, .02);
    --ph-ink: rgba(255, 255, 255, .3);
  }

  /* 다크에서는 흰 아이콘이 눈에 띄게 밝다. 살짝 낮춘다 */
  .cell__flag { color: rgba(255, 255, 255, .92); }
}

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

/* 상태바 뒤 세이프에어리어와 스크롤 바운스 영역의 색.
   (헤더가 있을 때는 헤더가 그 자리를 덮고 있어 드러나지 않았다) */
html { background: var(--bg); }

body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

/* body 가 화면 전체를 덮으므로 상태바 뒤에도 body 배경이 비친다.
   --page 는 PC에서 카드 바깥을 회색으로 두려는 색이라, 폰에서는 그 회색이
   상단에 띠로 남는다. 앱이 화면 전체를 차지하는 폭에서는 본문색과 맞춘다. */
@media (max-width: 430px) {
  body { background: var(--bg); }
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ═══ 앱 셸 ═══
   문서(document)가 직접 스크롤된다.
   내부 div를 스크롤 컨테이너로 만들면 모바일 브라우저의
   상·하단 UI 자동 숨김이 동작하지 않기 때문. height:100dvh 금지. */
.app {
  max-width: var(--app-w);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  overflow-x: clip;                     /* overflow-x:hidden은 스크롤 컨테이너를 만든다 */
  padding-bottom: calc(90px + env(safe-area-inset-bottom));  /* 플로팅 탭바 자리 */
}

/* 표지 → 영상 → 초대장, 세 장짜리 페이지 스냅.
   살짝만 밀어도 다음 장으로 딱 넘어가고, 그 사이 어중간한 위치에서는 멈추지 않는다.
   세 장 모두 화면 높이와 정확히 같으므로 start 정렬이면 곧 화면 중앙 정렬이다.

   ★ mandatory 를 쓰되 JS 가 .snap-pages 로 구간을 제한한다.
     초대장 본문은 길어서 스냅 지점이 없는데, mandatory 가 계속 걸려 있으면
     브라우저가 "반드시 스냅 지점에 멈춰야 한다"며 스토리 링 자리로 되끌어당겨
     본문을 아예 못 읽는다. 그래서 스토리 링을 지나 아래로 내려가는 순간
     JS 가 .snap-pages 를 떼고, 다시 올라오면 붙인다 (app.js 의 watchReel).

   ★ 문서 스크롤은 그대로 유지한다. 내부 스크롤 컨테이너로 바꾸면
     브라우저 UI 자동 숨김 자체가 죽어서 이 방법이 성립하지 않는다 (컨셉.md 참조). */
@media (max-width: 430px) {
  html.snap-pages { scroll-snap-type: y mandatory; }
  .intro   { scroll-snap-align: start; scroll-snap-stop: always; }
  .reel    { scroll-snap-align: start; scroll-snap-stop: always; }
  .stories { scroll-snap-align: start; scroll-snap-stop: always; }
}

/* ═══ 인트로 ═══ */
.intro {
  position: relative;
  height: var(--screen-h, 100svh);   /* JS 실측값. 없을 때만 svh 로 떨어진다 */
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  text-align: center;
}
.intro__in { animation: introIn .9s ease both; }
.intro__label {
  font-family: var(--script);
  font-size: 34px; color: var(--sub);
  letter-spacing: .02em; margin-bottom: 18px;
}
.intro__names { font-size: 24px; font-weight: 600; letter-spacing: .04em; }
.intro__date { margin-top: 8px; font-size: 13px; color: var(--sub); letter-spacing: .08em; }

@keyframes introIn {
  from { opacity: 0; transform: translateY(10px) }
  to   { opacity: 1; transform: none }
}

/* 표지 구간에서는 탭바가 감춰져 있으므로 탭바 높이를 비켜 갈 필요가 없다 */
.intro__hint {
  position: absolute; left: 0; right: 0; margin-inline: auto;
  bottom: calc(34px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--sub); font-size: 12px; letter-spacing: .02em;
  animation: introIn 1.2s .4s ease both;
}
.intro__hint-arrow {
  width: 10px; height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  animation: reelHint 1.8s ease-in-out infinite;
}

/* 게시물 피드에서만 뜨는 플로팅 뒤로가기.
   헤더를 없앤 대신 이 버튼이 그 자리를 대신한다. 사진 위에 떠 있으므로
   밝은 사진에서도 보이도록 어두운 원판을 깐다 (인스타와 같은 처리) */
.fabback {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: max(10px, calc(50vw - var(--app-w) / 2 + 10px));
  z-index: 60;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  /* 탭바와 같은 이유로 backdrop-filter 를 쓰지 않는다.
     이 버튼이 안 보이면 게시물에서 빠져나올 방법이 없어진다 */
  background: rgba(0, 0, 0, .55);
  color: #fff;
}
.fabback[hidden] { display: none; }
.fabback svg { width: 22px; height: 22px; }

/* 첫 게시물이 뒤로가기 버튼에 가리지 않도록 자리를 비운다 */
.screen[data-screen="feed"] { padding-top: calc(52px + env(safe-area-inset-top)); }

.iconbtn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
}
.iconbtn[hidden] { display: none; }   /* display:flex가 hidden을 덮어쓰지 않도록 */
.iconbtn svg { width: 22px; height: 22px; }

.screen[hidden] { display: none; }

/* ═══ 하단 탭바 — 콘텐츠 위에 뜨는 플로팅 필 ═══ */
/* ★ 이 요소에는 backdrop-filter 도 transform 도 걸지 않는다.
   둘 중 무엇이든 걸리면 카톡 인앱 브라우저(구형 크로미움 WebView)가 탭바를
   "속이 빈 흰 판" 하나로 합성해 버린다 — 아이콘·라벨이 사라지고 탭도 눌리지 않는다.

   2026-08-13 transform 을 먼저 제거했으나 카톡에서 증상이 그대로였다.
   남은 원인은 backdrop-filter 였고, blur 효과를 포기했다.
   하객 대부분이 카톡으로 들어오므로 그 환경에서 확실히 보이는 쪽이 우선이다.
   대신 배경을 거의 불투명하게 올려 콘텐츠 위에서도 또렷하게 보이게 했다. */
.tabbar {
  position: fixed;
  left: 0; right: 0;
  margin-left: auto; margin-right: auto;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
  width: min(calc(100vw - 26px), calc(var(--app-w) - 26px));
  height: var(--tabbar-h);
  display: flex; align-items: stretch;
  padding: 5px 6px;
  border-radius: 999px;
  background: var(--glass);
  box-shadow: var(--glass-sh);
}
/* 표지·영상 구간에서는 탭바 자체를 감춘다 (JS 가 hidden 을 토글).
   표지와 영상은 "한 장짜리 화면"으로 보여야 하므로 그 위에 아무것도 띄우지 않는다.

   ★ display 로만 껐다 켠다. opacity/transform 트랜지션을 쓰지 않는 이유는
     transform 이 걸리면 카톡 인앱 브라우저가 이 요소를 자식이 그려지지 않는
     빈 판으로 합성해 버리기 때문이다 (위 주석 참조).
   탭바가 영상 위에 겹치는 일이 없어졌으므로 어둡게 뒤집던 .is-onreel 은 걷어냈다 */
.tabbar[hidden] { display: none; }
.tab {
  position: relative; z-index: 1;   /* 배경 레이어보다 확실히 위에 그린다 */
  touch-action: manipulation;       /* 인앱 브라우저의 더블탭 확대 판정에 탭이 씹히지 않게 */
  flex: 1; border-radius: 999px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
}
.tab.is-on { background: var(--tab-on); }
.tab svg { width: 23px; height: 23px; }
.tab__av {
  width: 23px; height: 23px; border-radius: 50%;
  border: 1px solid transparent;
  background: linear-gradient(160deg, hsl(var(--h) 24% 88%), hsl(var(--h) 20% 78%));
}
.tab.is-on .tab__av { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.tab__label { font-size: 9px; color: var(--sub); letter-spacing: -.03em; }
.tab.is-on .tab__label { color: var(--ink); font-weight: 600; }

/* ═══ 사진 플레이스홀더 ═══ */
.ph {
  width: 100%; aspect-ratio: 1/1;
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, var(--ph-weave) 10px 20px),
    linear-gradient(160deg, hsl(var(--h,30) var(--ph-s1) var(--ph-l1)), hsl(var(--h,30) var(--ph-s2) var(--ph-l2)));
  display: flex; align-items: flex-end; justify-content: flex-start;
  color: var(--ph-ink); font-size: 10px; letter-spacing: .04em;
  padding: 6px 8px;
}
.ph::after { content: attr(data-label); }

/* ═══ 홈 — 커버 (릴스 레이아웃) ═══
   9:16으로 고정한 영상을 화면 안에 가둔다(contain). 화면비가 9:16보다 긴 요즘 폰에서는
   위아래에 자동으로 여백이 생기는데, 억지로 없애려 하지 않고 --reel-letterbox 로 채운다.
   상태바가 자체 UI라 뒤가 안 뚫리는 카톡 인앱 브라우저까지 포함해 모든 브라우저에서
   잘림 없이 보이는 걸 우선한다(컨셉.md 참조). */
.reel {
  position: relative;
  height: var(--screen-h, 100dvh);
  overflow: hidden;
  background: var(--reel-letterbox);
  display: flex; align-items: center; justify-content: center;
  /* box-sizing: border-box 이므로 이 여백은 화면 높이 안에서 잘려 나간다.
     즉 영상이 커질 수 있는 최대 높이가 그만큼 줄어든다 */
  padding-top: var(--reel-gap-top);
  padding-bottom: calc(var(--reel-gap-bottom) + env(safe-area-inset-bottom));
}
/* 화면 안에 완전히 들어가는 "가장 큰 9:16 상자".
   실제 영상 좌표는 전부 이 기준이라, 레터박스가 얼마나 남든
   오버레이(좋아요·이름·진행바)가 항상 영상 가장자리에 붙는다.

   폭을 두 값 중 작은 쪽으로 잡고 높이는 aspect-ratio 가 따라오게 한다.
     ① 100%              — 가로로 꽉 채운 값
     ② 남은 높이 × 9/16  — 세로에 맞춰 역산한 값

   ★ width:100% + max-height:100% 조합으로는 안 된다. max-height 에 걸려
     높이만 잘리고 폭은 100% 그대로라 상자가 9:16 보다 납작해지고, 그만큼
     object-fit:cover 가 영상을 위아래로 다시 잘라낸다. 세로로 짧은 화면
     (가로 모드·데스크톱)에서 실제로 재현됐다 — 비율이 0.65까지 벌어졌다. */
.reel__frame {
  position: relative;
  --reel-avail-h: calc(
    var(--screen-h, 100dvh) - var(--reel-gap-top) - var(--reel-gap-bottom) - env(safe-area-inset-bottom)
  );
  width: min(100%, calc(var(--reel-avail-h) * var(--reel-ratio-w) / var(--reel-ratio-h)));
  aspect-ratio: var(--reel-ratio);
  overflow: hidden;
}
.reel__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;   /* 상자 비율은 9:16으로 고정, 실제 영상이 살짝 어긋나도 크롭으로 흡수 */
}
/* 글자가 어떤 영상 위에서도 읽히도록 위아래만 어둡게 */
.reel__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(0,0,0,.28) 0%, rgba(0,0,0,0) 26%,
    rgba(0,0,0,0) 52%, rgba(0,0,0,.55) 100%);
}

.reel__side {
  position: absolute; right: 10px; bottom: 30px;
  display: flex; flex-direction: column; gap: 20px;
  color: #fff;
}
.reel__act {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
}
.reel__act svg { width: 28px; height: 28px; }
.reel__act span { font-size: 11px; font-weight: 600; }
.reel__act.like.is-on svg { fill: #ed4956; stroke: #ed4956; }

.reel__meta {
  position: absolute; left: 16px; bottom: 30px;
  color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.reel__names { font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.reel__date { font-size: 13px; opacity: .9; margin-top: 4px; }

/* 영상 진행바 — 영상 하단에 가느다랗게 */
.reel__bar {
  position: absolute; left: 14px; right: 14px; bottom: 12px;
  height: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  overflow: hidden;
}
.reel__bar.is-off { display: none; }     /* 영상이 없으면 진행바도 없다 */
.reel__bar-fill {
  display: block; width: 0; height: 100%;
  background: rgba(255, 255, 255, .9);
  border-radius: inherit;
}

/* 계속 보라는 신호. .reel__frame 밖, 그 아래 레터박스 여백 한가운데 얹는다.
   ★ 색을 var(--sub) 로 두면 안 된다 — 레터박스 그라데이션은 다크 모드에서도
     밝은 톤 그대로인데 --sub 는 다크에서 밝은 회색으로 뒤집혀 글자가 묻힌다.
     그래서 모드와 무관한 고정 어두운 색(--reel-hint-ink)을 쓴다. */
.reel__hint {
  position: absolute; left: 0; right: 0; margin-inline: auto;
  bottom: calc(34px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--reel-hint-ink); font-size: 12px; letter-spacing: .02em;
}
.reel__hint-arrow {
  width: 10px; height: 10px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  animation: reelHint 1.8s ease-in-out infinite;
}
@keyframes reelHint {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: .5 }
  50%      { transform: rotate(45deg) translate(3px, 3px); opacity: 1 }
}

/* ═══ 홈 — 청첩장 섹션 ═══ */
.sect {
  padding: 34px 20px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.sect--last { border-bottom: none; }
.sect__title {
  font-size: 12px; font-weight: 600; letter-spacing: .12em;
  color: var(--sub); margin-bottom: 18px;
}
.sect__body { font-size: 14.5px; line-height: 2.1; color: var(--ink); }
.sect .kv { text-align: left; max-width: 300px; margin: 0 auto; }
.sect .lead { margin-bottom: 14px; }
.sect .acc__group { text-align: left; }

/* 혼주 */
.fam { margin-bottom: 18px; }
.fam__row + .fam__row { margin-top: 10px; }
.fam__line {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 14.5px; line-height: 2;
}
.fam__parent { color: var(--ink); }
.fam__rel { color: var(--sub); font-size: 12.5px; }
.fam__line b { font-weight: 600; }
.fam__call {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--fill); border: 1px solid var(--line-soft);
  color: var(--ink); margin-left: 3px;
}
.fam__call svg { width: 15px; height: 15px; }

/* 혼주에게 연락하기 — 펼쳐지는 목록 */
.parents { padding: 6px 0 2px; }
.parents__item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 12px; margin-top: 6px;
  border-radius: 8px; background: var(--fill); border: 1px solid var(--line-soft);
  color: var(--ink); text-decoration: none; font-size: 13.5px;
}
.parents__who b { font-weight: 600; margin-right: 6px; }
.parents__item svg { width: 17px; height: 17px; color: var(--sub); }

/* 갤러리 격자 */
.gal {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
}
.gal__cell { display: block; position: relative; aspect-ratio: 1/1; overflow: hidden; }
.gal__cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal__cell .ph { height: 100%; }

/* ═══ 갤러리 전체 화면 ═══ */
.lb {
  position: fixed; inset: 0; z-index: 200;
  background: #000;                    /* 사진에만 집중하도록 뒤를 완전히 가린다 */
  display: flex; align-items: center; justify-content: center;
}
.lb[hidden] { display: none; }
.lb__stage {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 60px 12px;
}
.lb__stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb__ph { width: min(100%, 420px); }
.lb__ph .ph { aspect-ratio: 1/1; }

.lb__close, .lb__nav {
  position: absolute; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.lb__close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
.lb__nav { top: 50%; transform: translateY(-50%); }
.lb__nav--prev { left: 10px; }
.lb__nav--next { right: 10px; }
.lb__close svg, .lb__nav svg { width: 22px; height: 22px; }

.lb__count {
  position: absolute; left: 0; right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center; color: rgba(255,255,255,.75); font-size: 12px;
}

/* 화면이 좁으면 좌우 버튼이 사진을 가리므로 스와이프에 맡긴다 */
@media (max-width: 420px) {
  .lb__nav { display: none; }
}

/* ═══ 홈 — 스토리 링 ═══ */
.stories {
  display: flex; gap: 14px;
  padding: 12px 14px;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line-soft);
}
.stories::-webkit-scrollbar { display: none; }

.story { flex-shrink: 0; width: 62px; text-align: center; }
.story__ring {
  width: 62px; height: 62px; border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from 200deg, #f0a04b, var(--rose), #b06ab3, #f0a04b);
  display: flex;
}
.story__in {
  flex: 1; border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--fill);
  display: flex; align-items: center; justify-content: center;
  padding: 0 7px;
  font-size: 10px; line-height: 1.25; letter-spacing: -.03em;
  color: var(--sub); text-align: center; word-break: keep-all;
}
.story__label {
  display: block; margin-top: 5px; font-size: 11px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ═══ 홈 — 피드 ═══ */
.post { border-bottom: 1px solid var(--line-soft); }
.post:last-child { border-bottom: none; }

.post__head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
}
.post__av {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(160deg, hsl(var(--h,20) 24% 88%), hsl(var(--h,20) 20% 78%));
  flex-shrink: 0;
}
.post__av--pair { position: relative; width: 44px; }
.post__av--pair::after {
  content: ''; position: absolute; left: 14px; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--bg);
  background: linear-gradient(160deg, hsl(340 24% 90%), hsl(340 20% 80%));
}
.post__who { font-size: 13px; font-weight: 600; }
.post__where { font-size: 11px; color: var(--sub); font-weight: 400; margin-left: 6px; }

.post__actions {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 14px 4px;
}
.post__actions .iconbtn { width: 24px; height: 24px; }
.post__actions .spacer { margin-left: auto; }
.like.is-on svg { fill: #ed4956; stroke: #ed4956; }
.save.is-on svg { fill: var(--ink); stroke: var(--ink); }

/* 좋아요 줄 — 얼굴 최대 3개 + "OO님 외 N명이 좋아합니다" */
.likeline {
  display: flex; align-items: center; gap: 8px;
  padding: 3px 14px 0; width: 100%; text-align: left;
}
.likeline.is-empty { font-size: 13px; color: var(--sub); padding-top: 4px; }
.likeline__avs { display: flex; flex-shrink: 0; }
.likeline__av {
  position: relative;
  width: 19px; height: 19px; border-radius: 50%;
  border: 1.5px solid var(--bg);
  background: linear-gradient(160deg, hsl(var(--h,30) 26% 86%), hsl(var(--h,30) 22% 74%));
}
.likeline__av + .likeline__av { margin-left: -7px; }
.likeline__txt { font-size: 13px; color: var(--ink); }
.likeline__txt b { font-weight: 600; }

.post__more {
  display: block; padding: 4px 14px 0;
  font-size: 13px; color: var(--sub); text-align: left;
}
.post__cap {
  padding: 4px 14px 0; font-size: 13.5px; line-height: 1.6;
  white-space: pre-line;
}
.post__cap b { font-weight: 600; }
/* 등장인물 이름 — 어디에 놓이든 눈에 띄어야 한다 */
.mention { color: #00376b; font-weight: 500; }
.post__sub { padding: 6px 14px 0; font-size: 13px; color: var(--sub); line-height: 1.65; }
.post__date { padding: 8px 14px 14px; font-size: 10.5px; color: var(--sub); letter-spacing: .02em; }

/* 정보 카드형 게시물 */
.card { padding: 16px 14px 18px; }
.card__title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }

.kv { display: grid; grid-template-columns: 52px 1fr; gap: 8px 8px; font-size: 13px; }
.kv dt { color: var(--sub); }
.kv dd { color: var(--ink); }

.family { text-align: center; font-size: 13.5px; line-height: 2.1; padding: 6px 0; }
.family .rel { color: var(--sub); font-size: 12px; margin: 0 3px; }
.family b { font-weight: 600; }

.map {
  height: 180px; border-radius: 8px; background: var(--fill);
  border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px;
  align-items: center; justify-content: center;
  color: var(--ink); font-size: 14px; font-weight: 600;
  margin-bottom: 10px; overflow: hidden;
}
.map span { color: var(--sub); font-size: 12px; font-weight: 400; }
/* 카카오맵 SDK가 붙으면 안내 텍스트를 지우고 이 자리에 지도를 그린다 */
.map--live { display: block; padding: 0; }

/* 주소 줄 전체가 복사 버튼 */
.addr {
  width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 10px;
  border-radius: 8px; background: var(--fill); border: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--sub); line-height: 1.6;
}
.addr em { font-style: normal; color: var(--blue); font-weight: 600; margin-left: 4px; white-space: nowrap; }

.maplinks { display: flex; gap: 6px; margin-bottom: 14px; }
.maplinks .btn { flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 14px; border-radius: 8px;
  background: var(--fill); border: 1px solid var(--line-soft);
  font-size: 13px; font-weight: 500; color: var(--ink);
  text-decoration: none;
}
.btn--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn--full { width: 100%; }

.acc__group + .acc__group { margin-top: 8px; }
.acc__head {
  width: 100%; padding: 11px 12px; border-radius: 8px;
  background: var(--fill); border: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; font-weight: 500;
}
.acc__head .chev { color: var(--sub); transition: transform .22s; }
.acc__head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.acc__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease; }
.acc__body.is-open { grid-template-rows: 1fr; }
.acc__body > div { overflow: hidden; }
.acc__row {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.acc__role { color: var(--sub); width: 38px; flex-shrink: 0; }
.acc__num { flex: 1; }
.acc__copy { font-size: 11px; color: var(--blue); font-weight: 600; }

.lead { font-size: 13px; color: var(--sub); margin-bottom: 12px; line-height: 1.7; }
.note { font-size: 11px; color: var(--sub); margin-top: 8px; text-align: center; }

/* ═══ 프로필 탭 ═══
   최신 인스타 레이아웃:
   아바타 옆 오른쪽 칸에 [이름] 위 / [통계] 아래,
   소개글은 그 아래 전체 폭, 그다음 액션 버튼 줄. */
.pf__top { padding: 16px 14px 0; }

/* 오른쪽 칸은 아바타 상단에 맞춰 위로 붙는다 (가운데 정렬 아님) */
.pf__row { display: flex; align-items: flex-start; gap: 16px; }
.pf__av {
  width: 86px; height: 86px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(160deg, hsl(var(--h) 24% 90%), hsl(var(--h) 20% 79%));
}
.pf__meta { flex: 1; min-width: 0; }
.pf__name {
  font-size: 15px; font-weight: 600; line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 각 칸을 내용 폭으로 두고 균등 간격 — 마지막 칸이 오른쪽 끝에 붙지 않는다 */
.pf__stats {
  display: flex; justify-content: space-between;
  margin-top: 15px; padding-right: 34px;
}
.pf__stat { text-align: center; }
.pf__stat b { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.pf__stat span { font-size: 12.5px; color: var(--sub); }

.pf__bio { margin-top: 15px; font-size: 13.5px; line-height: 1.6; white-space: pre-line; }

.pf__hl {
  display: flex; gap: 15px; padding: 18px 14px 14px;
  overflow-x: auto; scrollbar-width: none;
}
.pf__hl::-webkit-scrollbar { display: none; }
.hl { flex-shrink: 0; width: 64px; text-align: center; }
.hl__c {
  display: block;                     /* span은 inline이라 크기가 먹지 않는다 */
  width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, hsl(var(--h,30) 20% 93%), hsl(var(--h,30) 16% 85%));
}
.hl__label {
  display: block; margin-top: 5px; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.pf__tabs { display: flex; border-top: 1px solid var(--line-soft); }
.pf__tab {
  flex: 1; padding: 10px 0;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid transparent;
  color: #c7c7c7;
}
.pf__tab.is-on { border-bottom-color: var(--ink); color: var(--ink); }
.pf__tab svg { width: 22px; height: 22px; }

/* ═══ 그리드 ═══ */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.cell { position: relative; display: block; }
.cell .ph { aspect-ratio: 1/1; height: 100%; }
/* 누군가 함께 나온 사진임을 알리는 표시 — 발견의 단서 */
.cell__flag {
  position: absolute; top: 5px; right: 5px;
  display: block; color: #fff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.cell__flag svg { display: block; width: 15px; height: 15px; }
.cell__year {
  position: absolute; left: 6px; bottom: 5px;
  color: rgba(0,0,0,.42); font-size: 10px; letter-spacing: .02em;
}

.empty { padding: 60px 30px; text-align: center; color: var(--sub); font-size: 13px; }

/* 탐색 그리드 — 일부 셀 2×2 */
.grid--explore { grid-auto-rows: 1fr; grid-auto-flow: dense; }
.grid--explore .cell.is-big { grid-column: span 2; grid-row: span 2; }

/* ═══ 청모 기록 탭 ═══ */
/* 헤더가 함께 스크롤되므로 검색바도 고정하지 않는다 */
.search {
  padding: 8px 14px;
  background: var(--bg);
}
.search__box {
  display: flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px;
  background: var(--fill); border-radius: 10px;
  color: var(--sub); font-size: 13px;
}
.search__box svg { width: 16px; height: 16px; flex-shrink: 0; }
.chips {
  display: flex; gap: 7px; padding: 4px 14px 12px;
  overflow-x: auto; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 12.5px; color: var(--ink);
  white-space: nowrap;
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.records__meta {
  padding: 0 14px 10px; font-size: 11.5px; color: var(--sub);
}

/* ═══ 방명록 탭 ═══ */
.gb__event {
  margin: 12px 14px; padding: 15px 16px;
  background: var(--fill); border-radius: 12px;
}
.gb__event-title { font-size: 13.5px; font-weight: 600; }
.gb__event-desc {
  margin-top: 5px; font-size: 12.5px; color: var(--sub);
  line-height: 1.65; white-space: pre-line;
}
.gb__top { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.gb__top-item { font-size: 12px; color: var(--sub); }
.gb__top-item b { color: var(--rose); font-weight: 600; margin-right: 2px; }
.gb__top-item em { font-style: normal; color: var(--ink); }
.gb__joined { margin-top: 8px; font-size: 11px; color: var(--sub); }

.gb__write { padding: 4px 14px 14px; border-bottom: 8px solid var(--fill); }
.gb__write .btn svg { width: 17px; height: 17px; margin-right: 6px; }
.gb__who {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px; font-size: 12.5px; color: var(--sub);
}
.gb__out { margin-left: auto; font-size: 12px; color: var(--blue); }

.btn--kakao { background: #fee500; border-color: #fee500; color: #191600; font-weight: 600; }

/* 방명록 글 */
.gbe { padding: 14px; border-bottom: 1px solid var(--line-soft); }
.gbe__head { display: flex; align-items: center; gap: 8px; }
.gbe__av {
  display: block; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(160deg, hsl(var(--h,30) 24% 89%), hsl(var(--h,30) 20% 79%));
}
.gbe__name { font-size: 13px; font-weight: 600; }
.gbe__time { font-size: 11px; color: var(--sub); margin-left: auto; }
.gbe__text { margin-top: 9px; font-size: 13.5px; line-height: 1.65; }

.gbe__photos { margin-top: 10px; border-radius: 10px; overflow: hidden; }
.gbe__photos.is-multi { display: grid; gap: 2px; }
.gbe__photos.is-2 { grid-template-columns: repeat(2, 1fr); }
.gbe__photos.is-3 { grid-template-columns: repeat(3, 1fr); }
.gbe__photos .ph { aspect-ratio: 1/1; }
.gbe__photos:not(.is-multi) .ph { aspect-ratio: 4/5; }

.gbe__act { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.gbe__act .iconbtn { width: 26px; height: 26px; margin-left: -4px; }
.gbe__act .iconbtn svg { width: 20px; height: 20px; }
.gbe__likes { font-size: 12.5px; color: var(--sub); padding: 2px 4px; }

/* ═══ 게시물 피드 화면 ═══
   그리드에서 진입하는 화면. 팝업이 아니라 탭과 같은 층위의 화면이라
   문서 스크롤·플로팅 탭바가 그대로 유지된다. */
.screen[data-screen="feed"] .post:last-child { border-bottom: none; }

/* ═══ 댓글 시트 (아래에서 올라옴) ═══ */
.csheet { position: fixed; inset: 0; z-index: 400; }
.csheet[hidden] { display: none; }

.csheet__dim {
  position: absolute; inset: 0;
  background: var(--dim);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0 } }

.csheet__panel {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: var(--app-w);
  max-height: 78dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheetRise .28s cubic-bezier(.2, .85, .25, 1);
}
@keyframes sheetRise { from { transform: translate(-50%, 100%) } }

.csheet__grip {
  display: block; width: 38px; height: 4px; border-radius: 2px;
  background: var(--line); margin: 8px auto 0; flex-shrink: 0;
}
.csheet__bar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 8px 10px 10px; position: relative;
  border-bottom: 1px solid var(--line-soft);
}
.csheet__title { font-size: 14px; font-weight: 600; }
.csheet__bar .iconbtn { position: absolute; right: 6px; }
.csheet__bar .iconbtn svg { width: 19px; height: 19px; }

.csheet__list {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 6px 0 4px; min-height: 90px;
}
.cmt { display: flex; gap: 10px; padding: 9px 14px; }
.cmt__av {
  display: block; width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(160deg, hsl(var(--h,30) 24% 89%), hsl(var(--h,30) 20% 79%));
}
.cmt__body { flex: 1; min-width: 0; }
.cmt__text { font-size: 13.5px; line-height: 1.55; }
.cmt__text b { font-weight: 600; margin-right: 5px; }
.cmt__meta { margin-top: 3px; font-size: 11px; color: var(--sub); }
/* 좋아요 누른 사람 목록 */
.liker { align-items: center; }
.liker__name { font-size: 13.5px; font-weight: 600; }
.liker__name em {
  font-style: normal; font-weight: 400; font-size: 11.5px;
  color: var(--sub); margin-left: 6px;
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px;
}

.cmt__empty {
  padding: 34px 20px; text-align: center;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.cmt__empty span {
  display: block; margin-top: 4px;
  font-size: 12.5px; font-weight: 400; color: var(--sub);
}

.csheet__foot {
  flex-shrink: 0; padding: 10px 14px 14px;
  border-top: 1px solid var(--line-soft);
}
.cinput { display: flex; align-items: center; gap: 9px; }
.cinput input {
  flex: 1; min-width: 0; height: 36px;
  border: 1px solid var(--line-soft); border-radius: 999px;
  background: var(--fill); padding: 0 14px;
  font: inherit; font-size: 13.5px; color: var(--ink);
}
.cinput input:focus { outline: none; border-color: var(--line); }
.cinput__send { font-size: 13.5px; font-weight: 600; color: var(--blue); flex-shrink: 0; }
.cinput__send:disabled { color: #b2dffc; cursor: default; }
.cinput__note {
  margin-top: 8px; font-size: 11px; color: var(--sub);
  text-align: center; line-height: 1.55;
}

/* 방명록 — 어떤 게시물에 남긴 댓글인지 */
.gbe__target {
  width: 100%; display: flex; align-items: center; gap: 10px;
  margin-top: 10px; padding: 9px 10px;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: var(--fill); text-align: left;
}
.gbe__target-thumb {
  width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(160deg, hsl(var(--h,30) 24% 90%), hsl(var(--h,30) 20% 80%));
}
.gbe__target-txt {
  flex: 1; min-width: 0; font-size: 12px; color: var(--sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gbe__target-txt em {
  display: block; font-style: normal; font-size: 10.5px;
  color: var(--rose); letter-spacing: -.01em; margin-bottom: 1px;
}
.gbe__target-txt b { color: var(--ink); font-weight: 600; }
.gbe__target-go { color: var(--sub); font-size: 17px; flex-shrink: 0; }

/* ═══ 토스트 ═══ */
.toast {
  position: fixed; left: 50%;
  bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
  transform: translate(-50%, 10px);
  background: var(--toast-bg); color: var(--toast-ink);
  padding: 9px 16px; border-radius: 8px; font-size: 12.5px;
  opacity: 0; pointer-events: none; transition: all .24s; z-index: 500;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
