/* 全站 LINE 即時諮詢浮動鈕（首頁除外）。z-index 低於編輯器 modal（1000+）。 */
.contact-line-fab {
	position: fixed;
	z-index: 900;
	right: 0;
	bottom: max(16px, env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 72px;
	min-height: 96px;
	width: auto;
	height: auto;
	box-sizing: border-box;
	padding: 14px max(10px, env(safe-area-inset-right)) 16px 14px;
	border: 1px solid #dbeafe;
	border-right: none;
	border-radius: 16px 0 0 16px;
	background: #fff;
	color: #06c755;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	box-shadow: -2px 2px 14px rgba(15, 23, 42, 0.12);
	cursor: pointer;
	overflow: visible;
	-webkit-appearance: none;
	appearance: none;
	transition: background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}
.contact-line-fab:hover {
	background: #f0fdf4;
	color: #04a647;
	box-shadow: -3px 3px 16px rgba(15, 23, 42, 0.16);
}
.contact-line-fab:active {
	background: #ecfdf5;
}
.contact-line-fab__icon {
	flex: 0 0 auto;
	width: 24px;
	height: 24px;
	display: block;
}
.contact-line-fab .fab.fa-line {
	font-size: 24px;
	line-height: 1;
}
.contact-line-fab__label {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	text-align: center;
	line-height: 1.25;
}
.contact-line-fab__label-line {
	display: block;
	line-height: 1.25;
}
.contact-line-fab__toast {
	position: fixed;
	z-index: 901;
	left: 50%;
	bottom: calc(max(16px, env(safe-area-inset-bottom)) + 112px);
	max-width: min(320px, calc(100vw - 32px));
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(30, 30, 30, 0.92);
	color: #fff;
	font-size: 13px;
	line-height: 1.45;
	text-align: center;
	pointer-events: none;
	opacity: 0;
	transform: translateX(-50%) translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.contact-line-fab__toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
/* 底部有操作列（我的名片、create 下一步/儲存）時上移，避免遮住按鈕 */
.contact-line-fab--lift {
	bottom: max(80px, calc(68px + env(safe-area-inset-bottom)));
}
.contact-line-fab__toast--lift {
	bottom: calc(max(80px, calc(68px + env(safe-area-inset-bottom))) + 112px);
}
/* 手機版（全站）：縮成只有 LINE 圖示的 44px 小圓鈕貼右下角，不遮住頁面動作列。 */
@media (max-width: 767px) {
	.contact-line-fab {
		right: 12px;
		bottom: max(14px, env(safe-area-inset-bottom));
		gap: 0;
		min-width: 0;
		min-height: 0;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 1px solid #dbeafe;
		border-radius: 50%;
		box-shadow: 0 2px 10px rgba(15, 23, 42, 0.16);
	}
	.contact-line-fab .contact-line-fab__label {
		display: none;
	}
	.contact-line-fab .contact-line-fab__icon {
		width: 22px;
		height: 22px;
	}
	.contact-line-fab .fab.fa-line {
		font-size: 22px;
	}
	.contact-line-fab__toast,
	.contact-line-fab__toast--lift {
		bottom: calc(max(14px, env(safe-area-inset-bottom)) + 56px);
	}
	/* create 頁：也貼右下角（與我的名片一致）。只有 step1（選範本）有吸底的「下一步」列，
	   用 :has() 判斷該步驟時把小圓鈕抬到列的上方；step2 編輯頁的按鈕列不吸底，不必抬。 */
	body:has(#step1:checked) .contact-line-fab.contact-line-fab--create,
	body:has(#step1:checked) .contact-line-fab.contact-line-fab--wizard-edit {
		bottom: calc(max(14px, env(safe-area-inset-bottom)) + 72px);
	}
}
.contact-line-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 10050;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.5);
}
.contact-line-modal.is-open {
	display: flex;
}
.contact-line-modal__panel {
	position: relative;
	width: 100%;
	max-width: 360px;
	max-height: 92vh;
	overflow-y: auto;
	padding: 18px 14px 16px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.contact-line-modal__close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: #9ca3af;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.contact-line-modal__close:hover {
	background: #f3f4f6;
	color: #6b7280;
}
.contact-line-modal__title {
	margin: 0 0 4px;
	font-size: 20px;
	font-weight: 700;
	color: #111827;
	text-align: center;
}
.contact-line-modal__subtitle {
	margin: 0 0 16px;
	font-size: 13px;
	color: #9ca3af;
	text-align: center;
}
.contact-line-modal__step {
	position: relative;
	margin-bottom: 12px;
	padding: 14px 14px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fafafa;
}
.contact-line-modal__step-num {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: #06c755;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
}
.contact-line-modal__step-title {
	margin: 0 0 10px 30px;
	font-size: 15px;
	font-weight: 700;
	color: #111827;
	line-height: 1.35;
}
.contact-line-modal__step-oa {
	margin-left: 4px;
	font-weight: 600;
	color: #06c755;
}
.contact-line-modal__step-desc,
.contact-line-modal__step-note {
	margin: 0 0 10px 30px;
	font-size: 12px;
	line-height: 1.45;
	color: #9ca3af;
}
.contact-line-modal__step-note {
	margin: 8px 0 0;
	text-align: center;
}
.contact-line-modal__btn-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 10px;
}
.contact-line-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: auto;
	padding: 10px 20px;
	border-radius: 999px;
	background: #06c755;
	color: #fff !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	box-sizing: border-box;
	transition: background 0.15s ease;
}
.contact-line-modal__btn:hover {
	background: #04a647;
}
.contact-line-modal__btn-icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}
.contact-line-modal__qr-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 10px;
}
.contact-line-modal__step-desc--center {
	margin-left: 0;
	margin-bottom: 0;
	text-align: center;
}
.contact-line-modal__alt {
	margin: 2px 0 0;
	font-size: 12px;
	line-height: 1.5;
	color: #9ca3af;
	text-align: center;
}
.contact-line-modal__copy {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 4px;
	padding: 2px 6px 2px 2px;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	background: #fff;
	color: #6b7280;
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	cursor: pointer;
	vertical-align: middle;
	transition: border-color 0.15s ease, color 0.15s ease;
}
.contact-line-modal__copy:hover {
	border-color: #06c755;
	color: #06c755;
}
.contact-line-modal__copy.is-copied {
	border-color: #06c755;
	color: #06c755;
}
.contact-line-modal__alt-id {
	padding: 1px 5px;
	border-radius: 4px;
	background: #f3f4f6;
	color: #374151;
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 12px;
}
.contact-line-modal__copy-icon {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
}
.contact-line-modal__copy-tip {
	font-size: 11px;
}
.contact-line-modal__qr-link {
	display: block;
	line-height: 0;
	border-radius: 10px;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.contact-line-modal__qr-link:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 14px rgba(6, 199, 85, 0.22);
}
.contact-line-modal__qr {
	width: 160px;
	height: 160px;
	border-radius: 10px;
	border: 1px solid #f3f4f6;
	background: #fff;
}
.contact-line-modal__qr--loading {
	background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
	background-size: 200% 100%;
	animation: contact-line-qr-shimmer 1.2s infinite;
}
@keyframes contact-line-qr-shimmer {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}
/* LINE 聊天示範（步驟 2，桌機用動畫代替無法開啟對話） */
.contact-line-demo {
	margin-top: 2px;
}
.contact-line-demo__screen {
	border-radius: 10px;
	background: linear-gradient(180deg, #7eb0e8 0%, #8cabd9 100%);
	padding: 8px 8px 10px;
}
.contact-line-demo__oa-name {
	margin: 0 0 8px;
	font-size: 10px;
	font-weight: 700;
	color: #fff;
	text-align: center;
}
.contact-line-demo__chat {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 120px;
	padding-bottom: 2px;
}
.contact-line-demo__user {
	position: relative;
	z-index: 1;
	align-self: flex-end;
	width: fit-content;
	max-width: 90%;
	padding: 7px 12px;
	border-radius: 14px 14px 4px 14px;
	background: #86e079;
	color: #111827;
	font-size: 12px;
	line-height: 1.4;
	white-space: nowrap;
}
.contact-line-demo__flex {
	position: relative;
	z-index: 0;
	align-self: flex-start;
	max-width: 88%;
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.contact-line-demo--animated .contact-line-demo__flex {
	opacity: 0;
	transform: translateY(12px);
	animation: contact-line-demo-flex 8s ease infinite;
}
.contact-line-demo__flex-body {
	padding: 10px 10px 8px;
}
.contact-line-demo__flex-title {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 700;
	color: #06c755;
	line-height: 1.35;
}
.contact-line-demo__flex-text {
	margin: 0;
	font-size: 11px;
	line-height: 1.45;
	color: #374151;
}
.contact-line-demo__flex-footer {
	padding: 0 10px 10px;
}
.contact-line-demo__flex-btn {
	display: block;
	padding: 6px 8px;
	border-radius: 6px;
	background: #06c755;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-align: center;
	line-height: 1.3;
}
@keyframes contact-line-demo-flex {
	0%, 18% { opacity: 0; transform: translateY(12px); }
	26%, 88% { opacity: 1; transform: translateY(0); }
	96%, 100% { opacity: 0; transform: translateY(12px); }
}
@media (prefers-reduced-motion: reduce) {
	.contact-line-demo--animated .contact-line-demo__flex {
		animation: none;
		opacity: 1;
		transform: none;
	}
}
