/*!
 * DeepSeek Chat — v1.1
 * Professional palette · Light theme default · WCAG AA contrast
 * All selectors scoped under .dsc-root to avoid theme bleed.
 */

/* ───────────────── Design tokens — LIGHT (default) ───────────────── */
.dsc-root,
.dsc-root[data-theme="light"] {
	--dsc-bg:           #ffffff;
	--dsc-surface:      #f8fafc;
	--dsc-surface-2:    #f1f5f9;
	--dsc-elevated:     #ffffff;
	--dsc-border:       #e2e8f0;
	--dsc-border-strong:#cbd5e1;

	--dsc-text:         #0f172a;  /* 17.7:1 on white — AAA */
	--dsc-text-soft:    #334155;  /* 10.4:1 — AAA */
	--dsc-text-muted:   #64748b;  /* 4.8:1  — AA */

	--dsc-brand:        #4f46e5;  /* indigo-600 — 7.45:1 on white, AAA for normal text */
	--dsc-brand-2:      #7c3aed;  /* violet-600 */
	--dsc-brand-soft:   #eef2ff;
	--dsc-brand-soft-2: #ede9fe;

	--dsc-accent:       #06b6d4;  /* cyan-500 — for AI accent gradient */
	--dsc-success:      #16a34a;
	--dsc-danger:       #dc2626;

	--dsc-user-bg:      linear-gradient(135deg, #4f46e5, #7c3aed);
	--dsc-user-fg:      #ffffff;
	--dsc-ai-bg:        #ffffff;
	--dsc-ai-fg:        #0f172a;
	--dsc-ai-border:    #e2e8f0;

	--dsc-input-bg:     #ffffff;
	--dsc-input-bd:     #cbd5e1;
	--dsc-input-bd-fc:  #4f46e5;
	--dsc-input-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);

	--dsc-shadow-sm:    0 1px 2px rgba(15, 23, 42, 0.05);
	--dsc-shadow:       0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
	--dsc-shadow-lg:    0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);

	--dsc-radius:       12px;
	--dsc-radius-sm:    8px;
	--dsc-radius-xs:    6px;

	--dsc-font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--dsc-mono:         ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ───────────────── Design tokens — DARK ───────────────── */
.dsc-root[data-theme="dark"] {
	--dsc-bg:           #0f172a;
	--dsc-surface:      #1e293b;
	--dsc-surface-2:    #334155;
	--dsc-elevated:     #1e293b;
	--dsc-border:       #334155;
	--dsc-border-strong:#475569;

	--dsc-text:         #f8fafc;  /* 17.7:1 on slate-900 */
	--dsc-text-soft:    #e2e8f0;
	--dsc-text-muted:   #94a3b8;

	--dsc-brand:        #818cf8;  /* indigo-400 — 7.4:1 on slate-900, AAA */
	--dsc-brand-2:      #a78bfa;  /* violet-400 */
	--dsc-brand-soft:   rgba(129, 140, 248, 0.15);
	--dsc-brand-soft-2: rgba(167, 139, 250, 0.15);

	--dsc-accent:       #22d3ee;
	--dsc-success:      #4ade80;
	--dsc-danger:       #f87171;

	--dsc-user-bg:      linear-gradient(135deg, #4f46e5, #7c3aed);
	--dsc-user-fg:      #ffffff;
	--dsc-ai-bg:        #1e293b;
	--dsc-ai-fg:        #f8fafc;
	--dsc-ai-border:    #334155;

	--dsc-input-bg:     #0f172a;
	--dsc-input-bd:     #475569;
	--dsc-input-bd-fc:  #818cf8;
	--dsc-input-shadow: 0 0 0 4px rgba(129, 140, 248, 0.15);

	--dsc-shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.3);
	--dsc-shadow:       0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
	--dsc-shadow-lg:    0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Auto: respect OS preference */
@media (prefers-color-scheme: dark) {
	.dsc-root[data-theme="auto"] {
		--dsc-bg:           #0f172a;
		--dsc-surface:      #1e293b;
		--dsc-surface-2:    #334155;
		--dsc-elevated:     #1e293b;
		--dsc-border:       #334155;
		--dsc-border-strong:#475569;
		--dsc-text:         #f8fafc;
		--dsc-text-soft:    #e2e8f0;
		--dsc-text-muted:   #94a3b8;
		--dsc-brand:        #818cf8;
		--dsc-brand-2:      #a78bfa;
		--dsc-brand-soft:   rgba(129, 140, 248, 0.15);
		--dsc-brand-soft-2: rgba(167, 139, 250, 0.15);
		--dsc-accent:       #22d3ee;
		--dsc-success:      #4ade80;
		--dsc-danger:       #f87171;
		--dsc-ai-bg:        #1e293b;
		--dsc-ai-fg:        #f8fafc;
		--dsc-ai-border:    #334155;
		--dsc-input-bg:     #0f172a;
		--dsc-input-bd:     #475569;
		--dsc-input-bd-fc:  #818cf8;
		--dsc-input-shadow: 0 0 0 4px rgba(129, 140, 248, 0.15);
		--dsc-shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.3);
		--dsc-shadow:       0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.2);
		--dsc-shadow-lg:    0 12px 32px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.3);
	}
}

