.nav-search-wrap {
	gap: 4px;
}

.dashihui-ai-toggle {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--dsh-gold);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border-radius: var(--dsh-radius);
	transition: color var(--dsh-transition), background var(--dsh-transition), box-shadow var(--dsh-transition);
	line-height: 1;
	flex-shrink: 0;
	animation: dashihui-ai-breathe 2.8s ease-in-out infinite;
}

.dashihui-ai-toggle:hover,
.dashihui-ai-toggle[aria-expanded="true"] {
	color: var(--dsh-nav-text-hover);
	background: rgba(201,168,76,0.12);
	box-shadow: 0 0 0 1px rgba(201,168,76,0.22);
	animation-play-state: paused;
}

@keyframes dashihui-ai-breathe {
	0%,
	100% {
		background: rgba(201,168,76,0.03);
		box-shadow: 0 0 0 0 rgba(201,168,76,0);
	}
	50% {
		background: rgba(201,168,76,0.13);
		box-shadow: 0 0 0 5px rgba(201,168,76,0.08);
	}
}

.dashihui-ai-panel {
	position: fixed;
	top: var(--dashihui-ai-panel-top, 112px);
	right: 24px;
	width: min(360px, calc(100vw - 32px));
	max-height: min(540px, var(--dashihui-ai-panel-max-height, calc(100vh - var(--dashihui-ai-panel-top, 112px) - 18px - env(safe-area-inset-bottom, 0px))));
	z-index: 1002;
	background: var(--dsh-bg-secondary);
	border: 1px solid var(--dsh-border);
	box-shadow: 0 18px 50px rgba(0,0,0,0.38);
	display: none;
	flex-direction: column;
	overflow: hidden;
	color: var(--dsh-text-primary);
}

.dashihui-ai-panel.is-open {
	display: flex;
}

.dashihui-ai-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 14px 16px 12px;
	border-bottom: 1px solid var(--dsh-border);
	background: var(--dsh-nav-bg);
	flex-shrink: 0;
}

.dashihui-ai-kicker {
	font-family: var(--dsh-font-body);
	font-size: 9px;
	line-height: 1;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--dsh-gold);
	margin-bottom: 5px;
}

.dashihui-ai-head h2 {
	margin: 0;
	font-family: var(--dsh-font-display);
	font-size: 17px;
	line-height: 1.1;
	color: var(--dsh-nav-text-hover);
	letter-spacing: 0;
}

.dashihui-ai-close {
	width: 30px;
	height: 30px;
	border: none;
	background: transparent;
	color: var(--dsh-gold);
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--dsh-radius);
	flex-shrink: 0;
}

.dashihui-ai-close:hover {
	background: rgba(201,168,76,0.12);
	color: var(--dsh-nav-text-hover);
}

.dashihui-ai-messages {
	padding: 14px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 160px;
	flex: 1 1 auto;
	-webkit-overflow-scrolling: touch;
}

.dashihui-ai-msg {
	max-width: 86%;
	padding: 9px 11px;
	font-family: var(--dsh-font-body);
	font-size: 13px;
	line-height: 1.55;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	border-radius: 7px;
}

.dashihui-ai-msg-bot {
	align-self: flex-start;
	background: rgba(201,168,76,0.09);
	border: 1px solid rgba(201,168,76,0.18);
	color: var(--dsh-text-primary);
}

.dashihui-ai-msg-user {
	align-self: flex-end;
	background: var(--dsh-red);
	color: var(--dsh-white);
}

.dashihui-ai-form {
	display: flex;
	gap: 8px;
	padding: 12px;
	border-top: 1px solid var(--dsh-border);
	background: var(--dsh-bg-primary);
	flex-shrink: 0;
}

.dashihui-ai-form input {
	min-width: 0;
	flex: 1;
	border: 1px solid var(--dsh-border);
	background: rgba(255,255,255,0.06);
	color: var(--dsh-text-primary);
	font-family: var(--dsh-font-body);
	font-size: 13px;
	padding: 10px 11px;
	border-radius: var(--dsh-radius);
	outline: none;
}

.dashihui-ai-form input:focus {
	border-color: var(--dsh-gold);
}

.dashihui-ai-form input::placeholder {
	color: var(--dsh-text-muted);
}

.dashihui-ai-form button {
	border: none;
	background: var(--dsh-gold);
	color: var(--dsh-ink);
	font-weight: 700;
	font-size: 12px;
	letter-spacing: 0;
	padding: 0 14px;
	border-radius: var(--dsh-radius);
	cursor: pointer;
	flex-shrink: 0;
}

.dashihui-ai-form button:disabled,
.dashihui-ai-form input:disabled {
	opacity: 0.65;
	cursor: wait;
}

body.theme-light .dashihui-ai-panel {
	background: #FFFDF5;
	color: var(--dsh-text-primary);
	box-shadow: 0 18px 50px rgba(44,24,16,0.18);
}

body.theme-light .dashihui-ai-form {
	background: #FAF6EF;
}

body.theme-light .dashihui-ai-form input {
	background: #FFFFFF;
	color: var(--dsh-text-primary);
}

@media (max-width: 768px) {
	.dashihui-ai-toggle {
		width: 34px;
		height: 34px;
	}

	.dashihui-ai-panel {
		left: 12px;
		right: 12px;
		width: auto;
		max-height: var(--dashihui-ai-panel-max-height, calc(100vh - var(--dashihui-ai-panel-top, 104px) - 14px - env(safe-area-inset-bottom, 0px)));
	}

	.dashihui-ai-messages {
		min-height: 0;
	}

	.dashihui-ai-form {
		padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
	}
}
