/* AmoGPT / AI Tools — поверх общего стиля tasks-shell / tasks-form */

.ai-page .amogpt-hero {
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	overflow: visible;
	background: transparent;
}

.ai-page .amogpt-seo {
	margin: 0;
	padding: 1.2rem 1.35rem .9rem;
	border: 0;
	border-bottom: 1px solid var(--amc-border, #efe8f8);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

.ai-page .amogpt-seo__inner {
	max-width: 52rem;
}

.ai-page .amogpt-seo__eyebrow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .4rem .45rem;
	margin-bottom: .7rem;
}

.ai-page .amogpt-seo__badge {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .28rem .7rem;
	border-radius: 999px;
	background: rgba(158, 97, 255, .12);
	color: var(--brand-700, #6941c6);
	font-size: .78rem;
	font-weight: 700;
	letter-spacing: .01em;
	line-height: 1.2;
}

.ai-page .amogpt-seo__badge .bi {
	font-size: .9em;
}

.ai-page .amogpt-seo__chip {
	display: inline-flex;
	align-items: center;
	padding: .24rem .55rem;
	border-radius: 999px;
	border: 1px solid var(--amc-border-strong, #e8ddf7);
	background: rgba(255, 255, 255, .72);
	color: var(--amc-text-muted, #8a7aa8);
	font-size: .72rem;
	font-weight: 600;
	line-height: 1.2;
}

.ai-page .amogpt-seo__title {
	font-size: clamp(1.2rem, 2.2vw, 1.55rem);
	font-weight: 700;
	line-height: 1.28;
	letter-spacing: -.015em;
	margin: 0 0 .55rem;
	color: var(--amc-text, #2b2340);
}

.ai-page .amogpt-seo__lead {
	margin: 0;
	font-size: .92rem;
	line-height: 1.55;
	color: var(--amc-text-muted, #8a7aa8);
}

.ai-page .amogpt-seo__lead strong {
	color: var(--amc-text, #2b2340);
	font-weight: 700;
}

.ai-page .amogpt-seo__more {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	margin-top: .55rem;
	margin-bottom: .15rem;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--amc-link, #7b3fe0);
	font: inherit;
	font-size: .86rem;
	font-weight: 600;
	cursor: pointer;
}

.ai-page .amogpt-seo__more:hover,
.ai-page .amogpt-seo__more:focus-visible {
	color: var(--brand-700, #6941c6);
}

.ai-page .amogpt-seo__more .bi {
	font-size: .85em;
	transition: transform .18s ease;
}

.ai-page .amogpt-seo__more[aria-expanded="true"] .bi {
	transform: rotate(180deg);
}

.ai-page .amogpt-seo__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: .7rem;
	margin-top: .75rem;
	margin-bottom: .15rem;
}

.ai-page .amogpt-seo__feature {
	display: flex;
	gap: .65rem;
	align-items: flex-start;
	padding: .75rem .8rem;
	border: 1px solid var(--amc-border, #efe8f8);
	border-radius: .7rem;
	background: rgba(255, 255, 255, .78);
}

.ai-page .amogpt-seo__feature-ico {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: .55rem;
	background: rgba(158, 97, 255, .1);
	color: var(--brand-600, #8e57e6);
	font-size: .95rem;
}

.ai-page .amogpt-seo__feature-title {
	margin: 0 0 .2rem;
	font-size: .86rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--amc-text, #2b2340);
}

.ai-page .amogpt-seo__feature-text {
	margin: 0;
	font-size: .8rem;
	line-height: 1.45;
	color: var(--amc-text-muted, #8a7aa8);
}

@media (max-width: 900px) {
	.ai-page .amogpt-seo__grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 575.98px) {
	.ai-page .amogpt-seo {
		padding: 1rem 1rem .75rem;
	}
}

html.dark-theme .ai-page .amogpt-seo,
html[data-bs-theme="dark"] .ai-page .amogpt-seo {
	border-bottom-color: rgba(148, 163, 184, .16);
}

html.dark-theme .ai-page .amogpt-seo__badge,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__badge {
	background: rgba(158, 97, 255, .2);
	color: #d6bbfb;
}

html.dark-theme .ai-page .amogpt-seo__chip,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__chip {
	border-color: rgba(148, 163, 184, .2);
	background: rgba(15, 23, 42, .35);
	color: #cbd5e1;
}

html.dark-theme .ai-page .amogpt-seo__title,
html.dark-theme .ai-page .amogpt-seo__feature-title,
html.dark-theme .ai-page .amogpt-seo__lead strong,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__title,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__feature-title,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__lead strong {
	color: #f8fafc;
}

html.dark-theme .ai-page .amogpt-seo__lead,
html.dark-theme .ai-page .amogpt-seo__feature-text,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__lead,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__feature-text {
	color: #94a3b8;
}

html.dark-theme .ai-page .amogpt-seo__feature,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__feature {
	border-color: rgba(148, 163, 184, .14);
	background: rgba(15, 23, 42, .4);
}

html.dark-theme .ai-page .amogpt-seo__feature-ico,
html[data-bs-theme="dark"] .ai-page .amogpt-seo__feature-ico {
	background: rgba(158, 97, 255, .18);
	color: #c4b5fd;
}

.ai-page .ai-auth-link {
	font-weight: 600;
	color: #7c3aed;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.ai-page .ai-auth-link:hover {
	color: #6d28d9;
}

.ai-page .amogpt-hero .tasks-my-nav-bar.ai-tabs-bar {
	margin: 0;
	padding: .85rem 1.35rem;
	border: 0;
	border-bottom: 1px solid rgba(15, 23, 42, .06);
	background: transparent;
	align-items: center;
}

.ai-page .tasks-my-nav-bar.ai-tabs-bar {
	border-bottom: 1px solid rgba(15, 23, 42, .08);
}

/* Рабочая зона нейронки — вплотную к табам, боковые паддинги чата не трогаем */
.ai-page .amogpt-hero + .ai-workspace,
.ai-page .amogpt-hero + .tasks-shell-section.ai-workspace {
	margin-top: 0;
	border-top: 0;
}

@media (max-width: 575.98px) {
	.ai-page .amogpt-hero .tasks-my-nav-bar.ai-tabs-bar {
		padding: .75rem 1rem;
	}
}

.ai-page .ai-tabs.tasks-my-nav {
	width: 100%;
}

.ai-page .ai-tabs .tasks-my-nav__link {
	border: 1.5px solid rgba(15, 23, 42, .1);
	background: #fff;
	cursor: pointer;
	font: inherit;
}

.ai-page .ai-tabs .tasks-my-nav__link.is-active {
	border-color: rgba(158, 97, 255, .45);
	background: rgba(158, 97, 255, .1);
	color: #7c3aed;
}

.ai-page .ai-tabs .tasks-my-nav__link .ai-tab-soon {
	display: inline-flex;
	align-items: center;
	margin-left: .4rem;
	padding: .1rem .4rem;
	border-radius: 999px;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.2;
	color: #7c3aed;
	background: rgba(158, 97, 255, .14);
	border: 1px solid rgba(158, 97, 255, .28);
	vertical-align: middle;
}

html.dark-theme .ai-page .ai-tabs .tasks-my-nav__link .ai-tab-soon,
html[data-bs-theme="dark"] .ai-page .ai-tabs .tasks-my-nav__link .ai-tab-soon {
	color: #c4a8ff;
	background: rgba(158, 97, 255, .18);
	border-color: rgba(196, 168, 255, .35);
}

.ai-panel[hidden] {
	display: none !important;
}

.ai-field + .ai-field,
.ai-field + .row,
.row + .ai-actions {
	margin-top: 1rem;
}

.ai-field + .ai-voice-setup,
.ai-field + .ai-image-setup {
	margin-top: 1.35rem;
}

.ai-field .tasks-form-label {
	margin-bottom: .45rem;
}

.ai-field__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin-bottom: .45rem;
}

.ai-field__head .tasks-form-label {
	margin-bottom: 0;
}

.ai-dictation-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	overflow: visible;
}

.ai-dictation-pulse {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	border: 2px solid #dc2626;
	background: transparent;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(1);
	box-sizing: border-box;
	z-index: 0;
}

.ai-dictation-wrap.is-recording .ai-dictation-pulse {
	animation: ai-dictation-pulse 1.35s ease-out infinite;
}

.ai-dictation-wrap.is-recording .ai-dictation-pulse--delay {
	animation-delay: .67s;
}

[data-ai-dictation] {
	position: relative;
	z-index: 1;
}

[data-ai-dictation].is-recording {
	border-color: rgba(220, 38, 38, .45) !important;
	background: rgba(220, 38, 38, .12) !important;
	color: #dc2626 !important;
}

[data-ai-dictation].is-processing {
	opacity: .75;
}

textarea.ai-dictation-target {
	border-color: rgba(220, 38, 38, .35) !important;
	box-shadow: 0 0 0 .2rem rgba(220, 38, 38, .08);
	caret-color: #dc2626;
}

@keyframes ai-dictation-pulse {
	0% {
		opacity: .85;
		transform: translate(-50%, -50%) scale(1);
	}
	100% {
		opacity: 0;
		transform: translate(-50%, -50%) scale(2.15);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ai-dictation-wrap.is-recording .ai-dictation-pulse {
		animation: none;
	}
}

.ai-presets {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

.ai-preset {
	display: inline-flex;
	align-items: center;
	border: 1.5px solid rgba(15, 23, 42, .1);
	background: #fff;
	color: #475569;
	font: inherit;
	font-size: .8125rem;
	font-weight: 600;
	line-height: 1.3;
	padding: .45rem .85rem;
	border-radius: 999px;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.ai-preset:hover {
	border-color: rgba(158, 97, 255, .35);
	color: #7c3aed;
}

.ai-preset.is-active {
	border-color: rgba(158, 97, 255, .45);
	background: rgba(158, 97, 255, .1);
	color: #7c3aed;
}

.ai-textarea {
	min-height: 11rem;
	resize: vertical;
}

.ai-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem;
	margin-top: 1.1rem;
}

.ai-actions .btn[disabled] {
	opacity: .72;
	pointer-events: none;
}

.ai-btn-spinner {
	margin-left: .45rem;
	vertical-align: -0.1em;
}

.ai-range-value {
	color: #9e61ff;
	font-weight: 700;
	margin-left: .2rem;
}

.ai-range {
	margin-top: .35rem;
}

.ai-page .ai-range::-webkit-slider-runnable-track {
	height: .35rem;
	border-radius: 999px;
	background: rgba(158, 97, 255, .18);
}

.ai-page .ai-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 1.1rem;
	height: 1.1rem;
	margin-top: -.375rem;
	border-radius: 50%;
	background: #9e61ff;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}

.ai-page .ai-range::-moz-range-track {
	height: .35rem;
	border-radius: 999px;
	background: rgba(158, 97, 255, .18);
	border: 0;
}

.ai-page .ai-range::-moz-range-thumb {
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: #9e61ff;
	border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(15, 23, 42, .18);
}

.ai-result {
	margin-top: 1.25rem;
	cursor: default;
}

.ai-result:hover {
	transform: none;
	box-shadow: none;
	border-color: rgba(15, 23, 42, .08);
	color: inherit;
}

.ai-result__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin-bottom: .85rem;
}

.ai-markdown {
	color: #334155;
	font-size: .95rem;
	line-height: 1.65;
	overflow-wrap: anywhere;
}

.ai-markdown > *:first-child { margin-top: 0; }
.ai-markdown > *:last-child { margin-bottom: 0; }

.ai-markdown h1,
.ai-markdown h2,
.ai-markdown h3,
.ai-markdown h4 {
	color: #1e293b;
	font-weight: 700;
	line-height: 1.3;
	margin: 1.1rem 0 .55rem;
}

.ai-markdown h1 { font-size: 1.25rem; }
.ai-markdown h2 { font-size: 1.12rem; }
.ai-markdown h3 { font-size: 1.02rem; }

.ai-markdown p,
.ai-markdown ul,
.ai-markdown ol {
	margin: 0 0 .75rem;
}

.ai-markdown ul,
.ai-markdown ol {
	padding-left: 1.25rem;
}

.ai-markdown code {
	font-size: .875em;
	padding: .1rem .35rem;
	border-radius: .35rem;
	background: rgba(158, 97, 255, .08);
	color: #6941c6;
}

.ai-markdown pre {
	margin: 0 0 .85rem;
	padding: .85rem 1rem;
	border-radius: .75rem;
	background: rgba(15, 23, 42, .04);
	border: 1px solid rgba(15, 23, 42, .08);
	color: #1e293b;
	overflow-x: auto;
}

.ai-markdown pre code {
	padding: 0;
	background: transparent;
	color: inherit;
}

.ai-markdown blockquote {
	margin: 0 0 .85rem;
	padding: .35rem 0 .35rem .9rem;
	border-left: 3px solid rgba(158, 97, 255, .4);
	color: #64748b;
}

.ai-markdown img.ai-md-img,
.ai-markdown img {
	display: block;
	max-width: min(100%, 28rem);
	width: auto;
	height: auto;
	margin: .65rem 0;
	border-radius: .75rem;
	border: 1px solid rgba(15, 23, 42, .1);
	background: rgba(15, 23, 42, .03);
	object-fit: contain;
}

.ai-markdown p:has(> img:only-child) {
	margin: .35rem 0;
}

.ai-markdown p:has(> img) img {
	margin: .35rem 0;
}

.ai-audio {
	width: 100%;
	margin-top: .15rem;
}

.ai-voice-list {
	display: flex;
	flex-direction: column;
	gap: .75rem;
}

.ai-voice-item {
	padding: .85rem .9rem;
	border: 1px solid rgba(15, 23, 42, .08);
	border-radius: .85rem;
	background: rgba(15, 23, 42, .015);
}

.ai-voice-item__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin-bottom: .45rem;
}

.ai-voice-item__meta {
	min-width: 0;
	font-size: .8125rem;
	font-weight: 600;
	color: #64748b;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ai-voice-item__actions {
	display: flex;
	flex-shrink: 0;
	gap: .35rem;
}

html.dark-theme .ai-voice-item,
html[data-bs-theme="dark"] .ai-voice-item {
	border-color: rgba(255, 255, 255, .08);
	background: rgba(255, 255, 255, .03);
}

html.dark-theme .ai-voice-item__meta,
html[data-bs-theme="dark"] .ai-voice-item__meta {
	color: #94a3b8;
}

.ai-admin__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	margin-bottom: .85rem;
}

.ai-tg-panel {
	padding: 1.1rem 1.15rem 1.2rem;
	border: 1px solid rgba(158, 97, 255, .22);
	border-radius: 1rem;
	background: linear-gradient(165deg, rgba(158, 97, 255, .07), rgba(255, 255, 255, .9) 42%);
}
.ai-tg-panel__head {
	display: flex;
	align-items: flex-start;
	gap: .85rem;
	margin-bottom: 1rem;
}
.ai-tg-panel__ico {
	flex: 0 0 auto;
	width: 2.4rem;
	height: 2.4rem;
	border-radius: .75rem;
	display: grid;
	place-items: center;
	background: rgba(42, 171, 238, .14);
	color: #229ed9;
	font-size: 1.25rem;
}
.ai-tg-panel__title {
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.25;
	color: #1e293b;
}
.ai-tg-panel__sub {
	margin-top: .15rem;
	font-size: .82rem;
	line-height: 1.35;
	color: #64748b;
}
.dark-theme .ai-tg-panel {
	background: linear-gradient(165deg, rgba(158, 97, 255, .16), rgba(30, 24, 48, .92) 45%);
	border-color: rgba(196, 168, 255, .22);
}
.dark-theme .ai-tg-panel__title {
	color: #f1eef8;
}
.dark-theme .ai-tg-panel__sub {
	color: #a89bb8;
}

.ai-cselect {
	position: relative;
	z-index: 1;
}
.ai-cselect.is-open {
	z-index: 40;
}
.ai-cselect__btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .75rem;
	width: 100%;
	min-height: 3.35rem;
	padding: .55rem 1rem;
	border: 1px solid rgba(158, 97, 255, .35);
	border-radius: .85rem;
	background: #fff;
	text-align: left;
	cursor: pointer;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	color: inherit;
	font: inherit;
}
.ai-cselect__btn:hover,
.ai-cselect.is-open .ai-cselect__btn {
	border-color: rgba(158, 97, 255, .65);
	box-shadow: 0 0 0 .2rem rgba(158, 97, 255, .12);
}
.ai-cselect__meta {
	display: flex;
	flex-direction: column;
	gap: .12rem;
	min-width: 0;
}
.ai-cselect__label {
	font-size: .72rem;
	line-height: 1;
	color: #8e57e6;
	font-weight: 500;
}
.ai-cselect__value {
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.25;
	color: #1e293b;
}
.ai-cselect__chev {
	flex: 0 0 auto;
	opacity: .5;
	transition: transform .15s ease;
	font-size: .95rem;
}
.ai-cselect.is-open .ai-cselect__chev {
	transform: rotate(180deg);
}
.ai-cselect__list {
	position: fixed;
	z-index: 50;
	margin: 0;
	padding: .35rem;
	list-style: none;
	border: 1px solid rgba(158, 97, 255, .28);
	border-radius: .85rem;
	background: #fff;
	box-shadow: 0 .55rem 1.4rem rgba(20, 16, 40, .12);
	display: none;
	max-height: min(14rem, 50vh);
	overflow: auto;
}
.ai-cselect.is-open .ai-cselect__list {
	display: block;
}
.ai-cselect__opt {
	display: block;
	width: 100%;
	border: 0;
	background: transparent;
	border-radius: .6rem;
	padding: .7rem .85rem;
	text-align: left;
	font-size: .95rem;
	color: #1e293b;
	cursor: pointer;
	font: inherit;
}
.ai-cselect__opt:hover {
	background: rgba(158, 97, 255, .08);
}
.ai-cselect__opt.is-active {
	background: rgba(158, 97, 255, .14);
	color: #6d28d9;
	font-weight: 600;
}
.dark-theme .ai-cselect__btn {
	background: #1e1830;
	border-color: rgba(196, 168, 255, .28);
	color: #f1eef8;
}
.dark-theme .ai-cselect__btn:hover,
.dark-theme .ai-cselect.is-open .ai-cselect__btn {
	border-color: rgba(196, 168, 255, .55);
	box-shadow: 0 0 0 .2rem rgba(158, 97, 255, .18);
}
.dark-theme .ai-cselect__label {
	color: #c4a8ff;
}
.dark-theme .ai-cselect__value {
	color: #f1eef8;
}
.dark-theme .ai-cselect__list {
	background: #211c2d;
	border-color: rgba(196, 168, 255, .22);
	box-shadow: 0 .55rem 1.4rem rgba(0, 0, 0, .45);
}
.dark-theme .ai-cselect__opt {
	color: #f1eef8;
}
.dark-theme .ai-cselect__opt:hover {
	background: rgba(196, 168, 255, .1);
}
.dark-theme .ai-cselect__opt.is-active {
	background: rgba(158, 97, 255, .28);
	color: #e9ddff;
}

.ai-divider {
	margin: 1.35rem 0;
	border: 0;
	border-top: 1px solid rgba(15, 23, 42, .08);
	opacity: 1;
}

.ai-check {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	font-size: .9rem;
	color: #475569;
	cursor: pointer;
	user-select: none;
	margin-bottom: .35rem;
}

.ai-check .form-check-input {
	margin: 0;
	width: 1.05rem;
	height: 1.05rem;
	border-color: rgba(15, 23, 42, .2);
}

.ai-check .form-check-input:checked {
	background-color: #9e61ff;
	border-color: #9e61ff;
}

.ai-preset-admin-list {
	display: grid;
	gap: .55rem;
}

.ai-preset-admin-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: .75rem;
	padding: .85rem 1rem;
	border: 1px solid rgba(15, 23, 42, .08);
	border-radius: .75rem;
	background: rgba(15, 23, 42, .02);
}

.ai-preset-admin-item__main {
	min-width: 0;
}

.ai-preset-admin-item__name {
	font-weight: 600;
	color: #1e293b;
}

.ai-preset-admin-item__meta {
	margin-top: .2rem;
	font-size: .8125rem;
	color: #64748b;
}

.ai-preset-admin-item__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .35rem;
	flex: 0 0 auto;
}

/* Dark theme — как у tasks-page */
html.dark-theme .ai-page .ai-tabs .tasks-my-nav__link,
html[data-bs-theme="dark"] .ai-page .ai-tabs .tasks-my-nav__link,
html.dark-theme .ai-preset,
html[data-bs-theme="dark"] .ai-preset,
html.dark-theme .ai-preset-admin-item,
html[data-bs-theme="dark"] .ai-preset-admin-item {
	background: #211c2d;
	border-color: rgba(255, 255, 255, .1);
	color: #cbd5e1;
}

html.dark-theme .ai-page .ai-tabs .tasks-my-nav__link.is-active,
html[data-bs-theme="dark"] .ai-page .ai-tabs .tasks-my-nav__link.is-active,
html.dark-theme .ai-preset:hover,
html[data-bs-theme="dark"] .ai-preset:hover,
html.dark-theme .ai-preset.is-active,
html[data-bs-theme="dark"] .ai-preset.is-active {
	background: rgba(158, 97, 255, .18);
	border-color: rgba(196, 168, 255, .35);
	color: #c4a8ff;
}

html.dark-theme .ai-markdown,
html[data-bs-theme="dark"] .ai-markdown,
html.dark-theme .ai-preset-admin-item__name,
html[data-bs-theme="dark"] .ai-preset-admin-item__name,
html.dark-theme .ai-check,
html[data-bs-theme="dark"] .ai-check {
	color: #e2e8f0;
}

html.dark-theme .ai-markdown h1,
html.dark-theme .ai-markdown h2,
html.dark-theme .ai-markdown h3,
html.dark-theme .ai-markdown h4,
html[data-bs-theme="dark"] .ai-markdown h1,
html[data-bs-theme="dark"] .ai-markdown h2,
html[data-bs-theme="dark"] .ai-markdown h3,
html[data-bs-theme="dark"] .ai-markdown h4 {
	color: #f1f5f9;
}

html.dark-theme .ai-markdown code,
html[data-bs-theme="dark"] .ai-markdown code {
	background: rgba(158, 97, 255, .16);
	color: #c4a8ff;
}

html.dark-theme .ai-markdown pre,
html[data-bs-theme="dark"] .ai-markdown pre {
	background: rgba(255, 255, 255, .04);
	border-color: rgba(255, 255, 255, .08);
	color: #e2e8f0;
}

html.dark-theme .ai-divider,
html[data-bs-theme="dark"] .ai-divider {
	border-top-color: rgba(255, 255, 255, .08);
}

html.dark-theme .ai-result:hover,
html[data-bs-theme="dark"] .ai-result:hover {
	border-color: rgba(255, 255, 255, .08);
}

/* Chat layout */
.ai-workspace--chat {
	padding: 0 !important;
}

.ai-workspace--chat .ai-panel--voice,
.ai-workspace--chat .ai-panel--images {
	padding: 1.25rem 1.35rem 1.35rem;
}

.ai-image-setup {
	display: flex;
	flex-direction: column;
	gap: .95rem;
	margin-bottom: 1.15rem;
	padding: 1rem 1.1rem 1.1rem;
	border: 1px solid rgba(15, 23, 42, .08);
	border-radius: 16px;
	background: rgba(15, 23, 42, .015);
}

.ai-image-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1rem;
}

.ai-image-item {
	display: flex;
	flex-direction: column;
	gap: .65rem;
	padding: .75rem;
	border: 1px solid rgba(15, 23, 42, .08);
	border-radius: 14px;
	background: #fff;
}

.ai-image-item__preview {
	overflow: hidden;
	border-radius: 10px;
	background: rgba(15, 23, 42, .04);
	aspect-ratio: 1 / 1;
}

.ai-image-item__preview img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ai-image-item__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: .5rem;
}

.ai-image-item__meta {
	font-size: .8rem;
	line-height: 1.35;
	color: #64748b;
	word-break: break-word;
}

.ai-image-item__actions {
	display: flex;
	flex-shrink: 0;
	gap: .35rem;
}

html.dark-theme .ai-image-setup,
html[data-bs-theme="dark"] .ai-image-setup {
	border-color: rgba(255, 255, 255, .08);
	background: rgba(255, 255, 255, .03);
}

html.dark-theme .ai-image-item,
html[data-bs-theme="dark"] .ai-image-item {
	border-color: rgba(255, 255, 255, .08);
	background: rgba(15, 23, 42, .35);
}

html.dark-theme .ai-image-item__meta,
html[data-bs-theme="dark"] .ai-image-item__meta {
	color: #94a3b8;
}

.ai-voice-setup {
	display: flex;
	flex-direction: column;
	gap: 1.15rem;
	margin-bottom: 1.15rem;
	padding: 1rem 1.1rem 1.1rem;
	border: 1px solid rgba(15, 23, 42, .08);
	border-radius: 16px;
	background: rgba(15, 23, 42, .015);
}

.ai-voice-setup__mode .tasks-form-label,
.ai-voice-field .tasks-form-label {
	margin-bottom: .45rem;
}

.ai-voice-setup__body {
	display: flex;
	flex-direction: column;
	gap: .95rem;
}

.ai-voice-setup__row {
	display: grid;
	gap: .85rem 1rem;
}

.ai-voice-setup__row--voice {
	grid-template-columns: minmax(0, 320px);
}

.ai-voice-setup__row--roles {
	grid-template-columns: 1fr;
}

.ai-voice-setup__row--sliders {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	max-width: 720px;
}

.ai-voice-setup__body[data-ai-tts-simple] .ai-voice-setup__row--sliders {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	max-width: 520px;
}

.ai-voice-field__label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: .75rem;
}

.ai-voice-field__label .ai-range-value {
	flex-shrink: 0;
	font-variant-numeric: tabular-nums;
	color: #7c3aed;
	font-weight: 600;
}

.ai-voice-radios {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
}

@media (max-width: 767.98px) {
	.ai-voice-setup {
		padding: .9rem;
	}

	.ai-voice-setup__row--voice,
	.ai-voice-setup__row--sliders,
	.ai-voice-setup__body[data-ai-tts-simple] .ai-voice-setup__row--sliders {
		grid-template-columns: 1fr;
		max-width: none;
	}
}

html.dark-theme .ai-voice-setup,
html[data-bs-theme="dark"] .ai-voice-setup {
	border-color: rgba(255, 255, 255, .08);
	background: rgba(255, 255, 255, .03);
}

html.dark-theme .ai-voice-field__label .ai-range-value,
html[data-bs-theme="dark"] .ai-voice-field__label .ai-range-value {
	color: #c4a8ff;
}

.ai-voice-radio {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
	margin: 0;
}

.ai-voice-radio input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.ai-voice-radio span {
	display: inline-flex;
	align-items: center;
	padding: .55rem 1rem;
	border: 1.5px solid rgba(15, 23, 42, .1);
	border-radius: 999px;
	background: #fff;
	color: #475569;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.2;
	transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.ai-voice-radio:hover span {
	border-color: rgba(158, 97, 255, .35);
	color: #7c3aed;
}

.ai-voice-radio input:checked + span,
.ai-voice-radio input:focus-visible + span {
	border-color: rgba(158, 97, 255, .45);
	background: rgba(158, 97, 255, .1);
	color: #7c3aed;
}

html.dark-theme .ai-voice-radio span,
html[data-bs-theme="dark"] .ai-voice-radio span {
	background: #211c2d;
	border-color: rgba(255, 255, 255, .1);
	color: #cbd5e1;
}

html.dark-theme .ai-voice-radio input:checked + span,
html[data-bs-theme="dark"] .ai-voice-radio input:checked + span,
html.dark-theme .ai-voice-radio:hover span,
html[data-bs-theme="dark"] .ai-voice-radio:hover span {
	background: rgba(158, 97, 255, .18);
	border-color: rgba(196, 168, 255, .35);
	color: #c4a8ff;
}

.ai-chat {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	min-height: 620px;
	height: min(74vh, 760px);
}

.ai-chat__sidebar {
	display: flex;
	flex-direction: column;
	gap: .75rem;
	padding: 1rem;
	border-right: 1px solid rgba(15, 23, 42, .08);
	background: rgba(15, 23, 42, .02);
}

.ai-chat__list {
	display: flex;
	flex-direction: column;
	gap: .4rem;
	overflow-y: auto;
	min-height: 0;
	flex: 1;
}

.ai-chat__item {
	display: flex;
	align-items: center;
	width: 100%;
	min-width: 0;
	padding: .7rem .8rem;
	border: 1.5px solid transparent;
	border-radius: .75rem;
	background: #fff;
	color: #334155;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.ai-chat__item:hover {
	border-color: rgba(158, 97, 255, .28);
	color: #7c3aed;
}

.ai-chat__item.is-active {
	border-color: rgba(158, 97, 255, .45);
	background: rgba(158, 97, 255, .1);
	color: #7c3aed;
}

.ai-chat__item-title {
	display: block;
	width: 100%;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.35;
	mask-image: linear-gradient(90deg, #000 78%, transparent);
	-webkit-mask-image: linear-gradient(90deg, #000 78%, transparent);
}

.ai-chat__item-title:not(.is-overflow) {
	mask-image: none;
	-webkit-mask-image: none;
}

.ai-chat__item-title-inner {
	display: inline-block;
	white-space: nowrap;
	will-change: transform;
}

.ai-chat__item:hover .ai-chat__item-title.is-overflow .ai-chat__item-title-inner,
.ai-chat__item:focus-visible .ai-chat__item-title.is-overflow .ai-chat__item-title-inner {
	animation: ai-chat-title-marquee var(--marquee-duration, 3s) ease-in-out infinite alternate;
}

@keyframes ai-chat-title-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(calc(-1 * var(--marquee-shift, 0px))); }
}

@media (prefers-reduced-motion: reduce) {
	.ai-chat__item:hover .ai-chat__item-title.is-overflow .ai-chat__item-title-inner,
	.ai-chat__item:focus-visible .ai-chat__item-title.is-overflow .ai-chat__item-title-inner {
		animation: none;
	}
}

.ai-chat__item-date {
	font-size: .75rem;
	color: #94a3b8;
}

.ai-chat__main {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
}

.ai-chat__messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 1rem 1.1rem;
	display: flex;
	flex-direction: column;
	gap: .85rem;
	background: rgba(158, 97, 255, .015);
}

.ai-chat__empty {
	margin: auto;
	max-width: 32rem;
	text-align: center;
	padding: 1rem;
}

.ai-chat__empty-title {
	font-size: 1.1rem;
	font-weight: 700;
	color: #1e293b;
	margin-bottom: .4rem;
}

.ai-chat__empty-text {
	font-size: .9rem;
	color: #64748b;
	line-height: 1.5;
	margin-bottom: 1rem;
}

.ai-presets--empty,
.ai-presets--composer {
	justify-content: center;
}

.ai-msg {
	max-width: min(780px, 92%);
	padding: .85rem 1rem;
	border-radius: 1rem;
	border: 1px solid rgba(15, 23, 42, .08);
	background: #fff;
}

.ai-msg--user {
	align-self: flex-end;
	background: rgba(158, 97, 255, .1);
	border-color: rgba(158, 97, 255, .18);
}

.ai-msg--model {
	align-self: flex-start;
}

.ai-msg__text {
	color: #334155;
	font-size: .95rem;
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.ai-msg__text.ai-markdown > *:first-child { margin-top: 0; }
.ai-msg__text.ai-markdown > *:last-child { margin-bottom: 0; }

.ai-msg__meta {
	display: flex;
	align-items: center;
	gap: .55rem;
	margin-top: .7rem;
	flex-wrap: wrap;
}

.ai-chat__composer {
	border-top: 1px solid rgba(15, 23, 42, .08);
	padding: .9rem 1.1rem 1.5rem;
	background: #fff;
}

.ai-chat__input {
	min-height: 5.5rem;
	resize: vertical;
}

.ai-chat__composer-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: .75rem;
	margin-top: .75rem;
}

.ai-chat__composer-left {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .4rem;
}

.ai-presets--composer {
	margin-bottom: .75rem;
	justify-content: flex-start;
}

html.dark-theme .ai-chat__sidebar,
html[data-bs-theme="dark"] .ai-chat__sidebar,
html.dark-theme .ai-chat__messages,
html[data-bs-theme="dark"] .ai-chat__messages {
	background: rgba(255, 255, 255, .03);
}

html.dark-theme .ai-chat__item,
html[data-bs-theme="dark"] .ai-chat__item,
html.dark-theme .ai-msg,
html[data-bs-theme="dark"] .ai-msg,
html.dark-theme .ai-chat__composer,
html[data-bs-theme="dark"] .ai-chat__composer {
	background: #211c2d;
	border-color: rgba(255, 255, 255, .08);
	color: #cbd5e1;
}

html.dark-theme .ai-msg--user,
html[data-bs-theme="dark"] .ai-msg--user {
	background: rgba(158, 97, 255, .16);
	border-color: rgba(196, 168, 255, .24);
}

html.dark-theme .ai-chat__title,
html[data-bs-theme="dark"] .ai-chat__title,
html.dark-theme .ai-chat__empty-title,
html[data-bs-theme="dark"] .ai-chat__empty-title,
html.dark-theme .ai-msg__text,
html[data-bs-theme="dark"] .ai-msg__text {
	color: #e2e8f0;
}

html.dark-theme .ai-chat__item.is-active,
html[data-bs-theme="dark"] .ai-chat__item.is-active {
	background: rgba(158, 97, 255, .18);
	border-color: rgba(196, 168, 255, .35);
	color: #c4a8ff;
}

@media (max-width: 575.98px) {
	.ai-result__head {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 991.98px) {
	.ai-chat {
		grid-template-columns: 1fr;
		height: auto;
		min-height: 0;
	}

	.ai-chat__sidebar {
		border-right: 0;
		border-bottom: 1px solid rgba(15, 23, 42, .08);
		max-height: 220px;
	}

	.ai-chat__messages {
		min-height: 360px;
		max-height: 55vh;
	}
}
