/* DeepSeek Chat Español — widget styles.
   System font stack only: zero external requests, fast paint, good CWV. */

.dsce {
	--dsce-primary: #4D6BFE;
	--dsce-radius: 16px;
	--dsce-bg: #ffffff;
	--dsce-surface: #f5f6fa;
	--dsce-border: #e6e8ef;
	--dsce-text: #1c2333;
	--dsce-muted: #6a7185;
	--dsce-bot-bubble: #f1f3f9;
	--dsce-err-bg: #fdecec;
	--dsce-err-text: #9b1c1c;
	--dsce-err-border: #f5c2c2;
	margin: 1.5em auto;
	max-width: 760px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.dsce, .dsce * { box-sizing: border-box; }

.dsce[data-theme="dark"] {
	--dsce-bg: #12151f;
	--dsce-surface: #1a1e2c;
	--dsce-border: #2a2f42;
	--dsce-text: #e8eaf2;
	--dsce-muted: #98a0b8;
	--dsce-bot-bubble: #222739;
	--dsce-err-bg: #3a1d1d;
	--dsce-err-text: #ffb4b4;
	--dsce-err-border: #5a2a2a;
}

@media (prefers-color-scheme: dark) {
	.dsce[data-theme="auto"] {
		--dsce-bg: #12151f;
		--dsce-surface: #1a1e2c;
		--dsce-border: #2a2f42;
		--dsce-text: #e8eaf2;
		--dsce-muted: #98a0b8;
		--dsce-bot-bubble: #222739;
		--dsce-err-bg: #3a1d1d;
		--dsce-err-text: #ffb4b4;
		--dsce-err-border: #5a2a2a;
	}
}

/* --- server-rendered SEO elements above the card --- */

.dsce-title {
	margin: 0 0 .4em;
	font-size: 1.45em;
	line-height: 1.25;
	font-weight: 700;
}

.dsce-intro {
	margin: 0 0 1.1em;
	opacity: .88;
}
.dsce-intro p { margin: 0 0 .6em; }
.dsce-intro p:last-child { margin: 0; }

/* --- card --- */

.dsce-card {
	background: var(--dsce-bg);
	border: 1px solid var(--dsce-border);
	border-radius: var(--dsce-radius);
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(15, 23, 42, .06);
	color: var(--dsce-text);
}

.dsce-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--dsce-border);
	background: var(--dsce-surface);
}

.dsce-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}

.dsce-status {
	font-size: 13px;
	color: var(--dsce-muted);
}

.dsce-new {
	margin-left: auto;
	background: none;
	border: 1px solid var(--dsce-border);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12.5px;
	font-family: inherit;
	color: var(--dsce-muted);
	cursor: pointer;
	transition: color .15s, border-color .15s;
}
.dsce-new:hover {
	color: var(--dsce-primary);
	border-color: var(--dsce-primary);
}

/* --- messages --- */

.dsce-messages {
	height: var(--dsce-h, 520px);
	overflow-y: auto;
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	overscroll-behavior: contain;
}

.dsce-messages::-webkit-scrollbar { width: 8px; }
.dsce-messages::-webkit-scrollbar-thumb {
	background: var(--dsce-border);
	border-radius: 8px;
}

.dsce-msg {
	display: flex;
	animation: dsce-in .18s ease-out;
}

@keyframes dsce-in {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.dsce-msg { animation: none; }
	.dsce-dots span { animation: none; }
}

.dsce-user { justify-content: flex-end; }

.dsce-bubble {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 15px;
	line-height: 1.55;
	overflow-wrap: anywhere;
}

