.alycon-conversation {
	--alycon-message-font: 16px;
	--alycon-name-font: 13px;
	--alycon-narration-font: 15px;
	--alycon-narration-color: #6b7280;
	--alycon-narration-style: italic;
	--alycon-radius: 18px;
	--alycon-gap: 18px;
	--alycon-muted: #6b7280;
	box-sizing: border-box;
	width: 100%;
	margin: 1.5rem 0;
	font: inherit;
}

.alycon-conversation *,
.alycon-conversation *::before,
.alycon-conversation *::after {
	box-sizing: inherit;
}

.alycon-message-list {
	display: grid;
	gap: var(--alycon-gap);
	width: 100%;
	overflow: visible;
}

.alycon-message {
	display: flex;
	width: 100%;
	overflow: visible;
}

.alycon-message-lane {
	width: min(78%, 46rem);
	max-width: 100%;
	min-width: 0;
	overflow: visible;
}

.alycon-message-left {
	justify-content: flex-start;
}

.alycon-message-right {
	justify-content: flex-end;
}

.alycon-message-inner {
	display: flex;
	align-items: flex-end;
	gap: 9px;
	min-width: 0;
}

.alycon-message-right .alycon-message-inner {
	flex-direction: row-reverse;
}

.alycon-avatar {
	flex: 0 0 36px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	overflow: hidden;
	background: #e5e7eb;
}

.alycon-avatar img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.alycon-message-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	max-width: 100%;
}

.alycon-message-right .alycon-message-content {
	align-items: flex-end;
}

.alycon-message-meta {
	display: flex;
	align-items: baseline;
	gap: .4em;
	max-width: 100%;
	margin: 0 9px 5px;
	font-size: var(--alycon-name-font);
	line-height: 1.25;
	color: var(--alycon-muted);
}

.alycon-message-right .alycon-message-meta {
	justify-content: flex-end;
}

.alycon-participant-name {
	font-weight: 600;
}

.alycon-participant-name + .alycon-timestamp::before,
.alycon-timestamp + .alycon-participant-name::before {
	content: '·';
	margin-right: .4em;
}

.alycon-timestamp {
	font-size: .92em;
	font-weight: 400;
	white-space: nowrap;
}