/* ───────────────── Root container ───────────────── */
.dsc-root {
	all: initial;
	display: block;
	font-family: var(--dsc-font);
	color: var(--dsc-text);
	background: var(--dsc-bg);
	border: 1px solid var(--dsc-border);
	border-radius: var(--dsc-radius);
	overflow: hidden;
	box-shadow: var(--dsc-shadow);
	height: var(--dsc-height, 680px);
	position: relative;
	contain: layout style;
	-webkit-font-smoothing: antialiased;
}
.dsc-root *, .dsc-root *::before, .dsc-root *::after {
	box-sizing: border-box;
	font-family: inherit;
}
.dsc-root button { font-family: inherit; cursor: pointer; }

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

.dsc-noscript { padding: 28px; color: var(--dsc-text-soft); }

/* ───────────────── Layout ───────────────── */
.dsc-shell {
	display: grid;
	grid-template-columns: 260px 1fr;
	height: 100%;
	transition: grid-template-columns .25s ease;
}
.dsc-root[data-sidebar="0"] .dsc-shell { grid-template-columns: 1fr; }

/* Desktop: burger collapses the sidebar (column shrinks to 0) */
.dsc-root.is-sidebar-collapsed .dsc-shell {
	grid-template-columns: 0 1fr;
}
.dsc-root.is-sidebar-collapsed .dsc-sidebar {
	visibility: hidden;
	opacity: 0;
	transition: visibility 0s linear .25s, opacity .15s ease;
}

/* ───────────────── Sidebar ───────────────── */
.dsc-sidebar {
	display: flex;
	flex-direction: column;
	border-right: 1px solid var(--dsc-border);
	background: var(--dsc-surface);
	padding: 14px;
	gap: 10px;
	overflow: hidden;
	transition: opacity .15s ease;
}
.dsc-new-chat {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 14px;
	background: var(--dsc-user-bg);
	color: #fff;
	border: 0;
	border-radius: var(--dsc-radius-sm);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.01em;
	box-shadow: var(--dsc-shadow-sm);
	transition: transform .15s, box-shadow .15s;
}
.dsc-new-chat:hover { transform: translateY(-1px); box-shadow: var(--dsc-shadow); }
.dsc-new-chat:active { transform: translateY(0); }

