:root {
	color-scheme: dark;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
	background: #101413;
	color: #f5f3eb;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
}
main {
	max-width: 660px;
	margin: auto;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	padding: 0 22px;
}
header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 24px 0;
	border-bottom: 1px solid #ffffff0d;
}
.brand {
	font-size: 18px;
	letter-spacing: 4px;
	font-weight: 600;
}
.brand span {
	display: block;
	font-size: 11px;
	letter-spacing: .4px;
	margin-top: 7px;
	color: #b7b6ae;
	font-weight: 400;
}
#status {
	font-size: 11px;
	color: #b7b6ae;
	display: flex;
	align-items: center;
	gap: 7px;
}
#status:before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #c8b685;
}
#intro {
	margin: auto;
	text-align: center;
	padding: 64px 12px;
	max-width: 360px;
	align-self: center;
}
.emblem {
	border: 1px solid #c8b68555;
	color: #c8b685;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	font-family: Georgia, serif;
	font-size: 27px;
	margin: 0 auto 24px;
}
h1 {
	font-size: 23px;
	font-weight: 450;
	letter-spacing: -.5px;
}
p {
	line-height: 1.6;
	color: #b7b6ae;
	font-size: 14px;
}
#messages {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 28px 0;
	flex: 1;
}
.bubble {
	max-width: 88%;
	padding: 15px 17px;
	background: #1d2421;
	border-radius: 3px 17px 17px 17px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.bubble.customer {
	align-self: flex-end;
	background: #c8b685;
	color: #171b17;
	border-radius: 17px 3px 17px 17px;
}
.bubble .meta {
	display: none;
}
.bubble p {
	margin: 0;
	color: inherit;
	font-size: 14px;
	line-height: 1.55;
}
#composer {
	position: sticky;
	bottom: 0;
	background: #101413;
	padding: 14px 0 max(18px, env(safe-area-inset-bottom));
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 12px;
	border-top: 1px solid #ffffff0d;
}
textarea {
	resize: none;
	border: 0;
	background: #1b211e;
	border-radius: 24px;
	color: #f5f3eb;
	padding: 14px 18px;
	font: inherit;
	font-size: 14px;
	min-width: 0;
	max-height: 140px;
	line-height: 1.5;
}
textarea:focus {
	outline: 1px solid #c8b68588;
}
button {
	background: #c8b685;
	border: 0;
	border-radius: 24px;
	color: #171b17;
	padding: 12px 20px;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}
#send {
	width: 44px;
	height: 44px;
	padding: 12px;
	display: grid;
	place-items: center;
}
button:disabled {
	opacity: 0.45;
	cursor: default;
}
#send-error {
	grid-column: 1 / -1;
	margin: 0;
	color: #edb5ab;
	font-size: 12px;
}
#ended {
	border-top: 1px solid #c8b68533;
	padding: 22px 0;
	margin-bottom: 18px;
}
h2 {
	font-size: 16px;
	font-weight: 500;
	color: #c8b685;
	margin: 0 0 10px;
}
#closing {
	white-space: pre-line;
	font-size: 13px;
	margin: 0;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}
[hidden] {
	display: none !important;
}
@media (max-width: 400px) {
	main {
		padding: 0 16px;
	}
	header {
		padding: 20px 0;
	}
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}
#end-session {
	background: transparent;
	color: #b7b6ae;
	padding: 3px 6px;
	font-size: 24px;
	line-height: 1;
}
#composer {
	grid-template-columns: auto 1fr auto;
	gap: 9px;
}
#attach {
	background: transparent;
	color: #c8b685;
	padding: 8px;
	font-size: 25px;
	width: 30px;
}
#selected-files {
	grid-column: 1 / -1;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}
#selected-files:empty {
	display: none;
}
.file-chip {
	font-size: 11px;
	padding: 6px 10px;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	background: #26302a;
	color: #e7dfc8;
}
.bubble img,
.bubble video {
	display: block;
	max-width: 100%;
	max-height: 260px;
	border-radius: 8px;
	margin-top: 8px;
}
.file-link {
	display: block;
	color: inherit;
	font-size: 12px;
	margin-top: 8px;
	overflow-wrap: anywhere;
}
.attach-wrap {
	position: relative;
	display: grid;
	place-items: center;
}
#files {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	z-index: 1;
	cursor: pointer;
}
#files:disabled {
	pointer-events: none;
}
#send.loading {
	opacity: 1;
}
#send.loading svg {
	display: none;
}
#send.loading:after {
	content: "";
	width: 18px;
	height: 18px;
	border: 2px solid #171b1733;
	border-top-color: #171b17;
	border-radius: 50%;
	animation: send-spin .8s linear infinite;
}
@keyframes send-spin {
	to {
		transform: rotate(360deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	#send.loading:after {
		animation-duration: 1.6s;
	}
}
main {
	height: 100dvh;
	max-height: 100dvh;
}
header,
#composer,
#ended {
	flex-shrink: 0;
}
#messages {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	scroll-behavior: smooth;
}
#messages:empty {
	flex: 1;
}
#intro:not([hidden]) + #messages:empty {
	display: none;
}
#intro {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bubble p {
	line-height: 1.45;
}

