/* ============================================================================
   NovaP Story 모바일 화면 - 인스타그램 스타일(2026-09-28 사용자 결정 D27)
   ----------------------------------------------------------------------------
   "사람들은 익숙한 것에 친밀함을 느낀다" - 인스타그램의 모양·배치를 따른다. 모바일 기준 한 줄(470px),
   PC에서도 가운데에 휴대폰 폭으로 보여 준다. 관리 화면 디자인 시스템(custom.css)과 따로다.
   **색 값은 이 파일에 쓰지 않는다** - 테마 파일(public/css/themes/*.css, 테마 하나 = 파일 하나)의 --ig-* 변수만 쓴다.
   예외(테마와 상관없이 고정): 사진 위 검정 막·흰 글자, 사진 칸 검정 바탕, 기록 종류 색(스토리·함께·방명록 등).
   아이콘은 인스타그램과 같은 모양의 선 아이콘(Lucide, src/utils/Icon.php). 부품 이름·규칙: .claude/docs/ui/components/story.md
   ============================================================================ */

body.ig {
  /* 색 값은 여기 없다 - 테마 파일(public/css/themes/*.css)에만 있다(2026-09-28 사용자 결정) */
  --ig-w: 470px;
  --ig-top-h: 54px;
  --ig-tab-h: 52px;
  /* 공통 UI(novap-ui) 변수 --uk-* ← 스토리 테마 --ig-* (2026-10-29 사용자 승인 "스토리 테마에 잇는 묶음") - 공통 바닥 시트(bottom-sheet.css)를 그대로 쓴다.
     공통 부품이 쓰는 --uk-*는 여기 한 곳에서만 잇는다(테마 파일은 --ig-*만). 공통 부품을 더 실으면 그 부품이 쓰는 --uk-*도 여기에 더한다 */
  --uk-surface: var(--ig-bg);
  --uk-fg: var(--ig-text);
  --uk-muted: var(--ig-muted);
  --uk-border: var(--ig-line);
  --uk-line: var(--ig-line-soft);
  --uk-head: var(--ig-soft);
  --uk-danger: var(--ig-danger);
  --uk-scrim: rgba(0, 0, 0, .45); /* 바닥 시트 뒤 막 - 테마와 상관없이 검정 45%(공통 규칙) */
  --uk-up-lg: var(--ig-card-shadow); /* PC 버튼 아래 창·메뉴 그림자 */
  --uk-r-md: 12px;
  --uk-r-lg: 16px;
  margin: 0;
  background: var(--ig-page);
  color: var(--ig-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
}
/* 공통 CSS가 body를 flex로 잡는다 - 그대로면 내용이 좁은 화면에서 앱 틀이 가운데로 쪼그라든다(2026-09-28 캡처에서 발견) */
body.ig { display: block; }
body.ig a { color: inherit; text-decoration: none; }
body.ig svg { display: block; }

.ig-app {
  width: 100%;
  max-width: var(--ig-w);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--ig-bg);
  border-left: 1px solid var(--ig-line-soft);
  border-right: 1px solid var(--ig-line-soft);
}

/* ── 위 줄 ── */
.ig-top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--ig-top-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--ig-bg);
  border-bottom: 1px solid var(--ig-line-soft);
}
.ig-brand { font-size: 24px; font-weight: 700; font-style: italic; letter-spacing: -.5px; font-family: "Brush Script MT", "Segoe Script", cursive, -apple-system; }
.ig-top-back { margin-left: -8px; }
.ig-top-title { position: absolute; left: 56px; right: 56px; text-align: center; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ig-top-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }

/* ── 휴대폰 위 줄 메뉴(2026-09-28 시안) - 아래 탭바 대신. 아래는 홈 타임라인이 쓴다. PC는 왼쪽 세로줄 ── */
.ig-top-nav { display: flex; align-items: center; }
.ig-top-nav a { display: flex; align-items: center; justify-content: center; width: 36px; height: 40px; }
.ig-top-nav a.is-active svg { stroke-width: 2.6; }
.ig-top-nav a.is-active .ig-avatar { box-shadow: 0 0 0 2px var(--ig-bg), 0 0 0 3.5px var(--ig-text); }
@media (max-width: 767px) {
  .ig-top .ig-top-actions { gap: 4px; }
  /* 메뉴가 오른쪽을 차지하니 제목은 가운데 겹치지 않고 ‹ 옆으로 */
  .ig-top-title { position: static; flex: 1 1 auto; min-width: 0; text-align: left; font-size: 15px; }
  .ig-top .ig-brand { flex: 1 1 auto; }
}
@media (max-width: 380px) { .ig-top-nav a { width: 32px; } .ig-top-nav svg { width: 22px; height: 22px; } }
/* 서비스 모음(auth novap-apps.js, 2026-10-12 사용자 결정) - 위 줄 아이콘과 같은 칸 폭·선 색으로 */
.ig-top-nav .nap-btn { width: 36px; height: 36px; color: var(--ig-text); }
.ig-top-nav .nap-btn:hover, .ig-top-nav .nap-btn[aria-expanded="true"] { background: var(--ig-soft); }
@media (max-width: 380px) { .ig-top-nav .nap-btn { width: 32px; height: 32px; } .ig-top-nav .nap-btn svg { width: 20px; height: 20px; } }
/* PC 서비스 모음(2026-10-13 사용자) - 위 줄 메뉴가 숨는 PC에서만 창 오른쪽 위에 떠 있는다. 휴대폰은 위 줄 것을 쓴다 */
.ig-pc-apps { display: none; }
@media (min-width: 768px) {
  .ig-pc-apps { display: flex; align-items: center; gap: var(--uk-hd-gap, 4px); position: fixed; top: 10px; right: 16px; z-index: 30; }
  .ig-pc-apps .nap-btn { color: var(--ig-text); background: var(--ig-bg); }
  .ig-pc-apps .nap-btn:hover, .ig-pc-apps .nap-btn[aria-expanded="true"] { background: var(--ig-soft); }
  /* 내 사진 단추 - 공통 프로필 메뉴(ui/profile-menu.md)와 같은 40px 동그라미, 누르면·열려 있으면 둘레 4px 흐린 테(2026-11-24 사용자 "다른곳과 동일하게") */
  .ig-pc-me { display: block; padding: 2px; border-radius: 50%; }
  .ig-pc-apps .ig-pc-me .ig-avatar { width: var(--uk-hd-avatar, 40px); height: var(--uk-hd-avatar, 40px); font-size: 15px; }
  .ig-pc-me:hover, .ig-pc-me[aria-expanded="true"] { box-shadow: 0 0 0 4px var(--ig-soft); }
}
/* 오른쪽 칸(960px~)이 창 오른쪽 끝에 붙으면 맨 위가 [서비스 모음][내 사진]과 겹친다 - 단추 아래부터 시작 */
@media (min-width: 960px) { body:has(.ig-pc-apps) .ig-side { padding-top: 64px; } }

/* ── 버튼 ── */
.ig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 42px; /* 32px에서 130%로(2026-09-29 사용자 "기본버튼이 좀 작다") - 작은 버튼(.is-small)은 그대로 */
  padding: 0 20px;
  border: 0;
  border-radius: 10px;
  background: var(--ig-soft);
  color: var(--ig-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ig-btn:hover { background: var(--ig-line); }
.ig-btn.is-primary { background: var(--ig-primary); color: var(--ig-on-primary); }
.ig-btn.is-primary:hover { background: var(--ig-primary-dark); }
.ig-btn.is-danger { background: transparent; color: var(--ig-danger); }
.ig-btn.is-small { height: 30px; padding: 0 12px; }
.ig-btn.is-block { width: 100%; }
.ig-btn.is-loading { opacity: .85; pointer-events: none; }
/* 보내는 중 - 누른 버튼 안에 도는 표시(form-validate.js가 .is-loading을 붙인다, 2026-09-29 사용자 "저장할 때 멈춘 것 같다") */
.ig-btn.is-loading::before { content: ""; flex: 0 0 auto; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ig-spin .7s linear infinite; }
@keyframes ig-spin { to { transform: rotate(360deg); } }
.ig-link { background: none; border: 0; padding: 0; color: var(--ig-primary); font-weight: 600; font-size: 14px; cursor: pointer; }
.ig-link.is-muted { color: var(--ig-muted); font-weight: 400; }
.ig-link.is-danger { color: var(--ig-danger); }
.ig-icon-btn { background: none; border: 0; padding: 8px; margin: -8px; cursor: pointer; color: var(--ig-text); display: inline-flex; }
/* 아이콘 판 - 여기서는 감싸기만 한다. 튀어나온 모양(자판처럼)은 테마 파일이 입힌다(coffee.css "입체 판", 2026-09-28) */
.ig-key { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }

/* ── 아바타 ── */
.ig-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--ig-avatar-bg);
  color: var(--ig-avatar-text);
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
}
.ig-avatar.is-tab { width: 26px; height: 26px; font-size: 11px; }
.ig-avatar.is-lg { width: 86px; height: 86px; font-size: 32px; }
.ig-avatar.is-md { width: 44px; height: 44px; font-size: 16px; }
/* 노바프 프로필 사진이 있으면 사진으로 꽉 채우고 첫 글자는 감춘다(StoryApi::avatar, 2026-09-29). 테마의 판 모양(그림자)은 그대로 */
body.ig .ig-avatar.has-photo { background-size: cover; background-position: center; background-repeat: no-repeat; color: transparent; }

