 
        :root {
            /* Primary colors */
            --primary-blue: #1e88e5;
            --primary-hover: #1976d2;
            --accent-purple: #7c4dff;
            --accent-purple-hover: #651fff;
            
            /* Neutral colors for base buttons */
            --neutral-gray: #f5f7fa;
            --neutral-gray-hover: #e4e7eb;
            --neutral-border: #d1d5db;
            --neutral-text: #374151;
            
            /* Modifier colors */
            --mod-orange: #ff9800;
            --mod-orange-hover: #fb8c00;
            
            /* System colors */
            --secondary-gray: #9e9e9e;
            --bg-white: #ffffff;
            --bg-light: #f5f5f5;
            --text-dark: #212121;
            --text-gray: #757575;
            --border-gray: #e0e0e0;
            --success-green: #4caf50;
            --error-red: #f44336;
            --warning-orange: #ff9800;
            --shadow: 0 2px 8px rgba(0,0,0,0.1);
            --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
        }
 
		 .overlay.ssmlModal .modalwindow {
			     max-width: 800px;
				     padding: 0;
		 }
		 
		 .overlay.ssmlModal .modalwindow .modal-content {
			 width:100%;
			 display: flex;
			flex-direction: column;
			flex-wrap: nowrap;
			justify-content: space-between;
			height: 100%;
			padding: 0; 
			margin-top:0;
		 }
		 .overlay.ssmlModal .modalwindow.prisingBox {
			 min-height: 40vh;
			 min-height: 40dvh;
		 }
		 .overlay.ssmlModal .modalwindow.prisingBox .closeModal {
			     position: absolute;
				top: 4px;
				right: 8px;
		 }
		.editor-toolbar.ssml {
			position:relative;
			z-index:9;
		}
		.ssml-modal-body {
			padding-left:16px;
			padding-right:16px;
		}
		
		.ssml-modal {
			  padding: 0;
			display: flex;
			flex-direction: column;
			justify-content: space-between;
			flex-wrap: nowrap;
			align-items: stretch;
			height: 100%;
			gap: 16px;
		}
		.ssml-modal-title {
			padding: 12px 16px;
			border-bottom: 1px solid var(--border-gray);
			display: flex;
			justify-content: space-between;
			align-items: center;
			background: linear-gradient(to right, #f8f9fa, white); 
			    font-weight: 500;
		}

        /* Engine Selector */
        .engine-selector {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            padding: 15px 20px;
            display: flex;
            align-items: center;
            gap: 15px;
            color: white;
        }

        .engine-selector label {
            font-weight: 600;
            font-size: 14px;
        }

        .engine-select {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            background: white;
            color: var(--text-dark);
            transition: all 0.2s;
        }

        /* Toolbar */
        .toolbar {
            background: var(--bg-white);
            padding: 15px 20px;
            border-bottom: 1px solid var(--border-gray);
            display: flex;
            align-items: center;
            gap: 8px;
            position: relative;
            z-index: 1;
        }

        .toolbar-main {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 1;
        }

        .toolbar-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .toolbar-divider {
            width: 1px;
            height: 24px;
            background: var(--neutral-border);
            margin: 0 4px;
        }

        .toolbar-ssml {
            margin-left: auto;
        }

        /* Mobile insert dropdown - hidden by default, shown on mobile */
        .mobile-insert-dropdown {
            display: none;
            align-items: center;
            gap: 4px;
            width: 100%;
            overflow: visible; /* ВАЖНО: не обрезать dropdown-content */
        }

        /* SSML Panel (collapsible) */
        .ssml-panel {
            margin-top: 15px;
            padding-top: 15px;
            display: none;
            opacity: 0;
            transform: translateY(-10px);
            transition: all 0.3s ease;
        }

        .ssml-panel.active {
            display: flex;
			  flex-direction: row;
			  align-items: center;
			  gap: 8px;
			  opacity: 1;
			  transform: translateY(0);
        }

        .ssml-header {
             display: flex;
			  align-items: center;
			  justify-content: space-between;
			  gap: 10px;
			  margin: 0;
			  width: auto;
			  flex-shrink: 0;
            color: var(--text-gray);
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .ssml-close-btn {
            background: transparent;
            border: none;
            color: var(--text-gray);
            font-size: 20px;
            cursor: pointer;
            padding: 0px 8px;
			    padding-right: 0px;
            line-height: 14px;
            transition: color 0.2s ease;
        }
        
        .ssml-close-btn:hover {
            color: var(--text-dark);
        }

        /* IPA Chart Styles */
        .ipa-chart-header {
            position: sticky;
            top: 0;
            background: white;
            border-bottom: 1px solid var(--border-gray);
            padding: 15px 20px;
            z-index: 10;
        }

        .ipa-header-top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 12px;
        }

        .ipa-title {
            margin: 0;
            font-size: 18px;
            color: var(--text-dark);
            font-weight: 600;
        }

        .ipa-header-buttons {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .ipa-apply-btn {
            background: #0db7ed;
            border: none;
            color: white;
            padding: 8px 18px;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 2px 4px rgba(13, 183, 237, 0.2);
        }

        .ipa-apply-btn:hover {
            background: #0aa5d6;
            box-shadow: 0 4px 8px rgba(13, 183, 237, 0.3);
        }

        .ipa-close-btn {
            background: #f3f4f6;
            border: none;
            color: #6b7280;
            font-size: 20px;
            cursor: pointer;
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .ipa-close-btn:hover {
            background: #e5e7eb;
        }

        .ipa-preview {
            background: #f9fafb;
            border: 2px solid #0db7ed;
            border-radius: 6px;
            padding: 12px 16px;
            font-family: 'Courier New', monospace;
            font-size: 20px;
            font-weight: 600;
            color: var(--text-dark);
            text-align: center;
            min-height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
            letter-spacing: 1px;
        }

        .ipa-preview-text {
            color: #0db7ed;
        }

        .ipa-chart-content {
            padding: 20px;
        }

        .ipa-section {
            margin-bottom: 20px;
        }

        .ipa-section-title {
            color: var(--text-dark);
            margin-bottom: 10px;
            font-size: 13px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .ipa-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
            gap: 6px;
        }

        .ipa-btn {
            background: white;
            border: 1.5px solid var(--border-gray);
            border-radius: 6px;
            padding: 6px 4px;
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
        }

        .ipa-btn:hover {
            border-color: #0db7ed;
            background: #f0f9ff;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(13, 183, 237, 0.15);
        }

        .ipa-symbol {
            font-size: 18px;
            font-weight: 700;
            color: #0db7ed;
            margin-bottom: 2px;
            line-height: 1;
        }

        .ipa-cyrillic {
            font-size: 9px;
            color: #6b7280;
            margin-bottom: 1px;
            font-weight: 500;
        }

        .ipa-example {
            font-size: 8px;
            color: #9ca3af;
            font-style: normal;
        }

        /* Mobile IPA Chart */
        @media (max-width: 768px) {
            .ipa-chart-header {
                padding: 12px 15px;
            }

            .ipa-title {
                font-size: 16px;
            }

            .ipa-apply-btn {
                padding: 7px 14px;
                font-size: 13px;
            }

            .ipa-close-btn {
                width: 30px;
                height: 30px;
                font-size: 18px;
            }

            .ipa-preview {
                padding: 10px 12px;
                font-size: 16px;
                min-height: 22px;
            }

            .ipa-chart-content {
                padding: 15px;
            }

            .ipa-section {
                margin-bottom: 16px;
            }

            .ipa-section-title {
                font-size: 12px;
                margin-bottom: 8px;
            }

            .ipa-grid {
                grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
                gap: 5px;
            }

            .ipa-btn {
                padding: 5px 3px;
            }

            .ipa-symbol {
                font-size: 16px;
            }

            .ipa-cyrillic {
                font-size: 8px;
            }

            .ipa-example {
                font-size: 7px;
            }
        }

        @media (max-width: 480px) {
            .ipa-grid {
                grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
                gap: 4px;
            }

            .ipa-btn {
                padding: 4px 2px;
            }

            .ipa-symbol {
                font-size: 14px;
            }
        }

        .ssml-buttons {
             display: flex;
			  flex-wrap: wrap;
			  gap: 8px;
			  align-items: center;
			  flex: 1;
        }
        
        /* SSML Button Groups */
        .ssml-group {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            align-items: center;
        }
        
        .ssml-divider {
            width: 1px;
            height: 24px;
            background: #d1d5db;
            margin: 0 4px;
        }
        
        /* Color schemes for different SSML groups */
        /* Базовый стиль для всех кнопок */
        .ssml-group .btn-ssml-tag {
            border: 1px solid;
            color: #374151;
            transition: all 0.2s ease;
            font-weight: 500;
        }
        
        /* Group 1: Break - Neutral Gray */
        .ssml-group-break .btn-ssml-tag {
            background: #f9fafb;
            border-color: #e5e7eb;
        }
        
        .ssml-group-break .btn-ssml-tag:hover {
            background: #f3f4f6;
            border-color: #d1d5db;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
        }
        
        /* Group 2: Prosody - Light Blue */
        .ssml-group-prosody .btn-ssml-tag {
            background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
            border-color: #bfdbfe;
            color: #1e40af;
        }
        
        .ssml-group-prosody .btn-ssml-tag:hover {
            background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
            border-color: #93c5fd;
            box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
        }
        
        /* Group 3: Say-As - Light Purple */
        .ssml-group-sayas .btn-ssml-tag {
            background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
            border-color: #e9d5ff;
            color: #6b21a8;
        }
        
        .ssml-group-sayas .btn-ssml-tag:hover {
            background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
            border-color: #d8b4fe;
            box-shadow: 0 2px 4px rgba(139, 92, 246, 0.15);
        }
        
        /* Group 4: Phoneme - Light Orange */
        .ssml-group-phoneme .btn-ssml-tag {
            background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
            border-color: #fed7aa;
            color: #c2410c;
        }
        
        .ssml-group-phoneme .btn-ssml-tag:hover {
            background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
            border-color: #fdba74;
            box-shadow: 0 2px 4px rgba(249, 115, 22, 0.15);
        }

        /* Mobile dropdown */
        .mobile-dropdown {
            position: relative;
            display: inline-block;
            overflow: visible; /* ВАЖНО: не обрезать dropdown-content */
        }

        .mobile-dropdown-content {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 8px;
            background: white;
            min-width: 200px;
            box-shadow: var(--shadow-lg);
            border-radius: 8px;
            padding: 8px;
            z-index: 2100;
            border: 1px solid var(--border-gray);
        }

        .mobile-dropdown.active .mobile-dropdown-content {
            display: block;
            animation: dropdownFadeIn 0.2s ease;
        }

        /* Fix for mobile dropdown - position below button */
        @media (max-width: 768px) {
            .mobile-dropdown {
                position: relative;
            }

            .mobile-dropdown-content {
                position: absolute;
                left: auto;
                right: 0;
                top: 100%;
                bottom: auto;
                width: 200px;
                max-width: 200px;
                margin-top: 8px;
                transform: none;
                z-index: 9999; /* Очень высокий z-index */
            }

            .mobile-dropdown.active .mobile-dropdown-content {
                display: block;
            }
        }

        @keyframes dropdownFadeIn {
            from {
                opacity: 0;
                transform: translateY(-5px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .mobile-dropdown-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border: none;
            background: transparent;
            width: 100%;
            text-align: left;
            cursor: pointer;
            border-radius: 6px;
            font-size: 14px;
            color: var(--text-dark);
            transition: background 0.2s;
            white-space: nowrap;
            min-height: 40px;
        }

        .mobile-dropdown-item:hover {
            background: var(--bg-light);
        }

        .mobile-dropdown-item:active {
            background: #e3f2fd;
        }

        .arrow {
            font-size: 10px;
            transition: transform 0.2s;
        }

        .mobile-dropdown.active .arrow {
            transform: rotate(180deg);
        }

        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
        }

        .btn-primary {
            background: var(--primary-blue);
            color: white;
        }

        .btn-primary:hover {
            background: var(--primary-hover);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
        }

        .btn-ghost {
            background: transparent;
            color: var(--text-gray);
            border: 1px solid var(--border-gray);
        }

        .btn-ghost:hover {
            background: var(--bg-light);
            border-color: var(--primary-blue);
            color: var(--primary-blue);
        }

        .btn-secondary {
            background: var(--secondary-gray);
            color: white;
        }

        .btn-secondary:hover {
            background: #757575;
        }

        /* New button styles - Neutral (base actions) */
        .btn-neutral {
            background: var(--neutral-gray);
            color: var(--neutral-text);
            border: 1px solid var(--neutral-border);
        }

        .btn-neutral:hover {
            background: var(--neutral-gray-hover);
            border-color: #9ca3af;
            transform: translateY(-1px);
        }

        /* Icon buttons (compact) */
        .btn-icon {
            padding: 8px 12px;
            min-width: auto;
        }

        /* Modifier buttons (orange) */
        .btn-modifier {
            background: white;
            color: var(--neutral-text);
            border: 1px solid var(--neutral-border);
        }

        .btn-modifier:hover {
            background: var(--neutral-gray-hover);
            border-color: var(--neutral-gray);
            transform: translateY(-1px);
        }

        /* SSML button (accent purple) */
        .btn-ssml {
            background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
            color: white;
            font-weight: 600;
            box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
        }

        .btn-ssml:hover {
            background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(107, 114, 128, 0.4);
        }

        /* SSML tag buttons (inside panel) */
        .btn-ssml-tag {
            padding: 6px 12px;
            font-size: 13px;
            background: #f3e5f5;
            color: #6a1b9a;
            border: 1px solid #ce93d8;
        }

        .btn-ssml-tag:hover {
            background: #e1bee7;
            border-color: #ab47bc;
            transform: translateY(-1px);
        }

        /* Arrow indicator (triangle) */
        .arrow-indicator {
            display: inline-block;
            font-size: 10px;
            transition: transform 0.3s;
            margin-left: 2px;
        }

        .arrow-indicator.active {
            transform: rotate(180deg);
        }

        /* Panel Actions - кнопки Отмена/Применить */
        .panel-actions {
            margin-top: 20px;
            display: flex;
            gap: 12px;
        }

        .btn-action {
            flex: 1;
            min-height: 22px;
            font-size: 15px;
            font-weight: 600;
        }

        .btn-wrapper {
            position: relative;
            display: inline-block;
        }

        /* Editor */
        .editor-container {
            padding: 20px;
        }

        .editor {
            width: 100%;
            min-height: 400px;
            padding: 16px;
            border: 2px solid var(--border-gray);
            border-radius: 6px;
            font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
            font-size: 14px;
            line-height: 1.6;
            resize: vertical;
            transition: border-color 0.2s;
        }

        .editor:focus {
            outline: none;
            border-color: var(--primary-blue);
        }

        /* Dropdown Panel */
        .dropdown-panel {
            position: absolute;
            top: calc(100% + 8px);
            background: white;
            border-radius: 8px;
            box-shadow: var(--shadow-lg);
            width: 540px;
            max-width: 540px;
            max-height: 85vh;
            z-index: 2000;
            display: none;
            opacity: 0;
            transition: all 0.2s;
            overflow: visible;
        }

        /* Выравнивание панели по левому краю (для левых кнопок) */
        .dropdown-panel.align-left {
            left: 0;
            transform: translateY(-10px);
        }

        .dropdown-panel.align-left.show {
            transform: translateY(0);
        }

        /* Центрирование панели (для центральных кнопок) */
        .dropdown-panel.align-center {
            left: 50%;
            transform: translateX(-50%) translateY(-10px);
        }

        .dropdown-panel.align-center.show {
            transform: translateX(-50%) translateY(0);
        }

        /* Выравнивание панели по правому краю (для правых кнопок) */
        .dropdown-panel.align-right {
            right: 0;
            left: auto;
            transform: translateY(-10px);
        }

        .dropdown-panel.align-right.show {
            transform: translateY(0);
        }

        /* Стрелочка панели */
        .dropdown-panel::before {
            content: '';
            position: absolute;
            top: -8px;
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-bottom: 8px solid white;
            filter: drop-shadow(0 -2px 2px rgba(0,0,0,0.1));
            z-index: 1;
            transition: left 0.2s, right 0.2s, opacity 0.2s;
        }

        /* Стрелочка для левого выравнивания */
        .dropdown-panel.align-left::before {
            left: 30px;
        }

        /* Стрелочка для центрального выравнивания */
        .dropdown-panel.align-center::before {
            left: 50%;
            transform: translateX(-50%);
        }

        /* Стрелочка для правого выравнивания */
        .dropdown-panel.align-right::before {
            right: 30px;
            left: auto;
        }

        .dropdown-panel.show {
            display: block;
            opacity: 1;
        }
        
        /* Tag Visualizer for Say-As */
        .tag-visualizer {
            background: #f8f9fa;
            border-bottom: 1px solid var(--border-gray);
            padding: 15px 20px;
            overflow-x: auto;
            scrollbar-width: thin;
        }
        
        .tag-visualizer::-webkit-scrollbar {
            height: 6px;
        }
        
        .tag-visualizer::-webkit-scrollbar-track {
            background: #e5e7eb;
            border-radius: 3px;
        }
        
        .tag-visualizer::-webkit-scrollbar-thumb {
            background: #9ca3af;
            border-radius: 3px;
        }
        
        .tag-preview {
            font-family: 'Courier New', monospace;
            font-size: 14px;
            color: var(--text-dark);
            display: flex;
            align-items: center;
            gap: 4px;
            white-space: nowrap;
        }
        
        .tag-bracket {
            color: #999;
        }
        
        .tag-bracket span {
            color: #0db7ed;
            font-weight: 600;
        }
        
        .tag-content-input {
            font-family: 'Courier New', monospace;
            font-size: 14px;
            font-weight: 600;
            color: #0db7ed;
            border: none;
            border-bottom: 2px solid #0db7ed;
            background: white;
            padding: 2px 6px;
            outline: none;
            transition: all 0.2s;
            min-width: 100px;
        }
        
        .tag-content-input:focus {
            border-bottom-color: #0aa5d6;
            background: #f0f9ff;
        }
        
        .tag-content-input::placeholder {
            color: #9ca3af;
            font-style: italic;
        }
        
        /* Mobile adaptations for tag visualizer */
        @media (max-width: 768px) {
            .tag-visualizer {
                padding: 10px 12px;
            }
            
            .tag-preview {
                font-size: 12px;
                gap: 3px;
            }
            
            .tag-content-input {
                font-size: 12px;
                padding: 2px 4px;
                min-width: 80px;
                max-width: 200px;
            }
        }
        
        @media (max-width: 480px) {
            .tag-visualizer {
                padding: 8px 10px;
            }
            
            .tag-preview {
                font-size: 11px;
                gap: 2px;
            }
            
            .tag-content-input {
                font-size: 11px;
                padding: 2px 3px;
                min-width: 60px;
                max-width: 150px;
            }
        }

        .panel-header {
            padding: 12px 15px;
            border-bottom: 1px solid var(--border-gray);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(to right, white, #f8f9fa);
        }

        .panel-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-dark);
        }

        .btn-close {
            background: transparent;
            border: none;
            color: var(--text-gray);
            cursor: pointer;
            font-size: 20px;
            line-height: 1;
            padding: 4px 8px;
            border-radius: 4px;
            font-weight: bold;
        }

        .btn-close:hover {
            background: var(--error-red);
            color: white;
        }

        .panel-content {
            padding: 12px;
            max-height: 500px;
            overflow-y: auto;
        }

        .panel-content::-webkit-scrollbar {
            width: 8px;
        }

        .panel-content::-webkit-scrollbar-track {
            background: var(--bg-light);
        }

        .panel-content::-webkit-scrollbar-thumb {
            background: var(--border-gray);
            border-radius: 4px;
        }

        /* Categories */
        .category-section {
            margin-bottom: 24px;
        }

        .category-section:last-child {
            margin-bottom: 0;
        }

        .category-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 2px solid var(--border-gray);
        }

        .options-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 10px;
        }

        .option-btn {
            padding: 12px 10px;
            background: white;
            border: 2px solid var(--border-gray);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 13px;
            font-weight: 500;
            text-align: center;
            color: var(--text-dark);
        }

        .option-btn:hover {
            border-color: var(--primary-blue);
            background: #e3f2fd;
            transform: translateY(-2px);
            box-shadow: 0 2px 8px rgba(30, 136, 229, 0.2);
        }
        
        .option-btn.selected {
            border-color: var(--primary-blue);
            background: #e3f2fd;
            font-weight: 600;
        }

        .option-btn.has-suboptions::after {
            content: '→';
            margin-left: 4px;
            color: var(--primary-blue);
        }

        /* Form Controls */
        .form-group {
            margin-bottom: 12px;
        }

        .form-group:last-child {
            margin-bottom: 0;
        }

        .form-label {
            display: block;
            font-size: 16px;
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 8px;
        }

        .form-label.required::after {
            content: '*';
            color: var(--error-red);
            margin-left: 4px;
        }

        .form-input {
            width: 100%;
            padding: 6px;
            border: 2px solid var(--border-gray);
            border-radius: 6px;
            font-size: 14px;
            transition: all 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary-blue);
            box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
        }

        .form-input.error {
            border-color: var(--error-red);
            background: #ffebee;
        }

        .form-select {
            width: 100%;
            padding: 10px 12px;
            border: 2px solid var(--border-gray);
            border-radius: 6px;
            font-size: 14px;
            background: white;
            cursor: pointer;
            transition: all 0.2s;
        }

        .form-select.error {
            border-color: var(--error-red);
            background: #ffebee;
        }

        /* Dual Input */
        .dual-input-section {
            border: 1px solid var(--border-gray);
            border-radius: 6px;
            padding: 12px;
            background: #fafafa;
        }

        .dual-input-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-gray);
            margin-bottom: 12px;
            text-transform: uppercase;
        }

        .presets-group {
            margin-bottom: 12px;
        }

        .presets {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 6px;
        }

        .preset-btn {
            padding: 6px 12px;
            background: white;
            border: 2px solid var(--border-gray);
            border-radius: 4px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.2s;
            font-weight: 500;
			color: var(--text-gray);
        }

        .preset-btn:hover {
            background: var(--primary-blue);
            color: white;
            border-color: var(--primary-blue);
            transform: translateY(-1px);
        }

        .preset-btn.selected {
            background: var(--primary-blue);
            color: white;
            border-color: var(--primary-blue);
        }

        .custom-inputs-group {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .input-with-unit {
            display: flex;
            gap: 6px;
            align-items: center;
        }

        .input-with-unit input {
            flex: 1;
        }

        .text-input-wrapper {
            margin-bottom: 10px;
        }

        .input-helper {
            display: block;
            font-size: 12px;
            color: var(--text-gray);
            margin-top: 6px;
            font-style: italic;
            line-height: 1.4;
        }

        /* Custom Format Toggle (Вариант 5) */
        .custom-format-trigger {
            margin-top: 12px;
        }

        .btn-custom-format {
            width: 100%;
            padding: 12px 16px;
            background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
            border: 2px dashed var(--border-gray);
            border-radius: 8px;
            color: var(--text-dark);
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-custom-format:hover {
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            border-color: var(--primary-blue);
            border-style: solid;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(30, 136, 229, 0.2);
        }

        .btn-custom-format:active {
            transform: translateY(0);
            box-shadow: none;
        }

        .custom-format-section {
            padding: 16px;
            background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
            border: 2px solid #ffa726;
            border-radius: 8px;
            margin-top: 12px;
        }

        .custom-format-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 10px;
        }

        .custom-format-section .form-input {
            margin-bottom: 8px;
            border: 2px solid #ffa726;
        }

        .custom-format-section .form-input:focus {
            border-color: #ff9800;
            box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);
        }

        .custom-format-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 12px;
        }

        .custom-format-hint {
            display: block;
            text-align: center;
            color: #f57c00;
            font-size: 12px;
            font-weight: 600;
            opacity: 0.8;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 0.8; }
            50% { opacity: 1; }
        }

        .btn-back-presets {
            width: 100%;
            padding: 10px 16px;
            background: white;
            border: 2px solid var(--border-gray);
            border-radius: 6px;
            color: var(--text-dark);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }

        .btn-back-presets:hover {
            background: var(--bg-light);
            border-color: var(--primary-blue);
        }

        .btn-back-presets:active {
            transform: scale(0.98);
        }

        /* Back button in panel title */
        .btn-back-inline {
            padding: 6px 12px;
            background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
            border: 2px solid var(--primary-blue);
            border-radius: 6px;
            color: var(--primary-blue);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-right: 10px;
            vertical-align: middle;
        }

        .btn-back-inline:hover {
            background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
            transform: translateX(-2px);
            box-shadow: 0 2px 8px rgba(30, 136, 229, 0.3);
        }

        .btn-back-inline:active {
            transform: translateX(0) scale(0.98);
        }

        /* IPA Chart Overlay & Modal */
        .ipa-chart-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.75);
            z-index: 10000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            box-sizing: border-box;
        }

        .ipa-chart-modal {
            background: white;
            border-radius: 8px;
            max-width: 1200px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
            position: relative;
        }

        /* IPA Preview states */
        .ipa-preview-text.has-content {
            color: #1a202c;
        }

        .ipa-preview-text.is-empty {
            color: #0db7ed;
        }

        /* Touch effects for mobile */
        .btn-back-inline.touch-active {
            transform: scale(0.95);
        }

        /* Mobile back button */
        .btn-back-mobile {
            background: linear-gradient(135deg, #2563eb 0%, #4a90e2 100%);
            border: none;
            color: white;
            font-size: 15px;
            cursor: pointer;
            padding: 8px 14px;
            display: flex;
            align-items: center;
            gap: 6px;
            font-weight: 600;
            border-radius: 8px;
            box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
            transition: all 0.2s ease;
            min-height: 40px;
            line-height: 1.5;
            white-space: nowrap;
        }

        .btn-back-mobile.touch-active {
            transform: scale(0.95);
        }

        .panel-title {
            display: flex;
            align-items: center;
        }

        .panel-title span {
            display: inline-block;
        }

        .unit-selector {
            display: flex;
            gap: 4px;
        }

        .unit-btn {
            padding: 8px 12px;
            background: white;
            border: 2px solid var(--border-gray);
            border-radius: 4px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            min-width: 45px;
        }

        .unit-btn:hover {
            border-color: var(--primary-blue);
        }

        .unit-btn.active {
            background: var(--primary-blue);
            color: white;
            border-color: var(--primary-blue);
			cursor: default;
        }
		
		.break-inputs {
			    display: flex;
				flex-direction: column;
				flex-wrap: nowrap;
				justify-content: space-between;
				gap: 8px;
		}
        /* ssml-tabs for Prosody */
        .ssml-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
            border-bottom: 2px solid var(--border-gray);
        }

        .tab-btn {
            padding: 8px 16px;
            background: transparent;
            border: none;
            border-bottom: 2px solid transparent;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-gray);
            transition: all 0.2s;
            margin-bottom: -2px;
			border-radius:0px
        }

        .tab-btn:hover {
            color: var(--primary-blue);
        }

        .tab-btn.selected {
            color: var(--primary-blue);
            border-bottom-color: var(--primary-blue);
        }

        .tab-content {
            display: none;
        }

        .tab-content.selected {
            display: block;
        }

        /* Sub-attributes dynamic section - без дополнительных стилей */

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Actions */
        .panel-actions {
            padding: 12px 15px;
            border-top: 1px solid var(--border-gray);
            display: flex;
            gap: 10px;
            justify-content: flex-end;
            background: #fafafa;
        }

        /* Alert */
        .alert {
            padding: 12px 16px;
            border-radius: 6px;
            margin-bottom: 16px;
            font-size: 13px;
        }

        .alert-warning {
            background: #fff3cd;
            border: 1px solid #ffc107;
            color: #856404;
        }

        .alert-info {
            background: #e3f2fd;
            border: 1px solid #2196f3;
            color: #0d47a1;
        }

        .error-message {
            font-size: 12px;
            color: var(--error-red);
            margin-top: 4px;
            display: none;
        }

        .error-message.show {
            display: block;
        }

        /* Grouped Modal for Mobile */
        .group-modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s;
            z-index: 1001;
        }

        .group-modal-overlay.show {
            opacity: 1;
            pointer-events: all;
        }

        .group-modal {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) scale(0.9);
            width: 90%;
            max-width: 360px;
            max-height: 80vh;
            background: white;
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            opacity: 0;
            pointer-events: none;
            transition: all 0.3s;
            z-index: 1002;
            overflow: hidden;
        }

        .group-modal.show {
            transform: translate(-50%, -50%) scale(1);
            opacity: 1;
            pointer-events: all;
        }

        .group-modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid var(--border-gray);
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(to right, #f8f9fa, white);
        }

        .group-modal-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-dark);
        }

        .group-modal-close {
            background: transparent;
            border: none;
            color: var(--text-gray);
            cursor: pointer;
            font-size: 20px;
            line-height: 1;
            padding: 4px 8px;
            border-radius: 4px;
            font-weight: bold;
        }

        .group-modal-close:hover {
            background: var(--error-red);
            color: white;
        }

        .group-modal-content {
            padding: 20px;
            max-height: calc(80vh - 60px);
            overflow-y: auto;
        }

        .group-modal-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }

        .group-modal-item {
            padding: 16px 10px;
            background: var(--bg-light);
            border: 2px solid var(--border-gray);
            border-radius: 8px;
            text-align: center;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            min-height: 70px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

        .group-modal-item:active {
            background: #e3f2fd;
            border-color: var(--primary-blue);
            transform: scale(0.98);
        }

        .group-modal-item-icon {
            font-size: 20px;
        }

        /* Validation Error Message */
        .validation-error-message {
            padding: 16px;
            background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
            border: 2px solid var(--error-red);
            border-radius: 8px;
            color: var(--error-red);
            margin-bottom: 20px;
            animation: shake 0.4s ease-in-out;
        }

        .validation-error-message strong {
            display: block;
            font-size: 15px;
            margin-bottom: 10px;
            color: #c62828;
        }

        .validation-error-message ul {
            margin: 0;
            padding-left: 20px;
            list-style: disc;
        }

        .validation-error-message li {
            margin: 5px 0;
            font-size: 14px;
            color: #d32f2f;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-10px); }
            75% { transform: translateX(10px); }
        }

        /* Tablet Styles (480px - 768px) */
        @media (min-width: 480px) and (max-width: 767px) {
            .presets {
                grid-template-columns: repeat(4, 1fr);
            }
        }

        /* Desktop Styles (>768px) */
        @media (min-width: 768px) {
            /* Hide mobile groups on desktop */
            .mobile-group {
                display: none;
            }

            /* Show all desktop buttons */
            .btn-wrapper:not(.mobile-group) {
                display: block;
            }
			
			.btn-wrapper.hidden:not(.mobile-group) {
                display: none;
            }

            /* Desktop toolbar - horizontal flex */
            .toolbar {
                display: flex;
                flex-direction: row;
                flex-wrap: wrap;
                gap: 10px;
                padding: 12px 16px;
            }

            .btn {
                min-height: auto;
                width: auto;
            }

            /* Show File and Clear buttons */
            .btn-ghost {
                display: inline-flex;
            }
        }

        /* Mobile Responsive Styles */
        
        /* Tablets and small laptops (768px - 1024px) */
        @media (max-width: 1024px) {
            .container {
                max-width: 100%;
                border-radius: 0;
            }
            
            .dropdown-panel {
                max-width: calc(100vw - 30px);
            }
        }
        
        /* Desktop: show all buttons */
        @media (min-width: 769px) {
            .desktop-groups {
                display: flex;
            }
            
            .mobile-insert-dropdown {
                display: none;
            }
        }

        /* Small tablets and large phones (481px - 768px) */
        @media (max-width: 768px) {
            body {
                padding: 0;
            }
            
            .container {
                border-radius: 0;
                overflow: visible; /* ВАЖНО: не обрезать dropdown меню */
            }

            /* SSML Панели как полноэкранные модалки на мобильных */
            .dropdown-panel {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                width: 100%;
                max-width: 100%;
                height: 100vh;
                max-height: 100vh;
                transform: none;
                border-radius: 0;
                z-index: 99999;
                overflow-y: auto;
            }

            .dropdown-panel.show {
                display: block;
                opacity: 1;
                transform: none;
            }

            /* Белый фон для модалки (без backdrop) */
            .dropdown-panel {
                background: white;
            }

            /* Убираем стрелку на мобильных */
            .dropdown-panel::before {
                display: none;
            }

            /* Backdrop теперь через ::after панели, старый элемент не используется на мобильных */
            .modal-backdrop {
                display: none; /* Скрыт на мобильных */
            }

            @keyframes fadeIn {
                from { opacity: 0; }
                to { opacity: 1; }
            }

            /* Более заметная кнопка закрытия */
            .btn-close {
                width: 40px;
                height: 40px;
                font-size: 28px;
                background: rgba(0, 0, 0, 0.05);
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .btn-close:hover {
                background: rgba(0, 0, 0, 0.1);
            }
            
            /* Engine Selector */
            .engine-selector {
                padding: 12px 15px;
                gap: 10px;
                flex-wrap: wrap;
            }
            
            .engine-selector label {
                font-size: 13px;
            }

            /* Toolbar adaptivity */
            .desktop-groups {
                display: none;
            }

            .toolbar {
                padding: 8px 10px;
                overflow: visible; /* ВАЖНО: не обрезать dropdown */
            }

            .toolbar-main {
                width: 100%;
                gap: 4px;
                overflow: visible; /* ВАЖНО: не обрезать dropdown */
            }

            .mobile-insert-dropdown {
                display: flex;
                flex-wrap: nowrap;
                overflow: visible; /* ВАЖНО: не обрезать dropdown */
                gap: 4px;
                align-items: center;
                width: 100%; /* Занимаем всю ширину */
            }

            .toolbar-ssml {
                display: none; /* Скрываем десктопную SSML кнопку */
            }

            /* Компактные кнопки на мобильных */
            .btn-icon {
                min-width: 45px;
                max-width: 45px;
                width: 45px;
                padding: 8px 4px;
                font-size: 18px;
            }
            
            .mobile-dropdown {
                flex-shrink: 0;
                overflow: visible; /* ВАЖНО: не обрезать dropdown-content */
            }

            .btn-ssml {
                min-width: auto;
                max-width: max-content;
                width: auto;
                padding: 8px 12px;
                font-size: 13px;
                flex-shrink: 0;
                flex-grow: 0;
                margin-left: auto; /* Прижимаем вправо */
                background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
                color: white;
            }
            
            .btn-ssml:hover {
                background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
            }

            .ssml-panel {
                margin-top: 0;
                padding: 10px 10px 12px 10px;
                background: white;
            }

            .ssml-panel.active {
			  display: flex;
			  flex-direction: row;
			  align-items: flex-start;
			  gap: 8px;
			  opacity: 1;
			  transform: translateY(0);
			}

            .ssml-header {
			  font-size: 10px;
			  margin: 0;
			  width: auto;
			  flex-shrink: 0;
			  padding-top: 6px;
			}

            .ssml-buttons {
                display: flex; flex-direction: column; gap: 12px; flex: 1;
            }
            
            .ssml-group {
                display: grid;
                grid-template-columns: repeat(3, 1fr);
                gap: 6px;
                width: 100%;
            }
            
            .ssml-divider {
                width: 100%;
                height: 1px;
                margin: 0;
            }

            .btn-ssml-tag {
                font-size: 11px;
                padding: 5px 8px;
                white-space: nowrap;
                width: 100%; /* Занимаем всю ширину ячейки grid */
            }

            /* Mobile buttons optimization */
            .btn-icon {
                min-width: 40px;
                max-width: 40px;
                height: 40px;
                padding: 6px;
                font-size: 16px;
                flex-shrink: 0;
            }

            .mobile-dropdown {
                flex-shrink: 0;
            }

            .mobile-dropdown .btn {
                font-size: 12px;
                padding: 8px 12px;
                white-space: nowrap;
            }

            .mobile-dropdown-content {
                min-width: 170px;
            }

            .mobile-dropdown-item {
                padding: 10px 12px;
                font-size: 13px;
            }
            
            .engine-select {
                padding: 6px 12px;
                font-size: 13px;
                flex: 1;
                min-width: 140px;
            }
            
            #engineInfo {
                width: 100%;
                text-align: center;
                font-size: 12px;
            }
            
            /* Toolbar - Grouped mode for mobile */
            .toolbar {
                padding: 10px 12px;
                display: flex;
                flex-direction: row;
                gap: 8px;
            }
            
            .btn-wrapper {
                display: none; /* Hide individual buttons on mobile */
            }
            
            .btn-wrapper.mobile-group {
                display: block; /* Show only group buttons */
            }

            /* ВАЖНО: показываем btn-wrapper внутри SSML панели */
            .ssml-panel .btn-wrapper {
                display: inline-block;
				
            }
			
			.ssml-panel .btn-wrapper.hidden {
                display: none;
				
            }
            
            .btn {
                padding: 10px 12px;
                font-size: 13px;
                min-height: 50px;
                width: 100%;
                justify-content: center;
                text-align: center;
				border-radius:6px;
            }
            
            .btn-ghost {
                display: none; /* Hide File and Clear buttons on mobile */
            }
            
            /* Editor */
            .editor-container {
                padding: 15px;
            }
            
            .editor {
                min-height: 300px;
                padding: 12px;
                font-size: 13px;
            }
            
            /* Dropdown Panels - всегда центрируем на мобильных */
            .dropdown-panel.align-left,
            .dropdown-panel.align-center,
            .dropdown-panel.align-right {
                min-width: 300px;
                max-width: calc(100vw - 20px);
                max-height: 80vh;
                width: calc(100vw - 20px);
                left: 50%;
                right: auto;
                transform: translateX(-50%) translateY(-10px);
            }
            
            .dropdown-panel.align-left.show,
            .dropdown-panel.align-center.show,
            .dropdown-panel.align-right.show {
                transform: translateX(-50%) translateY(0);
            }
            
            /* Скрыть стрелочку на мобильных */
            .dropdown-panel::before {
                display: none;
            }
            
            .panel-header {
                padding: 12px 15px;
            }
            
            .panel-title {
                font-size: 15px;
            }
            
            .panel-content {
                padding: 15px;
                max-height: calc(80vh - 160px);
            }
            
            .panel-actions {
                padding: 12px 15px;
                flex-wrap: wrap;
            }
            
            .panel-actions .btn {
                flex: 1;
                min-width: 100px;
                justify-content: center;
            }
            
            /* Options Grid */
            .options-grid {
                grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
                gap: 8px;
            }
            
            .option-btn {
                padding: 10px 8px;
                font-size: 12px;
                min-height: 22px;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            
            /* ssml-tabs */
            .ssml-tabs {
                gap: 6px;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
            }
            
            .tab-btn {
                padding: 8px 16px;
                font-size: 13px;
                white-space: nowrap;
            }
            
            /* Presets */
            .preset-btn {
                padding: 8px 12px;
                font-size: 12px;
                min-height: 22px;
            }
            
            /* Form inputs */
            .form-input,
            .form-select {
                padding: 6px;
                font-size: 16px; /* Prevents zoom on iOS */
                min-height: 22px;
            }
            
            .unit-btn {
                min-width: 50px;
                min-height: 22px;
            }
        }
        
        /* Mobile phones (376px - 480px) */
        @media (max-width: 480px) {
            /* Engine Selector */
            .engine-selector {
                padding: 10px 12px;
                gap: 8px;
            }
            
            .engine-selector label {
                font-size: 12px;
                width: 100%;
            }
            
            .engine-select {
                width: 100%;
                min-width: 100%;
                font-size: 14px;
            }
            
            #engineInfo {
                font-size: 11px;
                margin-top: 5px;
            }
            
            /* Toolbar - Grouped mobile layout */
            .toolbar {
                padding: 8px 10px;
                display: flex;
                flex-direction: row;
                gap: 8px;
            }
            
            .btn-wrapper {
                display: none;
            }
            
            .btn-wrapper.mobile-group {
                display: block;
            }

            /* ВАЖНО: показываем btn-wrapper внутри SSML панели */
            .ssml-panel .btn-wrapper {
                display: inline-block;
            }
            
            .btn {
                font-size: 12px;
                padding: 10px 12px;
                width: 100%;
                justify-content: center;
                min-height: 50px;
            }
            
            .btn-ghost {
                display: none;
            }
            
            /* Editor */
            .editor-container {
                padding: 12px;
            }
            
            .editor {
                min-height: 250px;
                padding: 10px;
                font-size: 14px;
            }
            
            /* Полноэкранные модалки для SSML панелей */
            .dropdown-panel {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                width: 100%;
                max-width: 100%;
                height: 100vh;
                max-height: 100vh;
                transform: none;
                border-radius: 0;
                z-index: 99999;
                overflow-y: auto;
                background: white;
            }

            .dropdown-panel.show {
                display: block;
                opacity: 1;
                transform: none;
            }

            .dropdown-panel::before {
                display: none;
            }

            .modal-backdrop {
                display: none;
            }
            
            .panel-header {
                padding: 10px 12px;
                display: flex;
                align-items: center;
                gap: 10px;
                border-bottom: 2px solid var(--border-gray);
            }

            /* Кнопка "Назад" на мобильных */
            .btn-back-mobile {
                background: linear-gradient(135deg, #2563eb 0%, #4a90e2 100%);
                border: none;
                color: white;
                font-size: 15px;
                cursor: pointer;
                padding: 8px 14px;
                display: flex;
                align-items: center;
                gap: 6px;
                font-weight: 600;
                border-radius: 8px;
                box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
                transition: all 0.2s ease;
                min-height: 40px;
                line-height: 1.5;
                white-space: nowrap;
            }

            .btn-back-mobile:active {
                transform: scale(0.95);
                box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
            }
            
            .btn-back-mobile:hover {
                background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
            }
            
            .panel-title {
                font-size: 14px;
            }
            
            .panel-content {
                padding: 12px;
            }
            
            .panel-actions {
                padding: 10px 12px;
            }
			
	
			
            
            /* Options Grid */
            .options-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 8px;
            }
            
            .option-btn {
                padding: 12px 6px;
                font-size: 12px;
            }
            
            /* Dual Input */
            .dual-input-section {
                padding: 12px;
            }
            
            .presets {
                grid-template-columns: repeat(3, 1fr);
                gap: 6px;
            }
            
            .preset-btn {
                padding: 8px 8px;
                font-size: 11px;
            }
            
            /* ssml-tabs */
            .tab-btn {
                padding: 8px 12px;
                font-size: 12px;
            }
        }
        
        /* Small phones like iPhone SE (320px - 375px) */
        @media (max-width: 375px) {
            body {
                font-size: 14px;
            }
            
            /* Engine Selector */
            .engine-selector {
                padding: 8px 10px;
            }
            
            .engine-selector label {
                font-size: 11px;
            }
            
            .engine-select {
                padding: 6px 10px;
                font-size: 13px;
            }
            
            #engineInfo {
                font-size: 10px;
            }
            
            /* Toolbar - Grouped mobile layout */
            .toolbar {
                padding: 6px 8px;
                display: flex;
                flex-direction: row;
                gap: 6px;
            }
            
            .btn-wrapper {
                display: none;
            }
            
            .btn-wrapper.mobile-group {
                display: block;
            }

            /* ВАЖНО: показываем btn-wrapper внутри SSML панели */
            .ssml-panel .btn-wrapper {
                display: inline-block;
            }

            /* SSML кнопки в 2 колонки на маленьких экранах */
            .ssml-buttons {
                grid-template-columns: repeat(2, 1fr); /* 2 кнопки в ряд на маленьких экранах */
            }
            
            .btn {
                font-size: 11px;
                padding: 10px 8px;
                gap: 4px;
                width: 100%;
                justify-content: center;
                min-height: 48px;
            }
            
            .btn-ghost {
                display: none;
            }
            
            /* Group modal for small screens */
            .group-modal {
                width: 95%;
                max-width: 340px;
            }
            
            .group-modal-header {
                padding: 12px 15px;
            }
            
            .group-modal-title {
                font-size: 14px;
            }
            
            .group-modal-content {
                padding: 15px;
            }
            
            .group-modal-item {
                padding: 12px 6px;
                font-size: 11px;
                min-height: 60px;
            }
            
            .group-modal-item-icon {
                font-size: 18px;
            }
            
            /* Editor */
            .editor-container {
                padding: 10px;
            }
            
            .editor {
                min-height: 200px;
                padding: 8px;
                font-size: 13px;
            }
            
            /* Полноэкранные модалки для SSML панелей */
            .dropdown-panel {
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                width: 100%;
                max-width: 100%;
                height: 100vh;
                max-height: 100vh;
                transform: none;
                border-radius: 0;
                z-index: 99999;
                overflow-y: auto;
                background: white;
            }

            .dropdown-panel.show {
                display: block;
                opacity: 1;
                transform: none;
            }

            .dropdown-panel::before {
                display: none;
            }

            .modal-backdrop {
                display: none;
            }
            
            .panel-header {
                padding: 8px 10px;
                display: flex;
                align-items: center;
                gap: 8px;
                border-bottom: 2px solid var(--border-gray);
            }

            /* Кнопка "Назад" на мобильных */
            .btn-back-mobile {
                background: linear-gradient(135deg, #2563eb 0%, #4a90e2 100%);
                border: none;
                color: white;
                font-size: 14px;
                cursor: pointer;
                padding: 7px 12px;
                display: flex;
                align-items: center;
                gap: 5px;
                font-weight: 600;
                border-radius: 8px;
                box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
                transition: all 0.2s ease;
                min-height: 38px;
                line-height: 1.5;
                white-space: nowrap;
            }

            .btn-back-mobile:active {
                transform: scale(0.95);
                box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
            }
            
            .btn-back-mobile:hover {
                background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
            }
            
            .panel-title {
                font-size: 13px;
            }
            
            .btn-close {
                font-size: 18px;
                padding: 2px 6px;
            }
            
            .panel-content {
                padding: 10px;
                max-height: calc(85vh - 140px);
            }
            
            .panel-actions {
                padding: 8px 10px;
                gap: 6px;
            }
            
            .panel-actions .btn {
                font-size: 12px;
                padding: 8px 12px;
            }
            
            /* Options Grid */
            .options-grid {
                grid-template-columns: 1fr 1fr;
                gap: 6px;
            }
            
            .option-btn {
                padding: 10px 4px;
                font-size: 11px;
                min-height: 22px;
            }
            
            /* Category */
            .category-section {
                margin-bottom: 16px;
            }
            
            .category-title {
                font-size: 12px;
                margin-bottom: 8px;
                padding-bottom: 6px;
            }
            
            /* Forms */
            .form-group {
                margin-bottom: 14px;
            }
            
            .form-label {
                font-size: 12px;
                margin-bottom: 6px;
            }
             
            .form-input,
            .form-select {
                font-size: 16px; /* Prevents iOS zoom */
                padding: 6px;
            }
            
            /* Dual Input */
            .dual-input-section {
                padding: 10px;
            }
            
            .dual-input-title {
                font-size: 11px;
                margin-bottom: 8px;
            }
            
            .presets {
                grid-template-columns: repeat(3, 1fr);
                gap: 4px;
            }
            
            .preset-btn {
                padding: 8px 6px;
                font-size: 10px;
            }
            
            .input-with-unit {
                gap: 6px;
            }
            
            .unit-btn {
                min-width: 45px;
                padding: 8px 8px;
                font-size: 11px;
            }
            
            /* ssml-tabs */
            .ssml-tabs {
                gap: 4px;
                margin-bottom: 12px;
            }
            
            .tab-btn {
                padding: 6px 10px;
                font-size: 11px;
            }
            
            /* Alerts */
            .alert {
                padding: 8px 10px;
                font-size: 11px;
                margin-bottom: 12px;
            }
            
            /* Sub-attributes - без дополнительных стилей */
        }
        
        /* Touch device improvements */
        @media (hover: none) and (pointer: coarse) {
            /* Увеличиваем минимальный размер кликабельных элементов для сенсорных экранов */
            .btn,
            .option-btn,
            .preset-btn,
            .unit-btn,
            .tab-btn {
                min-height: 22px;
                min-width: 44px;
            }
            
            /* Убираем hover эффекты на touch устройствах */
            .btn:hover,
            .option-btn:hover,
            .preset-btn:hover,
            .unit-btn:hover,
            .tab:hover {
                transform: none;
            }
            
            /* Добавляем активное состояние для touch */
            .btn:active,
            .option-btn:active,
            .preset-btn:active {
                transform: scale(0.98);
                opacity: 0.8;
            }
        }
        
        /* Landscape mode для маленьких экранов */
        @media (max-width: 768px) and (orientation: landscape) {
            .editor {
                min-height: 150px;
            }
            
            .dropdown-panel {
                max-height: 75vh;
            }
            
            .panel-content {
                max-height: calc(75vh - 120px);
            }
        }

        /* ============== TOAST NOTIFICATIONS ============== */
        #toastContainer {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
        }

        .toast {
            pointer-events: auto;
            min-width: 300px;
            max-width: 400px;
            padding: 14px 18px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
            display: flex;
            align-items: flex-start;
            gap: 12px;
            animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .toast.hiding {
            animation: slideOutRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            opacity: 0;
            transform: translateX(100%);
        }

        .toast-icon {
            font-size: 20px;
            line-height: 1;
            flex-shrink: 0;
        }

        .toast-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .toast-title {
            font-size: 14px;
            font-weight: 600;
            color: #1a202c;
            line-height: 1.4;
        }

        .toast-message {
            font-size: 13px;
            color: #4a5568;
            line-height: 1.5;
        }

        .toast-close {
            background: none;
            border: none;
            color: #a0aec0;
            cursor: pointer;
            font-size: 18px;
            line-height: 1;
            padding: 0;
            margin: -2px -2px 0 0;
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s;
            flex-shrink: 0;
        }

        .toast-close:hover {
            background: #f7fafc;
            color: #2d3748;
        }

        /* Toast Types */
        .toast.info {
            border-left: 3px solid #3182ce;
        }

        .toast.info .toast-icon {
            color: #3182ce;
        }

        .toast.warning {
            border-left: 3px solid #dd6b20;
        }

        .toast.warning .toast-icon {
            color: #dd6b20;
        }

        .toast.error {
            border-left: 3px solid #e53e3e;
        }

        .toast.error .toast-icon {
            color: #e53e3e;
        }

        .toast.success {
            border-left: 3px solid #38a169;
        }

        .toast.success .toast-icon {
            color: #38a169;
        }

        /* Animations */
        @keyframes slideInRight {
            from {
                opacity: 0;
                transform: translateX(100%);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        @keyframes slideOutRight {
            from {
                opacity: 1;
                transform: translateX(0);
            }
            to {
                opacity: 0;
                transform: translateX(100%);
            }
        }

        /* Mobile adjustments */
        @media (max-width: 480px) {
            #toastContainer {
                top: 10px;
                right: 10px;
                left: 10px;
            }

            .toast {
                min-width: auto;
                max-width: none;
            }
        }

        /* ============== ADDITIONAL CSS CLASSES (NO MORE INLINE STYLES) ============== */
        
        /* Engine info positioning */
        .engine-info {
            margin-left: auto;
            font-size: 13px;
            opacity: 0.9;
        }
        
        /* Desktop groups display */
        .desktop-groups {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        /* SSML Panel background */
        .ssml-panel {
				padding: 0;
				border-top: #e6e6e6 1px solid;
				padding-top: 8px;
				margin-left: -12px;
				margin-right: -12px;
				padding-left: 12px;
				padding-right: 12px;
				padding-bottom: 8px;
        }
        
        /* Hidden element utility */
        .hidden {
            display: none;
        }
        
        /* Text muted utility */
        .text-muted {
            opacity: 0.5;
        }
        
        /* Text primary color */
        .text-primary {
            color: #0366d6;
            font-weight: 600;
        }
        
        /* Input width utilities */
        .input-width-sm {
            width: 100px;
            max-width: 200px;
        }
        
        .input-width-md {
            width: 150px;
            max-width: 300px;
        }
        
        .input-width-lg {
            width: 400px;
            max-width: 400px;
        }
        
        /* Info box */
        .info-box {
            padding: 12px;
            background: #f0fdf4;
            border: 1px solid #86efac;
            border-radius: 6px;
            font-size: 13px;
            color: #166534;
            margin-bottom: 16px;
        }
        
        /* Info box blue */
        .info-box-blue {
            padding: 10px 14px;
            background: #f0f9ff;
            border-radius: 6px;
            border-left: 3px solid #0db7ed;
        }
        
        .info-box-blue-text {
            color: var(--text-dark);
            font-size: 12px;
            font-weight: 500;
        }
        
        .info-box-icon {
            color: #0db7ed;
            font-weight: 700;
        }
        
        .info-box-highlight {
            font-family: 'Courier New', monospace;
            color: #0db7ed;
        }
        
        /* Prosody preview container */
        .prosody-preview {
            margin: 0 0 15px 0;
            padding: 10px 14px;
            background: #f8f9fa;
            border-radius: 6px;
            border: 1px solid #e1e4e8;
            color: #24292e;
            font-size: 13px;
            line-height: 1.5;
            word-wrap: break-word;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
			position:relative;
        }
		
		.prosody-preview div {
			position:relative;
			 font-family: 'Courier New', monospace;
		}
		
		.prosody-preview div button {
			    position: absolute;
				right: 0px;
				top: 0px;
				padding: 2px;
				padding-left: 10px;
				padding-right: 10px;
				border-radius: 8px;
				 font-family: 'Courier New', monospace;
		}
        
        .prosody-preview-code {
            font-weight: 500;
        }
		.prosody-preview-code span {
			color: #457769;
			 font-family: 'Courier New', monospace;
		}
		.prosody-preview-code span span {
			color: #39b995;
		}
        
        /* Actions container visibility */
        .actions-container-visible {
            display: block;
        }
        
        .actions-container-hidden {
            display: none;
        }
        
        /* Tag input utilities */
        .tag-input {
            font-family: 'Segoe UI', Arial, sans-serif;
            font-size: 16px;
        }
        
        /* Button spacing utilities */
        .btn-margin-top {
            margin-top: 10px;
        }
        
        .btn-full-width {
            width: 100%;
        }


		section .panel-actions .btn, section .panel-actions .btn-primary, section .panel-actions .btn-secondary  {
				    box-shadow: none;
					    border-radius: 8px;
						min-width:22px;
						padding:8px;
			}
			

	.btn::first-letter {
			 display: none;
			 font-size: 0;
				visibility: hidden;
			}