.dsc-history-label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--dsc-text-muted);
	padding: 6px 4px 4px;
}
.dsc-history {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}
.dsc-history li {
	display: flex; align-items: center; gap: 6px;
	padding: 9px 10px;
	border-radius: var(--dsc-radius-xs);
	cursor: pointer;
	font-size: 13px;
	color: var(--dsc-text-soft);
	transition: background .12s;
	margin-bottom: 2px;
}
.dsc-history li:hover { background: var(--dsc-brand-soft); color: var(--dsc-text); }
.dsc-history li.is-active { background: var(--dsc-brand-soft); color: var(--dsc-text); font-weight: 500; }
.dsc-history li .dsc-history-title {
	flex: 1; min-width: 0;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dsc-history li .dsc-history-del {
	background: transparent; border: 0; color: var(--dsc-text-muted);
	font-size: 14px; line-height: 1; padding: 2px 6px; border-radius: 4px;
	opacity: 0; transition: opacity .12s, color .12s, background .12s;
}
.dsc-history li:hover .dsc-history-del { opacity: 1; }
.dsc-history li .dsc-history-del:hover { color: var(--dsc-danger); background: rgba(220, 38, 38, 0.1); }

.dsc-sidebar-foot {
	display: flex; align-items: center; gap: 6px;
	font-size: 11px;
	color: var(--dsc-text-muted);
	padding-top: 10px;
	border-top: 1px solid var(--dsc-border);
}
.dsc-pulse {
	width: 7px; height: 7px;
	background: var(--dsc-success);
	border-radius: 50%;
	box-shadow: 0 0 0 0 var(--dsc-success);
	animation: dsc-pulse 2s infinite;
}
@keyframes dsc-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6); }
	70%  { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); }
	100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ───────────────── Main column ───────────────── */
.dsc-main {
	display: grid;
	grid-template-rows: auto 1fr auto;
	min-width: 0;
	min-height: 0;
	background: var(--dsc-bg);
}

/* ───────────────── Header ───────────────── */
.dsc-header {
	display: flex; align-items: center; gap: 10px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--dsc-border);
	background: var(--dsc-elevated);
	min-height: 60px;
}
.dsc-toggle-sidebar {
	display: inline-flex;
	flex: none;
}
.dsc-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.dsc-brand-mark {
	width: 36px; height: 36px;
	display: flex; align-items: center; justify-content: center;
	color: #fff;
	background: var(--dsc-user-bg);
	border-radius: var(--dsc-radius-sm);
	box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
	flex: none;
}
.dsc-brand-text { display: flex; flex-direction: column; min-width: 0; }
.dsc-brand-text strong {
	font-size: 14px;
	font-weight: 700;
	color: var(--dsc-text);
	letter-spacing: -0.01em;
}
.dsc-brand-sub {
	font-size: 11px;
	color: var(--dsc-text-muted);
	letter-spacing: 0.02em;
}

.dsc-controls {
	display: flex; align-items: center; gap: 6px;
}
.dsc-segmented {
	display: inline-flex;
	background: var(--dsc-surface);
	border: 1px solid var(--dsc-border);
	border-radius: var(--dsc-radius-sm);
	padding: 3px;
	gap: 2px;
}
.dsc-seg-btn {
	background: transparent;
	color: var(--dsc-text-soft);
	border: 0;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	border-radius: var(--dsc-radius-xs);
	transition: all .15s;
}
.dsc-seg-btn:hover { color: var(--dsc-text); background: var(--dsc-surface-2); }
.dsc-seg-btn.is-active {
	background: var(--dsc-bg);
	color: var(--dsc-brand);
	box-shadow: var(--dsc-shadow-sm);
}

.dsc-icon-btn {
	width: 34px; height: 34px;
	display: inline-flex; align-items: center; justify-content: center;
	background: transparent;
	color: var(--dsc-text-soft);
	border: 1px solid transparent;
	border-radius: var(--dsc-radius-xs);
	transition: all .15s;
}
.dsc-icon-btn:hover { background: var(--dsc-surface); color: var(--dsc-text); border-color: var(--dsc-border); }
.dsc-icon-btn:focus-visible {
	outline: none;
	border-color: var(--dsc-brand);
	box-shadow: var(--dsc-input-shadow);
}
.dsc-icon-btn.is-active {
	background: var(--dsc-brand-soft);
	color: var(--dsc-brand);
	border-color: var(--dsc-brand);
}

