/* Praiseworth – Ask AI: floating text button + chat (panel on desktop, bottom sheet on phones). */
html.pwh-ai-open { overflow: hidden; }

/* Floating button. Sits below every top-layer dialog (booking sheet, bridal enquiry). */
#pwh-ai-fab {
	position: fixed; right: 24px; bottom: 24px; z-index: 9000;
	display: inline-flex; align-items: center; gap: 8px;
	margin: 0; padding: 13px 20px; min-height: 0; border: 0; border-radius: 0;
	background: #141414; color: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
	font: 600 14px/1 Questrial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
	transition: background .2s, transform .2s, opacity .2s;
}
#pwh-ai-fab:hover, #pwh-ai-fab:focus-visible { background: #a8663a; color: #fff; transform: translateY(-2px); }
#pwh-ai-fab svg { flex: none; color: #e7c3a3; }
#pwh-ai-fab:hover svg, #pwh-ai-fab:focus-visible svg { color: #fff; }
html.pwh-ai-open #pwh-ai-fab { opacity: 0; pointer-events: none; }

/* Chat dialog: desktop panel, bottom right */
#pwh-ai {
	position: fixed; inset: auto 24px 24px auto; margin: 0;
	width: min(420px, calc(100vw - 48px)); height: min(640px, calc(100vh - 48px)); height: min(640px, calc(100dvh - 48px));
	max-width: none; max-height: none; padding: 0; border: 0; border-radius: 14px;
	background: #fff; color: #141414; box-shadow: 0 24px 70px rgba(0, 0, 0, .25);
	font-family: Questrial, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.5;
	overflow: hidden; opacity: 0; transform: translateY(14px); transition: opacity .2s ease, transform .22s ease;
}
#pwh-ai[open] { display: flex; flex-direction: column; }
#pwh-ai.is-open { opacity: 1; transform: none; }
#pwh-ai::backdrop { background: rgba(20, 20, 20, .18); }
#pwh-ai *, #pwh-ai *::before, #pwh-ai *::after { box-sizing: border-box; }
#pwh-ai [hidden] { display: none !important; }
#pwh-ai :where(button, button:hover, button:focus) { background: none; border: 0; border-radius: 0; box-shadow: none; color: inherit; font: inherit; letter-spacing: 0; text-transform: none; padding: 0; margin: 0; min-height: 0; }

#pwh-ai .pwh-ai__bar { position: relative; flex: none; display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px 22px; background: #fbf9f6; border-bottom: 1px solid #eee6dd; }
#pwh-ai .pwh-ai__handle { display: none; }
#pwh-ai .pwh-ai__head { flex: 1; min-width: 0; }
#pwh-ai .pwh-ai__title { margin: 0; font-family: inherit; font-size: 20px; line-height: 1.25; font-weight: 600; color: #141414; text-transform: none; letter-spacing: 0; }
#pwh-ai .pwh-ai__sub { margin: 2px 0 0; font-size: 13px; color: #7a7470; }
#pwh-ai .pwh-ai__new { flex: none; padding: 7px 12px; border: 1px solid #d8d0c7; background: #fff; font-size: 13px; cursor: pointer; }
#pwh-ai .pwh-ai__new:hover, #pwh-ai .pwh-ai__new:focus-visible { border-color: #141414; }
#pwh-ai .pwh-ai__close { flex: none; width: 36px; height: 36px; border: 1px solid #e3dbd2; border-radius: 50%; background: #fff; color: #141414; font-size: 22px; line-height: 1; display: grid; place-items: center; cursor: pointer; }
#pwh-ai .pwh-ai__close:hover, #pwh-ai .pwh-ai__close:focus-visible { background: #141414; color: #fff; border-color: #141414; }

#pwh-ai .pwh-ai__log { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 12px; }
#pwh-ai .pwh-ai__intro p { margin: 0 0 12px; color: #4a4542; }
#pwh-ai .pwh-ai__prompts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
#pwh-ai .pwh-ai__prompts button { padding: 9px 13px; border: 1px solid #e3dbd2; background: #fbf9f6; color: #141414; font-size: 14px; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
#pwh-ai .pwh-ai__prompts button:hover, #pwh-ai .pwh-ai__prompts button:focus-visible { border-color: #a8663a; background: #fff; }

