@charset "utf-8";
/* ===== bbs_katalk 글 보기 편집 모드(body.chat-edit-on) — 제목/정보 입력칸·저장/수정 단추·말풍선 편집 아이콘·말풍선 안 편집창·
   끼워 넣기 창·터치 편집. 편집 전용 요소의 기본 숨김(.edit-only·.bbs-btn.savebtn …)도 여기라 손님 화면에도 싣는다.
   싣는 순서는 style.view.css 머리 ===== */
body.chat-edit-on .board-viewer.has-banner-image > .subject .subject-view, body.chat-edit-on .board-viewer.has-banner-image > .info {
	display: block;
}

/* 배너 자체는 편집 모드에서 보조 정보로만 남기고 인풋이 본문이 되도록 살짝 흐리게 */
body.chat-edit-on .bbs-hero-banner {
	opacity: 0.55;
}

.edit-only {
	display: none;
}

.chat-edit-on .edit-only {
	display: inline-flex;
}

.chat-edit-on .subject-view, .chat-edit-on .info-view {
	display: none;
}

.chat-edit-on .subject .subject-view {
	display: none;
}

body.chat-edit-on .info-view {
	display: none;
}

.subject-edit {
	width: min(560px, 78vw);
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: var(--bbs-field-bg);
	color: inherit;
	font-size: 18px;
	font-weight: var(--bbs-fw-semi, 600);
	margin-left: 6px;
}

.chat-edit-on .info.info-empty {
	display: block;
}

.info-edit {
	margin-top: 6px;
	width: min(420px, 72vw);
	padding: 6px 10px;
	border: 0;
	border-radius: 8px;
	background: var(--bbs-field-bg);
	color: inherit;
	font-size: 13px;
}

/* 편집 모드에서는 제목/부제목 입력칸을 컨테이너 폭 전체로 확장 */
body.chat-edit-on .subject {
	display: block;
	width: 100%;
}

body.chat-edit-on .subject-right {
	display: block;
	width: 100%;
}

body.chat-edit-on .subject-edit, body.chat-edit-on .info-edit {
	display: block;
	width: 100%;
	max-width: none;
	margin-left: 0;
	box-sizing: border-box;
}

.bbs-btn.savebtn {
	display: none;
}

.active .bbs-btn.savebtn, body.chat-edit-on .bbs-btn.savebtn {
	display: inline-flex;
}

.active .bbs-btn.savebtn.active, body.chat-edit-on .bbs-btn.savebtn.active {
	color: var(--bbs-ui-fg-strong);
	background: var(--bbs-ui-bg-hover);
}

.active .bbs-btn.modbtn, body.chat-edit-on .bbs-btn.modbtn {
	display: none;
}

.con_cont button {
	border: none;
	padding: 5px 10px;
	border-radius: 5px;
	display: inline-block;
	margin-right: 5px;
}

.first .con_message_btn {
	right: -45px;
}

.second .con_message_btn {
	left: -60px;
}

.con_message_btn {
	position: absolute;
	width: 40px;
	bottom: 16px;
	display: none;
}

.active .con_message_btn, body.chat-edit-on .con_message_btn {
	display: flex;
	opacity: 0.7;
}

.con_message:hover .con_message_btn {
	opacity: 1;
}

.con_message_btn .material-icons {
	font-size: 16px;
	border-radius: 100%;
	padding: 1px;
	cursor: pointer;
	background: transparent;
	color: var(--bbs-ui-fg-muted, rgba(0, 0, 0, 0.45)); /* 다크 테마에서도 보이게 토큰 사용 */
}

.con_message_btn.inactive {
	opacity: 0.1 !important;
	pointer-events: none;
}

/* [CUSTOM(takemd)] 편집창은 원래 말풍선 크기에서 시작한다.
   예전엔 min-width:200px / min-height:80px 고정이라 "ㅇㅇ" 같은 짧은 말풍선을
   누르면 갑자기 큼직한 상자로 벌어져 목록이 출렁였다. 시작 크기는 JS 가
   (view_edit.js) 원래 콘텐츠 박스를 재서 인라인으로 주고, 타이핑에 따라 늘린다. */