.attachment-preview {
	position: relative;
	min-width: 100px;
	max-width: 260px;
	padding: 8px;
	background: #ffffff0b;
	border-radius: 12px;
	overflow: hidden;
}
.attachment-preview img,
.attachment-preview video {
	display: block;
	width: 100%;
	max-height: 220px;
	object-fit: contain;
	border-radius: 8px;
	margin: 0;
}
.preview-name {
	display: block;
	font-size: 11px;
	max-width: 210px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-top: 6px;
	padding-right: 24px;
}
#selected-files .attachment-preview {
	width: 104px;
}
#selected-files img,
#selected-files video {
	height: 72px;
	object-fit: cover;
}
.upload-ring {
	position: absolute;
	right: 8px;
	bottom: 7px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: conic-gradient(#a18b50 var(--progress, 0%), #ffffff35 0);
	mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
}
.remove-file {
	position: absolute;
	right: 4px;
	top: 4px;
	border-radius: 50%;
	width: 22px;
	height: 22px;
	padding: 0;
	background: #101413cc;
	color: #fff;
}
.retry-message {
	display: block;
	background: transparent;
	color: #6d251d;
	font-size: 11px;
	padding: 8px 0 0;
}
.delivery-failed {
	outline: 1px solid #bf6e60;
}
.bubble .attachment-preview {
	margin-top: 8px;
}
button:focus-visible {
	outline: 2px solid #e7dfc8;
	outline-offset: 3px;
}

/* Flexible bubbles and a composer that grows with multiline messages. */
main {
	width: 100%;
	min-width: 0;
}
#messages {
	width: 100%;
	gap: 12px;
	padding: 22px 0;
}
.bubble {
	min-width: 0;
	width: fit-content;
	max-width: 88%;
	white-space: normal;
	word-break: normal;
	overflow-wrap: anywhere;
}
.bubble p {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.bubble p:empty {
	display: none;
}
#composer {
	width: 100%;
	min-width: 0;
	align-items: end;
}
#message {
	display: block;
	width: 100%;
	height: 48px;
	min-height: 48px;
	max-height: 144px;
	overflow-y: auto;
	scrollbar-width: thin;
	border-radius: 24px;
	line-height: 20px;
	padding: 14px 18px;
	box-sizing: border-box;
}
#attach,
#send,
.attach-wrap {
	align-self: end;
	margin-bottom: 2px;
}
#selected-files {
	display: flex;
	flex-wrap: nowrap;
	max-width: 100%;
	overflow-x: auto;
	gap: 10px;
	padding: 0 0 4px;
	scrollbar-width: thin;
	align-items: start;
}
.attachment-preview {
	box-sizing: border-box;
	min-width: 0;
	width: 100%;
	max-width: 280px;
	padding: 0;
	background: transparent;
	border-radius: 10px;
	white-space: normal;
	overflow: hidden;
}
#selected-files .attachment-preview {
	position: relative;
	flex: 0 0 96px;
	width: 96px;
	padding: 0;
	background: #1d2421;
	border-radius: 10px;
}
#selected-files img,
#selected-files video {
	display: block;
	width: 96px;
	height: 80px;
	object-fit: cover;
	border-radius: 0;
}
.bubble .attachment-preview img,
.bubble .attachment-preview video {
	width: 100%;
	height: auto;
	max-height: 300px;
	object-fit: contain;
	border-radius: 10px;
	margin: 0;
}
.preview-name {
	margin: 0;
	padding: 7px 8px;
	font-size: 11px;
	line-height: 16px;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.bubble .preview-name {
	padding: 6px 0 0;
	color: #343a30;
}
.file-placeholder {
	display: grid;
	place-items: center;
	height: 80px;
	padding: 16px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	color: #c8b685;
	background: #202822;
	border-radius: 8px;
}
.remove-file {
	right: 4px;
	top: 4px;
	width: 24px;
	height: 24px;
	line-height: 24px;
	box-shadow: 0 1px 5px #0004;
}
.upload-ring {
	right: 7px;
	bottom: 7px;
	width: 16px;
	height: 16px;
}
.preview-name {
	padding-right: 28px;
}
#send:focus:not(:focus-visible) {
	outline: none;
}
@media (max-width: 360px) {
	main {
		padding: 0 12px;
	}
	.bubble {
		max-width: 92%;
		padding: 12px 14px;
	}
	#composer {
		gap: 6px;
	}
	#message {
		padding-inline: 13px;
	}
}
@media (max-height: 500px) {
	header {
		padding: 12px 0;
	}
	#messages {
		padding: 12px 0;
	}
	#composer {
		padding-top: 8px;
		padding-bottom: max(8px, env(safe-area-inset-bottom));
	}
}