/* Theme icon swap */
.dsc-icon-sun, .dsc-icon-moon { display: none; }
.dsc-root[data-theme="dark"] .dsc-icon-sun  { display: block; }
.dsc-root[data-theme="light"] .dsc-icon-moon { display: block; }
.dsc-root[data-theme="auto"] .dsc-icon-moon  { display: block; }
@media (prefers-color-scheme: dark) {
	.dsc-root[data-theme="auto"] .dsc-icon-moon { display: none; }
	.dsc-root[data-theme="auto"] .dsc-icon-sun  { display: block; }
}

/* Privacy lock icon swap */
.dsc-icon-lock-closed { display: none; }
.dsc-privacy-btn[aria-pressed="true"] .dsc-icon-lock-open { display: none; }
.dsc-privacy-btn[aria-pressed="true"] .dsc-icon-lock-closed { display: block; }
.dsc-privacy-btn[aria-pressed="true"] {
	color: var(--dsc-brand);
	background: var(--dsc-brand-soft);
	border-color: var(--dsc-brand);
}

/* Fullscreen icon swap */
.dsc-icon-collapse { display: none; }
.dsc-root.is-fullscreen .dsc-icon-expand { display: none; }
.dsc-root.is-fullscreen .dsc-icon-collapse { display: block; }

/* Thinking active state */
.dsc-thinking-btn[aria-pressed="true"] {
	color: var(--dsc-brand);
	background: var(--dsc-brand-soft);
	border-color: var(--dsc-brand);
}

/* ───────────────── Messages area ───────────────── */
.dsc-messages {
	overflow-y: auto;
	padding: 24px 18px;
	min-height: 0;
}
.dsc-messages::-webkit-scrollbar { width: 8px; }
.dsc-messages::-webkit-scrollbar-thumb { background: var(--dsc-border-strong); border-radius: 4px; }
.dsc-messages::-webkit-scrollbar-thumb:hover { background: var(--dsc-text-muted); }