.alycon-bubble {
	position: relative;
	width: fit-content;
	max-width: 100%;
	padding: .68em .9em;
	border-radius: var(--alycon-radius);
	background: var(--alycon-bubble-color, #0a84ff);
	color: var(--alycon-bubble-text, #fff);
	box-shadow: 0 2px 10px rgba(17, 24, 39, .10);
	font-size: var(--alycon-message-font);
	line-height: 1.48;
	word-break: break-word;
	overflow: visible;
}

.alycon-no-shadow .alycon-bubble,
.alycon-settings-preview.alycon-no-shadow .alycon-bubble {
	box-shadow: none !important;
}

.alycon-message-text > :first-child {
	margin-top: 0;
}

.alycon-message-text > :last-child {
	margin-bottom: 0;
}

.alycon-message-text {
	font-size: inherit;
	line-height: inherit;
}

.alycon-message-text p {
	color: inherit;
	font: inherit;
}

.alycon-message-text a {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: .08em;
	text-underline-offset: .12em;
}

/* Modern: soft, compact messenger bubbles. */
.alycon-preset-modern .alycon-bubble {
	border-radius: max(14px, var(--alycon-radius));
	box-shadow: 0 1px 5px rgba(17, 24, 39, .10);
}

.alycon-preset-modern .alycon-participant-name {
	font-weight: 500;
}

/* Material: card-like messages with stronger elevation and squarer corners. */
.alycon-preset-material .alycon-bubble {
	padding: .82em 1em;
	border-radius: min(12px, var(--alycon-radius));
	box-shadow: 0 4px 14px rgba(17, 24, 39, .18);
}

.alycon-preset-material .alycon-message-meta {
	margin-bottom: 6px;
}

.alycon-preset-material .alycon-participant-name {
	font-weight: 700;
	letter-spacing: .02em;
}

/* Minimal: text-first treatment with participant color only as an accent line. */
.alycon-preset-minimal .alycon-bubble {
	padding: .18em 0 .42em;
	border-radius: 0;
	border-bottom: 2px solid var(--alycon-bubble-color, #0a84ff);
	background: transparent;
	color: inherit;
	box-shadow: none;
}

.alycon-preset-minimal .alycon-message-meta {
	margin-left: 0;
	margin-right: 0;
}

.alycon-preset-minimal .alycon-participant-name {
	color: var(--alycon-bubble-color, #0a84ff);
}

/* Classic: unmistakable speech bubbles with visible tails. */
.alycon-preset-classic .alycon-bubble {
	border-radius: max(8px, calc(var(--alycon-radius) * .75));
	box-shadow: 0 2px 7px rgba(17, 24, 39, .13);
}

.alycon-preset-classic .alycon-bubble::after {
	content: '';
	position: absolute;
	left: -9px;
	bottom: 10px;
	width: 11px;
	height: 15px;
	background: var(--alycon-bubble-color, #0a84ff);
	clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.alycon-preset-classic .alycon-message-right .alycon-bubble::after {
	left: auto;
	right: -9px;
	clip-path: polygon(0 0, 100% 100%, 0 100%);
}

/* Editorial: book/interview dialogue without bubbles while preserving participant alignment. */
.alycon-preset-editorial .alycon-message-lane {
	width: min(78%, 46rem);
}

.alycon-preset-editorial .alycon-message-inner,
.alycon-preset-editorial .alycon-message-right .alycon-message-inner {
	display: block;
}

.alycon-preset-editorial .alycon-avatar {
	display: none;
}

.alycon-preset-editorial .alycon-message-content {
	align-items: flex-start;
	max-width: 100%;
	text-align: left;
}

.alycon-preset-editorial .alycon-message-right .alycon-message-content {
	align-items: flex-end;
	text-align: right;
}

.alycon-preset-editorial .alycon-message-meta {
	margin: 0 0 .25rem;
}

.alycon-preset-editorial .alycon-participant-name {
	font-weight: 700;
	letter-spacing: .045em;
	text-transform: uppercase;
}

.alycon-preset-editorial .alycon-bubble {
	display: block;
	width: fit-content;
	text-align: inherit;
	max-width: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	box-shadow: none;
	font-family: Georgia, 'Times New Roman', serif;
	line-height: 1.65;
}

.alycon-preset-editorial .alycon-message-text > p:first-child::before,
.alycon-preset-editorial .alycon-message-text > p:last-child::after {
	color: var(--alycon-bubble-color, currentColor);
	font-size: 1.12em;
	font-weight: 700;
}

.alycon-preset-editorial .alycon-message-text > p:first-child::before {
	content: '“';
	margin-right: .04em;
}

.alycon-preset-editorial .alycon-message-text > p:last-child::after {
	content: '”';
	margin-left: .04em;
}

.alycon-preset-editorial .alycon-message-text {
	min-width: 0;
}

.alycon-preset-editorial .alycon-participant-name {
	color: var(--alycon-bubble-color, var(--alycon-muted));
}


/* Storytelling entries that do not belong to a participant. */
.alycon-story-entry {
	width: 100%;
	min-width: 0;
}

.alycon-entry-narration {
	display: flex;
	justify-content: flex-start;
	color: var(--alycon-narration-color, #6b7280);
	font-size: var(--alycon-narration-font, 15px);
	font-style: var(--alycon-narration-style, italic);
	line-height: 1.6;
}

.alycon-conversation[data-narration-align="center"] .alycon-entry-narration {
	justify-content: center;
	text-align: center;
}

.alycon-conversation[data-narration-align="right"] .alycon-entry-narration {
	justify-content: flex-end;
	text-align: right;
}

.alycon-narration-text {
	width: min(88%, 48rem);
	min-width: 0;
}

.alycon-narration-text > :first-child {
	margin-top: 0;
}

.alycon-narration-text > :last-child {
	margin-bottom: 0;
}

.alycon-entry-divider {
	padding: .35rem 0;
}

.alycon-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	color: var(--alycon-muted);
	font-size: .82em;
	font-weight: 600;
	line-height: 1.35;
	text-align: center;
}

.alycon-divider::before,
.alycon-divider::after {
	content: '';
	flex: 1 1 auto;
	height: 1px;
	background: currentColor;
	opacity: .25;
}

.alycon-divider span {
	flex: 0 1 auto;
	max-width: 72%;
}

.alycon-entry-system {
	text-align: center;
}

.alycon-system-notice {
	display: inline-block;
	max-width: min(86%, 42rem);
	padding: .36em .72em;
	border-radius: 999px;
	background: rgba(107, 114, 128, .10);
	color: var(--alycon-muted);
	font-size: .82em;
	line-height: 1.4;
}

.alycon-preset-editorial .alycon-narration-text,
.alycon-preset-editorial .alycon-divider,
.alycon-preset-editorial .alycon-system-notice {
	font-family: Georgia, 'Times New Roman', serif;
}

.alycon-preset-editorial .alycon-system-notice {
	padding: 0;
	background: transparent;
}

/* Settings preview helpers. */
.alycon-conversation.alycon-preview-hide-names .alycon-participant-name,
.alycon-conversation.alycon-preview-hide-timestamps .alycon-timestamp,
.alycon-conversation.alycon-preview-hide-avatars .alycon-avatar {
	display: none !important;
}

.alycon-conversation.alycon-preview-hide-names .alycon-timestamp::before,
.alycon-conversation.alycon-preview-hide-timestamps .alycon-participant-name::before {
	display: none;
}

.alycon-conversation.alycon-preview-hide-names.alycon-preview-hide-timestamps .alycon-message-meta {
	display: none;
}

.alycon-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 18px;
}

.alycon-controls[hidden] {
	display: none !important;
}

.alycon-control {
	appearance: none;
	border: 1px solid currentColor;
	border-radius: 999px;
	padding: .58em 1em;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.alycon-control:hover,
.alycon-control:focus-visible {
	background: rgba(127,127,127,.10);
}

/* Progressive enhancement: content remains readable without JavaScript.
 * In progressive reveal modes, future entries are removed from layout entirely
 * so the conversation grows naturally as entries are revealed.
 */
.alycon-conversation.alycon-js.alycon-reveal-scroll [data-alycon-entry],
.alycon-conversation.alycon-js.alycon-reveal-step [data-alycon-entry],
.alycon-conversation.alycon-js.alycon-reveal-autoplay [data-alycon-entry] {
	opacity: 0;
	transform: translateY(10px);
	transition: opacity .3s ease, transform .3s ease;
	pointer-events: none;
}

.alycon-conversation.alycon-js.alycon-reveal-scroll [data-alycon-entry][aria-hidden="true"],
.alycon-conversation.alycon-js.alycon-reveal-step [data-alycon-entry][aria-hidden="true"],
.alycon-conversation.alycon-js.alycon-reveal-autoplay [data-alycon-entry][aria-hidden="true"] {
	display: none !important;
}

.alycon-conversation.alycon-js [data-alycon-entry].is-visible {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
	.alycon-conversation.alycon-js [data-alycon-entry] {
		transition: none !important;
		transform: none !important;
	}
}

@media (max-width: 600px) {
	.alycon-message-lane {
		width: min(90%, 46rem);
	}

	.alycon-avatar {
		flex-basis: 30px;
		width: 30px;
		height: 30px;
	}

	.alycon-preset-editorial .alycon-message-lane {
		width: min(90%, 46rem);
	}
}

.alycon-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}


/* Per-message typing indicators.
 * Bubble and indicator never share layout space: while typing, only the
 * indicator participates in document flow. This is especially important for
 * image and link attachments, which can be substantially taller than text.
 */
.alycon-message-stage {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 100%;
	max-width: 100%;
	min-width: 0;
}

.alycon-message-right .alycon-message-stage {
	align-items: flex-end;
}

.alycon-typing-indicator {
	pointer-events: none;
}

.alycon-message:not(.is-typing) .alycon-typing-indicator {
	display: none !important;
}

.alycon-message.is-typing .alycon-bubble {
	display: none !important;
}

.alycon-typing-indicator--bubble {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 3.35em;
	min-height: 2.2em;
	padding: .58em .72em;
	border-radius: max(14px, var(--alycon-radius));
	background: var(--alycon-bubble-color, #0a84ff);
	color: var(--alycon-bubble-text, #fff);
	box-shadow: 0 1px 5px rgba(17, 24, 39, .10);
	font-size: var(--alycon-message-font);
}

.alycon-no-shadow .alycon-typing-indicator--bubble {
	box-shadow: none;
}

.alycon-typing-indicator--text {
	display: inline-flex;
	align-items: baseline;
	min-height: 1.65em;
	color: var(--alycon-muted);
	font-size: var(--alycon-message-font);
	font-style: italic;
	line-height: 1.5;
	white-space: nowrap;
}

.alycon-typing-dots {
	display: inline-flex;
	align-items: center;
	gap: .22em;
	margin-left: .22em;
}

.alycon-typing-indicator--bubble .alycon-typing-dots {
	gap: .24em;
	margin-left: 0;
}

.alycon-typing-dot {
	display: inline-block;
	width: .36em;
	height: .36em;
	border-radius: 50%;
	background: currentColor;
	opacity: .35;
}

.alycon-typing-indicator--bubble .alycon-typing-dot {
	width: .42em;
	height: .42em;
	animation: alycon-typing-bubble-dot 1.05s ease-in-out infinite;
}

.alycon-typing-indicator--bubble .alycon-typing-dot:nth-child(2) {
	animation-delay: .14s;
}

.alycon-typing-indicator--bubble .alycon-typing-dot:nth-child(3) {
	animation-delay: .28s;
}

.alycon-typing-indicator--text .alycon-typing-dot {
	width: .18em;
	height: .18em;
	margin: 0;
	border-radius: 50%;
	opacity: 0;
}

.alycon-typing-indicator--text .alycon-typing-dot:nth-child(1) {
	opacity: 1;
}

.alycon-typing-indicator--text .alycon-typing-dot:nth-child(2) {
	animation: alycon-typing-text-dot-two 1.2s steps(1, end) infinite;
}

.alycon-typing-indicator--text .alycon-typing-dot:nth-child(3) {
	animation: alycon-typing-text-dot-three 1.2s steps(1, end) infinite;
}

@keyframes alycon-typing-bubble-dot {
	0%,
	60%,
	100% {
		opacity: .35;
		transform: translateY(0) scale(.92);
	}
	30% {
		opacity: 1;
		transform: translateY(-.13em) scale(1.06);
	}
}

@keyframes alycon-typing-text-dot-two {
	0%,
	32% {
		opacity: 0;
	}
	33%,
	100% {
		opacity: 1;
	}
}

@keyframes alycon-typing-text-dot-three {
	0%,
	65% {
		opacity: 0;
	}
	66%,
	100% {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.alycon-typing-dot {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}


/* Message images and link preview cards. */
.alycon-bubble--has-image,
.alycon-bubble--has-link {
	width: min(24rem, 100%);
}

.alycon-message-left .alycon-bubble--has-image,
.alycon-message-left .alycon-bubble--has-link {
	align-self: flex-start;
}

.alycon-message-right .alycon-bubble--has-image,
.alycon-message-right .alycon-bubble--has-link {
	align-self: flex-end;
}

.alycon-bubble--has-image .alycon-message-text,
.alycon-bubble--has-link .alycon-message-text {
	margin-bottom: .65em;
}

.alycon-bubble--attachment-only .alycon-message-text {
	display: none;
}

.alycon-message-image {
	display: block;
	width: 100%;
	max-width: 22rem;
	padding: 0;
	overflow: hidden;
	border: 0;
	border-radius: max(10px, calc(var(--alycon-radius) - 5px));
	background: transparent;
	color: inherit;
	cursor: zoom-in;
}

.alycon-message-image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 22rem;
	object-fit: cover;
}

.alycon-bubble--attachment-only.alycon-bubble--has-image {
	padding: .28em;
}

.alycon-link-preview {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	overflow: hidden;
	border-radius: max(10px, calc(var(--alycon-radius) - 5px));
	background: rgba(255, 255, 255, .94);
	color: #111827 !important;
	text-decoration: none !important;
	box-shadow: inset 0 0 0 1px rgba(17, 24, 39, .10);
}

.alycon-link-preview:hover,
.alycon-link-preview:focus-visible {
	background: #fff;
	box-shadow: inset 0 0 0 2px rgba(17, 24, 39, .18);
}

.alycon-link-preview-media {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 8;
	overflow: hidden;
	background: #e5e7eb;
}

.alycon-link-preview-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.alycon-link-preview--icon {
	grid-template-columns: 76px minmax(0, 1fr);
	align-items: center;
	column-gap: .9em;
	padding: .72em .78em .72em .72em;
}

.alycon-link-preview--icon .alycon-link-preview-media {
	width: 76px;
	height: 76px;
	aspect-ratio: 1;
	margin: 0;
	border-radius: 14px;
	background: transparent;
}

.alycon-link-preview--icon .alycon-link-preview-media img {
	object-fit: contain;
}

.alycon-link-preview--icon .alycon-link-preview-body {
	padding: 0;
}


.alycon-link-preview-body {
	display: grid;
	gap: .22em;
	padding: .7em .78em .78em;
}

.alycon-link-preview-domain {
	overflow: hidden;
	color: #6b7280;
	font-size: .72em;
	font-weight: 600;
	letter-spacing: .03em;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.alycon-link-preview-title {
	display: -webkit-box;
	overflow: hidden;
	font-weight: 700;
	line-height: 1.32;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.alycon-link-preview-description {
	display: -webkit-box;
	overflow: hidden;
	color: #4b5563;
	font-size: .88em;
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.alycon-preset-minimal .alycon-bubble--has-image,
.alycon-preset-minimal .alycon-bubble--has-link {
	padding-bottom: .55em;
}

.alycon-preset-material .alycon-link-preview {
	border-radius: 8px;
}

.alycon-preset-classic .alycon-message-image,
.alycon-preset-classic .alycon-link-preview {
	border-radius: max(8px, calc(var(--alycon-radius) * .55));
}

/* Accessible plugin lightbox. */
.alycon-lightbox {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: grid;
	place-items: center;
	padding: clamp(18px, 4vw, 52px);
	background: rgba(0, 0, 0, .88);
	opacity: 0;
	visibility: hidden;
	transition: opacity .18s ease, visibility .18s ease;
}

.alycon-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.alycon-lightbox__frame {
	position: relative;
	display: grid;
	place-items: center;
	width: min(96vw, 1200px);
	max-height: 92vh;
}

.alycon-lightbox__image {
	display: block;
	max-width: 100%;
	max-height: 88vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 18px 70px rgba(0, 0, 0, .45);
}

.alycon-lightbox__close {
	position: absolute;
	top: -14px;
	right: -14px;
	display: grid;
	width: 42px;
	height: 42px;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #111827;
	font: 700 28px/1 sans-serif;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.alycon-lightbox__close:focus-visible {
	outline: 3px solid #72aee6;
	outline-offset: 3px;
}

body.alycon-lightbox-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.alycon-bubble--has-image,
	.alycon-bubble--has-link {
		width: min(20rem, 100%);
	}

	.alycon-link-preview--icon {
		grid-template-columns: 62px minmax(0, 1fr);
		column-gap: .72em;
		padding: .62em .68em .62em .62em;
	}

	.alycon-link-preview--icon .alycon-link-preview-media {
		width: 62px;
		height: 62px;
		margin: 0;
		border-radius: 12px;
	}

	.alycon-lightbox {
		padding: 18px;
	}

	.alycon-lightbox__close {
		top: -10px;
		right: -8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.alycon-lightbox {
		transition: none;
	}
}
