/* 전역 CSS 커스텀 속성과 기본 테마를 정의합니다. */
:root {
	/* 하렘 서바이벌 - 매혹적인 럭셔리 다크 테마 */
	color-scheme: dark;
	/* 페이지 배경 색상: 매우 어두운 미드나잇 블랙 */
	--bg: #080104;
	/* 카드나 패널 배경: 거의 블랙에 가까운 딥 와인 */
	--panel: rgba(15, 2, 8, 0.96);
	/* 채팅 영역 서피스 */
	--surface: rgba(12, 3, 7, 0.9);
	/* 기본 포인트 컬러: 차분하게 가라앉은 로즈 레드 */
	--primary: #d6335c;
	/* 포인트 컬러의 어두운 음영 */
	--primary-dark: #a12546;
	/* 강조 및 럭셔리 포인트: 은은한 골드 */
	--accent: #e6be60;
	/* 본문 텍스트: 눈이 편안한 밝은 그레이 핑크 */
	--text-main: #f0e6e9;
	/* 보조 설명 텍스트 */
	--text-muted: #a38d97;
	/* 그림자 공통 값입니다. */
	--shadow: 0 28px 64px rgba(4, 6, 14, 0.55);
	/* 앱 높이를 뷰포트에 맞추는 변수의 기본값입니다. */
	--app-height: 100vh;
	/* 모바일 키보드 높이 보정 값 기본 설정입니다. */
	--keyboard-offset: 0px;
	/* 시각적 뷰포트가 좌우로 이동할 때 상쇄하기 위한 값입니다. */
	--viewport-offset-left: 0px;
	/* 주소창 등으로 발생하는 상단 여백 보정을 위한 값입니다. */
	--viewport-offset-top: 0px;
	/* 전체 폰트 기준 크기를 18px로 설정합니다. */
	font-size: 18px;
}

/* 모든 요소에 동일한 박스 모델을 적용합니다. */
* {
	box-sizing: border-box;
}

html {
	/* 모바일 브라우저의 바운스 효과를 원천 차단합니다. */
	overscroll-behavior: none;
	overflow: hidden;
	height: 100%;
}

/* 페이지 전체 레이아웃과 타이포그래피 기본값을 지정합니다. */
body {
	/* 외곽 여백을 제거합니다. */
	margin: 0;
	/* 세로 방향으로 화면을 꽉 채우게 합니다. */
	min-height: var(--app-height, 100vh);
	/* 내부 컨텐츠를 가운데 정렬하기 위해 flex를 사용합니다. */
	display: flex;
	/* 가로 중앙 정렬입니다. */
	justify-content: center;
	/* 세로 중앙 정렬입니다. */
	align-items: center;
	/* 하렘물 특유의 몽환적이고 매혹적인 배경 그라디언트 (눈의 피로도를 위해 채도 낮춤) */
	background:
		radial-gradient(circle at 20% 15%, rgba(214, 51, 92, 0.1), transparent 50%),
		radial-gradient(circle at 80% 85%, rgba(230, 190, 96, 0.08), transparent 45%),
		radial-gradient(circle at 50% 50%, rgba(139, 0, 0, 0.05), transparent 60%),
		var(--bg);
	background-size: 140% 140%;
	animation: bg-pulse 20s ease-in-out infinite alternate;
	/* ArcherLab 사이트와 유사한 폰트 스택을 사용합니다. */
	font-family: "Pretendard", "Manrope", "SUIT", "Noto Sans KR", -apple-system,
		BlinkMacSystemFont, "Segoe UI", sans-serif;
	/* 기본 텍스트 색상 지정입니다. */
	color: var(--text-main);
	/* 화면 크기에 따라 조절되는 패딩을 부여합니다. */
	--page-padding: clamp(0.75rem, 3vw, 2rem);
	padding: var(--page-padding);
	padding-top: calc(var(--page-padding) + var(--viewport-offset-top, 0px));
	padding-bottom: calc(var(--page-padding) + env(safe-area-inset-bottom));
	/* 페이지 전체 스크롤을 막아 진동 및 바운스 현상을 방지합니다. */
	overflow: hidden;
	/* 모바일 브라우저의 당겨서 새로고침 및 바운스 효과를 방지합니다. */
	overscroll-behavior: none;
}

@keyframes bg-pulse {
	0% { background-position: 0% 0%; }
	100% { background-position: 100% 100%; }
}