.bbs-box .con_cont textarea {
	border-radius: 6px;
	padding: 6px 8px;
	margin-bottom: 4px;
	/* 폭은 감싸는 .bbs-edit-box 가 정하고 여기선 그걸 100% 로 채운다.
	   textarea 에 직접 폭을 주면 인라인 !important 조차 무시되고 cols 기본값(≈156px)으로
	   계산되는 환경이 있어서(폼 컨트롤 고유 크기), 일반 div 로 폭을 잡는 편이 확실하다. */
	display: block;
	width: 100%;
	min-height: 24px;
	max-width: none;
	box-sizing: border-box;
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	overflow: hidden;        /* 자동 높이라 스크롤바가 뜰 일이 없음 */
	resize: vertical;
}

/* 편집창 래퍼 — JS 가 원래 말풍선 폭을 여기에 인라인으로 준다 */
.con_cont .bbs-edit-box {
	min-width: 90px;
	/* max-width 를 걸지 않는다 — JS 가 주는 폭은 '원래 글자 폭 + 편집창 패딩' 이라
	   부모(원래 글자 폭)보다 패딩만큼 넓다. 100% 로 묶으면 딱 그만큼 글자 영역이
	   좁아져 줄바꿈 위치가 달라진다. 말풍선 자체의 max-width(520px) 안에 들어간다. */
}

/* 저장/취소 — 말풍선 안에 들어가므로 작고 납작하게, 오른쪽 정렬 */
.con_cont .bbs-edit-row {
	display: flex;
	justify-content: flex-end;
	gap: 5px;
	margin-top: 2px;
}

.con_cont .bbs-edit-btn {
	border: 1px solid var(--bbs-modal-border, rgba(0, 0, 0, 0.15));
	background: var(--bbs-modal-btn-ghost-bg, rgba(255, 255, 255, 0.7));
	color: var(--bbs-modal-fg, #333);
	padding: 3px 10px;
	border-radius: 5px;
	font-family: inherit;
	font-size: 11px;
	font-weight: var(--bbs-fw-semi, 600);
	line-height: 1.6;
	cursor: pointer;
}

.con_cont .bbs-edit-btn.is-primary {
	background: var(--bbs-ui-accent-bg, var(--accent-color, #1a73e8));
	color: var(--btn-accent-text, #fff);
	border-color: transparent;
}

.con_cont .bbs-edit-btn:hover { filter: brightness(0.95); }

/* 간단 모달 스타일 (기존 JS가 id로 만든다) */
#chat-insert-modal-backdrop {
	position: fixed;
	inset: 0;
	background: var(--bbs-overlay-bg);
	display: none;
	z-index: var(--z-chat-insert-backdrop, 9998);
}

#chat-insert-modal {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: none;
	z-index: var(--z-chat-insert, 9999);
	background: var(--bbs-modal-bg);
	color: var(--bbs-modal-fg);
	border-radius: 12px;
	width: min(420px, 92vw);
	padding: 16px;
	box-shadow: var(--bbs-date-shadow-jump);
}

#chat-insert-modal header {
	font-weight: var(--bbs-fw-bold, 700);
	margin-bottom: 10px;
}

#chat-insert-modal .row {
	margin: 8px 0;
	color: var(--p-color-sub, currentColor);
}

#chat-insert-modal textarea {
	width: 100%;
	min-height: 120px;
}

#chat-insert-modal .actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 10px;
}

#chat-insert-modal .btn-ghost {
	padding: 8px 12px;
	border: 1px solid var(--bbs-modal-border);
	border-radius: 8px;
	background: var(--bbs-modal-btn-ghost-bg);
	color: var(--bbs-modal-fg);
}

#chat-insert-modal .btn-primary {
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid var(--bbs-ui-accent-bg);
	background: var(--bbs-ui-accent-bg);
	color: var(--bbs-ui-accent-fg);
}

/* ==================== 호버 편집 (편집 모드 밖) ====================
   추가/수정/삭제 버튼(.msg-fab)의 노출 규칙은 전부 css/style.reaction.css 「편집 fab」절로 모았다(2026-09-30 —
   두 파일에 갈라져 !important 로 서로 누르던 것을 명시도 순서로 정리). 여기엔 길게 누른 말풍선의 테두리만 남는다. */
