.ai-header-tools {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ai-lang-switcher {
	position: relative;
	z-index: 101;
	flex-shrink: 0;
}

.ai-lang-switcher.is-open {
	z-index: 130;
}

.ai-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 2.5rem;
	min-height: 2.5rem;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.04);
	color: #eef0f6;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.ai-lang-switcher__toggle:hover,
.ai-lang-switcher__toggle:focus-visible,
.ai-lang-switcher__toggle[aria-expanded="true"] {
	border-color: rgba(124, 92, 255, 0.45);
	background: rgba(124, 92, 255, 0.12);
	color: #fff;
	outline: none;
}

.ai-lang-switcher__current {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.ai-lang-switcher__flag {
	display: block;
	flex-shrink: 0;
	width: 20px;
	height: 15px;
	border-radius: 2px;
	object-fit: cover;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.ai-lang-switcher__chevron {
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	opacity: 0.7;
	transition: transform 0.2s ease;
}

.ai-lang-switcher__toggle[aria-expanded="true"] .ai-lang-switcher__chevron {
	transform: rotate(-135deg) translateY(1px);
}

.ai-lang-switcher__list {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 102;
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: max-content;
	min-width: 13.5rem;
	max-width: min(18rem, calc(100vw - 24px));
	margin: 0;
	padding: 6px;
	overflow: visible;
	list-style: none;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 14px;
	background: #0e101c;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.ai-lang-switcher__list li {
	margin: 0;
	padding: 0;
}

.ai-lang-switcher__option {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 0.7rem;
	padding: 10px 12px;
	border-radius: 10px;
	color: #eef0f6;
	text-decoration: none;
	font-family: 'Manrope', system-ui, sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.25;
	transition: background 0.15s ease, color 0.15s ease;
}

.ai-lang-switcher__option:hover,
.ai-lang-switcher__option:focus-visible {
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	outline: none;
}

.ai-lang-switcher__option.is-active {
	background: rgba(124, 92, 255, 0.16);
	color: #fff;
	font-weight: 600;
}

.ai-lang-switcher__option-flag {
	flex-shrink: 0;
	display: block;
	width: 20px;
	height: 15px;
	border-radius: 2px;
	object-fit: cover;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.ai-lang-switcher__option-native {
	min-width: 0;
}

/* Cabinet header: match profile / plan pills. */
.ai-cabinet__header-actions .ai-lang-switcher {
	flex-shrink: 0;
	align-self: center;
}

.ai-cabinet__header-actions .ai-lang-switcher__toggle {
	gap: 8px;
	min-width: 0;
	min-height: 0;
	height: 40px;
	padding: 4px 10px 4px 8px;
	border: 1px solid var(--cabinet-border);
	border-radius: 999px;
	background: var(--cabinet-surface);
	color: var(--cabinet-text);
	box-shadow: none;
}

.ai-cabinet__header-actions .ai-lang-switcher__toggle:hover,
.ai-cabinet__header-actions .ai-lang-switcher__toggle:focus-visible,
.ai-cabinet__header-actions .ai-lang-switcher__toggle[aria-expanded="true"] {
	border-color: var(--cabinet-border);
	background: var(--cabinet-surface-hover);
	color: var(--cabinet-text);
}

.ai-cabinet__header-actions .ai-lang-switcher__flag {
	width: 22px;
	height: 16px;
	border-radius: 3px;
}

.ai-cabinet__header-actions .ai-lang-switcher__chevron {
	width: 0;
	height: 0;
	border: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid var(--cabinet-text-muted);
	transform: none;
	opacity: 1;
}

.ai-cabinet__header-actions .ai-lang-switcher__toggle[aria-expanded="true"] .ai-lang-switcher__chevron {
	transform: rotate(180deg);
	border-top-color: var(--cabinet-text);
}

.ai-cabinet__header-actions .ai-lang-switcher__list {
	top: calc(100% + 8px);
	border-color: var(--cabinet-border);
	border-radius: 12px;
	background: #0e101c;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.ai-cabinet__header-actions .ai-lang-switcher__option {
	border-radius: 8px;
	font-family: var(--cabinet-font);
	font-size: 1rem;
	font-weight: 600;
}

.ai-cabinet__header-actions .ai-lang-switcher__option:hover,
.ai-cabinet__header-actions .ai-lang-switcher__option:focus-visible {
	background: rgba(255, 255, 255, 0.05);
}

.ai-cabinet__header-actions .ai-lang-switcher__option.is-active {
	background: var(--cabinet-sidebar-active);
}