/* Welcome screen */
.dsc-welcome {
	display: flex; flex-direction: column; align-items: center;
	text-align: center;
	padding: 32px 16px 16px;
	max-width: 720px;
	margin: 0 auto;
}
.dsc-welcome-orb {
	width: 88px; height: 88px;
	border-radius: 50%;
	margin-bottom: 18px;
	background: conic-gradient(from 180deg, #4f46e5, #7c3aed, #06b6d4, #4f46e5);
	filter: blur(0.5px);
	animation: dsc-orb 12s linear infinite;
	box-shadow: 0 12px 36px rgba(79, 70, 229, 0.3);
	position: relative;
}
.dsc-welcome-orb::after {
	content: '';
	position: absolute; inset: 12px;
	background: var(--dsc-bg);
	border-radius: 50%;
}
@keyframes dsc-orb { to { transform: rotate(360deg); } }
.dsc-welcome-title {
	margin: 0 0 8px;
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--dsc-text);
	background: var(--dsc-user-bg);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.dsc-welcome-sub {
	margin: 0 0 20px;
	color: var(--dsc-text-soft);
	font-size: 14px;
	line-height: 1.55;
	max-width: 540px;
}
.dsc-suggestions {
	display: flex; flex-wrap: wrap; gap: 8px;
	justify-content: center;
	margin-top: 8px;
}
.dsc-suggestion {
	padding: 9px 14px;
	background: var(--dsc-surface);
	color: var(--dsc-text-soft);
	border: 1px solid var(--dsc-border);
	border-radius: 999px;
	font-size: 13px;
	transition: all .15s;
	max-width: 320px;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dsc-suggestion:hover {
	background: var(--dsc-brand-soft);
	color: var(--dsc-brand);
	border-color: var(--dsc-brand);
	transform: translateY(-1px);
}

/* ───────────────── Message bubbles ───────────────── */
.dsc-msg {
	display: flex;
	gap: 12px;
	max-width: 880px;
	margin: 0 auto 22px;
	align-items: flex-start;
	animation: dsc-msg-in 0.25s ease-out;
}
@keyframes dsc-msg-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.dsc-msg.dsc-msg-user { justify-content: flex-end; }

/* Column wrapping bubble + actions */
.dsc-msg-col {
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.dsc-msg-ai .dsc-msg-col { flex: 1; max-width: calc(100% - 44px); }
.dsc-msg-user .dsc-msg-col { max-width: 75%; align-items: flex-end; }

.dsc-msg-bubble {
	padding: 13px 17px;
	border-radius: 16px;
	line-height: 1.65;
	font-size: 14.5px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
	position: relative;
}

/* User bubble — compact, gradient, right-aligned */
.dsc-msg-user .dsc-msg-bubble {
	background: var(--dsc-user-bg);
	color: var(--dsc-user-fg);
	border-bottom-right-radius: 5px;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.22);
	font-weight: 450;
}

/* AI bubble — wider, surface background, soft border */
.dsc-msg-ai .dsc-msg-bubble {
	background: var(--dsc-surface);
	color: var(--dsc-ai-fg);
	border: 1px solid var(--dsc-border);
	border-top-left-radius: 5px;
	box-shadow: var(--dsc-shadow-sm);
}

/* Avatar (AI only) — cyan-indigo gradient, rounded square */
.dsc-msg-avatar {
	width: 32px;
	height: 32px;
	border-radius: 9px;
	background: linear-gradient(135deg, var(--dsc-accent), var(--dsc-brand));
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	margin-top: 2px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

/* ───────────────── Markdown inside bubbles ───────────────── */
.dsc-msg-bubble > *:first-child { margin-top: 0; }
.dsc-msg-bubble > *:last-child  { margin-bottom: 0; }

.dsc-msg-bubble p {
	margin: 0 0 0.75em;
}

.dsc-msg-bubble strong { font-weight: 700; }
.dsc-msg-bubble em { font-style: italic; }

.dsc-msg-bubble h1,
.dsc-msg-bubble h2,
.dsc-msg-bubble h3,
.dsc-msg-bubble h4 {
	margin: 1.2em 0 0.5em;
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.3;
	color: var(--dsc-text);
}
.dsc-msg-user .dsc-msg-bubble h1,
.dsc-msg-user .dsc-msg-bubble h2,
.dsc-msg-user .dsc-msg-bubble h3,
.dsc-msg-user .dsc-msg-bubble h4 { color: #fff; }
.dsc-msg-bubble h1 { font-size: 1.35em; }
.dsc-msg-bubble h2 { font-size: 1.2em; }
.dsc-msg-bubble h3 { font-size: 1.08em; }
.dsc-msg-bubble h4 { font-size: 1em; }

.dsc-msg-bubble ul,
.dsc-msg-bubble ol {
	margin: 0.5em 0 0.85em;
	padding-left: 1.5em;
}
.dsc-msg-bubble li { margin-bottom: 0.35em; }
.dsc-msg-bubble li:last-child { margin-bottom: 0; }
.dsc-msg-bubble li > p { margin-bottom: 0.4em; }
.dsc-msg-bubble li > ul,
.dsc-msg-bubble li > ol { margin: 0.3em 0 0.4em; }

.dsc-msg-bubble blockquote {
	margin: 0.75em 0;
	padding: 8px 14px;
	border-left: 3px solid var(--dsc-brand);
	background: var(--dsc-brand-soft);
	color: var(--dsc-text-soft);
	border-radius: 0 var(--dsc-radius-xs) var(--dsc-radius-xs) 0;
	font-style: normal;
}
.dsc-msg-user .dsc-msg-bubble blockquote {
	background: rgba(255,255,255,0.15);
	border-left-color: rgba(255,255,255,0.6);
	color: rgba(255,255,255,0.92);
}

.dsc-msg-bubble a {
	color: var(--dsc-brand);
	text-decoration: underline;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
}
.dsc-msg-bubble a:hover { text-decoration-thickness: 2px; }
.dsc-msg-user .dsc-msg-bubble a {
	color: #fff;
	text-decoration-color: rgba(255,255,255,0.7);
}

.dsc-msg-bubble hr {
	border: 0;
	border-top: 1px solid var(--dsc-border);
	margin: 1.2em 0;
}

.dsc-msg-bubble table {
	border-collapse: collapse;
	margin: 0.75em 0;
	font-size: 0.93em;
	width: 100%;
	display: block;
	overflow-x: auto;
	border-radius: var(--dsc-radius-xs);
}
.dsc-msg-bubble th,
.dsc-msg-bubble td {
	border: 1px solid var(--dsc-border);
	padding: 7px 11px;
	text-align: left;
}
.dsc-msg-bubble th {
	background: var(--dsc-surface-2);
	font-weight: 600;
	color: var(--dsc-text);
}

/* Inline code */
.dsc-msg-bubble code:not([class*="language-"]) {
	background: var(--dsc-bg);
	color: var(--dsc-brand);
	padding: 1px 7px;
	border-radius: 5px;
	font-family: var(--dsc-mono);
	font-size: 0.87em;
	border: 1px solid var(--dsc-border);
	white-space: nowrap;
}
.dsc-msg-user .dsc-msg-bubble code:not([class*="language-"]) {
	background: rgba(255,255,255,0.18);
	color: #fff;
	border-color: rgba(255,255,255,0.28);
}

/* ───────────────── Code blocks ───────────────── */
.dsc-msg-bubble .dsc-code-wrap {
	margin: 0.85em 0;
	border-radius: var(--dsc-radius-sm);
	overflow: hidden;
	background: #0b1120;
	border: 1px solid #1e293b;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.dsc-code-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 7px 14px;
	background: #1e293b;
	color: #94a3b8;
	font-size: 11px;
	font-family: var(--dsc-mono);
	letter-spacing: 0.05em;
	border-bottom: 1px solid #0b1120;
}
.dsc-code-lang { text-transform: uppercase; font-weight: 600; }
.dsc-code-copy {
	background: transparent;
	color: #cbd5e1;
	border: 1px solid #475569;
	padding: 3px 10px;
	border-radius: 5px;
	font-size: 11px;
	font-weight: 500;
	transition: all .15s;
	cursor: pointer;
}
.dsc-code-copy:hover {
	background: #334155;
	color: #fff;
	border-color: #64748b;
}
.dsc-msg-bubble pre {
	margin: 0;
	padding: 14px 16px;
	background: #0b1120 !important;
	color: #e2e8f0;
	overflow-x: auto;
	font-size: 13px;
	line-height: 1.6;
}
.dsc-msg-bubble pre code {
	background: none;
	padding: 0;
	border: 0;
	color: inherit;
	font-family: var(--dsc-mono);
	white-space: pre;
}

/* Reasoning panel (Thinking mode) */
.dsc-reasoning {
	margin: 0 0 8px;
	padding: 10px 13px;
	background: var(--dsc-brand-soft);
	border: 1px dashed var(--dsc-brand);
	border-radius: var(--dsc-radius-xs);
	font-size: 13px;
	color: var(--dsc-text-soft);
}
.dsc-reasoning-summary {
	cursor: pointer;
	font-weight: 600;
	color: var(--dsc-brand);
	display: flex; align-items: center; gap: 6px;
	user-select: none;
}
.dsc-reasoning-summary::before {
	content: ''; width: 6px; height: 6px; border-radius: 50%;
	background: var(--dsc-brand);
	animation: dsc-think 1.6s ease-in-out infinite;
}
.dsc-reasoning[open] .dsc-reasoning-summary::before { animation: none; opacity: 0.5; }
@keyframes dsc-think {
	0%, 100% { opacity: 0.4; transform: scale(1); }
	50%      { opacity: 1;   transform: scale(1.4); }
}
.dsc-reasoning-body {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed var(--dsc-brand);
	white-space: pre-wrap;
	font-family: var(--dsc-mono);
	font-size: 12px;
	line-height: 1.55;
	max-height: 240px;
	overflow-y: auto;
}

/* Streaming cursor */
.dsc-cursor {
	display: inline-block;
	width: 8px; height: 1em;
	background: var(--dsc-brand);
	margin-left: 2px;
	vertical-align: text-bottom;
	border-radius: 1px;
	animation: dsc-blink 1s steps(2) infinite;
}
@keyframes dsc-blink { 50% { opacity: 0; } }

/* Typing indicator (before first chunk) */
.dsc-typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.dsc-typing span {
	width: 6px; height: 6px;
	background: var(--dsc-text-muted);
	border-radius: 50%;
	animation: dsc-typing 1.2s ease-in-out infinite;
}
.dsc-typing span:nth-child(2) { animation-delay: .2s; }
.dsc-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes dsc-typing {
	0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
	30%           { opacity: 1;   transform: translateY(-3px); }
}

/* Per-message actions */
.dsc-msg-actions {
	display: flex;
	gap: 6px;
	margin-top: 8px;
	margin-left: 4px;
	opacity: 0;
	transition: opacity .15s ease;
}
.dsc-msg:hover .dsc-msg-actions,
.dsc-msg:focus-within .dsc-msg-actions {
	opacity: 1;
}
@media (hover: none) {
	.dsc-msg-actions { opacity: 0.85; }
}
.dsc-msg-action {
	background: var(--dsc-bg);
	color: var(--dsc-text-muted);
	border: 1px solid var(--dsc-border);
	padding: 5px 11px;
	border-radius: var(--dsc-radius-xs);
	font-size: 11px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: all .12s;
	cursor: pointer;
}
.dsc-msg-action:hover {
	color: var(--dsc-brand);
	border-color: var(--dsc-brand);
	background: var(--dsc-brand-soft);
}

/* In-chat promo shown under each assistant response */
.dsc-msg-promo {
	display: block;
	margin: 8px 4px 0;
	padding: 8px 12px;
	border-left: 3px solid var(--dsc-brand);
	background: var(--dsc-brand-soft);
	border-radius: var(--dsc-radius-xs);
	font-size: 12.5px;
	line-height: 1.45;
	color: var(--dsc-text-muted);
}
.dsc-msg-promo-text {
	margin-right: 4px;
}
.dsc-msg-promo-cta {
	color: var(--dsc-brand);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}
.dsc-msg-promo-cta:hover,
.dsc-msg-promo-cta:focus {
	text-decoration: underline;
}

/* Error chip */
.dsc-error {
	background: rgba(220, 38, 38, 0.08);
	color: var(--dsc-danger);
	border: 1px solid rgba(220, 38, 38, 0.25);
	padding: 10px 14px;
	border-radius: var(--dsc-radius-sm);
	font-size: 13px;
	margin: 8px 0;
	max-width: 820px;
}

/* ───────────────── Composer ───────────────── */
.dsc-composer {
	border-top: 1px solid var(--dsc-border);
	padding: 14px 16px 12px;
	background: var(--dsc-elevated);
}
.dsc-composer-inner {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 6px;
	padding: 8px 8px 8px 14px;
	background: var(--dsc-input-bg);
	border: 1.5px solid var(--dsc-input-bd);
	border-radius: 14px;
	transition: border-color .15s, box-shadow .15s;
}
.dsc-composer-inner:focus-within {
	border-color: var(--dsc-input-bd-fc);
	box-shadow: var(--dsc-input-shadow);
}
.dsc-input {
	flex: 1;
	background: transparent;
	border: 0;
	outline: none;
	resize: none;
	color: var(--dsc-text);
	font-size: 15px;
	line-height: 1.55;
	padding: 6px 0;
	max-height: 200px;
	min-height: 24px;
	font-family: inherit;
}
.dsc-input::placeholder { color: var(--dsc-text-muted); }

.dsc-composer-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.dsc-voice-btn { width: 36px; height: 36px; border-radius: var(--dsc-radius-xs); }
.dsc-voice-btn.is-recording {
	background: rgba(220, 38, 38, 0.15);
	color: var(--dsc-danger);
	border-color: var(--dsc-danger);
	animation: dsc-rec 1.2s ease-in-out infinite;
}
@keyframes dsc-rec {
	0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
	50%      { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.dsc-send-btn {
	width: 38px; height: 38px;
	background: var(--dsc-user-bg);
	color: #fff;
	border: 0;
	border-radius: var(--dsc-radius-xs);
	display: inline-flex; align-items: center; justify-content: center;
	transition: all .15s;
	box-shadow: var(--dsc-shadow-sm);
}
.dsc-send-btn:hover { transform: translateY(-1px); box-shadow: var(--dsc-shadow); }
.dsc-send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.dsc-icon-stop { display: none; }
.dsc-root.is-streaming .dsc-send-btn .dsc-icon-send { display: none; }
.dsc-root.is-streaming .dsc-send-btn .dsc-icon-stop { display: block; }

.dsc-composer-foot {
	display: flex; align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 6px;
	padding: 0 4px;
	font-size: 11px;
	color: var(--dsc-text-muted);
	flex-wrap: wrap;
}
.dsc-foot-meta { display: inline-flex; align-items: center; gap: 4px; }
.dsc-quota { font-weight: 600; }
.dsc-quota.is-low { color: #d97706; }
.dsc-quota.is-empty { color: var(--dsc-danger); }

.dsc-privacy-notice {
	display: flex; align-items: center; gap: 6px;
	margin-top: 6px;
	padding: 6px 10px;
	background: var(--dsc-surface);
	border: 1px solid var(--dsc-border);
	border-radius: var(--dsc-radius-xs);
	font-size: 11px;
	color: var(--dsc-text-muted);
	line-height: 1.4;
}
.dsc-privacy-notice svg { color: var(--dsc-brand); flex: none; }

/* ───────────────── Fullscreen mode ───────────────── */
.dsc-root.is-fullscreen {
	position: fixed !important;
	inset: 0;
	height: 100vh !important;
	width: 100vw !important;
	max-width: none !important;
	border-radius: 0;
	border: 0;
	z-index: 99999;
	box-shadow: none;
}

/* ───────────────── Mobile ───────────────── */
@media (max-width: 768px) {
	.dsc-root { --dsc-height: 100vh; }
	.dsc-shell { grid-template-columns: 1fr; }
	.dsc-sidebar {
		position: absolute; inset: 0 auto 0 0; width: 270px;
		z-index: 50;
		transform: translateX(-100%);
		transition: transform .25s ease;
		box-shadow: var(--dsc-shadow-lg);
	}
	.dsc-root.has-sidebar-open .dsc-sidebar { transform: translateX(0); }
	.dsc-brand-text strong { font-size: 13px; }
	.dsc-segmented { display: none; }
	.dsc-msg-user .dsc-msg-col { max-width: 88%; }
	.dsc-msg-bubble { font-size: 14.5px; padding: 11px 14px; }
	.dsc-msg-avatar { width: 28px; height: 28px; font-size: 10px; }
	.dsc-msg { gap: 10px; margin-bottom: 18px; }
	.dsc-welcome-title { font-size: 22px; }
	.dsc-suggestions { gap: 6px; }
	.dsc-suggestion { font-size: 12px; padding: 7px 12px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.dsc-welcome-orb { animation: none; }
	.dsc-pulse, .dsc-cursor, .dsc-typing span, .dsc-voice-btn.is-recording { animation: none !important; }
}
