/* 공통 */
.ig-wrap { padding: 0; }
.m { display: none; }

/* 상단 프로필 */
.ig-visual-wrap { position: relative; width: 100%; height: 480px; overflow: hidden; background: #000; border-radius: 8px; margin-bottom: 6px; }
.ig-visual-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; }
.ig-visual-wrap::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 65%; background: linear-gradient(to top, rgba(0,0,0,.9) 0%, rgba(0,0,0,.4) 45%, transparent 100%); pointer-events: none; z-index: 1; }
.ig-visual-video-bg { position: absolute;left: 50%;transform: translateX(-50%);width: auto;height: 100%;}

/* 하단 프로필 */
.ig-visual-bottom {position: absolute;bottom: 0;left: 0;right: 0;padding: 0 20px 21px;z-index: 3;display: flex;align-items: flex-end;justify-content: space-between;}
.ig-visual-profile { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; text-align: center; }
.ig-visual-img {width: 110px;height: 110px;object-fit: cover;margin-bottom: 16px;background: #333;filter: drop-shadow(0 4px 20px rgba(0,0,0,.35));clip-path: path('M55,0 C95.12,0 110,14.88 110,55 C110,95.12 95.12,110 55,110 C14.88,110 0,95.12 0,55 C0,14.88 14.88,0 55,0 Z');}
.ig-visual-name {font-size: 28px;font-weight: 600;color: #fff;line-height: 1;margin-bottom: 14px;letter-spacing: -0.3px;}
.ig-visual-bio { font-size: 15px; color: rgba(255,255,255,.78); line-height: 1.4; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; padding-right:5px; }
.ig-visual-bio.expanded { white-space: normal; text-overflow: unset; }

/*  네비게이션 */
.ig-nav {position: absolute;top: 0;width: 100%;z-index: 5;display: flex;align-items: center;justify-content: space-between;padding: 20px 24px;}
.ig-nav-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; background: none; border: none; text-decoration: none; flex-shrink: 0; }
.ig-msg-btn { flex-shrink: 0; }

/* 탭 */
.ig-tabs { display: flex; background: #fff; top: 0; z-index: 2; justify-content: center; padding:4px 0; }
.ig-tab { width:calc(100% / 6); padding: 12px 0; position:relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #bbb; text-decoration: none; font-size: 13px; font-weight: 500; letter-spacing: .8px; }
.ig-tab svg { width: 18px; height: 18px; }
.ig-tab.active { color: #111; }
.ig-tab.active svg { stroke-width: 2; }
.ig-tab.active span { font-weight: 600; letter-spacing: .4px; }
.ig-tab:hover:not(.active) { color: #666; }

/* 탭 간격 */
.ig-tabs { gap: 3px; }
.ig-tabs .ig-tab-crown {padding: 0 1.5px;margin: 0 -3px;position: relative;left: 2px;}
.ig-tabs .ig-tab-crown svg { display: block; }
.ig-tabs .ig-tab-sub { border: 1px solid #ffe600; border-radius: 6px; box-sizing: border-box; color: #111; }
.ig-tabs .ig-tab[data-tab="free_photo"],
.ig-tabs .ig-tab[data-tab="free_video"] { border: 1px solid #bbb; border-radius: 6px; box-sizing: border-box; }
.ig-tabs .ig-tab[data-tab="free_photo"]:after,
.ig-tabs .ig-tab[data-tab="free_video"]:after,
.ig-tabs .ig-tab-sub:after { display: none; }

/* 구독 탭 사이 장식 아이콘 */
.ig-tab-crown { position: relative; left: -1px; }
.ig-tab-crown svg { position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%); width: 28px; height: 28px; color: #ffd000; }
.ig-tab:has(+ .ig-tab-crown):after { display: none; }

/* 그리드 */
.ig-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.ig-grid-item { position: relative; display: block; overflow: hidden; cursor: pointer; aspect-ratio: 3 / 4; }
.ig-grid-item input[type="checkbox"] { width: 21px;height: 21px;margin: 4.5px 0 0 4.5px; }
.ig-grid-thumb { width: 100%; height: 100%; background-color: #000; overflow: hidden; position: relative; border-radius: 8px; }
.ig-grid-thumb.blur::before { content: ''; position: absolute; background-image: inherit; background-size: cover; background-position: center; filter: blur(12px); inset: -24px; z-index: 0; }
.thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #aaa; }

/* 빈 상태 */
.ig-grid-empty,
.ig-saved-empty,
.ig-ranking-empty { text-align: center; padding: 80px 16px; color: #aaa; font-size: 13px; line-height: 1.8; background: #fff; }

/* 랭킹 탭 */
.ig-ranking-list { padding: 0; }
.ig-ranking-item { display: flex; align-items: center; gap: 16px; padding: 16px 40px; border-bottom: 1px solid #f0f0f0; }
.ig-ranking-rank { width: 28px; font-size: 14px; font-weight: 800; text-align: center; flex-shrink: 0; color: #bbb; }
.ig-ranking-rank.gold   { color: #c8a96e; }
.ig-ranking-rank.silver { color: #c77777; }
.ig-ranking-rank.bronze { color: #b87333; }
.ig-ranking-avatar { width: 40px; height: 40px; border-radius: 2px; object-fit: cover; background: #eee; flex-shrink: 0; }
.ig-ranking-info { flex: 1; min-width: 0; }
.ig-ranking-name { font-size: 13px; font-weight: 600; color: #111; }
.ig-ranking-amount { font-size: 12px; color: #aaa; margin-top: 2px; font-weight: 300; }
.ig-ranking-badge { font-size: 9px; padding: 4px 10px; letter-spacing: 0.3px; border: 1px solid #e5e5e5; color: #888; }

.ig-msg-anchor {display:flex; flex-direction:column; align-items:flex-end; gap:8px; flex-shrink:0;position:absolute;right:20px;}

/* 즐겨찾기 버튼 */
.ig-bookmark-btn { background: none; border: none; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; padding: 0; }
.ig-bookmark-btn svg { transition: fill .2s, stroke .2s; }
.ig-bookmark-btn.saved svg { fill: #fff; }

/* 1:1 채팅하기 버튼 */
.ig-chat-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,.12); backdrop-filter: blur(8px); color: #fff; border-radius: 2px; padding: 11px 16px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; letter-spacing: .3px; }
.ig-chat-btn svg { flex-shrink: 0; }

/* 상단 프로필 */
.ig-profile-wrap { padding: 40px 0 0; background: #fff; }
.ig-profile-top { display: flex; gap: 40px; margin-bottom: 32px; align-items: flex-start; }
.ig-avatar-wrap { flex-shrink: 0; position: relative; }
.ig-avatar-img { width: 150px; height: 150px; border-radius: 8px; object-fit: cover; display: block; background: #eee; filter: grayscale(8%); }
.ig-avatar-wrap:hover .ig-avatar-img { filter: grayscale(0%); }
.ig-verified-badge { position: absolute; bottom: -6px; right: -6px; width: 22px; height: 22px; background: #111; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.ig-profile-right { flex: 1; min-width: 0; }
.ig-username-row { display: flex; align-items: center; gap: 5.5px; flex-wrap: wrap; margin-bottom: 10px; }
.ig-username-row img { width: 20px; height: 20px; vertical-align: -10px; }
.ig-username { font-size: 22px; font-weight: 600; letter-spacing: -.5px; color: #111; }
.ig-bio-text { font-size: 13px; line-height: 1.75; letter-spacing: .1px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }

/* own_board 툴바 */
.own-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -6px 0 13px; }
.own-toolbar label { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 13px; color: #444; }
.own-toolbar .check-all-cb { width: 14px; height: 14px; cursor: pointer; accent-color: #e74c3c; margin: 0; }
.own-toolbar .bulk-delete-btn { padding: 6px 14px; background: #e74c3c; color: #fff; border: none; border-radius: 2px; font-size: 12px; font-weight: 600; cursor: pointer; margin-left:4px; }

/* own_board 그리드 아이템 오버레이 */
.post-check-wrap { position: absolute; top: 6px; left: 6px; z-index: 20; }
.post-check { width: 18px; height: 18px; cursor: pointer; accent-color: #e74c3c; }
.post-action-bar { position: absolute; bottom: 0; left: 0; right: 0; display: flex; align-items: center; gap: 5px; padding: 0 8px 10px; background: linear-gradient(transparent, rgba(0,0,0,.75)); z-index: 20; }
.post-action-bar .post-edit-btn,
.post-action-bar .post-del-btn,
.post-action-bar .reorder-btn { font-size: 12px; padding: 5px 12px; border-radius: 4px; cursor: pointer; white-space: nowrap; border: none; }
.post-action-bar .post-edit-btn { color: #fff; background: rgba(0,0,0,.18); text-decoration: none; }
.post-action-bar .post-edit-btn:hover { background: rgba(0,0,0,.32); }
.post-action-bar .post-del-btn { color: #fff; background: rgba(231,76,60,.65); }
.post-action-bar .post-del-btn:hover { background: rgba(231,76,60,.9); }
.post-action-bar .reorder-btn { color: #fff; background: rgba(255,255,255,.18); margin-left: auto; }
.post-action-bar .reorder-btn:hover { background: rgba(255,255,255,.32); }

/* 순서 변경 모달 */
.reorder-modal-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.55); }
.reorder-modal-box { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #fff; border-radius: 14px; padding: 24px; width: 90%; max-width: 380px; }
.reorder-modal-title { font-size: 16px; font-weight: 600; margin: 0 0 16px; }
.reorder-modal-current { font-size: 13px; color: #666; background: #f7f7f7; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; line-height: 1.6; }
.reorder-modal-current strong { color: #222; }
.reorder-modal-label { font-size: 13px; color: #555; margin: 0 0 8px; }
.reorder-modal-inputs { display: flex; align-items: center; gap: 6px; margin: 0 0 30px; }
.reorder-modal-inputs input { width: 76px; padding: 9px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; text-align: center; box-sizing: border-box; }
.reorder-modal-inputs span { font-size: 13px; color: #555; }
.reorder-modal-preview { min-height: 20px; font-size: 13px; color: #3498db; margin: 0 0 14px; }
.reorder-modal-btns { display: flex; gap: 8px; }
.reorder-modal-btns button { flex: 1; padding: 11px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; }
#reorderSaveBtn   { background: #222; color: #fff; }
#reorderCancelBtn { background: #f0f0f0; color: #333; }

/* 빈 상태 아이콘 */
.ig-grid-empty svg,
.ig-saved-empty svg,
.ig-ranking-empty svg { margin-bottom: 16px; }

/* 페이지네이션 */
.pagination { margin: 19px 0 -38px; padding: 0; }

@media (max-width: 799px) {
	main {padding:0;}
    .m { display: block; }
	
    .ig-visual-wrap { height: 35vh; max-height: 750px; border-radius: 0; margin-bottom: 2px; }
    .ig-chat-btn { font-size: 11px; padding: 8px 14px; gap: 6px; }
    .ig-chat-btn svg { width: 16px; height: 16px; }
    .ig-visual-wrap + .ig-tabs { top: 0; }

    /* 통합 네비 - 모바일 조정 */
    .ig-nav { padding: 12px 16px; }
    .ig-nav-btn { width: 36px; height: 36px; }

    /* 공지 롤링 (모바일 전용) */
    .ig-nav-notice { position: relative; height: 24px; overflow: hidden; }
    .ig-notice-track { display: flex; flex-direction: column; }
    .ig-notice-item { height: 24px; line-height: 24px; text-align: center; font-size: 13px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .3px; }

    .ig-visual-bottom { padding: 0 14px 14px; }
    .ig-visual-profile { align-items: flex-start; text-align: left; }
    .ig-visual-img { transform: scale(0.65); margin: -9px -18px; }
    .ig-visual-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
    .ig-visual-bio { font-size: 12px; color: rgba(255,255,255,.7); max-width: 100%; }

    .ig-tabs { gap: 3px; padding:2.5px 1.5px;}
    .ig-tab { flex: 1; font-size: 10px; letter-spacing: 0; gap: 2px; padding: 9px 0; }
    .ig-tab svg { width: 18px; height: 18px; }

    .ig-grid { grid-template-columns: repeat(3, 1fr); }
    .ig-grid-item { aspect-ratio: 2 / 3; }
	.ig-grid-item input[type="checkbox"] {width:20px;height:20px;margin:0 0 0 1px;}

    .ig-ranking-item { padding: 14px 16px; }

    .ig-profile-wrap { padding: 14px 14px 0; }
    .ig-profile-top { gap: 16px; margin-bottom: 16px; }
    .ig-avatar-img { width: 82px; height: 82px; }
    .ig-username { font-size: 16px; }
    .ig-username-row { gap: 5px; margin-bottom: 10px; }
    .ig-username-row img { width: 14px; height: 14px; vertical-align: middle; }
    .ig-bio-text { -webkit-line-clamp: 3; font-size: 12px; line-height: 1.5; }
	
	.ig-msg-anchor {position:relative;right:0;}
	
	.own-toolbar label,
	.bulk-delete-btn {font-size:11px;}
	
	.post-action-bar .post-edit-btn,
	.post-action-bar .post-del-btn,
	.post-action-bar .reorder-btn { width: calc(100% / 3); text-align: center; font-size: 9px; padding: 3px 0; }
	.reorder-modal-title { font-size:14px; }
	.reorder-modal-current,
	.reorder-modal-label,
	.reorder-modal-inputs span	{ font-size:12px; }
	.reorder-modal-inputs input { font-size:13px; }
	.reorder-modal-inputs { margin:0 0 25px; }
	
	/* 페이지네이션 */
	.pagination { margin: 16px 0 -35px; padding: 0 8px; }
}