/* Estilos locales de la conversación; brand.css aporta los tokens compartidos del producto. */
.chat-page {
	min-height: 100vh;
	margin: 0;
	padding: 1rem;
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
	background: var(--bl-page, #f6f7f9);
	color: var(--bl-text, #1f2933);
}

.chat-shell {
	width: min(100%, 42rem);
	min-height: calc(100vh - 2rem);
	margin: 0 auto;
	display: flex;
	align-items: center;
}

.chat-card {
	width: 100%;
	min-height: min(42rem, calc(100vh - 2rem));
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	background: var(--bl-surface, #fff);
	border: 1px solid var(--bl-border, #e2e6ec);
	border-radius: var(--bl-radius-lg, 12px);
	box-shadow: var(--bl-shadow-lg, 0 8px 24px rgb(16 24 40 / 10%));
}

.chat-header h1,
.chat-header p {
	margin: 0;
}

.chat-header h1,
.chat-unavailable h1 {
	font-size: 1.25rem;
}

.chat-header p,
.chat-status {
	color: var(--bl-muted, #6b7683);
}

.chat-status {
	min-height: 1.5rem;
	margin: 1rem 0 0;
}

.chat-status[data-error="true"] {
	color: var(--bl-danger, #c0392b);
}

.chat-transcript {
	flex: 1;
	min-height: 10rem;
	max-height: 55vh;
	margin: 1rem 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
}

.chat-message {
	width: fit-content;
	max-width: min(85%, 32rem);
	margin: 0 0 .75rem;
	padding: .65rem .85rem;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	background: var(--bl-surface-2, #eef1f5);
	border-radius: var(--bl-radius, 8px);
}

.chat-message.is-outgoing {
	margin-left: auto;
	background: var(--bl-brand, #123b4f);
	color: #fff;
}

.chat-message time {
	display: block;
	margin-top: .25rem;
	font-size: .75rem;
	opacity: .75;
}

.chat-form {
	display: flex;
	align-items: end;
	gap: .6rem;
}

.chat-form textarea {
	flex: 1;
	min-width: 0;
	resize: vertical;
	padding: .7rem;
	font: inherit;
	color: var(--bl-text, #1f2933);
	background: var(--bl-surface, #fff);
	border: 1px solid var(--bl-border, #e2e6ec);
	border-radius: var(--bl-radius, 8px);
}

.chat-form button {
	min-height: 2.8rem;
	padding: .55rem 1rem;
	font: inherit;
	color: #fff;
	background: var(--bl-brand, #123b4f);
	border: 0;
	border-radius: var(--bl-radius, 8px);
	cursor: pointer;
}

.chat-form button:disabled,
.chat-form textarea:disabled {
	opacity: .6;
	cursor: not-allowed;
}

.chat-form :focus-visible {
	outline: 3px solid var(--bl-accent, #e8a33d);
	outline-offset: 2px;
}

.chat-unavailable {
	min-height: 0;
	align-self: center;
}

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

[hidden] {
	display: none !important;
}

@media (max-width: 30rem) {
	.chat-page {
		padding: 0;
	}

	.chat-shell,
	.chat-card {
		min-height: 100vh;
	}

	.chat-card {
		padding: 1rem;
		border: 0;
		border-radius: 0;
	}
}
