/**
 * 시청자(구매자) PIP 확대 채팅 — 모바일 웹 / 09STORY APP / PC 판매자콘솔 시청자 미러 공통.
 * 시각(글자·색·6줄·관리자 뱃지)은 broadcast-ui-themes.css (bc-ui-chat-shorts) + ivs-chat.js 가 담당.
 * 본 파일은 레이아웃·터치 스크롤·시청자 미리보기(읽기 전용) 구조만 통일한다.
 */

#idx_live_pip:not(.is-expanded) .idx-live-chat-overlay {
	display: none !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay {
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-end !important;
	align-items: stretch !important;
	pointer-events: none !important;
	z-index: 32;
	position: absolute !important;
	top: auto !important;
	bottom: 5px !important;
	left: 0 !important;
	right: 0 !important;
	max-height: none !important;
	height: auto !important;
	overflow: visible !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay > * {
	pointer-events: auto !important;
}

#idx_live_pip.is-expanded.has-live-chat-bar .idx-live-chat-overlay {
	pointer-events: auto !important;
	z-index: 40 !important;
}

/* iOS Safari: 키보드가 레이아웃을 줄이지 않으므로 입력바를 visualViewport 위로 올림.
   조상 transform 은 포커스 글자가 안 보이는 버그가 있어 margin-bottom 만 사용. */
#idx_live_pip.is-expanded .idx-live-chat-overlay.story09-keyboard-open {
	transform: none !important;
	margin-bottom: var(--story09-chat-keyboard-offset, 0px) !important;
	z-index: 80 !important;
}

/* 갤럭시(크롬·삼성인터넷): 상품카드는 키보드에 가려두고 입력바만 키보드 위에 붙인다. */
html.story09-android-keyboard #idx_live_pip.is-expanded .idx-live-chat-overlay.story09-keyboard-open {
	margin-bottom: 0 !important;
	bottom: var(--story09-android-chat-kb-inset, 0px) !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-messages {
	flex: 0 0 auto !important;
	width: 100% !important;
	min-height: 0 !important;
	overflow-y: scroll !important;
	overflow-x: hidden !important;
	-webkit-overflow-scrolling: touch;
	pointer-events: auto !important;
	overscroll-behavior: contain;
	touch-action: pan-y;
	justify-content: flex-start !important;
	-webkit-mask-image: none !important;
	mask-image: none !important;
	position: relative !important;
	z-index: 1 !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-messages > li.bc-chat-flex-spacer {
	flex: 1 1 auto !important;
	min-height: 0 !important;
	height: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
	visibility: hidden !important;
	pointer-events: none !important;
	list-style: none !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-bar {
	flex: 0 0 auto !important;
	position: relative !important;
	z-index: 4 !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-emoji-pop {
	z-index: 55 !important;
	pointer-events: auto !important;
	display: grid !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-emoji-pop[hidden] {
	display: none !important;
}

/* PC 판매자콘솔 — 3인칭 시청자 미리보기: 입력·하트·이모지 바 없음 */
body.deal-list-embed-modal[data-seller-live-preview='1'] #idx_live_pip.is-expanded .idx-live-chat-overlay.is-view-only .bc-chat-overlay-bar,
body.deal-list-embed-modal[data-seller-live-preview='1'] #idx_live_pip.is-expanded .idx-live-chat-overlay.is-view-only .bc-chat-overlay-emoji-pop {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
	pointer-events: none !important;
}

body.deal-list-embed-modal[data-seller-live-preview='1'] #idx_live_pip.is-expanded .idx-live-chat-overlay.is-view-only .bc-chat-overlay-messages {
	pointer-events: auto !important;
}

body.deal-list-embed-modal[data-seller-live-preview='1'] #idx_live_pip.is-expanded.has-live-chat-bar .idx-live-pay-fab {
	bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
}

#idx_live_pip.is-stream-offline .idx-live-chat-overlay {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

#idx_live_pip.is-stream-offline .idx-live-badge {
	background: #4a5568;
	box-shadow: 0 2px 8px rgba(74, 85, 104, .28);
	font-size: 9px;
	padding: 0 7px;
}

#idx_live_pip.is-stream-offline #idx_live_pip_restore {
	background: linear-gradient(180deg, #5a6472 0%, #434c58 100%);
	box-shadow: 0 4px 14px rgba(74, 85, 104, .35);
	animation: ilrRestoreFloat 1.9s ease-in-out infinite;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-messages > li:first-child {
	margin-top: 0 !important;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-messages::-webkit-scrollbar {
	width: 4px;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-messages::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, .25);
	border-radius: 4px;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-msg.is-history {
	opacity: 1;
}

#idx_live_pip .bc-chat-overlay-jump {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	display: none;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(216, 45, 40, .92);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	border: 0;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(216, 45, 40, .4);
	z-index: 50 !important;
	pointer-events: auto !important;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	letter-spacing: -.02em;
}

#idx_live_pip .bc-chat-overlay-jump.is-on {
	display: inline-flex;
}

#idx_live_pip .bc-chat-overlay-jump::before {
	content: '\2193';
	font-size: 13px;
	line-height: 1;
}

#idx_live_pip.is-expanded .idx-live-chat-overlay .bc-chat-overlay-jump {
	position: absolute !important;
	z-index: 50 !important;
	pointer-events: auto !important;
	touch-action: manipulation !important;
}
