/* Quest Chat — no outer card: the component stands on its own. Collapsed
   it is just the round-ended pill bar (the bar carries its own border and
   shadow); expanded, the messages and bubbles sit directly on the page. */
.qc-app {
	--qc-orange: #f96d00;
	--qc-orange-dark: #e05f00;
	--qc-border: #e8e2d9;
	--qc-bg: #fffdf9;
	--qc-text: #26221d;
	--qc-muted: #7a7264;
	box-sizing: border-box;
	max-width: 920px;
	margin: 0 auto;
	background: transparent;
	border: none;
	font-family: inherit;
	color: var(--qc-text);
}
.qc-app * { box-sizing: border-box; }

/* The head, history and message areas start with the `hidden` attribute;
   their own display rules below would override it, so enforce it. */
.qc-head[hidden], .qc-history[hidden], .qc-messages[hidden] { display: none !important; }

@keyframes qc-in {
	from { opacity: 0; transform: translateY(-4px); }
	to { opacity: 1; transform: translateY(0); }
}
.qc-app:not(.qc-collapsed) .qc-head,
.qc-app:not(.qc-collapsed) .qc-messages {
	animation: qc-in 0.3s ease;
}

.qc-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 2px 2px 10px;
}
.qc-title { font-weight: 700; font-size: 17px; }
.qc-head-actions { display: flex; gap: 6px; }
.qc-btn {
	border: 1px solid var(--qc-border);
	background: #fff;
	color: var(--qc-text);
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 13px;
	cursor: pointer;
}
.qc-btn:hover { border-color: var(--qc-orange); color: var(--qc-orange-dark); }

.qc-history {
	border: 1px solid var(--qc-border);
	border-radius: 16px;
	background: #fff;
	max-height: 220px;
	overflow-y: auto;
	padding: 6px 10px;
	margin-bottom: 10px;
}
.qc-history-empty { color: var(--qc-muted); font-size: 13px; padding: 6px 4px; }
.qc-history-list { list-style: none; margin: 0; padding: 0; }
.qc-history-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 7px 6px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
}
.qc-history-list li:hover, .qc-history-list li.qc-active { background: #fff3e6; }
.qc-history-list .qc-h-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qc-history-list .qc-h-del {
	border: none; background: none; color: var(--qc-muted);
	cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px;
}
.qc-history-list .qc-h-del:hover { color: #c0392b; }

.qc-messages {
	padding: 6px 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 120px;
	max-height: 520px;
	overflow-y: auto;
}
.qc-msg { display: flex; }
.qc-msg-user { justify-content: flex-end; }
.qc-bubble {
	max-width: 96%;
	padding: 9px 13px;
	border-radius: 20px;
	font-size: 15px;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.qc-msg-assistant .qc-bubble { background: #fff; border: 1px solid var(--qc-border); border-bottom-left-radius: 4px; }
.qc-msg-user .qc-bubble { background: var(--qc-orange); color: #fff; border-bottom-right-radius: 4px; }
.qc-bubble a { color: var(--qc-orange-dark); }
.qc-msg-user .qc-bubble a { color: #fff; text-decoration: underline; }

.qc-typing { color: var(--qc-muted); font-style: italic; }

.qc-places {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 2px 0 6px;
	margin-top: 8px;
}
.qc-place {
	flex: 0 0 200px;
	background: #fff;
	border: 1px solid var(--qc-border);
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: var(--qc-text);
}
.qc-place img {
	width: 100%;
	height: 120px;
	object-fit: cover;
	object-position: 50% 20%;
	display: block;
	background: #f3ede2;
}
.qc-place .qc-place-title {
	display: block;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}
.qc-place:hover { border-color: var(--qc-orange); }

.qc-block { margin-top: 12px; }
.qc-block-name { display: block; font-weight: 700; margin-bottom: 2px; }
.qc-block img {
	width: 100%;
	max-height: 200px;
	object-fit: cover;
	object-position: 50% 30%;
	border-radius: 10px;
	display: block;
	margin: 6px 0 4px;
	background: #f3ede2;
}
.qc-block-src {
	display: block;
	font-size: 11px;
	color: var(--qc-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 4px;
}
.qc-outro { margin-top: 12px; }
.qc-place .qc-place-src {
	display: block;
	padding: 0 10px 8px;
	font-size: 11px;
	color: var(--qc-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Collapsed: the form IS the component — a standalone pill bar carrying
   its own border, background and shadow. Expanded: the pill chrome moves
   onto the input itself and the form becomes a plain row. */
.qc-form {
	display: flex;
	gap: 8px;
	padding: 6px;
}
.qc-app.qc-collapsed .qc-form {
	background: var(--qc-bg);
	border: 1px solid var(--qc-border);
	border-radius: 999px;
	box-shadow: 0 2px 14px rgba(60, 40, 10, 0.08);
}
.qc-app:not(.qc-collapsed) .qc-form {
	padding: 10px 0 0;
}
.qc-input {
	flex: 1;
	border: 1px solid transparent;
	background: transparent;
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 15px;
	outline: none;
	min-width: 0;
}
.qc-app:not(.qc-collapsed) .qc-input {
	border-color: var(--qc-border);
	background: #fff;
	box-shadow: 0 2px 10px rgba(60, 40, 10, 0.05);
}
.qc-input:focus { border-color: var(--qc-orange); background: #fff; }

/* Saved-chats button inside the pill, so returning visitors can reopen a
   chat without the panel expanding first. */
.qc-history-btn {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 999px;
	border: none;
	background: transparent;
	color: var(--qc-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.qc-history-btn:hover { color: var(--qc-orange); background: rgba(249, 109, 0, 0.08); }
.qc-send {
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	border: none;
	border-radius: 50%;
	background: var(--qc-orange);
	color: #fff;
	font-size: 17px;
	cursor: pointer;
	line-height: 1;
}
.qc-send:hover { background: var(--qc-orange-dark); }
.qc-send:disabled { opacity: 0.55; cursor: default; }

@media (max-width: 480px) {
	.qc-messages { min-height: 100px; max-height: 60vh; }
	.qc-place { flex-basis: 168px; }
}
