/* ───────── Instagram ───────── */
.ig { background: #fff; color: #000; }
.ig b { font-weight: 600; }
.ig-icon { display: flex; color: #000; }
.ig-body { padding-bottom: 20px; }

/* 아바타 */
.ig-av { position: relative; flex: none; display: grid; place-items: end center; overflow: hidden; border-radius: 50%; background: #C7CCD3; }
.ig-av svg { width: 80%; height: 80%; margin-bottom: -6%; }
.ig-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ig-av.xs { width: 26px; height: 26px; }
.ig-av.sm { width: 32px; height: 32px; }
.ig-av.md { width: 54px; height: 54px; }
.ig-av.lg { width: 62px; height: 62px; }
.ig-av.xl { width: 84px; height: 84px; }

/* 스토리 테두리 */
.ig-ring { position: relative; flex: none; display: inline-grid; place-items: center; padding: 2.5px; border-radius: 50%; cursor: pointer;
  background: conic-gradient(from 200deg, #FCAF45, #F77737, #E1306C, #C13584, #833AB4, #FCAF45); }
.ig-ring > .ig-av { border: 2.5px solid #fff; }
.ig-ring.seen { background: #DBDBDB; }
.ig-ring.none { background: none; padding: 0; cursor: default; }
.ig-ring.none > .ig-av { border: 0; }

/* 사진 자리 */
.ig-photo { position: relative; display: block; width: 100%; height: 100%; overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--h) 22% 86%), hsl(calc(var(--h) + 40) 20% 74%)); }
.ig-photo img, .ig-photo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ig-ph-label { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-size: 13px; color: rgba(0, 0, 0, .45); }

/* 상단 */
.ig-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: calc(var(--sb-h) + var(--safe-top)) 16px 6px; }
.ig-logo { font-size: 24px; font-weight: 700; letter-spacing: -.6px; }
.ig-top-icons { display: flex; gap: 20px; }
.ig-top-icons > * { display: flex; }
.ig-bar { flex: none; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: calc(var(--sb-h) + var(--safe-top)) 10px 6px; border-bottom: .5px solid #DBDBDB; }
.ig-bar > b { text-align: center; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-bar.mine { grid-template-columns: 0 1fr auto; padding-left: 16px; border-bottom: 0; }
.ig-bar.mine > b { justify-content: flex-start; font-size: 22px; letter-spacing: -.4px; }
.ig-bar-icons { display: flex; gap: 20px; justify-self: end; }
.ig-chev { display: inline-flex; }
.ig-bar.dm { grid-template-columns: 44px 1fr 10px; }

/* 스토리 줄 */
.ig-stories { display: flex; gap: 14px; padding: 8px 12px 12px; overflow-x: auto; border-bottom: .5px solid #EFEFEF; scrollbar-width: none; }
.ig-stories::-webkit-scrollbar { display: none; }
.ig-st { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 70px; }
.ig-st small { width: 100%; text-align: center; font-size: 11.5px; color: #262626; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 게시물 */
.ig-post { padding-bottom: 14px; }
.ig-post-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; }
.ig-who { display: flex; align-items: center; gap: 9px; }
.ig-who b { font-size: 14px; cursor: pointer; }
.ig-media { position: relative; aspect-ratio: 4 / 5; background: #efefef; }
.ig-bigheart { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(0); opacity: 0; pointer-events: none; }
.ig-bigheart svg { width: 96px; height: 96px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.25)); }
.ig-bigheart svg path { fill: #fff; }
.ig-bigheart.pop { animation: bigheart .9s ease both; }
@keyframes bigheart { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 15% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(.95); } 45%, 75% { transform: translate(-50%, -50%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } }
.ig-actions { display: flex; align-items: center; gap: 14px; padding: 8px 12px 4px; }
.ig-actions > * { display: flex; color: #000; }
.ig-save { margin-left: auto; }
.ig-like.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.25); } }
.ig-likes { padding: 2px 12px; font-size: 14px; }
.ig-cap { padding: 3px 12px; font-size: 14px; line-height: 1.4; }
.ig-cap b, .ig-c b { cursor: pointer; }
.ig-allc { display: block; padding: 4px 12px; font-size: 14px; color: #737373; }
.ig-time { padding: 4px 12px 0; font-size: 12px; color: #737373; }
.ig-mention { color: #00376B; cursor: pointer; }

/* 댓글 */
.ig-comments { border-top: .5px solid #EFEFEF; padding: 6px 0 10px; }
.ig-c { display: flex; align-items: flex-start; gap: 11px; padding: 10px 14px; }
.ig-c > span:first-child { cursor: pointer; }
.ig-c-main { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; }
.ig-c-time { color: #737373; font-size: 12.5px; font-weight: 400; }
.ig-c-text { margin-top: 1px; word-break: break-word; }
.ig-c-reply { display: inline-block; margin-top: 5px; font-size: 12.5px; color: #737373; }
.ig-c-heart { color: #737373; padding-top: 12px; display: flex; }
.ig-empty { padding: 30px 0; text-align: center; color: #737373; font-size: 14px; }
.ig-empty.big { padding: 60px 0; font-size: 22px; font-weight: 700; color: #000; }
.ig-cbar { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 14px calc(30px + var(--safe-bottom)); border-top: .5px solid #DBDBDB; color: #737373; font-size: 14px; }

/* 하단 탭 */
.ig-tabs { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 10px 0 calc(28px + var(--safe-bottom)); border-top: .5px solid #DBDBDB; background: #fff; }
.ig-tabs > * { display: flex; justify-content: center; color: #000; }
.ig-tab-me .ig-av { box-shadow: 0 0 0 0 #000; }
.ig-tab-me.on .ig-av { box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px #000; }

/* 프로필 */
.ig-prof { display: flex; align-items: center; gap: 22px; padding: 14px 16px 10px; }
.ig-stats { flex: 1; display: flex; justify-content: space-around; }
.ig-stats span { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ig-stats b { font-size: 17px; }
.ig-stats small { font-size: 13px; color: #262626; }
.ig-name { padding: 0 16px; font-size: 14px; font-weight: 600; }
.ig-bio { padding: 2px 16px 0; font-size: 14px; line-height: 1.4; }
.ig-btns { display: flex; gap: 6px; padding: 12px 16px 14px; }
.ig-btns > * { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; height: 32px; border-radius: 8px; background: #EFEFEF; font-size: 14px; font-weight: 600; color: #000; }
.ig-gridtabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: .5px solid #DBDBDB; }
.ig-gridtabs span { display: flex; justify-content: center; padding: 10px 0; color: #A8A8A8; }
.ig-gridtabs span.on { color: #000; box-shadow: inset 0 -1px 0 #000; }
.ig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5px; }
.ig-tile { aspect-ratio: 3 / 4; display: block; overflow: hidden; }
.ig-tile .ig-ph-label { font-size: 11px; }

/* 둘러보기 */
.ig-searchbar { flex: none; padding: calc(var(--sb-h) + var(--safe-top)) 14px 10px; }
.ig-searchbar > span, .ig-searchbar.inline > span { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: #EFEFEF; color: #737373; font-size: 15px; }
.ig-searchbar svg { width: 18px; height: 18px; }
.ig-searchbar.inline { padding: 10px 14px 4px; }

/* DM 목록 */
.ig-dm-title { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 8px; font-size: 16px; }
.ig-dm-title span { color: #0095F6; font-size: 14px; font-weight: 600; }
.ig-dm-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 16px; text-align: left; }
.ig-dm-row:active { background: #f5f5f5; }
.ig-dm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ig-dm-main b { font-size: 14px; font-weight: 400; }
.ig-dm-main span { font-size: 13.5px; color: #737373; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ig-dm-ago { flex: none; font-size: 13px; color: #737373; }

/* DM 대화 */
.ig-dm-who { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.ig-dm-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ig-dm-who b { font-size: 15px; }
.ig-dm-who small { font-size: 12px; color: #737373; }
.ig-dm-body { padding: 0 12px 16px; }
.ig-dm-intro { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px 0 18px; cursor: pointer; }
.ig-dm-intro b { margin-top: 8px; font-size: 18px; }
.ig-dm-intro small { color: #737373; font-size: 13px; }
.ig-dm-intro > span:last-child { margin-top: 10px; padding: 6px 14px; border-radius: 8px; background: #EFEFEF; font-size: 13.5px; font-weight: 600; }
.ig-stamp { margin: 16px 0 8px; text-align: center; font-size: 12px; color: #737373; }
.ig-msg { display: flex; align-items: flex-end; gap: 8px; margin-top: 3px; }
.ig-msg.me { justify-content: flex-end; }
.ig-msg-av { flex: none; width: 26px; }
.ig-bub { max-width: 72%; padding: 9px 13px; border-radius: 20px; font-size: 15px; line-height: 1.35; word-break: break-word; }
.them .ig-bub { background: #EFEFEF; color: #000; }
.me .ig-bub { background: #3797F0; color: #fff; }
.ig-seen { margin-top: 3px; text-align: right; font-size: 12px; color: #737373; }
.ig-dm-input { flex: none; padding: 8px 12px calc(30px + var(--safe-bottom)); }
.ig-dm-input span { display: block; padding: 10px 16px; border-radius: 22px; background: #EFEFEF; color: #737373; font-size: 15px; }

/* 스토리 보기 */
.ig-story { position: absolute; inset: 0; z-index: 20; background: #000; color: #fff; animation: storyIn .25s ease both; }
@keyframes storyIn { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.ig-st-media { position: absolute; left: 0; right: 0; top: calc(var(--sb-h) + var(--safe-top) - 6px); bottom: calc(76px + var(--safe-bottom)); border-radius: 10px; overflow: hidden; }
.ig-st-media .ig-ph-label { font-size: 15px; color: rgba(0, 0, 0, .5); }
.ig-st-shade { position: absolute; left: 0; right: 0; top: calc(var(--sb-h) + var(--safe-top) - 6px); height: 110px; background: linear-gradient(rgba(0,0,0,.35), transparent); pointer-events: none; border-radius: 10px 10px 0 0; }
.ig-st-bars { position: absolute; left: 8px; right: 8px; top: calc(var(--sb-h) + var(--safe-top)); display: flex; gap: 3px; z-index: 2; }
.ig-st-bars span { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.ig-st-bars i { display: block; height: 100%; width: 0; background: #fff; }
.ig-st-bars i.done { width: 100%; }
.ig-st-bars i.run { animation: storybar 5s linear forwards; }
@keyframes storybar { to { width: 100%; } }
.ig-st-head { position: absolute; left: 12px; right: 56px; top: calc(var(--sb-h) + var(--safe-top) + 12px); display: flex; align-items: center; gap: 9px; z-index: 3; font-size: 14px; }
.ig-st-head b { cursor: pointer; }
.ig-st-head span:last-child { color: rgba(255, 255, 255, .75); }
.ig-st-close { position: absolute; right: 8px; top: calc(var(--sb-h) + var(--safe-top) + 10px); z-index: 4; color: #fff; display: flex; padding: 4px; }
.ig-st-tap { position: absolute; top: calc(var(--sb-h) + var(--safe-top) + 56px); bottom: calc(76px + var(--safe-bottom)); z-index: 1; }
.ig-st-tap.left { left: 0; width: 34%; }
.ig-st-tap.right { right: 0; width: 66%; }
.ig-st-foot { position: absolute; left: 12px; right: 12px; bottom: calc(26px + var(--safe-bottom)); display: flex; align-items: center; gap: 16px; }
.ig-st-reply { flex: 1; padding: 11px 16px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 24px; font-size: 14px; }
.ig-st-activity { font-size: 13px; font-weight: 600; }

/* 답글 */
.ig-replies { padding-left: 54px; }
.ig-rtoggle { display: flex; align-items: center; gap: 10px; padding: 2px 0 4px; font-size: 12.5px; font-weight: 600; color: #737373; }
.ig-rtoggle span { width: 24px; height: 1px; background: #C7C7C7; }
.ig-rtoggle em { font-style: normal; }
.ig-rtoggle em:last-child { display: none; }
.ig-replies.closed .ig-rtoggle em:first-of-type { display: none; }
.ig-replies.closed .ig-rtoggle em:last-child { display: inline; }
.ig-replies.closed .ig-rlist { display: none; }
.ig-c.reply { padding: 8px 14px 8px 0; gap: 10px; }

/* 인증 배지, 팔로우 버튼 */
.ig-verified { display: inline-block; vertical-align: -2px; margin-left: 3px; flex: none; }
.ig-btns > .ig-follow { background: #0095F6; color: #fff; }

/* DM 공유 카드 */
.ig-share { display: block; width: 210px; border-radius: 16px; overflow: hidden; background: #EFEFEF; }
.ig-share-media { position: relative; display: block; }
.ig-share.reel .ig-share-media { aspect-ratio: 9 / 16; }
.ig-share.post .ig-share-media { aspect-ratio: 1; }
.ig-share-mark { position: absolute; right: 10px; top: 10px; display: flex; filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.ig-share-over { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; color: #fff; font-size: 12.5px; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.ig-share.reel { position: relative; }
.ig-share-head { display: flex; align-items: center; gap: 7px; padding: 8px 10px; font-size: 13px; }
.ig-share-cap { display: block; padding: 8px 10px 10px; font-size: 13px; line-height: 1.35; }
.ig-msg.me .ig-share { margin-left: auto; }

.ig-dm-intro.static, .ig-dm-who:not([data-user]) { cursor: default; }