#pwh-ai .pwh-ai__msg { max-width: 88%; padding: 10px 14px; border-radius: 12px; word-wrap: break-word; }
#pwh-ai .pwh-ai__msg p { margin: 0 0 6px; }
#pwh-ai .pwh-ai__msg p:last-child, #pwh-ai .pwh-ai__msg ul:last-child { margin-bottom: 0; }
#pwh-ai .pwh-ai__msg ul { margin: 0 0 6px; padding-left: 18px; }
#pwh-ai .pwh-ai__msg li { margin: 0 0 3px; }
#pwh-ai .pwh-ai__msg strong { font-weight: 700; }
#pwh-ai .pwh-ai__msg--me { align-self: flex-end; background: #141414; color: #fff; border-bottom-right-radius: 4px; }
#pwh-ai .pwh-ai__msg--ai { align-self: flex-start; background: #f5f0ea; color: #141414; border-bottom-left-radius: 4px; }
#pwh-ai .pwh-ai__msg--err { align-self: flex-start; background: #fff4ec; color: #6b3a1c; border: 1px solid #f0d7c4; border-bottom-left-radius: 4px; }
#pwh-ai .pwh-ai__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#pwh-ai .pwh-ai__links a { display: inline-block; padding: 7px 11px; background: #fff; border: 1px solid #141414; color: #141414; font-size: 13px; line-height: 1.2; text-decoration: none; transition: background .15s, color .15s; }
#pwh-ai .pwh-ai__links a:hover, #pwh-ai .pwh-ai__links a:focus-visible { background: #141414; color: #fff; }

#pwh-ai .pwh-ai__typing { display: flex; gap: 5px; padding: 14px 16px; }
#pwh-ai .pwh-ai__typing span { width: 7px; height: 7px; border-radius: 50%; background: #a8663a; opacity: .35; animation: pwh-ai-dot 1s infinite ease-in-out; }
#pwh-ai .pwh-ai__typing span:nth-child(2) { animation-delay: .15s; }
#pwh-ai .pwh-ai__typing span:nth-child(3) { animation-delay: .3s; }
@keyframes pwh-ai-dot { 0%, 100% { opacity: .35; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }

#pwh-ai .pwh-ai__form { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 14px 6px; border-top: 1px solid #eee6dd; }
#pwh-ai .pwh-ai__form textarea { flex: 1; min-width: 0; height: 46px; max-height: 120px; overflow-y: hidden; margin: 0; padding: 11px 14px; border: 1px solid #d8d0c7; border-radius: 10px; background: #fff; font: inherit; font-size: 16px; line-height: 1.35; color: #141414; resize: none; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
#pwh-ai .pwh-ai__form textarea:focus { outline: 0; border-color: #a8663a; box-shadow: 0 0 0 3px rgba(168, 102, 58, .15); }
#pwh-ai .pwh-ai__form textarea:disabled { background: #f7f4f0; cursor: not-allowed; }
#pwh-ai .pwh-ai__send { flex: none; width: 46px; height: 46px; display: grid; place-items: center; background: #141414; color: #fff; cursor: pointer; transition: background .15s; }
#pwh-ai .pwh-ai__send:hover, #pwh-ai .pwh-ai__send:focus-visible { background: #a8663a; }
#pwh-ai .pwh-ai__send:disabled { background: #cfc7be; cursor: not-allowed; }
#pwh-ai .pwh-ai__foot { flex: none; margin: 0; padding: 2px 16px 12px; font-size: 11.5px; line-height: 1.4; color: #8c8580; }
#pwh-ai .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Phones: the button moves in a little; the chat becomes a bottom sheet. */
@media (max-width: 767px) {
	#pwh-ai-fab { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); padding: 12px 16px; font-size: 13px; }
	#pwh-ai {
		inset: auto 0 0 0; width: 100%; height: 88vh; height: 88dvh;
		border-radius: 18px 18px 0 0; transform: translateY(100%); opacity: 1; transition: transform .26s ease;
	}
	#pwh-ai.is-open { transform: none; }
	#pwh-ai::backdrop { background: rgba(20, 20, 20, .55); }
	#pwh-ai .pwh-ai__bar { padding: 22px 14px 12px 18px; }
	#pwh-ai .pwh-ai__handle { display: block; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: #d8d0c7; }
	#pwh-ai .pwh-ai__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
	#pwh-ai, #pwh-ai-fab { transition: none; }
}
@media print { #pwh-ai-fab { display: none; } }