/* 검색엔진용 설명 복사를 시각적으로 숨기면서 DOM에는 유지합니다. */
.seo-copy {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

body.is-android-chrome {
	/* 안드로이드 크롬에서는 주소창 높이만큼 추가 여백을 확보합니다. */
	padding-top: calc(var(--page-padding) + var(--viewport-offset-top, 0px) + 0.75rem);
	/* 하단 여백은 살짝 줄여서 전체 카드가 너무 떠 있지 않도록 조정합니다. */
	padding-bottom: calc(max(env(safe-area-inset-bottom), var(--page-padding) * 0.45));
}

body.is-kakao-inapp {
	/* 카카오 인앱 브라우저에서는 브라우저 자체가 상단 여백을 처리하므로 추가 패딩을 제거합니다. */
	padding-top: var(--page-padding);
}

.app {
	/* 앱 컨테이너의 최대 너비와 반응형 조절입니다. */
	width: min(430px, 100%);
	/* 앱 높이를 지정하되 뷰포트와 패딩을 고려합니다. */
	height: min(
		820px,
		max(0px, calc(var(--app-height, 100vh) - (var(--page-padding, 0px) * 2)))
	);
	max-height: max(0px, calc(var(--app-height, 100vh) - (var(--page-padding, 0px) * 2)));
	/* 카드 배경을 네온 글래스 느낌으로 구성합니다. */
	background:
		linear-gradient(135deg, rgba(139, 91, 255, 0.14), rgba(79, 243, 198, 0.08)),
		var(--panel);
	/* 모서리를 부드럽게 라운드 처리합니다. */
	border-radius: 26px;
	/* 그림자 효과를 적용합니다. */
	box-shadow: var(--shadow);
	/* 미묘한 보더로 패널을 강조합니다. */
	border: 1px solid rgba(139, 91, 255, 0.18);
	/* 내부 레이아웃을 세로 정렬로 만들기 위해 flex 사용 */
	display: flex;
	/* 위에서 아래 방향으로 요소 배치 */
	flex-direction: column;
	/* 내용이 넘칠 경우 숨깁니다. */
	overflow: hidden;
	/* 내부 스크롤 바운스가 부모(body)로 전달되지 않도록 합니다. */
	overscroll-behavior: none;
	/* 배경 요소 배치를 위해 상대 위치를 지정합니다. */
	position: relative;
	/* 주소창 내려갈 때 발생하는 좌우 흔들림을 상쇄합니다. */
	transform: translate3d(
		calc(var(--viewport-offset-left, 0px) * -1),
		calc(var(--keyboard-offset, 0px) * -1),
		0
	);
	transition: transform 0.2s ease;
	/* 앱 전체에서 불필요한 터치 액션(드래그로 인한 페이지 이동 등)을 막습니다. */
	touch-action: none;
}
body.is-kakao-inapp .app {
	/* 카카오 인앱 브라우저는 자체적으로 키보드 공간을 확보하므로 수직 이동을 비활성화합니다. */
	transform: translate3d(calc(var(--viewport-offset-left, 0px) * -1), 0, 0);
}

body.is-android-chrome .app {
	/* 안드로이드 크롬에서는 transform으로 세로 이동하지 않고 하단 여백으로만 보정합니다. */
	transform: translate3d(calc(var(--viewport-offset-left, 0px) * -1), 0, 0);
}


.app__header {
	/* 상단 헤더는 차분한 딥 블랙 서피스로 구성 */
	background:
		linear-gradient(135deg, rgba(12, 3, 7, 0.96), rgba(8, 1, 4, 0.94));
	color: #fdfcff;
	padding: 1.1rem 1.55rem 1.05rem;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	position: relative;
	z-index: 20;
	box-shadow: 0 16px 42px rgba(5, 6, 12, 0.46);
	border-bottom: 1px solid rgba(230, 190, 96, 0.15);
	backdrop-filter: blur(18px);
}

.app__header::after {
	/* 상단에서 살짝 내려오는 그라디언트 발광 */
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at 50% 0%, rgba(139, 91, 255, 0.38), transparent 58%);
	opacity: 0.65;
	pointer-events: none;
}

/* AI 응답 중 UI 잠금 시각화 */
.ui--locked .app__header,
.ui--locked .app__footer {
	pointer-events: none;
	opacity: 0.6;
	filter: grayscale(0.3);
	transition: opacity 0.3s ease, filter 0.3s ease;
}

.app__language-switch {
	display: flex;
	align-items: center;
	z-index: 2;
}

.app__language-switch select {
	background: rgba(10, 14, 30, 0.92);
	border: 1px solid rgba(79, 243, 198, 0.4);
	color: #fbfcff;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	border-radius: 999px;
	padding: 0.45rem 0.95rem 0.45rem 0.85rem;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, var(--text-main) 50%),
		linear-gradient(135deg, var(--text-main) 50%, transparent 50%);
	background-position: calc(100% - 1rem) calc(50% - 0.15rem),
		calc(100% - 0.65rem) calc(50% - 0.15rem);
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	min-width: 7.2rem;
	box-shadow: 0 10px 24px rgba(8, 10, 24, 0.45);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.app__language-switch select:hover,
.app__language-switch select:focus-visible {
	border-color: rgba(139, 91, 255, 0.65);
	background: rgba(14, 20, 42, 0.96);
	box-shadow: 0 14px 28px rgba(8, 10, 24, 0.55);
}

.app__language-switch select:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.app__language-switch select option {
	background-color: #f4f6ff;
	color: #0d1326;
}

.app__language-switch select option:checked,
.app__language-switch select option:hover {
	background-color: rgba(139, 91, 255, 0.9);
	color: #ffffff;
}

.app__language-switch select:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.app__brand {
	/* 로고 링크를 inline-flex로 정렬 */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* 링크 기본 밑줄 제거 */
	text-decoration: none;
	padding: 0.45rem;
	border-radius: 18px;
	background: linear-gradient(135deg, rgba(79, 243, 198, 0.18), rgba(139, 91, 255, 0.22));
	box-shadow: 0 12px 28px rgba(6, 10, 26, 0.44);
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
	position: relative;
	z-index: 1; /* after 오버레이 보다 위로 */
}

.app__brand:focus-visible,
.app__brand:hover {
	background: linear-gradient(135deg, rgba(79, 243, 198, 0.28), rgba(139, 91, 255, 0.32));
	box-shadow: 0 18px 32px rgba(6, 10, 26, 0.56);
	transform: translateY(-1px);
	filter: brightness(1.05);
}