@media (hover: none) {
	body.bbs-can-edit #bo_v_con .bubble-wrap.touch-edit-active .con_message {
		outline: 2px solid var(--bbs-ui-accent-bg, #6aa9ff);
		outline-offset: 1px;
	}
}

/* 편집 모드: 편집과 무관한 버튼 숨김 — 미완/관심글/검색/백업/목록(헤더) + 이전글/다음글(하단).
   편집 중 오클릭으로 페이지를 떠나거나 상태를 건드리는 사고 방지. */
body.chat-edit-on #incomplete_btn, body.chat-edit-on #favorite_btn, body.chat-edit-on #search_btn, body.chat-edit-on #backup_btn, body.chat-edit-on .bbs-btn.quitbtn, body.chat-edit-on #bo_v_bot .bo_v_nb {
	display: none;
}

/* ===== 폰(≤1000px) ===== */
@media (max-width: 1000px) {
	/* 편집 모드는 입력 필드 보이게 다시 노출. */
	body.chat-edit-on .board-viewer.no-banner-image > .subject .subject-view, body.chat-edit-on .board-viewer.no-banner-image > .info {
		display: block;
	}

	body.chat-edit-on .board-viewer.no-banner-image .bbs-hero-banner {
		opacity: 0.55;
	}


	/* [CUSTOM(takemd)] 편집 모드의 저장·수정 버튼과 접힘 규칙의 케스케이드 정리.
	   위 접힘/펼침 규칙들(0,4,0 / 0,5,0)이 편집 모드 규칙(0,3,1)을 이겨서
	   ① 편집 중 메뉴를 닫으면 savebtn 이 opacity:0·pointer-events:none 의
	      '투명 유령'으로만 존재 — 편집하는 동안 화면 어디에도 저장 표지가 없어
	      저장하려면 매번 ⋯→렌치→저장 3탭이었고
	   ② 편집 모드 밖에서도 렌치를 열면 저장이 노출됐다(누르면 실제 저장 POST).
	   편집 중에는 저장을 우하단 고정 FAB 로 승격하고(메뉴 상태 무관),
	   수정(modbtn)은 편집 중 완전 숨김, 저장은 편집 밖 완전 숨김으로 강제한다. */
	/* 선택자를 헤더 스코프 없이 — JS 가 편집 진입 시 버튼을 body 직속으로 옮긴다
	   (.bbs-btn-header 가 fixed 의 기준 블록이 되어 right:12 가 헤더 기준으로
	   풀리는 문제의 우회). 옮겨진 뒤에도 이 규칙이 계속 맞아야 한다. */
	body.chat-edit-on .bbs-btn.savebtn {
		display: inline-flex;
		opacity: 1;
		pointer-events: auto;
		transform: none;
		position: fixed;
		z-index: 10080; /* 오버레이(10090) 아래, 본문 위 */
		right: 12px;
		bottom: calc(55px + env(safe-area-inset-bottom, 0px));
		width: 44px;
		height: 44px;
		border-radius: 12px;
		background: var(--bbs-ui-accent-bg, #1a73e8);
		color: var(--btn-accent-text, #fff);
		box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
	}

	body:not(.chat-edit-on) .bbs-btn-header .bbs-btn.savebtn {
		display: none;
	}

	body.chat-edit-on .bbs-btn-header .bbs-btn.modbtn {
		display: none;
	}

	/* ⑤ 말풍선이 액션 아이콘 자리를 뺏지 않게.
	   .con_message 는 max-width: 80% 인데 375px 에선 284px 라, 말풍선 옆
	   reaction-stack(하트 + 편집/추가/삭제 fab 3개 ≈ 90px)이 들어갈 자리가 없어
	   아이콘이 말풍선 아래로 밀려났다. 스택 자리를 남기고 말풍선을 줄인다.
	   (프로필 사진이 붙는 .first 라인은 그만큼 더 좁게) */
	/* ⑤ 말풍선의 추가/수정/삭제 아이콘(.msg-fab)의 폰 노출 규칙은 css/style.reaction.css 「편집 fab」절로(2026-09-30) */
	/* 롱프레스 중 iOS 텍스트 선택 루페와의 경합 방지 — 열린 말풍선만 잠깐 억제 */
	body.bbs-can-edit #bo_v_con .bubble-wrap.touch-edit-active .con_message {
		-webkit-user-select: none;
		user-select: none;
	}

	/* [CUSTOM(takemd)] 편집 모드의 말풍선 아이콘(추가/수정/삭제/반응편집)을 모바일에선
	   말풍선 **아래**로 옮긴다. 데스크톱 배치는 말풍선 옆(.first: right:-45 /
	   .second: left:-60)에 40px 상자 — 아이콘 4개(≈72px)가 상자를 넘치고, 최대폭
	   말풍선에선 그 초과분이 화면 밖(#bo_v_con overflow-x:hidden)이라 긴 말풍선
	   일수록 삭제·반응편집이 잘려 도달 불가였다. 아래 배치면 폭 제약이 사라져
	   아이콘을 30px 터치 타깃으로 키울 수 있다. 겹침 방지로 편집 모드에서만
	   말풍선 줄에 아래 여백을 준다. */
	body.chat-edit-on #bo_v_con .bubble-wrap {
		padding-bottom: 34px;
	}

	body.chat-edit-on #bo_v_con .con_message .con_message_btn, body.chat-edit-on #bo_v_con .con_message.first .con_message_btn, body.chat-edit-on #bo_v_con .con_message.second .con_message_btn {
		width: auto;
		top: calc(100% + 3px);
		bottom: auto;
		display: flex;
		gap: 4px;
		padding: 2px;
		border-radius: 10px;
		background: rgb(100 116 139 / 0.92); /* 좌하단 툴바 버튼과 같은 슬레이트 */
		opacity: 1;
	}

	body.chat-edit-on #bo_v_con .con_message.first .con_message_btn {
		left: 0;
		right: auto;
	}

	body.chat-edit-on #bo_v_con .con_message.second .con_message_btn {
		right: 0;
		left: auto;
	}

	body.chat-edit-on #bo_v_con .con_message_btn .material-icons {
		font-size: 18px;
		padding: 6px;
		color: #fff;
	}

	/* [CUSTOM(takemd)] 인라인 편집(말풍선 안) 저장/취소가 실측 ~24px.
	   Ctrl+Enter·Esc 의 터치 대체 경로라 폰에선 이게 주 동선인데, '저장먀' 옆
	   '관둘거먕'을 스치면 타이핑이 통째로 파기됐다. 세로만 키우고 간격을 벌린다
	   (가로는 말풍선 폭 안이라 여유가 없다). */
	.con_cont .bbs-edit-btn {
		min-height: 34px;
		padding: 6px 12px;
		font-size: 12px;
	}

	/* ⚠️ 버튼이 줄지 않게 해야 한다. 행 폭이 원래 말풍선 폭에서 오는데(실측 185px)
	   flex 기본 shrink 로 '저장먀'가 48px 까지 눌려 **2줄로 접혀 높이가 50px**
	   이 됐다(위 min-height 34 의 의도와 반대). nowrap + shrink 금지로 제 폭을
	   지키고, 세 개가 한 줄에 안 들어가면 행이 접히게 한다. */
	.con_cont .bbs-edit-row {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		gap: 8px;
	}

	.con_cont .bbs-edit-btn {
		white-space: nowrap;
		flex: 0 0 auto;
	}

	/* 사진 넣기 버튼(터치 전용) — 글자 버튼 둘 뒤에 아이콘만.
	   ⚠️ margin-left:auto 는 무의미하다 — 이 행은 폭이 내용에 맞춰지므로
	   밀어낼 여백 자체가 없다. */
	.con_cont .bbs-edit-btn.bbs-edit-img {
		min-width: 40px;
		padding: 6px 10px;
	}

	/* 편집 아이콘(material-icons)에도 더블탭 확대 억제 — 연속 추가/삭제 탭이 잦다 (.msg-fab 은 style.reaction.css) */
	#bo_v_con .con_message_btn .material-icons {
		touch-action: manipulation;
	}
}

/* 스킨 색 입히기 — 옛 style.css.php 에서 온 규칙이라 파일 끝(폰 블록 뒤) */
.con_cont button {
	background: var(--bbs-text);
	color: var(--bbs-base);
}

.con_message_btn .material-icons:hover {
	background: var(--bbs-text);
	color: var(--bbs-base);
}

.bbs-box .con_cont textarea {
	border: 1px solid var(--bbs-text2);
}