/* Subtle scrollbars across Chromium/WebView, Safari and Firefox. */
#messages,
#message,
#selected-files {
	scrollbar-width: thin;
	scrollbar-color: #65706466 transparent;
}
#messages::-webkit-scrollbar,
#message::-webkit-scrollbar {
	width: 4px;
}
#selected-files::-webkit-scrollbar {
	height: 3px;
}
#messages::-webkit-scrollbar-track,
#message::-webkit-scrollbar-track,
#selected-files::-webkit-scrollbar-track {
	background: transparent;
}
#messages::-webkit-scrollbar-thumb,
#message::-webkit-scrollbar-thumb,
#selected-files::-webkit-scrollbar-thumb {
	background: #65706466;
	border-radius: 999px;
}
#messages::-webkit-scrollbar-thumb:hover,
#message::-webkit-scrollbar-thumb:hover,
#selected-files::-webkit-scrollbar-thumb:hover {
	background: #89948099;
}
#messages::-webkit-scrollbar-button,
#message::-webkit-scrollbar-button,
#selected-files::-webkit-scrollbar-button {
	display: none;
	width: 0;
	height: 0;
}
#messages::-webkit-scrollbar-corner,
#message::-webkit-scrollbar-corner,
#selected-files::-webkit-scrollbar-corner {
	background: transparent;
}
#message {
	border-radius: 20px;
	clip-path: inset(0 round 20px);
}
@supports selector(::-webkit-scrollbar) {
	#messages,
	#message,
	#selected-files {
		scrollbar-width: auto;
		scrollbar-color: auto;
	}
}

#exit-confirm {
	max-width: min(360px, calc(100vw - 32px));
	width: 100%;
	padding: 28px 24px;
	border: 1px solid #c8b68533;
	border-radius: 20px;
	background: #141b17;
	color: #f5f3eb;
	box-shadow: 0 24px 80px #0008;
	text-align: center;
}
#exit-confirm::backdrop {
	background: #070b09bb;
	backdrop-filter: blur(5px);
}
#exit-confirm h2 {
	color: #f5f3eb;
	font-size: 20px;
	line-height: 1.3;
	margin: 18px 0 12px;
	font-weight: 500;
}
#exit-confirm p {
	font-size: 13px;
	line-height: 1.6;
	margin: 0 0 20px;
}
.exit-emblem {
	margin: auto;
	border: 1px solid #c8b68555;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: #c8b685;
	font: 24px Georgia, serif;
}
.exit-actions {
	display: grid;
	gap: 10px;
}
.exit-actions button {
	min-height: 44px;
}
#exit-stay {
	background: #26312a;
	color: #f5f3eb;
}
#exit-pending {
	color: #d7be83 !important;
}
/* Prevent iOS focus zoom and contain the keyboard-resized viewport. */
html {
	width: 100%;
	height: 100%;
	overflow: hidden;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
body {
	width: 100%;
	height: 100%;
	overflow: hidden;
}
main {
	height: var(--vip-viewport-height, 100dvh);
	min-height: 0;
	max-height: var(--vip-viewport-height, 100dvh);
	overflow: hidden;
	padding-left: max(16px, env(safe-area-inset-left));
	padding-right: max(16px, env(safe-area-inset-right));
}
#composer {
	grid-template-columns: 30px minmax(0, 1fr) 44px;
}
#messages {
	min-width: 0;
}
header {
	min-width: 0;
}
#exit-confirm {
	max-height: calc(var(--vip-viewport-height, 100dvh) - 24px);
	overflow-y: auto;
}
@media (pointer: coarse) {
	#message {
		font-size: 16px;
	}
}
@media (max-height: 400px) {
	#selected-files img,
	#selected-files video,
	#selected-files .file-placeholder {
		height: 40px;
	}
	#selected-files .preview-name {
		padding-block: 3px;
	}
	#selected-files {
		max-height: 68px;
	}
	header {
		padding: 8px 0;
	}
	#composer {
		padding-block: 8px;
	}
}
@media (max-height: 240px) {
	header {
		display: none;
	}
	#selected-files {
		max-height: 44px;
	}
	#selected-files img,
	#selected-files video,
	#selected-files .file-placeholder {
		height: 24px;
	}
	#selected-files .preview-name {
		font-size: 10px;
		line-height: 12px;
		padding-block: 2px;
	}
	#message {
		padding-block: 10px;
	}
	#messages {
		padding: 8px 0;
	}
}