.dsce-user .dsce-bubble {
	background: var(--dsce-primary);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.dsce-bot .dsce-bubble {
	background: var(--dsce-bot-bubble);
	color: var(--dsce-text);
	border-bottom-left-radius: 4px;
}

.dsce-error .dsce-bubble {
	background: var(--dsce-err-bg);
	color: var(--dsce-err-text);
	border: 1px solid var(--dsce-err-border);
}

/* content inside bubbles */

.dsce-bubble p { margin: 0 0 .7em; }
.dsce-bubble p:last-child { margin: 0; }
.dsce-bubble ul, .dsce-bubble ol { margin: .4em 0 .7em 1.25em; padding: 0; }
.dsce-bubble li { margin: .25em 0; }
.dsce-bubble .dsce-h { margin-top: .5em; }

.dsce-bubble code {
	background: rgba(99, 110, 140, .16);
	padding: .15em .4em;
	border-radius: 6px;
	font-size: .9em;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.dsce-user .dsce-bubble code {
	background: rgba(255, 255, 255, .22);
	color: #fff;
}

.dsce-bubble pre {
	background: #0f172a;
	color: #e2e8f0;
	padding: 12px 14px;
	border-radius: 10px;
	overflow-x: auto;
	margin: .6em 0;
	font-size: 13px;
	line-height: 1.5;
}
.dsce-bubble pre code {
	background: none;
	padding: 0;
	color: inherit;
	font-size: inherit;
}

.dsce-bubble a {
	color: var(--dsce-primary);
	text-decoration: underline;
}
.dsce-user .dsce-bubble a { color: #fff; }

.dsce-stream { white-space: pre-wrap; }

/* typing dots */

.dsce-dots {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	height: 1.4em;
}
.dsce-dots span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--dsce-muted);
	animation: dsce-bounce 1s infinite;
}
.dsce-dots span:nth-child(2) { animation-delay: .15s; }
.dsce-dots span:nth-child(3) { animation-delay: .3s; }

@keyframes dsce-bounce {
	0%, 60%, 100% { opacity: .35; transform: translateY(0); }
	30%           { opacity: 1;   transform: translateY(-3px); }
}

/* --- input bar --- */

.dsce-inputbar {
	display: flex;
	gap: 10px;
	align-items: flex-end;
	padding: 12px;
	border-top: 1px solid var(--dsce-border);
	background: var(--dsce-surface);
}

.dsce-input {
	flex: 1;
	resize: none;
	border: 1px solid var(--dsce-border);
	border-radius: 12px;
	padding: 10px 12px;
	font: inherit;
	font-size: 15px;
	line-height: 1.45;
	background: var(--dsce-bg);
	color: var(--dsce-text);
	max-height: 140px;
	min-height: 42px;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
}
.dsce-input::placeholder { color: var(--dsce-muted); }
.dsce-input:focus {
	border-color: var(--dsce-primary);
	box-shadow: 0 0 0 3px rgba(77, 107, 254, .18);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsce-primary) 18%, transparent);
}

.dsce-send {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	background: var(--dsce-primary);
	color: #fff;
	border-radius: 12px;
	padding: 0 16px;
	height: 42px;
	font-family: inherit;
	font-size: 14.5px;
	font-weight: 600;
	cursor: pointer;
	transition: filter .15s, transform .05s;
}
.dsce-send:hover { filter: brightness(1.08); }
.dsce-send:active { transform: scale(.97); }
.dsce-send:disabled { opacity: .55; cursor: not-allowed; }

.dsce button:focus-visible,
.dsce .dsce-input:focus-visible {
	outline: 2px solid var(--dsce-primary);
	outline-offset: 2px;
}

/* --- footer --- */

.dsce-disclaimer {
	margin: 0;
	padding: 8px 14px 12px;
	font-size: 12px;
	color: var(--dsce-muted);
	text-align: center;
	background: var(--dsce-surface);
}

.dsce-noscript {
	padding: 14px;
	text-align: center;
	color: var(--dsce-muted);
}

/* --- responsive --- */

@media (max-width: 520px) {
	.dsce-send-label { display: none; }
	.dsce-send { padding: 0 13px; }
	.dsce-bubble { max-width: 92%; font-size: 14.5px; }
	.dsce-messages { padding: 14px 12px; }
}