.app__brand-logo {
	/* 미니 PNG 로고 크기 */
	height: 30px;
	width: auto;
	filter: drop-shadow(0 6px 16px rgba(5, 6, 12, 0.52));
}

/* 기존 제목/상태 텍스트 클래스는 현재 사용하지 않지만, 추후 복원을 대비해 남겨 둡니다. */

.group-info-bar {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 0.8rem 1.2rem;
	background: rgba(255, 255, 255, 0.03);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	font-size: 0.85rem;
	color: var(--text-muted);
	margin: -1.3rem -1.2rem 1rem -1.2rem; /* app__main 패딩 상쇄 */
}

.group-info-bar__absent {
	font-size: 0.75rem;
	opacity: 0.7;
}

.app__main {
	/* 본문 영역이 남은 높이를 채우도록 지정 */
	flex: 1;
	/* 서피스를 어두운 미드나잇 그라디언트로 구성하여 눈의 피로를 줄임 */
	background: linear-gradient(160deg, rgba(12, 3, 7, 0.7), rgba(8, 1, 4, 0.95));
	/* 패딩을 주되 안전 영역만 반영합니다. */
	padding: 1.3rem 1.2rem calc(1.3rem + env(safe-area-inset-bottom));
	/* 내부 레이아웃을 column으로 배치 */
	display: flex;
	/* 위 아래 방향으로 요소 배치 */
	flex-direction: column;
	/* 넘치는 내용은 숨김 */
	overflow: hidden;
}

.chat {
	/* 기본 리스트 스타일 제거 */
	list-style: none;
	/* 외부 여백 제거 */
	margin: 0;
	/* 내부 패딩 제거 (하단은 JS로 계산된 높이만큼 확보) */
	padding: 0 0 calc(var(--composer-height, 80px) + 20px) 0;
	/* 채팅 메시지를 column으로 배치하고 간격 확보 */
	display: flex;
	flex-direction: column;
	/* 메시지 간격 설정 */
	gap: 0.9rem;
	/* 세로 방향 스크롤 허용 */
	overflow-y: auto;
	/* 터치 스크롤은 허용합니다. */
	touch-action: pan-y;
	/* 내부 스크롤 바운스가 부모로 전달되지 않도록 합니다. */
	overscroll-behavior: none;
	/* 브라우저의 자동 부드러운 스크롤이 진동을 유발할 수 있으므로 끕니다. */
	scroll-behavior: auto !important;
	/* 파이어폭스용 얇은 스크롤바 설정 */
	scrollbar-width: thin;
}

.chat::-webkit-scrollbar {
	/* 웹킷 브라우저에서 스크롤바 너비 정의 */
	width: 6px;
}

.chat::-webkit-scrollbar-thumb {
	/* 스크롤바 막대 색상 및 투명도 설정 */
	background: rgba(139, 91, 255, 0.45);
	/* 둥근 스크롤바를 위한 반지름 */
	border-radius: 999px;
}

.message {
	/* 메시지 항목을 가로로 나열하고 하단 정렬 */
	display: flex;
	align-items: flex-end;
	/* 아바타와 말풍선 사이의 간격 */
	gap: 0.6rem;
}

.message--assistant {
	/* 어시스턴트 메시지는 왼쪽 정렬 */
	justify-content: flex-start;
}

.message--user {
	/* 사용자 메시지는 오른쪽 정렬 */
	justify-content: flex-end;
}

.message__avatar {
	/* 아바타 크기를 살짝 줄여 모바일 가독성 확보 */
	width: 42px;
	height: 42px;
	/* 동그란 형태 유지 */
	border-radius: 50%;
	/* 가운데 정렬을 위한 grid 사용 */
	display: grid;
	place-items: center;
	/* 이모지 크기 지정 */
	font-size: 1.3rem;
	/* 공간 확보를 위해 축소되지 않도록 설정 */
	flex-shrink: 0;
	/* 은은한 네온 레드 그림자 */
	box-shadow: 0 8px 16px rgba(214, 51, 92, 0.15);
	/* 기본 배경색 (로즈 와인 변종) */
	background: rgba(214, 51, 92, 0.12);
	/* 이모지 색상 */
	color: #f9faff;
	/* 이미지일 경우 비율 유지 */
	object-fit: cover;
	/* 위치 보정 */
	margin-bottom: 2px;
}

