/* Тур (Intro.js) базовая стилизация */
.introjs-helperLayer{background-color:rgba(0,0,0,.5)!important;border-radius:8px!important}
.introjs-tooltip{max-width:350px!important;font-size:14px!important;background:#181825!important;color:#cdd6f4!important;border:1px solid #313244!important;box-shadow:0 4px 20px rgba(0,0,0,.3)!important;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif!important}
.introjs-button{background:#74c7ec!important;color:#1e1e2e!important;border:none!important;border-radius:4px!important;padding:5px 10px!important;font-weight:700!important;margin:3px!important}
.introjs-skipbutton{color:#cdd6f4!important;background:#45475a!important}
.introjs-bullets{display:none!important}
.introjs-tooltipbuttons{text-align:right!important;margin-top:10px!important}
.introjs-tooltiptext{line-height:1.5!important}
#start-tour{background-color:#ffd04c!important;color:#1e1e2e!important;margin-top:0!important;width:auto!important}
#start-tour:hover{background-color:#ffe08c!important}
/* Основные стили редактора */
.supa-editor * { margin: 0; padding: 0; box-sizing: border-box; }
.supa-editor, .supa-editor input, .supa-editor select, .supa-editor button, .supa-editor textarea { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
.supa-editor { background-color: #1e1e2e; color: #cdd6f4; display: flex; flex-direction: column; height: 100vh; overflow: hidden; position: relative; }
.supa-editor { color-scheme: dark; }
.supa-editor header { background-color: #11111b; padding: 8px 14px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #313244; position: relative; z-index: 100; }
.supa-editor .logo { font-size: 24px; font-weight: bold; color: #74c7ec; }
.supa-editor .header-actions { display: flex; align-items: center; gap: 8px; }
.supa-editor .icon-button { width: 36px; height: 32px; border-radius: 6px; border: 1px solid #313244; background: #181825; color: #cdd6f4; display: none; align-items: center; justify-content: center; cursor: pointer; }
.supa-editor .icon-button:hover { background: #313244; }
.supa-editor .header-actions-buttons { display: flex; gap: 6px; align-items: center; }
.supa-editor .header-actions .button { padding: 6px 10px; font-size: 12px; border-radius: 6px; height: 32px; display: inline-flex; align-items: center; white-space: nowrap; justify-content: center; }
.supa-editor .header-actions-buttons .button { min-width: 150px; }
.supa-editor .header-actions .button:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(116,199,236,0.3); border-color: #74c7ec; }
.supa-editor .header-actions .button .btn-text { display: inline; }
.supa-editor .button-success {
	/* Базовый зелёный и плавный градиентный перелив */
	background: linear-gradient(90deg, #28e677 0%, #3af08a 50%, #28e677 100%);
	background-size: 200% 100%;
	animation: successGradientFlow 4s ease infinite;
	color: #0c1a0c;
	font-weight: 700;
}
.supa-editor .button-success:hover { filter: brightness(1.05); animation-duration: 2s; }
.supa-editor .button-success:focus-visible { box-shadow: 0 0 0 2px rgba(40,230,119,0.4); }

@keyframes successGradientFlow {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}
.supa-editor .header-actions .button i { font-size: 12px; margin-right: 6px; }
.supa-editor .header-actions .button { height: 32px; display: inline-flex; align-items: center; }

/* Адаптивный header: сворачиваем в бургер */
@media (max-width: 900px) {
	.supa-editor .header-actions-buttons { position: absolute; right: 8px; top: 44px; background: #181825; border: 1px solid #313244; border-radius: 8px; padding: 8px; box-shadow: 0 8px 20px rgba(0,0,0,0.3); display: none; flex-direction: column; gap: 8px; }
	.supa-editor .header-actions-buttons.open { display: flex; }
	.supa-editor .icon-button { display: inline-flex; }
		.supa-editor .header-actions-buttons .button { min-width: 220px; justify-content: flex-start; }
}
.supa-editor .main-container { display: flex; flex: 1; overflow: hidden; position: relative; }
.supa-editor .left-panel { width: 280px; background-color: #181825; padding: 20px; border-right: 1px solid #313244; overflow-y: auto; display: flex; flex-direction: column; transition: transform 0.3s ease; z-index: 90; }
.supa-editor .right-panel { width: 280px; background-color: #181825; padding: 20px; border-left: 1px solid #313244; overflow-y: auto; transition: transform 0.3s ease; z-index: 90; }
.supa-editor .panel-resizer { width: 6px; cursor: col-resize; background: transparent; position: relative; z-index: 91; }
.supa-editor .left-resizer { order: 0; }
.supa-editor .right-resizer { order: 2; }
.supa-editor .panel-resizer:hover { background: rgba(116,199,236,0.15); }
.supa-editor.compact-mode .left-panel, .supa-editor.compact-mode .right-panel { width: 220px; padding: 12px; }
.supa-editor.compact-mode .panel-section { margin-bottom: 10px; }
.supa-editor.compact-mode .tool-buttons { grid-template-columns: repeat(1, 1fr); }
.supa-editor.compact-mode .icons-grid { grid-template-columns: repeat(3, 1fr); }
.supa-editor .editor-area { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; background-color: #1e1e2e; overflow: hidden; position: relative; }
.supa-editor #se-image-editor { background-color: #11111b; border: 1px solid #313244; border-radius: 8px; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.supa-editor .panel-section { margin-bottom: 15px; }
.supa-editor .panel-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: #74c7ec; display: flex; align-items: center; }
.supa-editor .panel-title i { margin-right: 6px; }
.supa-editor .upload-area { border: 2px dashed #45475a; border-radius: 8px; padding: 20px; text-align: center; margin-bottom: 15px; cursor: pointer; transition: all 0.3s; }
.supa-editor .upload-area:hover { border-color: #74c7ec; background-color: #313244; }
.supa-editor .upload-icon { font-size: 36px; color: #74c7ec; margin-bottom: 8px; }
.supa-editor .button { background-color: #74c7ec; color: #1e1e2e; border: none; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; transition: all 0.2s; margin-bottom: 8px; width: 100%; justify-content: center; font-size: 13px; }
.supa-editor .button i { margin-right: 6px; font-size: 12px; }
.supa-editor .button:hover { background-color: #89dceb; }
.supa-editor .button-secondary { background-color: #45475a; color: #cdd6f4; font-size: 13px; }
.supa-editor .button-secondary:hover { background-color: #585b70; }
.supa-editor .control-group { margin-bottom: 10px; }
.supa-editor .control-label { display: block; margin-bottom: 5px; font-size: 13px; }
.supa-editor .slider-container { display: flex; align-items: center; }
.supa-editor .slider { flex: 1; height: 4px; appearance: none; -webkit-appearance: none; background: #45475a; border-radius: 5px; outline: none; }
.supa-editor .slider::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #74c7ec; cursor: pointer; }
.supa-editor .slider-value { width: 35px; text-align: right; margin-left: 8px; font-size: 12px; }
.supa-editor .zoom-controls { position: absolute; bottom: 15px; right: 15px; background-color: rgba(17,17,27,0.7); border-radius: 6px; padding: 8px; display: flex; gap: 10px; z-index: 80; }
#se-zoom-level { min-width: 56px; text-align: center; line-height: 32px; font-weight: 600; color: #cdd6f4; }
.supa-editor .zoom-button { width: 32px; height: 32px; border-radius: 50%; background-color: #74c7ec; color: #1e1e2e; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.supa-editor .format-badges { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.supa-editor .format-badge { background-color: #313244; padding: 3px 8px; border-radius: 4px; font-size: 11px; }
.supa-editor .toggle-switch { position: relative; display: inline-block; width: 42px; height: 20px; }
.supa-editor .toggle-switch input { opacity: 0; width: 0; height: 0; }
.supa-editor .toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #45475a; transition: .4s; border-radius: 24px; }
.supa-editor .toggle-slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px; background-color: #ffffff; transition: .4s; border-radius: 50%; }
.supa-editor input:checked + .toggle-slider { background-color: #74c7ec; }
.supa-editor input:checked + .toggle-slider:before { transform: translateX(20px); }
.supa-editor .tab-controls { display: flex; background-color: #313244; border-radius: 6px; padding: 3px; margin-bottom: 10px; }
.supa-editor .tab { padding: 6px 12px; border-radius: 4px; cursor: pointer; flex: 1; text-align: center; font-size: 13px; }
.supa-editor .tab.active { background-color: #74c7ec; color: #1e1e2e; font-weight: 600; }
.supa-editor.compact-mode .tab-controls { position: sticky; top: 0; z-index: 5; }
.supa-editor.compact-mode .tab-content { max-height: calc(100vh - 220px); overflow: hidden auto; }
.supa-editor .tool-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.supa-editor .layers-list { max-height: 500px; overflow-y: auto; overflow-x: hidden; margin-bottom: 10px; border: 1px solid #313244; border-radius: 6px; padding: 4px; }
.supa-editor.compact-mode .layers-list { max-height: 320px; }
.supa-editor .layer-item { display: flex; align-items: center; padding: 6px; margin-bottom: 4px; border-radius: 4px; cursor: pointer; transition: all 0.2s; background-color: #313244; font-size: 13px; }
.supa-editor .layer-item:hover { background-color: #45475a; }
.supa-editor .layer-item.selected { background-color: #74c7ec; color: #1e1e2e; }
.supa-editor .layer-item.hidden { opacity: 0.5; }
.supa-editor .layer-item.locked { opacity: 0.7; background-color: #585b70; }
.supa-editor .layer-item.group { background-color: #2a3f2a; /* тёмно-зелёный фон для групп */ }
.supa-editor .layer-item.group.selected { background-color: #3fb950; color: #0c1a0c; }
.supa-editor .layer-icon { margin-right: 6px; width: 18px; text-align: center; font-size: 12px; }
.supa-editor .layer-name { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supa-editor .layer-visibility { margin-right: 4px; cursor: pointer; opacity: 0.7; font-size: 12px; }
.supa-editor .layer-visibility:hover { opacity: 1; }
.supa-editor .layer-item { position: relative; overflow: visible; }
.supa-editor .layer-menu { display: flex; gap: 6px; position: relative; }
.supa-editor .layer-menu-btn { width: 26px; height: 26px; border-radius: 4px; border: none; background: #45475a; color: #cdd6f4; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.supa-editor .layer-menu-btn:hover { background: #585b70; }
.supa-editor .layer-menu-content { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: #181825; border: 1px solid #313244; border-radius: 6px; padding: 6px; z-index: 300; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.supa-editor .layer-menu.open .layer-menu-content { display: block; }
.supa-editor .layer-menu-content button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: none; background: transparent; color: #cdd6f4; text-align: left; cursor: pointer; border-radius: 4px; font-size: 12px; }
.supa-editor .layer-menu-content button:hover { background: #313244; }
.supa-editor .layer-actions { display: flex; gap: 6px; margin-left: 6px; }
.supa-editor .editor-area canvas { display: block; }

/* Контрасты для подписей и инпутов под тёмную тему */
.supa-editor label,
.supa-editor .control-label {
	color: #cdd6f4; /* светлый текст для читабельности */
}

/* Общие поля ввода под тёмную тему (кроме range и color) */
.supa-editor input[type="text"],
.supa-editor input[type="number"],
.supa-editor textarea,
.supa-editor select {
	background-color: #181825;
	color: #cdd6f4;
	border: 1px solid #313244;
	border-radius: 6px;
}
.supa-editor input[type="text"],
.supa-editor input[type="number"],
.supa-editor select {
	padding: 8px;
	font-size: 13px;
}
.supa-editor input[type="text"]::placeholder,
.supa-editor textarea::placeholder {
	color: #a6adc8;
}
.supa-editor select:focus,
.supa-editor input[type="text"]:focus,
.supa-editor input[type="number"]:focus,
.supa-editor textarea:focus {
	outline: none;
	border-color: #74c7ec;
	box-shadow: 0 0 0 2px rgba(116,199,236,0.2);
}
/* Не трогаем ползунки и color-picker */
.supa-editor input[type="range"],
.supa-editor input[type="color"] {
	background: transparent;
	border: none;
}
/* Стили для disabled-полей, чтобы были различимы на тёмном фоне */
.supa-editor select:disabled,
.supa-editor input[type="text"]:disabled,
.supa-editor input[type="number"]:disabled,
.supa-editor textarea:disabled {
	background-color: #11111b;
	color: #a6adc8;
	opacity: 1; /* оставляем читаемость */
}

/* Специально для выпадающих списков: тёмный фон у опций */
.supa-editor select option {
	background-color: #181825 !important;
	color: #cdd6f4 !important;
}
/* Dark selects with stronger specificity */
.supa-editor .right-panel select.button-secondary,
.supa-editor .right-panel select#se-font-family,
.supa-editor .right-panel select#se-text-align,
.supa-editor .right-panel #se-font-family.button-secondary,
.supa-editor .right-panel #se-text-align.button-secondary,
.supa-editor #se-icons-category.icons-category-select,
.supa-editor .icons-category-select {
	background-color: #181825 !important;
	color: #cdd6f4 !important;
	border: 1px solid #313244 !important;
}
.supa-editor .right-panel select.button-secondary:focus,
.supa-editor .right-panel select#se-font-family:focus,
.supa-editor .right-panel select#se-text-align:focus,
.supa-editor #se-icons-category.icons-category-select:focus,
.supa-editor .icons-category-select:focus {
	outline: none !important;
	border-color: #74c7ec !important;
	box-shadow: 0 0 0 2px rgba(116,199,236,0.2) !important;
}

	/* Final override for any selects inside editor */
	.supa-editor select {
		background-color: #181825 !important;
		color: #cdd6f4 !important;
		border: 1px solid #313244 !important;
	}
	.supa-editor select option {
		background-color: #181825 !important;
		color: #cdd6f4 !important;
	}

/* Форсируем тёмные выпадающие списки и светлый текст с повышенной специфичностью */
.supa-editor select,
.supa-editor .icons-category-select,
#se-font-family,
#se-text-align,
#se-icons-category {
	background-color: #181825 !important;
	color: #cdd6f4 !important;
	border: 1px solid #313244 !important;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}
.supa-editor select:focus,
#se-font-family:focus,
#se-text-align:focus,
#se-icons-category:focus {
	outline: none !important;
	border-color: #74c7ec !important;
	box-shadow: 0 0 0 2px rgba(116,199,236,0.2) !important;
}
.supa-editor select:disabled,
#se-font-family:disabled,
#se-text-align:disabled,
#se-icons-category:disabled {
	background-color: #11111b !important;
	color: #a6adc8 !important;
}

/* Поисковая строка и селект категорий иконок */
.supa-editor .icons-search,
.supa-editor .icons-category-select {
	background-color: #181825;
	color: #cdd6f4;
	border: 1px solid #313244;
	border-radius: 6px;
	padding: 8px;
	font-size: 13px;
}

/* Быстрая панель ИИ внизу рабочей области */
/* Нижняя панель ИИ */
.supa-editor .ai-footer { position: absolute; left: 20px; right: 20px; bottom: 20px; background: rgba(17,17,27,0.92); border: 1px solid #313244; border-radius: 10px; padding: 12px; z-index: 85; backdrop-filter: blur(4px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); transition: transform .2s ease, opacity .2s ease, visibility .2s ease; }
.supa-editor .ai-footer.hidden { transform: translateY(15px); opacity: 0; visibility: hidden; pointer-events: none; }
.supa-editor .ai-footer-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.supa-editor .ai-field { display: flex; flex-direction: column; gap: 6px; }
.supa-editor .ai-field.full { grid-column: 1 / -1; }
.supa-editor .ai-field label { font-size: 12px; color: #a6adc8; }
.supa-editor #se-quick-prompt, .supa-editor #se-quick-output { width: 100%; resize: vertical; padding: 10px; border-radius: 8px; border: 1px solid #313244; background: #181825; color: #cdd6f4; font-size: 13px; }
.supa-editor #se-quick-output { min-height: 70px; }
.supa-editor .ai-actions { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.supa-editor .ai-status { font-size: 12px; color: #a6adc8; min-height: 16px; text-align: center; }

/* Кнопка-тогглер панели ИИ */
.supa-editor .ai-toggle-btn { position: absolute; right: 20px; bottom: 20px; z-index: 90; width: 40px; height: 40px; border-radius: 10px; border: 1px solid #313244; background: #74c7ec; color: #1e1e2e; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.supa-editor .ai-toggle-btn:hover { background: #89dceb; }
.supa-editor .ai-toggle-btn .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,1px,1px); white-space: nowrap; border: 0; }

/* Сетка иконок */
.supa-editor .icons-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 300px; overflow-y: auto; margin-bottom: 10px; padding: 5px; }
.supa-editor .icon-item { background-color: #313244; border-radius: 6px; padding: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; aspect-ratio: 1/1; }
.supa-editor .icon-item:hover { background-color: #45475a; transform: scale(1.05); }
.supa-editor .icon-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.supa-editor .icon-item .material-symbols-preview { font-size: 32px; line-height: 1; color: #cdd6f4; }
/* Material Symbols classes to enable ligatures properly */
.material-symbols-outlined,
.material-symbols-rounded,
.material-symbols-sharp {
	font-weight: normal;
	font-style: normal;
	display: inline-block;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	word-wrap: normal;
	white-space: nowrap;
	direction: ltr;
	-webkit-font-feature-settings: 'liga';
	font-feature-settings: 'liga';
	-webkit-font-smoothing: antialiased;
}
.material-symbols-outlined { font-family: 'Material Symbols Outlined'; }
.material-symbols-rounded  { font-family: 'Material Symbols Rounded'; }
.material-symbols-sharp    { font-family: 'Material Symbols Sharp'; }
.supa-editor .icons-mode-toggle { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.supa-editor .icons-mode-toggle .mode-btn { background: #45475a; color: #cdd6f4; border: none; border-radius: 6px; padding: 6px 8px; cursor: pointer; font-size: 12px; width: 100%; text-align: left; }
.supa-editor .icons-mode-toggle .mode-btn.active { background: #74c7ec; color: #1e1e2e; }
.supa-editor .icons-filters { display: flex; gap: 8px; margin: 8px 0; }
.supa-editor .icons-select { background-color: #181825; color: #cdd6f4; border: 1px solid #313244; border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.supa-editor #se-emoji-grid .emoji-item { background-color: #313244; border-radius: 6px; padding: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; aspect-ratio: 1/1; font-size: 28px; }
.supa-editor #se-emoji-grid .emoji-item:hover { background-color: #45475a; transform: scale(1.05); }
/* Место под емодзи-карточки остаётся без кнопки избранного */

/* Глобальное контекстное меню канваса */
.supa-editor .context-menu { display: none; position: fixed; left: 0; top: 0; background: #181825; border: 1px solid #313244; border-radius: 8px; padding: 6px; z-index: 1000; min-width: 200px; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
.supa-editor .context-menu .context-menu-item, .supa-editor .context-menu button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: transparent; color: #cdd6f4; border: none; text-align: left; cursor: pointer; border-radius: 4px; font-size: 13px; }
.supa-editor .context-menu .context-menu-item:hover, .supa-editor .context-menu button:hover { background: #313244; }
.supa-editor .context-menu .context-menu-divider { height: 1px; background: #313244; margin: 6px 0; }
.supa-editor .context-menu .color-palette { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 6px 0; }
.supa-editor .context-menu .color-option { width: 20px; height: 20px; border-radius: 4px; border: 1px solid #313244; cursor: pointer; }

/* Мобильные кнопки открытия панелей (прятать на десктопе) */
.supa-editor .mobile-menu-toggle { display: none; position: absolute; top: 15px; left: 15px; z-index: 1000; background-color: #74c7ec; color: #1e1e2e; border: none; border-radius: 6px; padding: 8px 12px; cursor: pointer; font-size: 16px; }

/* Виртуальная клавиатура (по умолчанию скрыта) */
.supa-editor .virtual-keyboard { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background-color: #313244; padding: 10px; box-shadow: 0 -2px 10px rgba(0,0,0,0.2); z-index: 1001; }
.supa-editor .keyboard-keys { display: flex; flex-wrap: wrap; justify-content: center; }
.supa-editor .keyboard-keys button { margin: 3px; padding: 8px; min-width: 30px; background-color: #45475a; color: #cdd6f4; border: none; border-radius: 4px; cursor: pointer; }

/* Респонсив: планшеты/ноутбуки */
@media (max-width: 1200px) {
	.supa-editor .left-panel, .supa-editor .right-panel { width: 240px; }
	.supa-editor .icons-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Респонсив: мобилки */
@media (max-width: 900px) {
	.supa-editor .mobile-menu-toggle { display: block; }
	.supa-editor .left-panel, .supa-editor .right-panel { position: absolute; top: 0; height: 100%; z-index: 99; transition: transform 0.3s ease; background-color: #181825; }
	.supa-editor .left-panel { left: 0; transform: translateX(-100%); width: 280px; border-right: 1px solid #313244; }
	.supa-editor .right-panel { right: 0; transform: translateX(100%); width: 280px; border-left: 1px solid #313244; }
	.supa-editor .left-panel.open, .supa-editor .right-panel.open { transform: translateX(0); }
	.supa-editor .main-container { flex-direction: column; }
	.supa-editor .editor-area { min-height: 400px; }
	.supa-editor .tool-buttons { grid-template-columns: repeat(4, 1fr); }
	.supa-editor .icons-grid { grid-template-columns: repeat(6, 1fr); max-height: 150px; }
	/* Сдвигаем панель выше, если мало места */
	.supa-editor .ai-footer { bottom: 80px; left: 12px; right: 12px; }
	.supa-editor .ai-toggle-btn { bottom: 20px; right: 12px; }
}