/* ── 동그라미 줄(D30 - 홈 맨 위, 스토리·묶음) ── */
.ig-rings {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ig-line-soft);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.ig-rings::-webkit-scrollbar { display: none; }
.ig-ring { flex: 0 0 auto; width: 70px; display: flex; flex-direction: column; align-items: center; gap: 4px; scroll-snap-align: start; }
.ig-ring-pic {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  padding: 3px;
  background: var(--ig-ring);
  display: flex;
}
.ig-ring.is-group .ig-ring-pic { background: var(--ig-line); }
.ig-ring.is-new .ig-ring-pic { background: none; border: 1px dashed var(--ig-line); padding: 2px; }
.ig-ring-pic > span {
  flex: 1;
  border-radius: 50%;
  border: 3px solid var(--ig-bg);
  background: var(--ig-soft) center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--ig-muted);
}
.ig-ring-label { font-size: 12px; line-height: 14px; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-ring.is-group .ig-ring-label { color: var(--ig-muted); }

/* ── 게시물(피드 한 장) ── */
.ig-post { border-bottom: 1px solid var(--ig-line-soft); padding-bottom: 12px; }
.ig-post-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; }
.ig-post-who { display: flex; flex-direction: column; min-width: 0; }
.ig-post-who strong { font-weight: 600; font-size: 14px; }
a.ig-post-who { color: inherit; } /* 묶음 카드 제목 = 바로가기 링크(2026-10-01) */
.ig-post-who small { color: var(--ig-text); font-size: 12px; line-height: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-post-head .ig-post-more { margin-left: auto; }
.ig-post-tag { display: inline-flex; align-items: center; gap: 3px; padding: 0 8px; height: 20px; border-radius: 999px; background: var(--ig-soft); font-size: 11px; font-weight: 600; color: var(--ig-text); }
.ig-post-tag.is-story { background: #fde7f3; color: #b0126c; }
.ig-post-tag.is-hidden { background: #fff4d6; color: #8a5a00; }

/* 사진 넘기기(가로 스크롤 + 스냅) */
.ig-media { position: relative; background: transparent; } /* 검정 바탕은 뺐다 - 사진 칸(.ig-slide)이 옅은 바탕을 가진다(2026-09-29) */
.ig-carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.ig-carousel::-webkit-scrollbar { display: none; }
.ig-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; background: var(--ig-soft); position: relative; }
.ig-slide:has(video) { background: #000; } /* 사진 자리는 뜨기 전에 검정 대신 옅은 바탕(2026-09-29 사용자 "검정 화면 대신 투명하게") - 영상만 검정 */
.ig-slide img, .ig-slide video { width: 100%; height: 100%; object-fit: contain; }
.ig-slide.is-hidden img { opacity: .35; }
.ig-slide-empty { color: #666; }
/* 사진 뒤 흐린 배경(2026-09-28 사용자 시안 "흐린 사진") - 세로 사진의 양옆 검정 띠 대신 같은 사진 썸네일(--ig-blur)을 크게 흐려 깐다.
   썸네일은 작아도 흐리면 차이가 없고, 피드 바둑판·타임라인이 이미 받아 둔 파일이라 빨리 뜬다. 뜨기 전에는 테마의 옅은 색 */
.ig-slide.has-blur { overflow: hidden; background: var(--ig-soft); }
.ig-slide.has-blur::before { content: ""; position: absolute; inset: -40px; background: var(--ig-blur) center / cover no-repeat; filter: blur(28px) saturate(1.1) brightness(.88); }
.ig-slide.has-blur > * { position: relative; z-index: 1; }
.ig-media-count { position: absolute; top: 12px; right: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 600; }
.ig-dots { display: flex; justify-content: center; gap: 4px; height: 6px; margin-top: 10px; }
.ig-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--ig-line); }
.ig-dots span.is-on { background: var(--ig-primary); }
.ig-heart-pop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; color: #fff; }
.ig-heart-pop svg { width: 96px; height: 96px; fill: #fff; stroke: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.4)); }
.ig-heart-pop.is-on { animation: ig-pop .8s ease; }
@keyframes ig-pop { 0% { opacity: 0; transform: scale(.4); } 20% { opacity: 1; transform: scale(1.1); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }

.ig-actions { display: flex; align-items: center; gap: 16px; padding: 8px 16px 4px; }
.ig-actions .ig-right { margin-left: auto; }
.ig-like.is-liked svg { fill: var(--ig-danger); stroke: var(--ig-danger); }
.ig-like.is-bump svg { animation: ig-bump .35s ease; }
@keyframes ig-bump { 50% { transform: scale(1.25); } }
.ig-likes { padding: 0 16px; font-weight: 600; }
.ig-caption { padding: 6px 16px 0; white-space: pre-line; word-break: break-word; }
.ig-caption strong { font-weight: 600; margin-right: 4px; }
.ig-caption .ig-title { display: block; font-weight: 700; margin-bottom: 2px; }
.ig-people { padding: 4px 16px 0; color: var(--ig-muted); font-size: 13px; }
.ig-people span { color: var(--ig-text); font-weight: 600; }
.ig-comments-link { display: block; padding: 6px 16px 0; color: var(--ig-muted); }
.ig-time { display: block; padding: 6px 16px 0; color: var(--ig-muted); font-size: 11px; letter-spacing: .2px; }

/* 스토리 카드(피드 안) */
.ig-story-card-cover { position: relative; aspect-ratio: 4 / 3; background: var(--ig-soft) center / cover no-repeat; display: flex; align-items: flex-end; }
.ig-story-card-cover.is-empty { background: var(--ig-cover-empty); align-items: center; justify-content: center; }
.ig-story-card-shade { width: 100%; padding: 40px 16px 14px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); color: #fff; }
.ig-story-card-cover.is-empty .ig-story-card-shade { background: none; color: var(--ig-strong); text-align: center; padding: 0 16px; }
.ig-story-card-title { font-size: 20px; font-weight: 700; line-height: 26px; }
.ig-story-card-meta { font-size: 13px; opacity: .9; margin-top: 2px; }
.ig-emoji { font-size: 40px; line-height: 1; margin-bottom: 8px; }

/* ── 프로필 ── */
.ig-profile { padding: 16px; }
.ig-profile-top { display: flex; align-items: center; gap: 24px; }
.ig-stats { flex: 1; display: flex; justify-content: space-around; text-align: center; }
.ig-stats strong { display: block; font-size: 16px; font-weight: 700; }
.ig-stats span { font-size: 13px; }
.ig-profile-name { margin-top: 12px; font-weight: 600; }
.ig-profile-bio { white-space: pre-line; }
.ig-profile-photo { display: flex; flex: 0 0 auto; border-radius: 50%; } /* 노바프 프로필 열기(2026-10-02) */
.ig-profile-buttons { display: flex; gap: 8px; margin-top: 12px; }
.ig-profile-buttons .ig-btn { flex: 1; }
/* 탭 - 고른 탭 아래에 줄(2026-09-29 사용자 "탭은 아래쪽에 라인이 있어야" - 예전엔 인스타 프로필처럼 위에 있어 위 버튼 줄의 표시처럼 보였다) */
.ig-tabs { display: flex; border-bottom: 1px solid var(--ig-line-soft); }
.ig-tabs a { flex: 1; display: flex; justify-content: center; align-items: center; gap: 4px; height: 44px; color: var(--ig-faint); font-size: 12px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ig-tabs a.is-active { color: var(--ig-text); border-bottom-color: var(--ig-text); }

/* 3열 격자(프로필·둘러보기·스토리 앨범) */
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-album-feed { padding-top: 12px; } /* 스토리 앨범 탭 - 사진 카드(.ig-feed-item) 나열, 2026-09-28 */
.ig-cell { position: relative; aspect-ratio: 1 / 1; background: var(--ig-soft) center / cover no-repeat; overflow: hidden; display: block; }
.ig-cell img { width: 100%; height: 100%; object-fit: cover; }
.ig-cell-badge { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.ig-cell-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 6px 6px; background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff; font-size: 12px; font-weight: 600; line-height: 15px; }
.ig-cell.is-text { display: flex; align-items: center; justify-content: center; padding: 10px; text-align: center; font-size: 13px; line-height: 17px; color: var(--ig-strong); background: var(--ig-text-cell); }
.ig-cell.is-hidden { opacity: .45; }

/* ── 목록 줄(알림·사람·참여자) ── */
.ig-list { list-style: none; margin: 0; padding: 0; }
.ig-row { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.ig-row-text { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; word-break: break-word; }
.ig-row-text strong { font-weight: 600; }
.ig-row-text small { color: var(--ig-muted); }
.ig-row-thumb { width: 44px; height: 44px; object-fit: cover; flex: 0 0 auto; }
.ig-section-title { padding: 16px 16px 8px; font-size: 16px; font-weight: 700; }

/* ── 코멘트 ── */
.ig-comment { display: flex; gap: 12px; padding: 8px 16px; }
.ig-comment.is-hidden { opacity: .5; }
.ig-comment-body { flex: 1; min-width: 0; padding-top: 6px; word-break: break-word; } /* 첫 줄을 동그라미(32px) 가운데에 맞춘다(2026-09-29 사용자 "좌측 이미지와 줄 맞춤") */
.ig-comment-text { white-space: pre-line; } /* 줄바꿈은 글에만 - 몸통 전체에 주면 템플릿의 줄바꿈이 빈 첫 줄로 보였다 */
/* 스토리 코멘트 탭 - 왼쪽 썸네일(2026-10-01 사용자 "각 사진의 코멘트가 같이 나오고 좌측 썸네일을 누르면 그 사진으로"). 사진 것은 한 장, 스토리 전체 것은 표지 뒤에 종이 두 장을 겹친 묶음 */
.ig-comment-thumb { position: relative; flex: 0 0 40px; width: 40px; height: 40px; margin-top: 1px; }
button.ig-comment-thumb { padding: 0; border: 0; background: none; cursor: pointer; } /* 스토리 전체 코멘트 썸네일 = 💬 시트 여는 단추(2026-10-02) */
.ig-comment-thumb > i { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; border-radius: 6px; background: var(--ig-soft) center / cover no-repeat; color: var(--ig-muted); font-style: normal; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.ig-comment-thumb.is-story > i { inset: 5px 5px 0 0; font-size: 18px; box-shadow: 0 0 0 1.5px var(--ig-bg), 0 1px 3px rgba(0, 0, 0, .25); }
.ig-comment-thumb.is-story::before, .ig-comment-thumb.is-story::after { content: ""; position: absolute; inset: 5px 5px 0 0; border-radius: 6px; background: color-mix(in srgb, var(--ig-muted) 40%, var(--ig-bg)); box-shadow: 0 0 0 1.5px var(--ig-bg), 0 1px 2px rgba(0, 0, 0, .2); }
.ig-comment-thumb.is-story::before { transform: translate(5px, -5px); }
.ig-comment-thumb.is-story::after { z-index: 1; transform: translate(2.5px, -2.5px); }
.ig-comment-body strong { font-weight: 600; margin-right: 4px; }
.ig-comment-meta { display: flex; gap: 12px; margin-top: 4px; color: var(--ig-muted); font-size: 12px; }
.ig-comment-meta button { background: none; border: 0; padding: 0; color: var(--ig-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.ig-comment-box {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: var(--ig-bg);
  border-top: 1px solid var(--ig-line-soft);
}
.ig-comment-box textarea { flex: 1; border: 0; resize: none; outline: none; font: inherit; min-height: 20px; max-height: 80px; padding: 6px 0; background: transparent; }
.ig-comment-box .error-message { position: absolute; bottom: 100%; left: 16px; }
/* 입력 줄은 카드로 - 바탕과 같은 띠라 구분이 안 됐다(2026-09-29 사용자 "이부분은 카드로 처리해줘"). 화면 아래에 붙는 것은 그대로, 아래 여백만 */
.ig-comment-box { margin: 8px 8px 10px; padding: 8px 14px; border: 1px solid var(--ig-card-line); border-radius: 16px; background: var(--ig-card-bg); box-shadow: var(--ig-card-shadow); bottom: 10px; }
.ig-comment-box { z-index: 5; } /* 아래 붙는 입력 칸이 목록의 썸네일(z-index 2)보다 위(2026-10-02 사용자 "작성폼 위쪽에 썸네일이 올라오는데") */

/* ── 입력(새 이야기·설정) ── */
.ig-form { padding: 0 0 16px; }
.ig-field { padding: 12px 16px; border-bottom: 1px solid var(--ig-line-soft); }
.ig-field > label, .ig-label { display: block; font-size: 12px; color: var(--ig-muted); margin-bottom: 6px; }
.ig-field > label.ig-check { display: flex; font-size: 14px; color: var(--ig-text); margin-bottom: 0; } /* 칸 안의 체크 줄은 작은 칸 이름 모양이 아니라 줄 모양(초대장 만들기·함께 만들기, 2026-09-29) */
.ig-input, .ig-textarea, .ig-select {
  width: 100%;
  border: 1px solid var(--ig-line);
  border-radius: 8px;
  padding: 9px 12px;
  font: inherit;
  background: var(--ig-input);
  color: var(--ig-text);
  outline: none;
}
.ig-input:focus, .ig-textarea:focus, .ig-select:focus { border-color: var(--ig-muted); background: var(--ig-bg); }
.ig-textarea { resize: none; min-height: 64px; } /* 크기 조절 손잡이 없음(2026-09-29 사용자 "텍스트에어리어 크기 조절안되게") */
/* 새 이야기 글 칸 - 테두리 없이 바탕과 같아 칸으로 안 보였다 → 카드 같은 입력칸(2026-09-29 사용자 "글작성 부분은 구분이 가게") */
.ig-textarea.is-plain { min-height: 110px; padding: 12px 14px; border: 1px solid var(--ig-card-line); border-radius: 12px; background: var(--ig-card-bg); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04); line-height: 1.6; }
.ig-textarea.is-plain:focus { border-color: var(--ig-primary); background: var(--ig-card-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ig-primary) 18%, transparent); }
.ig-inline { display: flex; gap: 8px; }
.ig-inline > * { flex: 1; min-width: 0; }
.ig-check { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.ig-check input { width: 20px; height: 20px; accent-color: var(--ig-primary); }
.ig-hint { color: var(--ig-muted); font-size: 12px; margin-top: 6px; word-break: keep-all; } /* 낱말 중간에서 끊지 않는다(2026-09-29 사용자 "보입니/다") */
body.ig .error-message { color: var(--ig-danger); font-size: 12px; display: block; margin-top: 4px; }
body.ig .field-error { border-color: var(--ig-danger) !important; }

/* 알약(종류·공개범위 고르기) */
.ig-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ig-chip { position: relative; }
.ig-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ig-chip span { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--ig-line); font-size: 13px; font-weight: 600; background: var(--ig-bg); color: var(--ig-text); }
.ig-chip input:checked + span { background: var(--ig-text); color: var(--ig-bg); border-color: var(--ig-text); }
.ig-chip input:focus-visible + span { outline: 2px solid var(--ig-primary); }

/* 새 이야기 - 사진 고르기 칸과 미리보기 */
.ig-picker { border-top: 1px solid var(--ig-line-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; aspect-ratio: 1 / 1; background: var(--ig-input); border-bottom: 1px solid var(--ig-line-soft); text-align: center; color: var(--ig-muted); cursor: pointer; position: relative; }
.ig-picker input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ig-picker.has-files { aspect-ratio: auto; max-height: none; padding: 12px; background: var(--ig-bg); display: block; cursor: default; } /* 사진을 고르면 높이는 바둑판대로 - PC의 60vh 제한에 걸려 아래 글 칸을 덮었다(2026-09-29) */
.ig-picker.has-files input[type=file] { display: none; }
/* 파일을 끌고 들어오면 점선(2026-09-29) - 고른 사진 칸은 늘 12px 안쪽에 있어(.has-files) 점선이 사진에 걸리지 않는다(사용자 "이미지 영역을 작게") */
.ig-picker.is-drop::after { content: ""; position: absolute; inset: 4px; z-index: 5; border: 2px dashed var(--ig-primary); border-radius: 8px; pointer-events: none; }
.ig-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--ig-bg); }
.ig-picker-grid > div { aspect-ratio: 1 / 1; background: var(--ig-soft) center / cover no-repeat; position: relative; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ig-muted); }
.ig-picker-grid > div.is-video::after { content: "▶"; position: absolute; right: 4px; bottom: 14px; color: #fff; text-shadow: 0 1px 2px #000; }
/* 고른 사진 칸(story.js) - 번호 · × 빼기 · 올리는 막대, 끌어서 순서 바꾸기(2026-09-29 사용자 - phpdashapi 파일 첨부와 같은 모양) */
.ig-picker-grid > .ig-pick { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .12s, opacity .12s; }
.ig-pick-no { position: absolute; left: 5px; top: 5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.ig-pick-x { position: absolute; right: 5px; top: 5px; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.ig-pick-x:hover { background: var(--ig-danger); }
.ig-pick-ext { font-size: 12px; font-weight: 700; color: var(--ig-muted); }
.ig-pick-bar { position: absolute; left: 6px; right: 6px; bottom: 6px; display: none; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, .6); overflow: hidden; }
.ig-pick-bar i { display: block; width: 0; height: 100%; background: var(--ig-primary); transition: width .15s; }
.ig-pick.is-uploading .ig-pick-bar { display: block; }
.ig-pick.is-uploading .ig-pick-x { display: none; }
.ig-pick.is-done .ig-pick-bar i { background: #2fa56e; }
.ig-pick.is-drag { opacity: .5; transform: scale(.92); outline: 2px dashed var(--ig-primary); outline-offset: -2px; z-index: 2; }
.ig-picker-grid.is-sorting .ig-pick { cursor: grabbing; }
/* 사진 보태기 시트(story.php #contribute, 2026-10-03 사용자 "새 이야기 사진 올리기 화면처럼") - 위 고르는 칸, 아래 사진 관리 바둑판 */
.ig-contribute .ig-step-title { margin-top: 4px; }
.ig-contribute .ig-wizard-nav { padding-top: 4px; }
.ig-photo-manage { border-top: 8px solid var(--ig-line-soft); padding-bottom: 16px; }
.ig-photo-manage-head { display: flex; align-items: center; gap: 8px; padding-right: 16px; }
.ig-photo-manage-head .ig-step-title { flex: 1; }
.ig-photo-manage > .ig-hint { margin: -6px 16px 10px; }
.ig-manage-grid { margin: 0 16px; }
.ig-manage-grid > .ig-pick { cursor: default; }
.ig-manage-grid.is-sorting .ig-pick, .ig-manage-grid.can-sort > .ig-pick:not(.is-deleted) { cursor: grab; }
.ig-pick-who { position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 0 6px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10.5px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-pick-who.is-hidden { left: auto; right: 4px; background: #8a5a00; }
/* 지운 사진 - 관리자만 흐리게 본다, 되돌리기 없음 */
.ig-pick.is-deleted { filter: grayscale(1); opacity: .45; }
.ig-pick-gone { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 4px; background: rgba(0, 0, 0, .35); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.3; text-align: center; }
/* 전체 진행 - 막대 + "N/M 완료" */
.ig-upload { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--ig-line-soft); }
.ig-upload-track { flex: 1 1 auto; height: 7px; border-radius: 999px; background: var(--ig-soft); overflow: hidden; }
.ig-upload-track i { display: block; width: 0; height: 100%; background: var(--ig-primary); transition: width .15s; }
.ig-upload-label { flex: 0 0 auto; font-size: 12px; color: var(--ig-muted); font-variant-numeric: tabular-nums; }
/* 다 올라간 뒤 서버 저장 중 - 글자 앞 스피너 + 막대에 흐르는 줄무늬(story.js .is-saving) */
.ig-upload.is-saving .ig-upload-label { display: inline-flex; align-items: center; gap: 4px; color: var(--ig-text); font-weight: 600; }
.ig-upload.is-saving .ig-upload-label::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--ig-primary); border-right-color: transparent; border-radius: 50%; animation: ig-spin .7s linear infinite; }
.ig-upload.is-saving .ig-upload-track i { width: 100% !important; background-image: linear-gradient(45deg, rgba(255, 255, 255, .28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .28) 50%, rgba(255, 255, 255, .28) 75%, transparent 75%); background-size: 16px 16px; animation: ig-stripes .6s linear infinite; }
@keyframes ig-stripes { to { background-position: 16px 0; } }
@media (prefers-reduced-motion: reduce) { .ig-btn.is-loading::before, .ig-upload.is-saving .ig-upload-label::before, .ig-upload.is-saving .ig-upload-track i { animation-duration: 2s; } }
.ig-picker-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; background: var(--ig-bg); border-bottom: 1px solid var(--ig-line-soft); }

/* 옵션 줄(+ 날짜 · 장소 · 행사 …) - 인스타그램의 "위치 추가 · 사람 태그" 줄 */
.ig-opt { border-bottom: 1px solid var(--ig-line-soft); }
.ig-opt > button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 15px;
  color: var(--ig-text);
  cursor: pointer;
  text-align: left;
}
.ig-opt > button .ig-opt-value { margin-left: auto; color: var(--ig-muted); font-size: 13px; max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-opt > button .ig-opt-plus { margin-left: 4px; color: var(--ig-faint); }
.ig-opt.is-open > button .ig-opt-plus { transform: rotate(45deg); }
.ig-opt.is-on > button { font-weight: 600; }
.ig-opt-body { display: none; padding: 0 16px 14px; }
.ig-opt.is-open .ig-opt-body { display: block; }

/* 태그 입력(함께한 사람) */
.ig-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--ig-line); border-radius: 8px; padding: 6px 8px; background: var(--ig-input); }
.ig-tags input { flex: 1; min-width: 90px; border: 0; outline: none; background: transparent; font: inherit; padding: 4px; }
.ig-tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--ig-text); color: var(--ig-bg); font-size: 13px; font-weight: 600; }
.ig-tag button { background: none; border: 0; color: var(--ig-bg); cursor: pointer; padding: 0; font-size: 14px; line-height: 1; }

/* ── 스토리 화면 ── */
.ig-invite { color: var(--ig-strong); position: relative; padding: 36px 20px 28px; text-align: center; background: var(--ig-invite-bg) center / cover no-repeat; }
.ig-invite.is-memorial { background: var(--ig-invite-memorial); }
.ig-invite-kicker { font-size: 12px; letter-spacing: 3px; color: var(--ig-muted); text-transform: uppercase; }
.ig-invite-title { font-size: 26px; line-height: 32px; font-weight: 800; margin: 10px 0 6px; }
.ig-invite-hero { font-size: 15px; color: var(--ig-muted); }
.ig-invite-when { margin-top: 16px; font-size: 17px; font-weight: 700; }
.ig-invite-where { margin-top: 4px; color: var(--ig-invite-sub); }
.ig-invite-msg { margin: 16px auto 0; max-width: 320px; white-space: pre-line; line-height: 21px; }
.ig-invite .ig-btn { margin-top: 16px; }
.ig-story-head { padding: 14px 16px; border-bottom: 1px solid var(--ig-line-soft); }
.ig-story-title { font-size: 20px; font-weight: 800; line-height: 26px; }
.ig-story-meta { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; color: var(--ig-text); }
.ig-story-meta div { display: flex; align-items: center; gap: 4px; }
.ig-story-meta svg { color: var(--ig-muted); }
.ig-rsvp { padding: 14px 16px; border-bottom: 1px solid var(--ig-line-soft); }
.ig-rsvp-sum { color: var(--ig-muted); font-size: 13px; margin-bottom: 10px; }
.ig-rsvp-sum strong { color: var(--ig-text); }

/* ── 바닥 시트 - 공통 novap-ui bottom-sheet.css·sheet-drag.js·bottom-sheet.js(색은 위 body.ig의 --uk-* ← --ig-*). 아래는 스토리에만 있는 것(CLAUDE.md "공통 규칙 예외") ──
   - 휴대폰 시트 폭은 앱 틀 폭(--ig-w)까지 - 앱 틀보다 넓은 휴대폰 창(가로 모드 등)에서 시트가 틀 밖으로 넓어지지 않게(공통 --sheet-w 한 줄)
   - 가운데 모달(.is-modal): 방명록 남기기·초대장 - 휴대폰에서도 가운데(D45), 살짝 커지며 나타나고 끌기 없음(sheet-drag는 화면 아래에 붙은 시트만 끈다) */
body.ig dialog.bottom-sheet { --sheet-w: var(--ig-w); }
dialog.bottom-sheet.is-modal { margin: auto; width: min(500px, calc(100vw - 32px)); max-height: calc(100dvh - 80px); border-radius: 14px; padding-top: 14px; }
dialog.bottom-sheet.is-modal:not([open]) { transform: scale(.96); opacity: 0; }
@starting-style { dialog.bottom-sheet.is-modal[open] { transform: scale(.96); opacity: 0; } }

/* 빈 화면 */
.ig-empty { padding: 48px 32px; text-align: center; color: var(--ig-muted); }
.ig-empty-icon { width: 62px; height: 62px; margin: 0 auto 14px; border: 2px solid var(--ig-text); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--ig-text); }
.ig-empty h2 { color: var(--ig-text); font-size: 22px; font-weight: 800; margin-bottom: 8px; }
.ig-empty .ig-btn { margin-top: 16px; }

.ig-more { display: block; margin: 16px auto; text-align: center; }
.ig-search { padding: 8px 16px; }
.ig-search input { width: 100%; height: 36px; border: 0; border-radius: 8px; background: var(--ig-soft); padding: 0 16px; font: inherit; outline: none; }

/* 토스트는 홈 아래 타임라인 위로 */
body.ig:has(.ig-tl) .bs-scope .toast-container { bottom: 230px !important; }

@media (min-width: 600px) {
  .ig-app { margin-top: 0; box-shadow: 0 0 0 1px var(--ig-line-soft); }
}

/* 서버가 돌려준 칸 오류가 접힌 옵션 안에 있으면 펼쳐 보인다(새 이야기) */
.ig-opt:has(.field-error) .ig-opt-body,
.ig-opt:has(.error-message:not(:empty)) .ig-opt-body { display: block; }

/* hidden 속성은 display를 준 클래스보다 늘 이긴다(새 이야기의 "다시 고르기" 줄이 사진 없이도 보이던 것, 2026-09-28) */
body.ig [hidden] { display: none !important; }
.ig-check > span { display: inline-flex; align-items: center; gap: 4px; }
.ig-check svg { display: inline-block; }
/* 사진을 고르면 고르기 안내(카메라·문구)는 숨기고 미리보기 격자만 */
.ig-picker.has-files > svg, .ig-picker.has-files > strong, .ig-picker.has-files > span { display: none; }


/* ── PC(768px 이상) - 인스타그램 PC처럼 왼쪽 아이콘 세로줄 + 가운데 피드 (+ 넓으면 오른쪽 칸) ──
   사용자가 보여 준 인스타 PC 화면(2026-09-28): 세로줄 72px(1264px 이상은 글자까지 244px), 피드 470px, 오른쪽 320px(960px 이상, 로그인한 모든 화면 - 3단 통일 2026-09-28)
   가운데 글·폼은 가운데 칸 전체 폭(width 100%) - ig-main이 세로 flex라 width를 안 주면 내용 폭으로 줄어 글쓰기 화면이 좁았다 */
.ig-rail, .ig-side { display: none; }
.ig-shell { display: block; }
@media (min-width: 768px) {
  .ig-rail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    z-index: 30;
    left: 0;
    top: 0;
    bottom: 0;
    width: 72px;
    padding: 24px 12px 20px;
    background: var(--ig-bg);
    border-right: 1px solid var(--ig-line-soft);
  }
  .ig-rail a {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 48px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--ig-text);
    font-size: 16px;
    white-space: nowrap;
  }
  .ig-rail a:hover { background: var(--ig-soft); }
  .ig-rail a.is-active { font-weight: 700; }
  .ig-rail a.is-active svg { stroke-width: 2.6; }
  .ig-rail a span.ig-rail-label { display: none; }
  .ig-rail .ig-rail-logo { height: 56px; margin-bottom: 18px; }
  .ig-rail .ig-rail-logo { display: none; } /* 아이콘만 보이는 폭에서는 로고 자리를 비운다(카메라 아이콘 뺌, 2026-09-29) */
  .ig-rail .ig-rail-more { margin-top: auto; }
  /* 가운데 가변(2026-09-28 시안) - 왼쪽·오른쪽 칸은 고정, 가운데 칸은 470~935px.
     그 안의 내용은 모두 홈 피드 카드 폭(--ig-center, 화면 높이에 맞춘 폭 360~600px)으로 가운데 정렬 - 홈 피드·아래 타임라인·서브 화면·위 줄이
     같은 폭(2026-09-28 사용자 "가운데 최대사이즈는 위쪽 카드사이즈로 ... 타임라인도 ... 다른 서브페이지 모두") */
  .ig-shell { display: flex; justify-content: center; align-items: flex-start; gap: 32px; margin-left: 72px; padding: 0 32px; }
  .ig-app { --ig-center: min(600px, max(360px, calc(100vh - 220px))); flex: 1 1 auto; width: auto; min-width: 470px; max-width: 935px; margin: 0; border: 0; box-shadow: none; } /* 휴대폰의 margin: 0 auto가 flex에서 남는 폭을 먹어 오른쪽 칸이 밀렸다 */
  .ig-main > :not(dialog), .ig-top { width: 100%; max-width: var(--ig-center); margin-left: auto; margin-right: auto; }
  .ig-picker { width: 100%; max-height: 60vh; } /* 전체 폭이면 정사각 사진 고르기 칸이 화면보다 커진다 */
  /* 정사각 비율에 높이를 막으면 폭까지 줄었다 - PC는 폭 100%에 높이만 제한(2026-09-29 사용자 "상단이미지 등록하는 부분 영역은 100%") */
  .ig-picker:not(.has-files) { aspect-ratio: auto; height: min(60vh, 420px); }
  body.ig { background: var(--ig-bg); }
  .ig-top.is-home { display: none; }
  .ig-top .ig-brand { display: none; }
  .ig-top-nav { display: none; } /* 서브 화면 위 줄 메뉴 아이콘은 왼쪽 세로줄과 겹친다 - PC에서는 뺀다(2026-09-28 사용자) */
  .ig-main { padding-top: 12px; }
  .ig-top + .ig-main { padding-top: 0; }
  .ig-top.is-home + .ig-main { padding-top: 28px; } /* 홈은 위 줄을 숨겨서 피드가 창 맨 위에 붙었다 - 오른쪽 칸(36px)과 비슷하게(2026-09-28 사용자) */
  .ig-comment-box { bottom: 10px; } /* 카드로 바꾸며 아래 여백(2026-09-29) */
  .ig-post { border: 0; margin-bottom: 20px; }
  .ig-post-head { padding-left: 4px; padding-right: 4px; }
  .ig-media, .ig-story-card-cover { border-radius: 4px; overflow: hidden; }
  /* 스토리 표지 - 가운데 칸 전체 폭에서 4:3으로 자르면 세로 사진의 위(머리)가 잘렸다(2026-09-28 사용자). PC는 자르지 않고 사진 전체, 남는 곳은 피드 사진처럼 어둡게 */
  .ig-story-card-cover:not(.is-empty) { aspect-ratio: auto; height: min(70vh, 620px); background-size: contain; background-color: #000; }
  /* 표지를 통째로 보일 때 양옆은 흐린 썸네일 - 표지 사진은 ::after로 그 위에(휴대폰은 칸을 꽉 채워 양옆이 없다) */
  .ig-story-card-cover.has-blur { background: var(--ig-soft) !important; overflow: hidden; }
  .ig-story-card-cover.has-blur::before { content: ""; position: absolute; inset: -40px; background: var(--ig-blur) center / cover no-repeat; filter: blur(28px) saturate(1.1) brightness(.88); }
  .ig-story-card-cover.has-blur::after { content: ""; position: absolute; inset: 0; background: var(--ig-cover) center / contain no-repeat; }
  .ig-story-card-cover.has-blur > * { position: relative; z-index: 1; }
  /* 여러 장 - 마우스로는 밀기 어려우니 좌우 화살표 */
  .ig-nav {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: #000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    z-index: 2;
  }
  .ig-nav.is-prev { left: 10px; }
  .ig-nav.is-next { right: 10px; }
  .ig-nav[disabled] { display: none; }
}
.ig-nav { display: none; }
@media (min-width: 768px) { .ig-media .ig-nav { display: flex; } .ig-media .ig-nav[disabled] { display: none; } }
@media (min-width: 1264px) {
  .ig-rail { width: 244px; }
  .ig-rail a span.ig-rail-label { display: inline; }
  .ig-rail .ig-rail-logo { display: flex; }
  .ig-shell { margin-left: 244px; }
}
@media (min-width: 960px) {
  .ig-side { display: block; width: 320px; padding-top: 36px; flex: 0 0 320px; position: sticky; top: 0; max-height: 100vh; overflow-y: auto; scrollbar-width: none; } /* 왼쪽 세로줄처럼 스크롤해도 제자리(2026-09-28 사용자), 창보다 길면 칸 안에서만 넘어간다 */
  .ig-side::-webkit-scrollbar { display: none; }
}
.ig-side-head { display: flex; justify-content: space-between; margin: 24px 0 8px; color: var(--ig-muted); font-weight: 600; }
.ig-side-head:first-child { margin-top: 0; } /* 맨 위 내 계정 줄을 뺀 뒤 칸 첫 줄(2026-11-24) */
.ig-side-head a { color: var(--ig-text); font-size: 12px; }
.ig-side .ig-row { padding: 8px 0; }
.ig-side-foot { margin-top: 24px; color: var(--ig-faint); font-size: 12px; line-height: 16px; }
.ig-side-foot a { color: var(--ig-faint); }
.ig-ring-mini { width: 44px; height: 44px; border-radius: 50%; padding: 2px; background: var(--ig-ring); flex: 0 0 auto; display: flex; }
.ig-ring-mini > span { flex: 1; border-radius: 50%; border: 2px solid var(--ig-bg); background: var(--ig-soft) center / cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 18px; }
/* 오른쪽 칸 "내 스토리"는 둥근 네모 - 내 사진(동그라미)과 사람/스토리를 모양으로 가른다(2026-10-02 사용자) */
.ig-side .ig-ring-mini { border-radius: 12px; }
.ig-side .ig-ring-mini > span { border-radius: 10px; }