.message--user .message__avatar {
	/* 사용자 아바타는 로즈 와인-골드 그라디언트 */
	background: linear-gradient(135deg, var(--primary), #b32a4d);
	/* 텍스트를 어두운 색으로 */
	color: #ffffff;
	/* 골드빛 아우라 그림자 축소 */
	box-shadow: 0 10px 20px rgba(214, 51, 92, 0.2);
}

.message--typing .message__bubble {
	animation: none !important;
}

.message__bubble {
	/* 말풍선 최대 너비를 화면 비율로 제한 */
	max-width: 78%;
	/* 내부 여백 설정 */
	padding: 0.9rem 1.1rem;
	/* 둥근 말풍선 형태 */
	border-radius: 22px;
	/* 은은한 네온 그림자 */
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	/* 기본 배경색 지정 (눈이 편안하도록 채도를 낮춘 어두운 톤) */
	background: rgba(22, 16, 18, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	/* 내부 요소를 세로로 배치 */
	display: flex;
	flex-direction: column;
	/* 메타와 본문 사이 간격 */
	gap: 0.35rem;
	/* 말풍선 꼬리 위치 조절을 위한 relative */
	position: relative;
	/* 문단 줄 간격 */
	line-height: 1.55;
	/* 글자 크기 지정 */
	font-size: 1.02rem;
	/* 애니메이션 적용 */
	animation: message-pop 0.3s ease-out backwards;
	transform-origin: bottom left;
}

@keyframes message-pop {
	0% {
		opacity: 0;
	}
	100% {
		opacity: 1;
	}
}

.message__bubble::after {
	/* 말풍선 꼬리 제거 (더 모던한 룩을 위해) */
	display: none;
}

.message--assistant .message__bubble {
	/* 어시스턴트 말풍선 테두리 색 */
	border: 1px solid rgba(255, 255, 255, 0.08);
	/* 텍스트 색상을 기본 색으로 */
	color: var(--text-main);
	/* 왼쪽 하단 둥글기 줄임 */
	border-bottom-left-radius: 4px;
}

.message--assistant .message__bubble::after {
	display: none;
}

.message--user .message__bubble {
	/* 사용자 말풍선: 눈의 피로를 줄이기 위해 채도를 낮추고 배경과 조화롭게 변경 */
	background: rgba(45, 12, 18, 0.95);
	/* 로즈 와인 테두리로 구분감 부여 */
	border: 1px solid rgba(214, 51, 92, 0.4);
	/* 텍스트는 부드러운 화이트 */
	color: #fce4ec;
	/* 내용이 오른쪽 정렬되도록 조정 */
	align-items: flex-end;
	text-align: right;
	/* 오른쪽 하단 둥글기 줄임 */
	border-bottom-right-radius: 4px;
	/* 애니메이션 기준점 변경 */
	transform-origin: bottom right;
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.message--user .message__bubble::after {
	display: none;
}

.message__meta {
	/* 화자 이름 텍스트 크기 */
	font-size: 0.78rem;
	/* 굵게 강조 */
	font-weight: 600;
	/* 자간 조절 */
	letter-spacing: 0.02em;
	/* 기본 텍스트 색상보다 연하게 */
	color: rgba(246, 247, 255, 0.52);
}

.message--user .message__meta {
	/* 사용자 말풍선 안의 메타 텍스트 색 */
	color: rgba(255, 255, 255, 0.7);
}

.message__text {
	/* 문단 기본 여백 제거 */
	margin: 0;
	/* 줄바꿈과 공백 유지 */
	white-space: pre-wrap;
}

.message--thinking .message__bubble {
	/* 생각중 메시지 투명도 조절 */
	opacity: 0.8;
	/* 스타일 차별화를 위한 이탤릭 */
	font-style: italic;
}

.message--thinking .message__text::after {
	content: '...';
	display: inline-block;
	width: 0;
	overflow: hidden;
	vertical-align: bottom;
	text-align: left;
	white-space: nowrap;
	animation: thinking-dots 1.5s infinite steps(4, end);
}

@keyframes thinking-dots {
	to { width: 1.25em; }
}

/* hidden 속성이 있을 때 확실히 숨김 */
.composer[hidden],
.app__main[hidden] {
	display: none !important;
}

.composer {
	/* 입력 영역 패딩 지정 */
	padding: 0 1rem calc(1rem + env(safe-area-inset-bottom));
	/* 배경색 제거 (투명하게) */
	background: transparent;
	/* 상단 경계선 제거 */
	border-top: none;
	/* 세로 정렬 flex 컨테이너 */
	display: flex;
	flex-direction: column;
	/* 요소 간 간격 */
	gap: 0.55rem;
	/* 플로팅 효과를 위해 위치 조정 */
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	z-index: 100;
	/* 그라디언트 마스크로 스크롤되는 내용이 자연스럽게 사라지게 함 */
	background: linear-gradient(to top, var(--bg) 20%, transparent);
	pointer-events: none; /* 배경 클릭 통과 */
}

.composer > * {
	pointer-events: auto; /* 자식 요소는 클릭 가능 */
}

.composer__label {
	/* 스크린 리더용 라벨을 화면에서 숨깁니다. */
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
	padding: 0;
	white-space: nowrap;
}

.composer__field {
	/* 입력창과 버튼을 한 줄에 배치 */
	display: flex;
	/* 세로 정렬을 중앙으로 맞춥니다. */
	align-items: center;
	/* 요소 간 직접 간격 대신 내부 마진 사용 */
	gap: 0;
	/* 입력 영역을 차분한 딥 블랙 캡슐로 묶습니다. */
	background: rgba(18, 12, 14, 0.8);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	padding: 0.4rem 0.45rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.composer__field:focus-within {
	/* 포커스 시 전체 캡슐을 강조 (차분한 로즈 레드) */
	border-color: rgba(214, 51, 92, 0.4);
	box-shadow: 0 12px 40px rgba(214, 51, 92, 0.1);
	background: rgba(26, 18, 20, 0.9);
	transform: translateY(-2px);
}

.composer__input {
	/* textarea가 가용 폭을 차지하도록 */
	flex: 1;
	/* 글자 크기: 화면 너비에 비례하여 자동 조절 (최소 14px, 최대 16px) */
	font-size: clamp(0.875rem, 4vw, 1rem);
	/* 줄 간격 */
	line-height: 1.5;
	/* 안쪽 여백 */
	padding: 0.85rem 1.1rem;
	/* 알약 형태의 라운드 */
	border-radius: 999px;
	/* 기본 테두리 제거 */
	border: none;
	/* 엷은 네온 배경 */
	background: transparent;
	/* 기본 상태에서는 추가 테두리 없이 매끄럽게 */
	box-shadow: none;
	/* 크기 조절 막음 */
	resize: none;
	/* 최대 높이 제한 */
	max-height: 160px;
	/* 내용이 넘칠 때 스크롤 가능하지만 트랙은 숨김 */
	overflow-y: auto;
	/* IE/Edge용 스크롤바 숨김 */
	-ms-overflow-style: none;
	/* Firefox용 스크롤바 숨김 */
	scrollbar-width: none;
	/* 텍스트 색상 */
	color: var(--text-main);
	/* 커서 색상 */
	caret-color: var(--primary);
	/* 포커스 시 부드러운 전환 */
	transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.composer__input:focus {
	/* 포커스 시 기본 아웃라인 제거 */
	outline: none;
	/* 살짝 뜨는 느낌 */
	transform: translateY(-1px);
}

.composer__input::placeholder {
	/* placeholder 텍스트 색상 지정 */
	color: rgba(155, 164, 198, 0.68);
	/* 글자 크기를 더 작게 조정 (디바이스 최적화) */
	font-size: clamp(0.7rem, 3.2vw, 0.8rem);
	/* 줄바꿈 방지 및 넘칠 경우 자름 (말줄임표 제거) */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: clip;
}

.composer__input::-webkit-scrollbar {
	/* WebKit 브라우저에서 스크롤바 숨김 */
	display: none;
}

.composer__send {
	/* 전송 버튼 크기 */
	width: 50px;
	height: 50px;
	/* 완전한 원 모양 */
	border-radius: 50%;
	/* 입력 영역과 버튼 사이 최소 간격 제거 */
	margin-left: 0;
	/* 기본 테두리 제거 */
	border: none;
	/* 가운데 정렬을 위해 grid 사용 */
	display: grid;
	place-items: center;
	/* 이모지/아이콘 크기 */
	font-size: 1.1rem;
	/* 버튼 텍스트 색: 어두운 배경과 대비를 위해 딥 블랙 계열 유지 */
	color: #080104;
	/* 은은한 로즈-골드 그라디언트 배경 */
	background: linear-gradient(135deg, var(--primary), var(--accent));
	/* 과하지 않은 차분한 골드빛 그림자 */
	box-shadow: 0 15px 30px rgba(230, 190, 96, 0.15);
	/* 커서를 포인터로 */
	cursor: pointer;
	/* 전환 효과 */
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.composer__send:hover,
.composer__send:focus-visible {
	/* 마우스 오버 시 약간 위로 이동 */
	transform: translateY(-2px);
	/* 그림자를 더 강조 (골드 테마) */
	box-shadow: 0 22px 40px rgba(255, 215, 0, 0.4);
	/* 약간 더 밝게 */
	filter: brightness(1.1);
}

.composer__send:disabled {
	/* 비활성화 시 투명도 낮춤 */
	opacity: 0.45;
	/* 그림자 제거 */
	box-shadow: none;
	/* 커서는 기본값으로 */
	cursor: default;
}

.composer__help {
	/* 안내 문구 외부 여백 제거 */
	margin: 0;
	/* 작은 글자 크기 */
	font-size: 0.85rem;
	/* 보조 텍스트 색상 */
	color: var(--text-muted);
	/* 중앙 정렬 */
	text-align: center;
}

.composer--locked .composer__input,
.composer__input:disabled {
	/* 잠금 상태 배경을 연하게 */
	background: rgba(22, 26, 42, 0.88);
	/* 텍스트 색도 옅게 */
	color: rgba(155, 164, 198, 0.55);
	/* 커서를 금지 모양으로 */
	cursor: not-allowed;
}

.composer--locked .composer__send,
.composer__send:disabled {
	/* 버튼 투명도 낮춤 */
	opacity: 0.45;
	/* 그림자 제거 */
	box-shadow: none;
	/* 클릭 불가 커서 */
	cursor: not-allowed;
}

.composer--locked .composer__send:hover,
.composer--locked .composer__send:focus-visible {
	/* 잠금 상태에서는 애니메이션 제거 */
	transform: none;
	box-shadow: none;
}

.friend-picker {
	/* 친구 선택 오버레이 전체 덮도록 */
	position: absolute;
	/* 사방을 꽉 채우도록 */
	inset: 0;
	/* 중앙 배치를 위한 flex 설정 */
	display: flex;
	justify-content: center;
	align-items: center;
	/* 내부 여백 */
	padding: 1.5rem;
	/* 어두운 반투명 배경 */
	background: rgba(5, 6, 10, 0.75);
	/* 배경 흐림 효과 */
	backdrop-filter: blur(6px);
	/* 다른 요소보다 위에 표시 */
	z-index: 10;
	/* 등장/퇴장 애니메이션 */
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.friend-picker--hidden {
	/* 숨김 상태에서는 투명하게 */
	opacity: 0;
	/* 화면에서 제거 */
	visibility: hidden;
	/* 사용자 입력 차단 */
	pointer-events: none;
}

.friend-picker__panel {
	/* 패널 너비를 반응형으로 제한 */
	width: min(360px, 100%);
	/* 내부 패딩 */
	padding: 1.6rem;
	/* 반투명 다크 패널 */
	background: rgba(12, 15, 28, 0.92);
	/* 모서리를 둥글게 */
	border-radius: 22px;
	/* 떠 있는 느낌의 그림자 */
	box-shadow: 0 28px 54px rgba(4, 6, 14, 0.45);
	/* 테두리로 네온 강조 */
	border: 1px solid rgba(139, 91, 255, 0.2);
	/* 콘텐츠 세로 배치 */
	display: flex;
	flex-direction: column;
	/* 내부 간격 */
	gap: 1.3rem;
	/* 텍스트 중앙 정렬 */
	text-align: center;
}

.friend-picker__title {
	/* 제목 여백 제거 */
	margin: 0;
	/* 제목 크기 */
	font-size: 1.3rem;
	/* 굵은 제목 */
	font-weight: 700;
}

.friend-picker__subtitle {
	/* 부제목 여백 제거 */
	margin: 0;
	/* 글자 크기 */
	font-size: 0.98rem;
	/* 연한 색상 */
	color: rgba(155, 164, 198, 0.8);
	/* 줄 간격 조절 */
	line-height: 1.5;
}

.friend-picker__grid {
	/* 카드를 그리드로 배치 */
	display: grid;
	/* 카드 최소 너비와 자동 칼럼 */
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	/* 카드 간격 */
	gap: 1rem;
}


.friend-card {
	/* 카드 테두리 제거 */
	border: none;
	/* 모서리를 둥글게 */
	border-radius: 18px;
	/* 그라디언트 배경 */
	background: linear-gradient(135deg, rgba(139, 91, 255, 0.18), rgba(79, 243, 198, 0.12));
	/* 패딩 지정 */
	padding: 1.1rem 0.9rem;
	/* 카드 내용 세로 배치 */
	display: flex;
	flex-direction: column;
	/* 내용 가운데 정렬 */
	align-items: center;
	/* 항목 간 간격 */
	gap: 0.55rem;
	/* 텍스트 색상 */
	color: var(--text-main);
	/* 폰트 상속 */
	font-family: inherit;
	/* 버튼처럼 클릭 가능 */
	cursor: pointer;
	/* 호버 애니메이션 */
	transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.friend-card:focus-visible,
.friend-card:hover {
	/* 호버/포커스 시 약간 위로 이동 */
	transform: translateY(-3px);
	/* 그림자 강화 */
	box-shadow: 0 20px 36px rgba(139, 91, 255, 0.32);
	/* 포커스 아웃라인 제거 */
	outline: none;
}

.friend-card--selected {
	/* 선택된 카드 강조 */
	transform: translateY(-3px);
	/* 더 강한 그림자 */
	box-shadow: 0 26px 40px rgba(79, 243, 198, 0.35);
	/* 배경을 조금 더 진하게 */
	background: linear-gradient(135deg, rgba(139, 91, 255, 0.25), rgba(79, 243, 198, 0.22));
}

.friend-card:focus-visible {
	/* 키보드 포커스 링 표현 */
	box-shadow: 0 0 0 3px rgba(79, 243, 198, 0.35);
}

.friend-card__avatar {
	/* 아바타 컨테이너 가운데 정렬 */
	display: grid;
	place-items: center;
	/* 크기 지정 */
	width: 58px;
	height: 58px;
	/* 원형 아바타 */
	border-radius: 50%;
	/* 아바타 이모지 크기 */
	font-size: 1.6rem;
	/* 연한 배경 */
	background: rgba(139, 91, 255, 0.18);
	/* 안쪽 경계선 */
	box-shadow: inset 0 0 0 1px rgba(79, 243, 198, 0.25);
}

.friend-card__name {
	/* 이름 텍스트 크기 */
	font-size: 1.1rem;
	/* 굵게 표시 */
	font-weight: 700;
}

.friend-card__tagline {
	/* 부가 설명 글자 크기 */
	font-size: 0.9rem;
	/* 연한 색상 */
	color: var(--text-muted);
	/* 줄 간격 */
	line-height: 1.4;
}

.friend-picker__hint {
	/* 힌트 문구 외부 여백 제거 */
	margin: 0;
	/* 작은 글자 */
	font-size: 0.85rem;
	/* 연한 색 */
	color: var(--text-muted);
}

@media (max-width: 480px) {
	/* 작은 화면에서 폰트 크기 살짝 축소 */
	:root {
		font-size: 17px;
	}

	/* 모바일에서는 레이아웃을 꽉 채우도록 조정 */
	body {
		display: block;
		min-height: 100vh;
		--page-padding: clamp(0.45rem, 4vw, 0.85rem);
		padding: var(--page-padding);
		padding-top: calc(var(--page-padding) + var(--viewport-offset-top, 0px));
		padding-bottom: calc(var(--page-padding) + env(safe-area-inset-bottom));
		justify-content: flex-start;
		align-items: stretch;
	}

	body.is-kakao-inapp {
		padding-top: var(--page-padding);
	}

	body.is-android-chrome {
		padding-top: calc(var(--page-padding) + var(--viewport-offset-top, 0px) + 0.75rem);
		padding-bottom: calc(max(env(safe-area-inset-bottom), var(--page-padding) * 0.45));
	}

	body.is-android-chrome.is-android-keyboard {
		/* 가상 키보드가 올라온 동안에는 추가 상단 여백을 제거해 헤더가 밀려 올라가지 않도록 합니다. */
		padding-top: calc(var(--page-padding) + var(--viewport-offset-top, 0px));
		padding-bottom: calc(var(--page-padding) + env(safe-area-inset-bottom));
	}

	/* 앱이 전체 화면을 채우도록 */
	.app {
		width: auto;
		height: auto;
		max-width: none;
		max-height: none;
		margin: 0;
		border-radius: 18px;
		position: fixed;
		top: calc(var(--page-padding) + var(--viewport-offset-top, 0px));
		left: var(--page-padding);
		right: var(--page-padding);
		bottom: calc(var(--page-padding) + env(safe-area-inset-bottom));
	}

	body.is-android-chrome .app {
		top: calc(var(--page-padding) + var(--viewport-offset-top, 0px) + 0.75rem);
		bottom: calc(var(--page-padding) + env(safe-area-inset-bottom) + var(--keyboard-offset, 0px));
	}

	body.is-android-chrome.is-android-keyboard .app {
		top: calc(var(--page-padding) + var(--viewport-offset-top, 0px));
		bottom: auto;
		height: max(
			320px,
			calc(
				var(--app-height, 100vh)
				-
				(
					var(--page-padding)
					+
					var(--viewport-offset-top, 0px)
				)
				-
				(
					var(--page-padding)
					+
					env(safe-area-inset-bottom)
				)
			)
		);
		max-height: max(
			320px,
			calc(
				var(--app-height, 100vh)
				-
				(
					var(--page-padding)
					+
					var(--viewport-offset-top, 0px)
				)
				-
				(
					var(--page-padding)
					+
					env(safe-area-inset-bottom)
				)
			)
		);
	}

	/* 본문 패딩 조정 */
	.app__main {
		padding: 1rem 0.9rem;
	}

	/* 헤더 패딩 축소 (모바일 공간 확보) */
	.app__header {
		padding: 1rem 1rem;
	}

	/* 친구 선택 패널 패딩 축소 */
	.friend-picker__panel {
		padding: 1.4rem;
	}

	/* 상단 버튼 패딩 축소 및 줄바꿈 방지 강화 */
	.app__action-btn {
		padding: 0.4rem 0.6rem;
		font-size: 0.8rem;
		white-space: nowrap;
	}

	/* 모바일에서는 말풍선 너비 확대 */
	.message__bubble {
		max-width: 82%;
	}

	/* 입력 영역 패딩 축소 */
	.composer {
		padding: 0.9rem 1rem;
	}
}

/* Character Selection Styles */
.character-selection {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	flex: 1;
	min-height: 0;
	padding: 1.5rem 0.5rem;
	text-align: center;
	overflow-y: auto;
	/* 터치 스크롤은 허용합니다. */
	touch-action: pan-y;
	/* 내부 스크롤 바운스가 부모로 전달되지 않도록 합니다. */
	overscroll-behavior: none;
}

.character-selection[hidden] {
	display: none;
}

.character-selection__title {
	font-size: 1.3rem;
	font-weight: 700;
	margin: 0 0 0.2rem;
	color: var(--text-main);
}

.character-selection__desc {
	font-size: 0.9rem;
	color: var(--text-muted);
	margin: 0 0 0.8rem;
}

.character-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.5rem;
	width: 100%;
	max-width: 400px;
}

.character-card {
	background: var(--surface);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 16px;
	padding: 0.6rem;
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
}

.character-card:hover,
.character-card:focus-visible {
	background: rgba(139, 91, 255, 0.1);
	border-color: var(--primary);
	transform: translateY(-2px);
	outline: none;
}

.character-card__avatar {
	width: 105px;
	height: 105px;
	border-radius: 50%;
	object-fit: cover;
	background: #2a2d3e;
	border: 2px solid transparent;
	transition: border-color 0.2s ease;
}

.character-card:hover .character-card__avatar {
	border-color: var(--primary);
}

.character-card__info {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.character-card__name {
	font-weight: 700;
	font-size: 1rem;
	color: var(--text-main);
}

.character-card__desc {
	font-size: 0.8rem;
	color: var(--text-muted);
	line-height: 1.4;
}

/* Header Actions */
.app__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	/* overflow-x: auto 제거: 드롭다운 메뉴가 잘리는 문제 해결 */
}

/* 영어 모드에서 버튼 크기 축소 및 간격 조정 */
:lang(en) .app__action-btn,
:lang(en) .custom-select__trigger {
	padding: 0.35rem 0.5rem;
	font-size: 0.75rem;
	letter-spacing: -0.03em;
}

@media (max-width: 380px) {
	:lang(en) .app__action-btn,
	:lang(en) .custom-select__trigger {
		padding: 0.3rem 0.4rem;
		font-size: 0.7rem;
	}
	
	:lang(en) .app__actions {
		gap: 0.3rem;
	}
}

.app__action-btn {
	background: rgba(139, 91, 255, 0.15);
	border: 1px solid rgba(139, 91, 255, 0.3);
	color: #ffffff;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0.4rem 0.9rem;
	border-radius: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	white-space: nowrap;
}

.app__action-btn:hover {
	background: rgba(139, 91, 255, 0.25);
	border-color: rgba(139, 91, 255, 0.5);
	box-shadow: 0 4px 12px rgba(139, 91, 255, 0.2);
	transform: translateY(-1px);
}

.app__main[hidden] {
	display: none;
}

.composer[hidden] {
	display: none;
}

/* Custom Select */
.custom-select {
	position: relative;
	display: inline-block;
}

.custom-select__trigger {
	background: rgba(255, 71, 133, 0.15);
	border: 1px solid rgba(255, 71, 133, 0.3);
	color: #ffffff;
	font-size: 0.85rem;
	font-weight: 600;
	cursor: pointer;
	padding: 0.4rem 0.9rem;
	border-radius: 20px;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.custom-select__trigger:hover {
	background: rgba(255, 71, 133, 0.25);
	border-color: rgba(255, 71, 133, 0.5);
	box-shadow: 0 4px 12px rgba(255, 71, 133, 0.2);
	transform: translateY(-1px);
}

.custom-select__arrow {
	transition: transform 0.2s ease;
}

.custom-select__trigger[aria-expanded="true"] .custom-select__arrow {
	transform: rotate(180deg);
}

.custom-select__options {
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	min-width: 120px;
	background: rgba(16, 10, 14, 0.95);
	backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 71, 133, 0.2);
	border-radius: 16px;
	padding: 0.5rem;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	z-index: 100;
	opacity: 0;
	transform: translateY(-10px);
	pointer-events: none;
	transition: all 0.2s ease;
}

.custom-select__options:not([hidden]) {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.custom-select__option {
	display: block;
	padding: 0.6rem 1rem;
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.9rem;
	border-radius: 12px;
	transition: all 0.2s ease;
	text-align: left;
}

.custom-select__option:hover,
.custom-select__option[aria-selected="true"] {
	background: rgba(255, 71, 133, 0.15);
	color: #ffffff;
}

/* Animation Utilities */
.animate-fade-in {
animation: fadeIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.animate-fade-out {
animation: fadeOut 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px) scale(0.98);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}

@keyframes fadeOut {
from {
opacity: 1;
transform: translateY(0) scale(1);
}
to {
opacity: 0;
transform: translateY(-10px) scale(0.98);
}
}

.app__action-btn[hidden] {
    display: none !important;
}

/* Footer & Contact Styles */
.app__footer {
    padding: 1rem 0 calc(1rem + env(safe-area-inset-bottom));
    text-align: center;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
    margin-top: auto;
}

.app__footer[hidden] {
    display: none !important;
}

.app__version {
    font-size: 0.6rem;
    color: var(--text-dim);
    opacity: 0.25;
    margin-top: 0.4rem;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

.contact-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-family: inherit;
}

.contact-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.contact-icon {
    font-size: 1.1rem;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    vertical-align: middle;
    margin-bottom: 2px;
}

/* Contact Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}
.modal-overlay.is-open {
    display: flex;
}
.modal-container {
    background: #1e1e24;
    width: 90%;
    max-width: 500px;
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}
.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.2s;
}
.modal-close:hover {
    color: var(--text-main);
}
.modal-body {
    padding: 1.5rem;
    color: var(--text-main);
}
.contact-modal-container {
    max-width: 360px !important;
    background: rgba(20, 25, 35, 0.95);
    backdrop-filter: blur(10px);
}
.contact-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}
.contact-option:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}
.contact-option.kakao {
    background: #FEE500;
    color: #000;
    border-color: #FEE500;
}
.contact-option.kakao:hover {
    background: #ffeb3b;
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.3);
}
.contact-option.email {
    background: rgba(255, 255, 255, 0.1);
}
.contact-option.email:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Image Modal */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

.image-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.image-modal__content {
    position: relative;
    z-index: 10001;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.image-modal__content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.image-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.image-modal__close:hover {
    opacity: 1;
}

@keyframes modalPop {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Group Chat Modal Styles */
.group-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.group-modal[hidden] {
    display: none;
}

.group-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.group-modal__content {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group-modal__header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.group-modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.group-modal__close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.group-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    /* 터치 스크롤은 허용합니다. */
    touch-action: pan-y;
    /* 내부 스크롤 바운스가 부모로 전달되지 않도록 합니다. */
    overscroll-behavior: none;
}

.group-modal__section {
    margin-bottom: 24px;
}

.group-modal__section:last-child {
    margin-bottom: 0;
}

.group-modal__section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.group-modal__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.group-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.group-item__info {
    flex: 1;
}

.group-item__name {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

.group-item__action {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.group-item__action--remove {
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
}

.group-item__action--remove:hover {
    background: rgba(255, 77, 77, 0.2);
}

.group-item__action--add {
    color: var(--accent);
    background: rgba(79, 243, 198, 0.1);
}

.group-item__action--add:hover {
    background: rgba(79, 243, 198, 0.2);
}

.group-modal__footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.group-modal__btn {
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.group-modal__btn--primary {
    background: var(--primary);
    color: white;
}

.group-modal__btn--primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Admin Panel Styles */
.admin-stats-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0.5rem;
}

.admin-char-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1rem;
}

.admin-char-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.admin-char-info-edit {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-char-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-char-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent);
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.admin-stat-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-stat-input {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-main);
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.2s;
}

.admin-file-input-wrapper {
    display: flex;
    align-items: center;
}

.admin-file-btn {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    width: 100%;
}

.admin-file-btn:active {
    opacity: 0.8;
}

.admin-stat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.admin-stat-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-top: 0.5rem;
}

.admin-stat-checkbox input {
    cursor: pointer;
}

.group-modal__btn--danger {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.group-modal__btn--danger:hover {
    background: rgba(255, 59, 48, 0.25);
    border-color: rgba(255, 59, 48, 0.5);
}
