/* UAP Chat */
.uapc-host { position: relative; }
.uapc-embed { overflow: hidden; border-radius: 10px; }
.uapc-shade {
	position: absolute; inset: 0; z-index: 200;
	background: #fff; opacity: .5; cursor: pointer;
}
.krychalka.inwindow .uapc-shade { display: none !important; }

.uapc {
	--uapc-line: var(--bb-content-border-color, #e7e9ec);
	--uapc-accent: var(--bb-primary-color, #385dff);
	--uapc-muted: var(--bb-alternate-text-color, #8a8f98);
	--uapc-text: var(--bb-body-text-color, #303030);
	--uapc-bg: var(--bb-content-background-color, #fff);
	display: flex; flex-direction: column;
	height: var(--uapc-h, 430px);
	text-align: left; font-size: 14px; line-height: 1.45; color: var(--uapc-text);
}
.krychalka.uapc-host { padding-bottom: 12px !important; }
.krychalka.uapc-host.inwindow { display: flex !important; flex-direction: column; }
.krychalka.inwindow .uapc { flex: 1 1 auto; min-height: 0; height: auto; }

.uapc-list {
	flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
	padding: 2px 4px 6px; scrollbar-width: thin;
}
.uapc-empty { color: var(--uapc-muted); text-align: center; padding: 40px 0; }

.uapc-msg {
	display: flex; gap: 10px; padding: 7px 6px;
	border-bottom: 1px solid var(--uapc-line);
}
.uapc-msg:last-child { border-bottom: 0; }
.uapc-own { background: color-mix(in srgb, var(--uapc-accent) 5%, transparent); border-radius: 8px; }
.uapc-av {
	width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
	object-fit: cover; background: var(--uapc-line);
}
.uapc-body { flex: 1 1 auto; min-width: 0; }
.uapc-head { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.uapc-name { font-weight: 600; color: var(--uapc-accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uapc-name:hover { text-decoration: underline; }
.uapc-adm::after { content: " ★"; color: #e0473e; font-size: 11px; }
.uapc-time { margin-left: auto; color: var(--uapc-muted); font-size: 11px; white-space: nowrap; }
.uapc .uapc-reply, .uapc .uapc-del {
	border: 0 !important; background: none !important; box-shadow: none !important;
	min-height: 0; height: auto; width: auto; border-radius: 0;
	padding: 0 2px; margin: 0; cursor: pointer;
	color: var(--uapc-muted); font-size: 13px; line-height: 1; opacity: 0; transition: opacity .15s;
}
.uapc .uapc-del { font-size: 16px; }
.uapc-msg:hover .uapc-reply, .uapc-msg:hover .uapc-del,
.uapc .uapc-reply:focus, .uapc .uapc-del:focus { opacity: 1; }
.uapc .uapc-reply:hover { color: var(--uapc-accent); }
.uapc .uapc-del:hover { color: #e0473e; }
@media (hover: none) { .uapc .uapc-reply, .uapc .uapc-del { opacity: .6; } }
.uapc-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.uapc-text a { color: var(--uapc-accent); }

.uapc-form {
	display: flex; align-items: flex-end; gap: 8px;
	margin: 0 !important; padding-top: 10px; border-top: 1px solid var(--uapc-line);
}
.uapc-me { width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; margin-bottom: 4px; object-fit: cover; }
.uapc-field { position: relative; flex: 1 1 auto; min-width: 0; }
.uapc .uapc-input {
	display: block; width: 100%; box-sizing: border-box; resize: none;
	min-height: 40px; max-height: 120px; margin: 0;
	padding: 9px 44px 9px 16px;
	border: 1px solid var(--uapc-line); border-radius: 20px;
	background: var(--uapc-bg); color: var(--uapc-text);
	font: inherit; line-height: 20px; box-shadow: none;
	transition: border-color .15s, box-shadow .15s;
}
.uapc .uapc-input:focus {
	outline: none; border-color: var(--uapc-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--uapc-accent) 15%, transparent);
}
.uapc-count { position: absolute; right: 14px; bottom: 11px; font-size: 11px; color: var(--uapc-muted); pointer-events: none; }
.uapc .uapc-send {
	flex: 0 0 40px; width: 40px; height: 40px; padding: 0; margin: 0;
	display: inline-flex; align-items: center; justify-content: center;
	border: 0; border-radius: 50%; cursor: pointer;
	background: var(--uapc-accent); color: #fff;
	transition: transform .1s, opacity .15s;
}
.uapc .uapc-send:hover:not(:disabled) { transform: scale(1.06); }
.uapc .uapc-send:disabled { opacity: .35; cursor: default; }
.uapc-error { margin-top: 6px; font-size: 12px; color: #e0473e; }
.uapc-guest {
	padding: 12px; border-top: 1px solid var(--uapc-line);
	text-align: center; color: var(--uapc-muted); font-size: 13px;
}
.uapc { container-type: inline-size; }
@container (max-width: 420px) {
	.uapc-me { display: none; }
	.uapc-msg { gap: 8px; }
}
@media (max-width: 600px) {
	.krychalka .uapc { padding: 0 10px; box-sizing: border-box; }
}
.uapc-more { min-height: 24px; text-align: center; font-size: 12px; color: var(--uapc-muted); padding: 4px 0; }