/* ── 홈 아래 타임라인(2026-09-28 시안 확정) - 흰 판 위 사진 카드 줄. 스크롤하면 작아지고 올리거나 만지면 커진다(story.js) ── */
.ig-app { display: flex; flex-direction: column; }
.ig-main { flex: 1 0 auto; display: flex; flex-direction: column; }
.ig-home-top { width: 100%; }
.ig-tl { position: sticky; bottom: 0; z-index: 25; margin-top: auto; padding: 8px 8px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--ig-bg); }
@media (min-width: 768px) { .ig-tl { padding-left: 0; padding-right: 0; } } /* PC - 판 가장자리를 피드 카드 가장자리와 맞춘다(2026-09-28 사용자) */
.ig-tl-panel { border: 1px solid var(--ig-panel-line); border-radius: 18px; padding: 10px 12px 10px; background: var(--ig-bg); box-shadow: var(--ig-panel-shadow); transition: padding .18s; }
.ig-tl-bar { display: flex; align-items: center; gap: 8px; height: 40px; padding-bottom: 8px; overflow: hidden; transition: height .18s, opacity .18s, padding .18s; }
.ig-tl-title { flex: 1 1 auto; min-width: 0; font-size: 17px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-tl-title small { font-size: 12px; font-weight: 400; color: var(--ig-muted); }
.ig-tl-order { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.ig-tl-order a { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid transparent; border-radius: 999px; background: var(--ig-pill-bg); font-size: 12px; font-weight: 600; color: var(--ig-pill-text); }
.ig-tl-order a.is-on { background: var(--ig-bg); border-color: var(--ig-accent); color: var(--ig-accent-text); }
.ig-tl-order svg { display: inline-block; }
.ig-flip { display: flex; transform: scaleX(-1); }
@media (max-width: 480px) { .ig-tl-order a { padding: 5px 9px; } .ig-tl-title small { display: none; } }
/* 넘김 단추 - 카드 줄 양 끝 가운데에 얹는다. 흰 동그라미 + 진한 그림자로 사진 위에서도 잘 보이게, 끝에 닿으면 숨김 */
.ig-tl-row { position: relative; }
.ig-tl-arrow { position: absolute; top: 50%; z-index: 3; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-top: -20px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 50%; background: var(--ig-float-bg); color: var(--ig-strong); cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .28); transition: opacity .15s, transform .15s; }
.ig-tl-arrow:hover { transform: scale(1.08); }
.ig-tl-arrow.is-prev { left: -6px; }
.ig-tl-arrow.is-next { right: -6px; }
.ig-tl-arrow:disabled { opacity: .35; cursor: default; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); transform: none; }
.ig-tl.is-small .ig-tl-arrow { width: 32px; height: 32px; margin-top: -16px; }
.ig-tl-track { display: flex; gap: 8px; padding: 5px; overflow-x: auto; overscroll-behavior-x: contain; scroll-padding: 5px; scrollbar-width: none; }
/* 카드에 달라붙기는 손가락으로 넘기는 화면에서만 - PC 휠·끌기에서는 멈칫멈칫 끊겼다(2026-09-29 사용자 "툭툭 끊긴다"). 부드러운 이동은 story.js가 한다 */
@media (hover: none) { .ig-tl-track { scroll-snap-type: x proximity; } }
.ig-tl-track::-webkit-scrollbar { display: none; }
/* 카드 - 처음 크기(136×156)의 절반 정도(2026-09-28 사용자 "너무커 ... 반절크기") */
.ig-tl-card { position: relative; flex: 0 0 112px; height: 84px; scroll-snap-align: start; border-radius: 12px; overflow: hidden; color: #fff; background: var(--ig-card-empty); transition: height .18s; }
@media (min-width: 768px) { .ig-tl-card { flex-basis: 124px; height: 88px; } }
body.ig .ig-tl-card { color: #fff; }
.ig-tl-pic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 30px; background: center / cover no-repeat; font-size: 26px; font-weight: 800; color: rgba(0, 0, 0, .5); }
.ig-tl-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, .66)); transition: background .18s; }
.ig-tl-info { position: absolute; left: 8px; right: 6px; bottom: 6px; z-index: 1; display: grid; justify-items: start; gap: 1px; }
.ig-tl-info b { max-width: 100%; font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.ig-tl-info small { max-width: 100%; font-size: 10px; line-height: 12px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-tl-tag { margin-bottom: 1px; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 700; line-height: 16px; color: #fff; background: rgba(90, 100, 115, .85); }
.ig-tl-card.is-story .ig-tl-tag { background: rgba(244, 93, 112, .92); }
.ig-tl-card.is-joined .ig-tl-tag { background: rgba(214, 51, 132, .88); }
.ig-tl-card.is-group .ig-tl-tag { background: rgba(76, 120, 70, .88); }
.ig-tl-card.is-record .ig-tl-tag { background: rgba(32, 128, 141, .9); } /* 사진 여러 장 기록 카드(2026-09-29) */
.ig-tl-card.is-guest .ig-tl-tag { background: rgba(196, 150, 20, .92); }
.ig-tl-card.is-guest { background: #fff3c4; }
.ig-tl-card.is-day .ig-tl-tag { background: rgba(59, 111, 196, .9); }
.ig-tl-card.is-nav .ig-tl-pic { font-size: 22px; color: var(--ig-pill-text); }
.ig-tl-card.is-on { box-shadow: none; } /* 테두리 없이 검정으로만 표시(2026-09-29 사용자) */
/* 작아지면 - 사진은 배경에 그대로 깔고(어둡게) 이름·날짜만 */
.ig-tl.is-small .ig-tl-panel { padding: 6px 8px; }
.ig-tl.is-small .ig-tl-bar { height: 0; padding: 0; opacity: 0; }
.ig-tl.is-small .ig-tl-card { height: 44px; }
.ig-tl.is-small .ig-tl-pic { padding-bottom: 0; font-size: 0; } /* 사진 없는 카드의 글자(방명록 이름 첫 글자)가 이름과 겹쳐서 - QA */
.ig-tl.is-small .ig-tl-card::after { background: rgba(0, 0, 0, .45); }
/* 지금 보는 카드 - 테두리만으로는 잘 안 보여서 반투명 검정을 얹는다(2026-09-29 사용자). 작아진 줄은 모든 카드가 이미 어두워서 더 진하게 */
.ig-tl-card.is-on::after { background: rgba(0, 0, 0, .7); }
.ig-tl.is-small .ig-tl-card.is-on::after { background: rgba(0, 0, 0, .82); }
.ig-tl.is-small .ig-tl-tag { display: none; }
.ig-tl.is-small .ig-tl-info { bottom: 5px; }
@media (prefers-reduced-motion: reduce) { .ig-tl-card, .ig-tl-card::after, .ig-tl-bar, .ig-tl-panel, .ig-tl-arrow { transition: none; } }

/* ── 홈 "하나만 보기"(_one.php) - 머리 + 3열 격자 ── */
.ig-one-head { padding: 12px 16px 14px; border-bottom: 1px solid var(--ig-line-soft); }
.ig-one-back { display: flex; width: fit-content; align-items: center; gap: 2px; margin: 0 0 10px -4px; color: var(--ig-primary) !important; font-weight: 600; font-size: 14px; }
.ig-one-chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--ig-soft); color: var(--ig-muted); }
.ig-one-chip.is-guest { background: #fff1c2; color: #8a6d00; }
/* 스토리 전체 코멘트 뱃지 - 이름 옆(2026-09-29 사용자 "스토리전체 코멘트인경우 뱃지") */
.ig-comment-scope { height: 18px; margin: 0 6px 0 2px; padding: 0 7px; font-size: 10px; vertical-align: 1px; }
/* 피드 방명록 카드(_feed_items.php, 2026-09-29) - 머리(이름·설명이 방명록 바로가기 링크, 2026-10-01) · 남긴 글 */
.ig-guest-card .ig-post-tag.is-hidden { margin-left: auto; }
.ig-guest-card .ig-post-tag.is-hidden + .ig-post-more { margin-left: 2px; }
.ig-guest-body { margin: 0; padding: 2px 16px 10px; font-size: 15px; line-height: 1.6; white-space: pre-line; word-break: break-word; }
.ig-guest-card.is-hidden .ig-guest-body { opacity: .5; }
.ig-one-head h2 { margin: 6px 0 4px; font-size: 21px; line-height: 1.3; }
.ig-one-head p { margin: 0; color: var(--ig-muted); font-size: 13px; }
.ig-one-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ig-one-feed { padding-top: 8px; }
/* 스토리·기록·일상 묶음 하나 보기도 스토리 화면과 같은 머리 카드(2026-10-03 사용자 "스토리·타임라인 모두 동일하게") - 전체 보기는 카드 위, 사진은 카드 아래 */
.ig-one-back.is-out { margin: 12px 0 0 12px; }
.ig-story-card + .ig-one-feed { margin-top: 10px; }
.ig-photo.is-hidden .ig-media { opacity: .45; }
.ig-comment.is-focus { background: #fffbea; }
.ig-guest-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--ig-line-soft); color: var(--ig-muted); font-size: 13px; }

/* ── 홈 피드 묶음(4차 D46~D50) - 스토리는 바둑판, 누르면 사진 크게 보기(story-viewer.js) - 그 자리 펼치기는 2026-10-01 뺐다 ── */
.ig-bundle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.ig-bundle-cell { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: var(--ig-soft) center / cover no-repeat; color: var(--ig-muted); cursor: pointer; }
.ig-bundle-cell:hover { filter: brightness(.94); }
.ig-bundle-more { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 22px; font-weight: 700; }
.ig-bundle-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 36px 16px; background: var(--ig-page); color: var(--ig-muted); font-size: 13px; }
.ig-bundle-empty span { font-size: 36px; }
.ig-bundle.is-loading .ig-bundle-grid { opacity: .5; pointer-events: none; }
.ig-bundle-all { border: 0; background: none; padding: 4px 16px 0; font: inherit; color: var(--ig-muted); cursor: pointer; text-align: left; }

/* ── 홈 피드 카드(2026-09-28 사용자 "스토리와 스토리 사이, 스토리와 코멘트 사이 구분이 안 가 - 카드 형태로") ──
   피드 항목(.ig-feed-item) 하나 = 카드 한 장. 색은 테마(--ig-card-bg · --ig-card-line · --ig-card-shadow - 판 그림자로는 흰 바탕에서 안 보여 따로 진하게), 안의 게시물 선·여백은 뺀다 */
.ig-feed-item, .ig-card { margin: 0 8px 14px; padding: 2px 8px 6px; border: 1px solid var(--ig-card-line); border-radius: 16px; background: var(--ig-card-bg); box-shadow: var(--ig-card-shadow); } /* overflow: hidden을 주면 펼친 묶음의 sticky [접기] 줄이 멈춘다 */
.ig-feed-item .ig-media, .ig-feed-item .ig-bundle-grid, .ig-feed-item .ig-bundle-empty, .ig-card .ig-media { border-radius: 8px; overflow: hidden; }
.ig-feed-item > .ig-post, .ig-card > .ig-post { border-bottom: 0; margin-bottom: 0; padding-bottom: 6px; }
.ig-feed-item { margin-bottom: 28px; } /* 피드 카드 사이 두 배(휴대폰 14 → 28px, 2026-09-29) */
/* 스토리 화면 머리 카드(2026-10-02 사용자 "위쪽과 아래쪽 구분") - 피드 카드와 같은 모양, 아래 탭과 사이를 띄운다 */
.ig-story-card { margin: 8px 8px 0; padding-bottom: 10px; border: 1px solid var(--ig-card-line); border-radius: 16px; background: var(--ig-card-bg); box-shadow: var(--ig-card-shadow); overflow: hidden; }
.ig-story-card .ig-story-head { border-bottom: 0; }
.ig-story-tags { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; } /* 뱃지 줄 - 오른쪽 끝 ⋮(.ig-story-more) */
.ig-story-tabs { margin-top: 18px; }
.ig-icon-btn.has-count { gap: 4px; align-items: center; }
.ig-act-n, .ig-tab-n { font-size: 13px; font-weight: 600; }
.ig-tab-n { color: var(--ig-muted); }
.ig-dot { flex: 0 0 auto; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ig-danger, #ed4956); align-self: flex-start; margin: 1px 0 0 -7px; vertical-align: top; } /* 새 코멘트 빨간 점(2026-10-02) - 💬 아이콘 오른쪽 위 */
.ig-story-tabs .ig-dot { align-self: center; margin: -10px 0 0 2px; }
@media (min-width: 768px) { .ig-story-card { margin: 8px 0 0; } }
@media (max-width: 767px) { .ig-feed { padding-top: 12px; } } /* 휴대폰 - 위 줄과 첫 카드 사이 여백([피드 | 앨범] 줄을 뺀 뒤 붙어 보였다, 2026-10-01 사용자). PC는 그대로 */
@media (min-width: 768px) {
  .ig-feed-item, .ig-card { margin: 0 0 20px; padding: 4px 12px 8px; }
  .ig-feed-item { margin-bottom: 40px; } /* 피드 카드 사이는 두 배(2026-09-29 사용자 "스토리와 스토리 사이 여백은 지금의 2배로") - 펼친 묶음 안 사진 카드(.ig-card)는 그대로 */
}

/* ── 사진 카드 안 코멘트(2026-09-28 사용자 "페이지 이동 말고 그곳에서") - _photo.php, story-comments.js ── */
.ig-inline-comments { margin: 8px 12px 0; padding-top: 6px; border-top: 1px solid var(--ig-line-soft); }
.ig-inline-comments .ig-comment { padding: 6px 4px; }
.ig-inline-comments .ig-avatar { width: 28px; height: 28px; font-size: 12px; flex: 0 0 auto; }
.ig-inline-comments .ig-comment-body { padding-top: 4px; } /* 작은 동그라미(28px)에 맞춤 */
.ig-inline-comments [aria-busy="true"] { min-height: 32px; opacity: .5; }
/* 방금 단 코멘트(2026-10-02 사용자 "새 댓글인지 모르겠다") - 잠깐 칠했다가 옅어진다 */
.ig-comment.is-new { border-radius: 10px; animation: ig-new-comment 3s ease-out; }
@keyframes ig-new-comment { 0%, 45% { background: color-mix(in srgb, var(--ig-accent, #0095f6) 16%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .ig-comment.is-new { animation: none; background: color-mix(in srgb, var(--ig-accent, #0095f6) 10%, transparent); } }
#likes-sheet .bottom-sheet-body { padding-top: 0; }
#likes-sheet .ig-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
/* 스토리 머리 - 버튼 줄이 카드 맨 아래(2026-10-02). 사진·기록 수는 스토리 정보(.ig-story-meta)의 한 줄 */
.ig-story-card .ig-actions { padding-top: 5px; } /* "좋아요 N개"와 버튼 줄 사이 - 10px이 넓어 반으로(2026-10-02 사용자) */
.ig-inline-empty { margin: 0; padding: 8px 4px; color: var(--ig-muted); font-size: 13px; }
.ig-inline-box { display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; padding: 6px 12px; border: 1px solid var(--ig-line); border-radius: 20px; background: var(--ig-input); }
.ig-inline-box textarea { flex: 1; border: 0; resize: none; outline: none; font: inherit; min-height: 20px; max-height: 80px; padding: 4px 0; background: transparent; color: var(--ig-text); }
/* 스크립트 없이도 글에 맞춰 늘어나게(지원하는 브라우저) - 최대 5줄은 story.js grow()가 max-height로 정한다 */
.ig-inline-box textarea, .ig-comment-box textarea, .ig-inline-edit textarea { field-sizing: content; }
/* 입력 줄의 [게시]는 항상 오른쪽 끝(2026-10-01 사용자 "게시 버튼이 왜 항상 왼쪽에 붙는지") - field-sizing: content면 칸이 글자 폭으로 줄어
   flex: 1이 먹지 않아 버튼이 글자 바로 옆에 붙었다. 칸은 남는 폭을 다 쓰고, 버튼은 margin-left: auto로 끝에 */
.ig-inline-box textarea, .ig-comment-box textarea { width: 100%; min-width: 0; }
.ig-inline-box > button, .ig-comment-box > button { flex: 0 0 auto; margin-left: auto; }
/* 시트 안에서도 한 줄(bottom-sheet.css가 시트 안 form을 모두 block으로 둔다 - 코멘트 시트에서 [게시]가 다음 줄 왼쪽으로 떨어졌다) */
dialog.bottom-sheet form.ig-inline-box, dialog.bottom-sheet form.ig-comment-box { display: flex; }
.ig-inline-more { display: inline-block; margin: 6px 4px 0; color: var(--ig-faint); font-size: 12px; }
.ig-inline-edit textarea { width: 100%; margin-top: 4px; padding: 6px 10px; border: 1px solid var(--ig-line); border-radius: 10px; background: var(--ig-input); font: inherit; color: var(--ig-text); resize: vertical; } /* 카드 안 코멘트 고치기 */

/* ── 확인창·알림창(ui-dialog.js의 .modal-sheet) - Story 테마 색으로(2026-09-28 사용자 "모달창도 테마에 맞게") ──
   관리 화면(custom.css --app-*) 모양이 흰 창·파랑으로 떠서 테마와 따로 놀았다. 틀·동작은 그대로, 색·둥글기만 테마 변수로.
   삭제 확인 버튼은 테마와 상관없이 빨강(늘 지키는 규칙) */
body.ig .modal-sheet { border: 1px solid var(--ig-card-line); border-radius: 8px; background: var(--ig-card-bg); color: var(--ig-text); box-shadow: var(--ig-card-shadow), 0 18px 48px rgba(0, 0, 0, .18); }
body.ig .modal-sheet::backdrop { background: rgba(0, 0, 0, .28); }
body.ig .ui-dialog .ui-dialog-main .modal-title { color: var(--ig-text); }
body.ig .ui-dialog .ui-dialog-body { color: var(--ig-muted); }
body.ig .ui-dialog .ui-dialog-icon { background-color: var(--ig-soft); }
body.ig .ui-dialog .modal-foot .button { height: 42px; border: 0; border-radius: 10px; background: var(--ig-soft); color: var(--ig-text); font-weight: 600; box-shadow: none; }
body.ig .ui-dialog .modal-foot .button:hover { background: var(--ig-line); }
body.ig .ui-dialog .modal-foot .button.is-primary { background: var(--ig-primary); color: var(--ig-on-primary); }
body.ig .ui-dialog .modal-foot .button.is-primary:hover { background: var(--ig-primary-dark); }
body.ig .ui-dialog .modal-foot .button.is-danger { background: var(--ig-danger); color: #fff; }
body.ig .ui-dialog .modal-foot .button.is-danger:hover { filter: brightness(.94); }
body.ig .ui-dialog .modal-foot .button:focus { outline: 2px solid var(--ig-primary); outline-offset: 2px; }
body.ig .ui-dialog .modal-foot .button.is-danger:focus { outline-color: var(--ig-danger); }
.ig-story-more { order: 99; margin-left: auto; } /* 스토리 머리 관리자 "…" - 뱃지 줄 오른쪽 끝(2026-09-29) */
/* 홈 방명록 - 글마다 카드(_comments.php $cCards, 2026-09-29). 고른 글(?c=)은 카드 테두리로 */
.ig-comment-card .ig-comment { padding: 10px 4px; }
.ig-comment-card:has(.ig-comment.is-focus) { border-color: var(--ig-accent); }
.ig-comment-card .ig-comment.is-focus { background: none; }
.ig-one-head + #comments { padding-top: 4px; }
/* 코멘트 한 개 - 첫 줄 닉네임 · 때 · 고치기 · 지우기 · 숨기기, 다음 줄부터 글(2026-09-29 사용자) */
.ig-comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ig-comment-head strong { margin-right: 0; }
.ig-comment-head .ig-comment-scope { align-self: center; }
.ig-comment-when { color: var(--ig-muted); font-size: 12px; }
.ig-comment-actions { display: inline-flex; gap: 10px; margin-left: auto; } /* 오른쪽 끝으로(2026-09-29 사용자 "우측정렬로") */
.ig-comment-actions button { padding: 0; border: 0; background: none; color: var(--ig-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.ig-comment-actions button:hover { color: var(--ig-text); }
div.ig-comment-text { margin-top: 2px; }
.ig-inline-older { display: block; margin: 4px 4px 2px; padding: 0; border: 0; background: none; color: var(--ig-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; } /* 이전 코멘트 N개 더보기 - 최근 3개만 보인다(2026-09-29) */
.ig-inline-older:hover { color: var(--ig-text); }
.ig-comments-older { display: block; margin: 8px 16px 0; padding: 0; border: 0; background: none; color: var(--ig-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; } /* 코멘트 화면 맨 위 [이전 코멘트 더보기](2026-10-01) */
.ig-comments-older:hover { color: var(--ig-text); }
.ig-tl-more { flex: 0 0 1px; align-self: stretch; } /* 아래 타임라인 끝 표시 - 보이면 다음 카드를 받는다(story.js) */

/* 관리 화면 공용 CSS(custom.css)가 그리는 체크박스·라디오 등은 --app-* 색을 쓴다 - Story 화면에서는 테마 색으로(2026-09-29, 파랑 체크가 떠 보였다) */
body.ig { --app-primary: var(--ig-primary); --app-primary-ring: rgba(0, 0, 0, .15); --app-border-strong: var(--ig-line); --app-surface: var(--ig-input); }

/* ── 새 이야기 - 단계별(2026-09-29 사용자). 위 단계 표시 · 종류 카드 · 초대장 만들기(디자인 · 칸이 초대장 모양 안에) · 추가 옵션 · 아래 [이전][다음/올리기] ── */
.ig-stepper { display: flex; gap: 6px; margin: 0; padding: 14px 16px 6px; list-style: none; }
.ig-stepper li { flex: 1; display: flex; align-items: center; gap: 6px; padding-bottom: 8px; border-bottom: 3px solid var(--ig-line-soft); color: var(--ig-faint); font-size: 12px; font-weight: 600; white-space: nowrap; }
.ig-stepper li span { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--ig-soft); color: var(--ig-muted); font-size: 11px; }
.ig-stepper li.is-done { color: var(--ig-muted); border-color: var(--ig-line); }
.ig-stepper li.is-on { color: var(--ig-text); border-color: var(--ig-primary); }
.ig-stepper li.is-on span, .ig-stepper li.is-done span { background: var(--ig-primary); color: var(--ig-on-primary); }
.ig-step-title { margin: 14px 16px 12px; font-size: 18px; font-weight: 800; }
.ig-kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; padding: 0 16px 16px; }
/* 종류 카드 - 작게: 아이콘 옆에 이름, 아래에 설명 두 줄(2026-09-29 사용자 "불필요하게 크다") */
.ig-kind-card { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 4px; row-gap: 3px; padding: 10px 12px; border: 1px solid var(--ig-card-line); border-radius: 12px; background: var(--ig-card-bg); box-shadow: var(--ig-card-shadow); cursor: pointer; transition: transform .12s, border-color .12s; }
.ig-kind-card:hover { transform: translateY(-2px); border-color: var(--ig-primary); }
.ig-kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.ig-kind-card:has(input:checked) { border-color: var(--ig-primary); box-shadow: 0 0 0 2px var(--ig-primary); }
.ig-kind-emoji { font-size: 20px; line-height: 1; }
.ig-kind-card strong { font-size: 14px; }
.ig-kind-card small { grid-column: 1 / -1; color: var(--ig-muted); font-size: 11.5px; line-height: 1.4; word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ig-design-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 12px; }
.ig-design-chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px; border: 2px solid transparent; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ig-strong); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.ig-design-chip.is-on { border-color: var(--ig-primary); }
.ig-invite-edit { margin: 0 16px 12px; border-radius: 16px; box-shadow: var(--ig-card-shadow); }
.ig-invite-deco { font-size: 22px; line-height: 1; margin-bottom: 8px; }
.ig-invite-input { width: 100%; border: 0; border-bottom: 1px dashed rgba(0, 0, 0, .22); background: transparent; color: inherit; font: inherit; text-align: center; outline: none; padding: 4px 2px; }
.ig-invite-input:focus { border-bottom-color: var(--ig-primary); }
.ig-invite-input::placeholder { color: inherit; opacity: .45; }
input.ig-invite-title { font-size: 24px; font-weight: 800; margin: 8px 0 4px; }
input.ig-invite-hero { font-size: 15px; }
.ig-invite-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; font-weight: 700; }
.ig-invite-line .ig-invite-input { width: auto; flex: 0 1 auto; min-width: 0; }
.ig-invite-line input[name=place_name] { flex: 1 1 auto; max-width: 260px; }
.ig-invite-key { flex: 0 0 auto; font-size: 12px; letter-spacing: 2px; opacity: .7; }
.ig-invite-sub { margin-top: 4px; font-size: 13px; }
textarea.ig-invite-msg { margin-top: 14px; resize: none; line-height: 21px; }
.ig-wizard-nav { display: flex; gap: 10px; padding: 16px; }
.ig-wizard-nav .ig-btn { flex: 1; }
.ig-wizard-nav .ig-btn[data-step-prev], .ig-wizard-nav .ig-btn[data-draft-save] { flex: 0 0 110px; }
.ig-wizard-nav .ig-btn[data-draft-delete] { flex: 0 0 auto; padding: 0 14px; border: 1px solid var(--ig-danger); background: transparent; color: var(--ig-danger); } /* 쓰던 내용 지우기(2026-09-29) - 빨간 테두리 버튼(사용자 "삭제 버튼도 라인을 넣어줘") */
.ig-wizard-nav .ig-btn[data-draft-delete]:hover { background: color-mix(in srgb, var(--ig-danger) 8%, transparent); }
@media (max-width: 480px) { .ig-wizard-nav { gap: 6px; } .ig-wizard-nav .ig-btn[data-step-prev], .ig-wizard-nav .ig-btn[data-draft-save] { flex-basis: 76px; } }
.ig-more-opts { display: grid; gap: 10px; }
.ig-radios { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ig-radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.ig-radio input { width: 18px; height: 18px; margin: 0; }
/* 초대장 디자인(story_invite_designs.php) - 새 이야기의 초대장·디자인 고르기, 스토리 화면의 초대장이 같이 쓴다 */
.is-design-cream { background: linear-gradient(160deg, #fbf1e7 0%, #f3dcc8 55%, #e9cfb8 100%); color: #3a2a20; }
.is-design-blush { background: linear-gradient(160deg, #fff5f6 0%, #fbdde3 55%, #f3c3cf 100%); color: #5a2a36; }
.is-design-garden { background: linear-gradient(160deg, #f3f8ee 0%, #dcebd2 55%, #c6ddb8 100%); color: #2f4527; }
.is-design-sky { background: linear-gradient(160deg, #f2f8ff 0%, #d9e9fb 55%, #bfd7f3 100%); color: #243a55; }
.is-design-party { background: linear-gradient(160deg, #fffbe8 0%, #ffecb0 55%, #ffd98a 100%); color: #5a4200; }
.is-design-night { background: linear-gradient(160deg, #26314f 0%, #1c2440 60%, #121831 100%); color: #f3efe6; }
.is-design-mono { background: linear-gradient(160deg, #f4efea 0%, #e7ddd4 55%, #d9ccc0 100%); color: #3d3530; }
.ig-invite[class*="is-design-"] .ig-invite-kicker, .ig-invite[class*="is-design-"] .ig-invite-hero, .ig-invite[class*="is-design-"] .ig-invite-where { color: inherit; opacity: .75; }
.is-design-night .ig-invite-input { border-bottom-color: rgba(255, 255, 255, .35); }
.is-design-night input[type=date], .is-design-night input[type=time] { color-scheme: dark; }
.ig-stepper li { cursor: pointer; } /* 단계를 눌러 오간다 */
.ig-stepper li:hover { color: var(--ig-text); }
.ig-draft-note { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 16px 0; padding: 10px 14px; border-radius: 12px; background: var(--ig-notice-bg); font-size: 13px; }
/* 첫 화면 스토리 카드의 초대장(_invite.php $invCompact) - 사진 격자 위, 누르면 스토리로(2026-09-29) */
.ig-invite.is-compact { display: block; margin: 0 0 8px; padding: 22px 16px 18px; border-radius: 10px; text-decoration: none; }
.ig-invite.is-compact:hover { filter: brightness(1.02); }
.ig-invite.is-compact .ig-invite-title { font-size: 21px; line-height: 27px; margin: 6px 0 4px; }
.ig-invite.is-compact .ig-invite-when { margin-top: 10px; font-size: 15px; }
.ig-invite.is-compact .ig-invite-msg { margin-top: 10px; font-size: 13px; line-height: 19px; }
/* 단계 표시 오른쪽 - 파랑 ✓ 다 됨 / 빨강 ● 더 채워야 함(story.js stepMarks, 2026-09-29 사용자 - 뜻 색이라 테마와 상관없이 파랑·빨강) */
.ig-stepper li b { font-weight: inherit; }
.ig-step-mark { display: inline-block; flex: 0 0 auto; margin-left: 2px; font-style: normal; } /* 이름 바로 뒤 - 오른쪽 끝에 두면 다음 단계 것처럼 보였다(2026-09-29) */
.ig-step-mark.is-ok { width: 16px; height: 16px; border-radius: 50%; background: #2f77c9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.ig-step-mark.is-need { width: 9px; height: 9px; border-radius: 50%; background: #e0413a; }
/* 끝난 행사의 접힌 초대장(story.php) - 한 줄 [초대장 보기], 누르면 펼침 */
.ig-invite-fold { border-bottom: 1px solid var(--ig-line-soft); }
.ig-invite-fold > summary { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; color: var(--ig-muted); font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
.ig-invite-fold > summary::-webkit-details-marker { display: none; }
.ig-invite-fold > summary::after { content: "▾"; font-size: 11px; }
.ig-invite-fold[open] > summary::after { content: "▴"; }
.ig-invite-fold[open] > summary { color: var(--ig-text); }

/* ── 사진 크게 보기(뷰 슬라이드, story-viewer.js, 2026-09-29 사용자 - phpdashapi 뷰슬라이드의 이미지 기능만 따로) ──
   화면 전체를 덮는 어두운 오버레이. 위 줄(X·제목·저장), 가운데 가로로 넘기는 사진 칸, 양옆 ‹ ›, 아래 미니 사진 줄 + N/M.
   사진을 한 번 두드리면 줄을 숨긴다(.is-bare), 확대 중(.is-zoomed)엔 넘기지 않는다. 테마와 상관없이 어두운 바탕 */
html.ig-viewer-lock, html.ig-viewer-lock body { overflow: hidden; }
.ig-viewer { position: fixed; inset: 0; z-index: 1000; display: none; background: #14171c; color: #fff; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.ig-viewer.is-open { display: block; opacity: 1; transform: none; }
@starting-style { .ig-viewer.is-open { opacity: 0; transform: translateY(12px); } }
.ig-viewer-head { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px; height: 56px; padding: env(safe-area-inset-top, 0) 8px 0; background: rgba(20, 20, 30, .75); backdrop-filter: blur(3px); }
.ig-viewer-x, .ig-viewer-save { display: inline-flex; align-items: center; gap: 4px; height: 40px; min-width: 40px; justify-content: center; padding: 0 8px; border: 0; border-radius: 20px; background: transparent; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.ig-viewer-x:hover, .ig-viewer-save:hover { background: rgba(255, 255, 255, .12); }
.ig-viewer-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-viewer-track { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; }
.ig-viewer-track::-webkit-scrollbar { display: none; }
.ig-viewer-slide { flex: 0 0 100%; height: 100%; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; scroll-snap-stop: always; overflow: hidden; }
.ig-viewer-slide img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; touch-action: pan-x; cursor: zoom-in; will-change: transform; }
.ig-viewer-slide.is-zoomed img { cursor: grab; }
.ig-viewer-slide.is-broken img { display: none; }
/* 영상 - 묶음 슬라이드에 섞인 영상은 그 자리에서 재생(2026-10-01). 확대는 사진만. 위 줄과 아래 줄(높이 --ig-vfoot, story-viewer.js) 사이에 두어 재생 단추가 가리지 않게 */
.ig-viewer-slide.is-video { box-sizing: border-box; padding: 56px 0 var(--ig-vfoot, 0px); }
.ig-viewer-slide video { max-width: 100%; max-height: 100%; width: 100%; background: #000; }
.ig-viewer-slide, .ig-viewer-slide video { touch-action: pan-x; } /* 세로로 쓸기는 닫기(story-viewer.js) */
.ig-viewer-slide.is-broken::after { content: "사진을 불러오지 못했어요"; color: rgba(255, 255, 255, .6); font-size: 14px; }
.ig-viewer-nav { position: absolute; top: 50%; z-index: 3; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-top: -24px; border: 0; border-radius: 50%; background: rgba(20, 20, 30, .8); color: #fff; cursor: pointer; backdrop-filter: blur(3px); }
.ig-viewer-nav.is-prev { left: 14px; }
.ig-viewer-nav.is-next { right: 14px; }
.ig-viewer-nav[hidden] { display: none; }
.ig-viewer-film { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(20, 20, 30, .75); backdrop-filter: blur(3px); pointer-events: none; }
.ig-viewer-film[hidden] { display: none; }
.ig-viewer-film-track[hidden] { display: none; }
/* 아래 줄 - 올린 사람·날짜·글 · ♡ 💬 ✈ · 바로가기(2026-10-01 사용자 "뷰슬라이드 안에 코멘트·좋아요·공유", 사진마다) */
.ig-viewer-info { pointer-events: auto; max-width: 640px; margin: 0 auto 8px; }
.ig-viewer-info[hidden] { display: none; }
.ig-viewer-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.ig-viewer-who .ig-avatar { width: 28px; height: 28px; font-size: 12px; flex: 0 0 auto; }
.ig-viewer-who [data-viewer-name] { color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-viewer-who small { flex: 0 0 auto; color: rgba(255, 255, 255, .7); font-size: 12px; }
.ig-viewer-caption { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .92); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ig-viewer-caption[hidden] { display: none; }
.ig-viewer-acts { display: flex; align-items: center; gap: 2px; margin: 4px 0 0 -8px; }
.ig-viewer-act { display: inline-flex; align-items: center; gap: 4px; height: 40px; min-width: 40px; justify-content: center; padding: 0 8px; border: 0; border-radius: 20px; background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.ig-viewer-act:hover { background: rgba(255, 255, 255, .12); }
.ig-viewer-act span:empty { display: none; }
/* 오른쪽 위 ⋮ 펼침 메뉴 - 스토리 바로가기 · 공유하기 · 사진 저장(2026-10-01 사용자 "우측 상단은 케밥, 그 안에 기능들을 다") */
.ig-viewer-menu { position: absolute; top: calc(100% - 4px); right: 8px; z-index: 4; min-width: 200px; padding: 6px; border-radius: 12px; background: #2a2f38; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.ig-viewer-menu[hidden] { display: none; }
/* [AI 보정 전] 버튼 - 오른쪽 위 ⋮ 왼쪽(2026-10-01 사용자). 누른 동안(보정 전 사진을 보는 중)은 흰 바탕 */
.ig-viewer-ai { flex: 0 0 auto; height: 30px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 999px; background: rgba(255, 255, 255, .14); color: #fff; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; cursor: pointer; }
.ig-viewer-ai:hover { background: rgba(255, 255, 255, .24); }
.ig-viewer-ai.is-on { background: #fff; color: #14171c; border-color: #fff; }
.ig-viewer-ai[hidden] { display: none; }
.ig-viewer-menu-item { display: flex; align-items: center; gap: 4px; width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #fff; font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.ig-viewer-menu-item:hover, .ig-viewer-menu-item:focus-visible { background: rgba(255, 255, 255, .1); outline: none; }
.ig-viewer-menu-item[hidden] { display: none; }
/* 아래로 쓰는 동안 위·아래 줄은 숨긴다 */
.ig-viewer.is-pulling .ig-viewer-head, .ig-viewer.is-pulling .ig-viewer-nav, .ig-viewer.is-pulling .ig-viewer-film { opacity: 0; }
/* 코멘트 시트 - 카드 코멘트 칸을 그대로 넣는다(가장자리 선·여백만 시트에 맞춤) */
.ig-viewer-comments { margin: 0; padding: 0 4px 12px; border: 0; box-shadow: none; background: transparent; }
.ig-viewer-comments .ig-inline-comments { border-top: 0; }
/* 스토리·기록 코멘트 미리 보기 상자(_story_cline.php, 2026-10-02 사용자 "여백도 많고 구분도 안 간다" → 회색 상자 + 작은 줄) - 머리 "💬 코멘트 N · 전체 ›",
   코멘트마다 한 줄(작은 아바타 · 이름 · 글 · 때). 상자 어디를 눌러도 바닥 시트 #story-comments. 줄은 story-comments.js updateLine()이 채운다 */
.ig-cline { display: block; margin: 8px 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--ig-soft); color: var(--ig-text); font-size: 13px; cursor: pointer; }
.ig-story-cline .ig-cline { margin: 0 16px 4px; } /* 위는 "사진 N장 · 기록 N개" 줄의 아래 여백(16px)만 */
.ig-cline:focus-visible { outline: 2px solid var(--ig-accent); outline-offset: 2px; }
.ig-cbox-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ig-muted); }
.ig-cbox-title { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ig-text); }
.ig-cbox-title b { font-weight: 600; }
.ig-cbox-all { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.ig-cbox-rows { display: block; }
.ig-cbox-rows:not(:empty) { margin-top: 6px; }
.ig-cbox-row { display: flex; align-items: center; gap: 6px; min-height: 24px; }
.ig-cbox-row .ig-avatar { flex: 0 0 auto; width: 20px; height: 20px; font-size: 9px; }
.ig-cbox-row b { flex: 0 0 auto; font-weight: 600; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-cbox-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-cbox-when { flex: 0 0 auto; color: var(--ig-muted); font-size: 11px; }
/* 시트 안은 받아 둔 코멘트 모두(카드에서는 최근 3개 + 더보기), 더 앞은 맨 위까지 올리면 저절로 - story-comments.js */
.ig-sheet-comments { margin: 0; padding: 0 4px 12px; border: 0; box-shadow: none; background: transparent; }
.ig-sheet-comments .ig-inline-comments { border-top: 0; }
.ig-viewer-film-track { display: flex; gap: 4px; justify-content: safe center; overflow-x: auto; scrollbar-width: none; pointer-events: auto; }
.ig-viewer-film-track::-webkit-scrollbar { display: none; }
.ig-viewer-thumb { flex: 0 0 52px; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #2a2f38; cursor: pointer; opacity: .65; outline: 2px solid transparent; outline-offset: -2px; }
.ig-viewer-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-viewer-thumb > svg { display: block; margin: auto; color: #fff; } /* 썸네일 없는 영상 - ▶ */
.ig-viewer-thumb.is-on { opacity: 1; outline-color: #f0b429; }
.ig-viewer-count { position: absolute; right: 12px; top: -30px; padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ig-viewer-count:empty { display: none; }
.ig-viewer-head, .ig-viewer-nav, .ig-viewer-film { transition: opacity .15s; }
.ig-viewer.is-bare .ig-viewer-head, .ig-viewer.is-bare .ig-viewer-nav, .ig-viewer.is-bare .ig-viewer-film { opacity: 0; pointer-events: none; }
.ig-viewer.is-bare .ig-viewer-film-track { pointer-events: none; }
@media (hover: none) { .ig-viewer-nav { display: none; } } /* 휴대폰은 밀어서 넘긴다 */
.ig-photo .ig-media img[data-view-id] { cursor: zoom-in; }
.ig-viewer button:focus:not(:focus-visible) { outline: none; } /* 열 때 X에 준 초점 테두리는 키보드일 때만 */
.ig-viewer-film-track { cursor: grab; user-select: none; }
.ig-viewer-film-track.is-dragging { cursor: grabbing; }
.ig-viewer-film-track.is-dragging .ig-viewer-thumb { pointer-events: none; }
.ig-viewer-thumb img { -webkit-user-drag: none; pointer-events: none; }
/* 휴대폰 - 피드·사진 카드는 화면 끝까지(좌우 여백·옆 선 없음, 둥근 모서리는 그대로 - 2026-09-29 사용자). 카드 사이는 간격과 위아래 선으로 나뉜다 */
@media (max-width: 767px) {
  .ig-feed-item, .ig-card { margin-left: 0; margin-right: 0; border-left: 0; border-right: 0; } /* 둥근 모서리는 둔다(사용자) */
  .ig-app { border-left: 0; border-right: 0; box-shadow: none; } /* 화면 양옆 1px 선도 뺀다 */
}
.ig-one-head { position: relative; }
/* #m사진으로 찾아온 카드 - 잠깐 테두리로 표시(story.js) */
.ig-card.is-pinned, .ig-feed-item.is-pinned { animation: ig-pin-blink .7s ease-in-out 4; } /* 테두리가 네 번 깜빡인다(2026-09-29 사용자) */
@keyframes ig-pin-blink { 0%, 100% { box-shadow: var(--ig-card-shadow); } 50% { box-shadow: 0 0 0 3px var(--ig-primary), var(--ig-card-shadow); } }
@media (prefers-reduced-motion: reduce) { .ig-card.is-pinned, .ig-feed-item.is-pinned { animation: none; box-shadow: 0 0 0 3px var(--ig-primary), var(--ig-card-shadow); } }
/* 알림 [내 활동] - 줄 앞 무엇을 했는지(좋아요·코멘트·방명록) + 쓴 글 앞부분(2026-09-29) */
.ig-act-verb { display: inline-block; margin-right: 6px; padding: 0 8px; border-radius: 999px; background: var(--ig-soft); font-size: 11px; font-weight: 700; line-height: 20px; vertical-align: 1px; }
.ig-act-verb.is-like { color: var(--ig-danger); }
.ig-act-text { display: block; margin-top: 2px; color: var(--ig-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 쪽 번호 줄(_pager.php, 2026-09-29 사용자 "페이징") */
.ig-pager { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 16px 12px 24px; }
.ig-pager a, .ig-pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; color: var(--ig-text); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; }
.ig-pager a:hover { background: var(--ig-soft); }
.ig-pager .is-on { background: var(--ig-primary); color: var(--ig-on-primary); }
.ig-pager .is-off { color: var(--ig-faint); }
.ig-pager-gap { color: var(--ig-muted); min-width: 20px !important; }

/* ── 노바프 저장소에서 가져오기(2026-09-29 사용자 시안) - _storage_picker.php · story-storage.js ── */
.ig-picker-ways { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; } /* 투명한 파일 칸(inset 0) 위로 - 아니면 [노바프 저장소]를 눌러도 파일 창이 열린다. [내 기기에서]는 <label> 안이라 그대로 파일 창 */
.ig-picker-ways .ig-btn { min-width: 128px; }
.ig-picker-more { display: flex; gap: 16px; }
dialog.ig-store { width: min(1100px, calc(100vw - 48px)); height: min(780px, calc(100dvh - 48px)); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 8px; background: var(--ig-card-bg, var(--ig-bg)); color: var(--ig-text); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); overflow: hidden; }
dialog.ig-store[open] { display: flex; flex-direction: column; }
dialog.ig-store::backdrop { background: rgba(0, 0, 0, .45); }
.ig-store-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 12px 20px; border-bottom: 1px solid var(--ig-line-soft); }
.ig-store-head h2 { margin: 0; font-size: 17px; font-weight: 700; white-space: nowrap; }
.ig-store-kind { font-size: 12px; font-weight: 600; color: var(--ig-primary-dark, var(--ig-primary)); background: var(--ig-soft); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.ig-store-search { margin-left: auto; display: flex; align-items: center; gap: 8px; width: 260px; height: 36px; padding: 0 12px; border: 1px solid var(--ig-line); border-radius: 8px; background: var(--ig-input); color: var(--ig-muted); }
.ig-store-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--ig-text); }
.ig-store-x { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--ig-text); cursor: pointer; flex-shrink: 0; }
.ig-store-x:hover { background: var(--ig-soft); }
.ig-store-tabs { display: flex; gap: 6px; padding: 10px 20px; border-bottom: 1px solid var(--ig-line-soft); overflow-x: auto; }
.ig-store-tabs button { height: 34px; padding: 0 16px; border: 1px solid var(--ig-line); border-radius: 999px; background: none; color: var(--ig-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.ig-store-tabs button.is-active { background: var(--ig-primary); border-color: var(--ig-primary); color: var(--ig-on-primary); }
.ig-store-body { flex: 1; display: flex; min-height: 0; }
.ig-store-side { width: 240px; flex-shrink: 0; overflow: auto; padding: 10px 8px; border-right: 1px solid var(--ig-line-soft); background: var(--ig-input); }
.ig-store-side[hidden] { display: none; }
.ig-store-row { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 36px; padding: 3px 10px; border: 0; border-radius: 8px; background: none; color: var(--ig-text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.ig-store-row:hover { background: var(--ig-soft); }
.ig-store-row.is-on { background: var(--ig-soft); font-weight: 700; }
.ig-store-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-store-row small { color: var(--ig-muted); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.ig-store-caret { width: 16px; flex-shrink: 0; color: var(--ig-muted); font-size: 11px; text-align: center; }
.ig-store-caret.is-leaf { visibility: hidden; }
.ig-store-side-note { margin: 10px 10px 4px; font-size: 12px; line-height: 1.5; color: var(--ig-muted); }
.ig-store-face { position: relative; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: var(--ig-line); display: flex; align-items: center; justify-content: center; }
.ig-store-face b { font-size: 13px; color: #fff; }
.ig-store-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.ig-store-row.is-on .ig-store-face { box-shadow: 0 0 0 2px var(--ig-input), 0 0 0 4px var(--ig-primary); }
.ig-store-main { flex: 1; min-width: 0; overflow: auto; padding: 12px 20px 20px; overscroll-behavior: contain; }
.ig-store-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 24px; margin-bottom: 8px; font-size: 14px; color: var(--ig-muted); }
.ig-store-crumbs strong { color: var(--ig-text); }
.ig-store-crumbs button { border: 0; background: none; padding: 0; font: inherit; color: var(--ig-primary); cursor: pointer; }
.ig-store-day { margin: 14px 0 8px; font-size: 14px; font-weight: 700; }
.ig-store-day:first-child { margin-top: 2px; }
.ig-store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.ig-store-folders { margin-bottom: 10px; }
.ig-store-folder { aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; border: 1px solid var(--ig-line); border-radius: 10px; background: var(--ig-input); color: var(--ig-primary); font: inherit; cursor: pointer; }
.ig-store-folder:hover { border-color: var(--ig-primary); }
.ig-store-folder b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--ig-text); }
.ig-store-folder small { font-size: 12px; color: var(--ig-muted); }
.ig-store-cell { position: relative; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--ig-soft); cursor: pointer; transition: transform .12s; }
.ig-store-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-store-cell.is-on { transform: scale(.93); box-shadow: 0 0 0 3px var(--ig-primary); }
.ig-store-mark { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: rgba(255, 255, 255, .25); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ig-store-cell.is-on .ig-store-mark { background: var(--ig-primary); }
.ig-store-dur { position: absolute; left: 6px; bottom: 6px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 11px; font-weight: 700; }
.ig-store-cell.is-added { cursor: default; }
.ig-store-cell.is-added .ig-store-mark { display: none; }
.ig-store-added { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; font-weight: 700; }
.ig-store-note { margin: 40px 0; text-align: center; color: var(--ig-muted); font-size: 14px; }
.ig-store-more { display: flex; justify-content: center; padding: 18px 0; }
.ig-store-more[hidden] { display: none; }
.ig-spin { width: 20px; height: 20px; border: 2px solid var(--ig-primary); border-right-color: transparent; border-radius: 50%; animation: ig-spin .7s linear infinite; }
.ig-store-foot { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--ig-line-soft); }
.ig-store-count { font-size: 14px; font-weight: 600; }
.ig-store-gap { flex: 1; }
.ig-store-foot .ig-btn { min-width: 96px; }
/* 좁은 화면 - 온 화면 시트, 인물·달은 위쪽 가로 줄(인물은 동그라미), 폴더는 옆 나무 없이 경로줄 + 폴더 칸 */
@media (max-width: 700px) {
  dialog.ig-store { width: 100vw; height: 100dvh; border-radius: 0; margin: 0; }
  .ig-store-head { padding: 6px 4px 6px 14px; gap: 6px; flex-wrap: wrap; }
  .ig-store-head h2 { font-size: 16px; flex: 1; }
  .ig-store-kind { display: none; }
  .ig-store-search { order: 3; width: 100%; margin: 0 10px 6px 0; }
  .ig-store-tabs { padding: 8px 12px; }
  .ig-store-body { flex-direction: column; }
  .ig-store-side { width: auto; flex-direction: row; display: flex; gap: 4px; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--ig-line-soft); flex-shrink: 0; }
  dialog[data-tab="folder"] .ig-store-side { display: none; }
  .ig-store-side .ig-store-row { width: auto; flex-shrink: 0; min-height: 34px; padding: 0 12px; border: 1px solid var(--ig-line); border-radius: 999px; }
  .ig-store-side .ig-store-row.is-on { background: var(--ig-primary); border-color: var(--ig-primary); color: var(--ig-on-primary); }
  .ig-store-side .ig-store-row.is-on small { color: inherit; }
  .ig-store-side-note { display: none; }
  dialog[data-tab="person"] .ig-store-side .ig-store-row { flex-direction: column; gap: 4px; width: 64px; padding: 2px 0; border: 0; border-radius: 0; background: none; color: var(--ig-text); font-size: 12px; }
  dialog[data-tab="person"] .ig-store-side .ig-store-row small { display: none; }
  dialog[data-tab="person"] .ig-store-side .ig-store-row-name { width: 100%; text-align: center; }
  dialog[data-tab="person"] .ig-store-face { width: 54px; height: 54px; box-shadow: 0 0 0 2px var(--ig-input), 0 0 0 3px var(--ig-line); }
  dialog[data-tab="person"] .ig-store-row.is-on .ig-store-face { box-shadow: 0 0 0 2px var(--ig-input), 0 0 0 4px var(--ig-primary); }
  .ig-store-main { padding: 8px 0 12px; }
  .ig-store-crumbs, .ig-store-day, .ig-store-note { padding: 0 12px; }
  .ig-store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .ig-store-folders { padding: 0 12px; gap: 6px; }
  .ig-store-cell { border-radius: 0; }
  .ig-store-cell.is-on { transform: none; box-shadow: inset 0 0 0 3px var(--ig-primary); }
  .ig-store-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); }
  .ig-store-foot [data-store-close] { display: none; }
}

/* ── 스토리 고치기(2026-09-29 사용자 "입력 페이지와 흡사하게") - _story_edit_form.php. 새 이야기 부품 그대로, 시트만 넓게 ── */
.ig-story-edit .ig-stepper { padding-top: 4px; }
.ig-story-edit .ig-stepper li { justify-content: center; }
.ig-edit-switch { margin: 0 16px 12px; padding: 10px 14px; border: 1px solid var(--ig-card-line); border-radius: 12px; background: var(--ig-card-bg); }
.ig-edit-danger { padding: 8px 16px 0; }
.ig-btn-danger-line { border: 1px solid var(--ig-danger); background: transparent; color: var(--ig-danger); }
.ig-btn-danger-line:hover { background: color-mix(in srgb, var(--ig-danger) 8%, transparent); }
.ig-story-edit .ig-wizard-nav { position: sticky; bottom: 0; background: var(--ig-bg); padding-top: 12px; }
/* 종류는 고치기에서 바꾸지 않는다(2026-10-03 사용자) - 고른 카드 하나만, 누를 수 없게. 기록 고치기(_post_edit_form.php)도 같은 모양 */
.ig-kind-card.is-locked { cursor: default; border-color: var(--ig-primary); box-shadow: 0 0 0 2px var(--ig-primary); } /* 고른 카드 모양(:has(input:checked)와 같게) */
.ig-kind-card.is-locked:hover { transform: none; }
.ig-kind-lock { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0 16px 12px; }

/* 보기 모드 줄 [일반 | 앨범](스토리) · [피드 | 앨범](홈) - 2026-09-30. 앨범 자체 모양은 story-album.css */
.alb-modebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 2px; }
.alb-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--ig-soft); }
.alb-seg a { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ig-muted); }
.alb-seg a.is-active { background: var(--ig-bg); color: var(--ig-text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.alb-modebar [data-album-edit] { display: inline-flex; align-items: center; gap: 4px; }


/* 이어가기 요청 시트(2026-10-02) - 사람 줄 전체를 눌러 고른다, 고른 줄은 옅은 파랑 */
.ig-handover-list { margin: 4px 0 0; }
.ig-handover-row { padding: 8px 4px; cursor: pointer; border-radius: 10px; }
.ig-handover-row input[type="radio"] { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--ig-primary); }
.ig-handover-row:has(input:checked) { background: var(--ig-notice-bg); }
.ig-handover-empty { padding: 4px; }
.ig-handover-band { padding: 14px 16px; border-bottom: 1px solid var(--ig-line-soft); }

/* 보기만 하는 사람(비공개 스토리의 부관리자 등, 2026-10-02) - 컨트롤러가 body에 .ig-readonly. ♡·코멘트 입력·답글·참석 칸을 숨긴다(서버도 막는다) */
.ig-readonly .ig-like,
.ig-readonly .ig-inline-box,
.ig-readonly .ig-comment-box,
.ig-readonly .ig-rsvp form { display: none !important; }

/* 스토리 머리의 [포토북 보기][초대장 보기] - ⋮ 메뉴에서 밖으로(2026-10-02 사용자) */
.ig-story-open { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ig-story-open .ig-btn { display: inline-flex; align-items: center; gap: 4px; }

/* 사람 사진은 누르면 노바프 프로필 창(2026-10-02) */
.ig-avatar[data-novap-profile] { cursor: pointer; }

/* 공개 범위 뱃지(2026-10-02 사용자 "공개 비공개는 뱃지로 잘보이게") - 첫 화면 스토리 카드 제목 옆 · 스토리 머리. 공개 = 초록(정상), 비공개 = 진한 회색 */
.ig-vis { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 2px; white-space: nowrap; }
.ig-vis.is-public { background: #e3f6ea; color: #157a43; }
.ig-vis.is-private { background: #2f3337; color: #fff; }
.ig-post-who strong .ig-vis { margin-left: 4px; }

/* 넘긴 기록 줄(2026-10-02) - 처음 만든 사람 → 받은 사람 → …, 스토리 머리 정보 줄 모양 그대로 */
.ig-handover-chain span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.ig-handover-chain i { font-style: normal; color: var(--ig-muted); }

/* 🔔·💬 새로 온 수 뱃지(2026-10-02) - 아이콘 오른쪽 위 빨간 동그라미 */
.ig-top-nav a, .ig-rail .ig-key { position: relative; }
.ig-badge { position: absolute; top: 2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--ig-danger, #ed4956); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--ig-bg); pointer-events: none; }
.ig-rail .ig-badge { top: -6px; right: -8px; }
.ig-badge[hidden] { display: none; }

/* 좁은 휴대폰(320~400px)에서 좌우 스크롤이 생기지 않게(2026-10-02 사용자 "모바일에서 좌우 스크롤") -
   단계 표시는 지금 단계만 이름을 보이고 나머지는 번호·표시만, 아래 버튼 줄은 [게시하기]·[다음]을 둘째 줄 전체 폭으로 */
.ig-stepper li { min-width: 0; }
.ig-wizard-nav .ig-btn { min-width: 0; white-space: nowrap; }
@media (max-width: 400px) {
  .ig-stepper { gap: 4px; padding-left: 12px; padding-right: 12px; }
  .ig-stepper li:not(.is-on) b { display: none; }
  .ig-stepper li { justify-content: center; }
}
@media (max-width: 380px) {
  .ig-wizard-nav { flex-wrap: wrap; }
  .ig-wizard-nav .ig-btn.is-primary { flex: 1 1 100%; order: 9; }
  .ig-wizard-nav .ig-btn[data-step-prev], .ig-wizard-nav .ig-btn[data-draft-save], .ig-wizard-nav .ig-btn[data-draft-delete] { flex: 1 1 0; padding-left: 8px; padding-right: 8px; }
}

/* 내 메뉴(#me-menu, 2026-10-02) - 내 사진·왼쪽 "프로필"을 누르면 그 자리에 펼쳐지는 메뉴(모아요 계정 메뉴와 같은 모양). 맨 위 사진 · 닉네임/이메일 줄 → 프로필 편집 */
.ig-me-pop { position: fixed; z-index: 60; min-width: 240px; max-width: calc(100vw - 16px); padding: 4px 0; border: 1px solid var(--ig-line); border-radius: 12px; background: var(--ig-bg); box-shadow: 0 8px 28px rgba(0, 0, 0, .14); }
.ig-me-pop[hidden] { display: none; }
@media (max-width: 767px) { .ig-me-pop { max-height: calc(100dvh - 72px); overflow-y: auto; } } /* 서비스 목록이 들어와 길어졌다 */
.ig-top-nav .nap-layer-close { width: 36px; height: 40px; color: var(--ig-text); } /* 층 안 [X] - 위 줄 아이콘과 같은 칸 */
.ig-top-nav .nap-layer-close svg { width: 24px; height: 24px; }
.ig-me-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--ig-line-soft); background: none; color: var(--ig-text); text-align: left; font: inherit; cursor: pointer; }
.ig-me-row:hover, .ig-me-item:hover { background: var(--ig-soft); }
.ig-me-row .ig-row-text small { color: var(--ig-muted); font-size: 12px; word-break: break-all; }
.ig-me-item { display: flex; align-items: center; gap: 4px; padding: 12px 16px; color: var(--ig-text); font-size: 15px; font-weight: 600; text-decoration: none; }
.ig-me-item svg { flex: none; } /* 줄 앞 그림([관리자 페이지로 이동]·[로그아웃], 2026-11-24) - 글자와 4px */
.ig-me-item + .ig-me-item { border-top: 1px solid var(--ig-line-soft); }
.ig-me-item.is-danger { color: var(--ig-danger); }

/* 첫 화면 [로그인 없이 둘러보기](2026-10-02) - 로그인 버튼 아래 같은 폭, 테두리 보조 버튼. 위 SNS 로그인 묶음과 떨어지게 위 여백 40px(같은 날 사용자 "조금 더") */
.ig-welcome-explore, .ig-empty .ig-welcome-explore { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 40px; border: 1px solid var(--ig-line); background: var(--ig-bg); color: var(--ig-text); }
.ig-welcome-explore:hover { background: var(--ig-soft); }

/* 비로그인 첫 화면 - 위 소개를 줄이고 아래에 공개 이야기 격자(2026-10-02) */
.ig-welcome { padding-top: 28px; padding-bottom: 12px; }
.ig-welcome-title { padding-top: 20px; border-top: 1px solid var(--ig-line-soft); }
.ig-vis-note { display: flex; align-items: flex-start; gap: 4px; }
.ig-vis-note svg { flex: 0 0 auto; margin-top: 2px; }

/* 첫 화면 SNS 시작 버튼(2026-10-02) - 로그인 화면(story/login.php)과 같은 모양 */
.ig-sns-btn { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 48px; margin-top: 10px; border-radius: 10px; font-size: 15px; font-weight: 700; text-decoration: none; }
.ig-sns-btn.is-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.ig-sns-btn.is-kakao { background: #fee500; color: rgba(0, 0, 0, .85); }
.ig-sns-btn:hover { filter: brightness(.97); }
.ig-welcome .ig-hint { margin: 10px 0 4px; }

/* 공개 이야기 격자 아래 여백(2026-10-02 사용자 "하단에 여백") - 첫 화면·둘러보기 맨 아래가 화면 끝에 붙지 않게 */
.ig-explore-grid { margin-bottom: calc(48px + env(safe-area-inset-bottom, 0px)); }
