/* ============================================
   Step Wizard Styles
   ============================================ */

/* Режим мастера - на всю ширину экрана */
body.wizard-mode .main-container {
    display: flex;
}

body.wizard-mode .sidebar-left,
body.wizard-mode .sidebar-right {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
    overflow: hidden;
}

body.wizard-mode .content-wrapper {
    flex: 1 !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
}

body.wizard-mode .step-wizard-container {
    max-width: 1900px;
    margin: 0 auto;
    padding: 24px 32px;
}

/* Анимация перехода */
.sidebar-left,
.sidebar-right,
.content-wrapper {
    transition: all 0.3s ease-in-out;
}

/* Кнопка переключения режима мастера */
#toggleWizardMode {
    position: relative;
    transition: all 0.3s ease;
}

#toggleWizardMode.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#toggleWizardMode.active:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

#toggleWizardMode.active svg {
    stroke: white;
}

/* Подсказка при наведении на кнопку */
#toggleWizardMode::after {
    content: 'Режим мастера';
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

#toggleWizardMode:hover::after {
    opacity: 1;
    visibility: visible;
}

#toggleWizardMode.active::after {
    content: 'Выйти из мастера';
}

.step-wizard-container {
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px;
    background: var(--bg-panel);
    min-height: 0; /* Важно для правильной работы flex и overflow */
    height: 100%;
    max-height: 100%;
}

.step-wizard {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    min-height: fit-content;
}

/* Step Indicator */
.step-indicator {
    margin-bottom: 2rem;
}

.step-indicator-list {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding: 0 1rem;
}

.step-indicator-list::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0%;
    right: 0%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step-indicator-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: var(--transition);
}

.step-indicator-item:hover {
    transform: translateY(-2px);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.step-indicator-item.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-indicator-item.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 120px;
}

.step-indicator-item.active .step-title {
    color: var(--primary);
    font-weight: 600;
}

/* Step Content */
.step-content {
    min-height: 400px;
    margin-bottom: 2rem;
    overflow-y: visible;
    overflow-x: hidden;
}

.step-panel {
    animation: fadeIn 0.3s ease;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

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

.step-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.step-note {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
    margin-top: 1rem;
}

/* Installation Type Cards */
.installation-type-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.type-card,.recuperator-type-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-card);
}

.type-card:hover,.recuperator-type-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.type-card.selected,.recuperator-type-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

.type-card-header,.recuperator-type-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.type-card-header input[type="radio"],.recuperator-type-card-header input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
} 

.type-card-header h3,.recuperator-type-card-header h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
}

.type-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.type-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.type-features li {
    padding: 0.25rem 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.type-features li::before {
    content: '✓ ';
    color: var(--success);
    font-weight: bold;
    margin-right: 0.5rem;
}

.type-applications {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.type-warning {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #FEF3C7;
    border-left: 3px solid var(--warning);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: #92400E;
}

.btn-recommend {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-recommend:hover {
    background: #475569;
}

/* Calculation Results */
.calculation-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.result-card h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.result-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-summary {
    background: var(--primary-light);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

.result-summary h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.summary-formula {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius);
}

.summary-with-reserve {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.summary-recommended {
    font-size: 1.5rem;
    color: var(--primary);
    margin: 1rem 0;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
}

.summary-dominant {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-style: italic;
}

.result-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
}

.result-actions label {
    font-weight: 500;
    color: var(--text-primary);
}

.result-actions input {
    flex: 1;
    max-width: 200px;
}

/* Unit Selection */
.unit-selection-result {
    margin-top: 2rem;
}

.selected-unit-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 2px solid var(--primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.selected-unit-card h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Сетка статистики оборудования с иконками */
.equipment-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.equipment-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    cursor: default;
}

.equipment-stat-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.equipment-stat-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, 0.2);
    overflow: hidden;
}

.equipment-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.equipment-icon-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
}

.equipment-stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.equipment-stat-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.3;
    word-wrap: break-word;
}

.equipment-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

/* Старый формат (для обратной совместимости) */
.equipment-stats-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
}

.unit-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.param-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius);
}

.param-label {
    color: var(--text-secondary);
}

.param-value {
    font-weight: 600;
    color: var(--text-primary);
}

.param-value.perfect {
    color: var(--success);
}

.param-value.oversized {
    color: var(--warning);
}

/* Visual Scheme Editor */
.visual-scheme-editor {
    width: 100%;
}

.scheme-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.scheme-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.scheme-editor-layout {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 1.5rem;
    min-height: 400px;
    margin-bottom: 2rem;
}

/* Component Palette */
.component-palette {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1rem;
    overflow: visible;
}

.component-palette h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.palette-groups {
    display: none; /* Скрываем старую структуру групп */
}

.palette-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.palette-components-line {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0.5rem 0.5rem 0.75rem 0.5rem;
    margin: 0 -0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.palette-components-line::-webkit-scrollbar {
    height: 10px;
}

.palette-components-line::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 5px;
    margin: 0 0.5rem;
}

.palette-components-line::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.palette-components-line::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
    background-clip: padding-box;
}

.palette-group:last-child {
    border-bottom: none;
}

.group-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.palette-component {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: grab;
    transition: var(--transition);
    user-select: none;
    min-width: 90px;
    max-width: 90px;
    flex-shrink: 0;
    text-align: center;
}

.palette-component:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.palette-component.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* Недоступные компоненты */
.palette-component.unavailable {
    opacity: 0.5;
    background: #f3f4f6;
    border-color: #d1d5db;
    cursor: not-allowed;
    filter: grayscale(100%);
    position: relative;
}

.palette-component.unavailable:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
    transform: none;
    box-shadow: none;
}

.palette-component.unavailable::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius);
    pointer-events: none;
}

.palette-component.unavailable .component-label {
    color: #9ca3af;
}

.palette-component.unavailable .component-icon,
.palette-component.unavailable .component-icon-text {
    opacity: 0.6;
}

.component-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    user-select: none;
    pointer-events: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.component-icon-text {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border-radius: var(--radius);
    font-size: 1.5rem;
    flex-shrink: 0;
    color: var(--text-secondary);
    user-select: none;
    pointer-events: none;
}

.component-label {
    font-size: 0.75rem;
    color: var(--text-primary);
    line-height: 1.2;
    word-wrap: break-word;
    text-align: center;
    user-select: none;
    pointer-events: none;
}

/* Assembly Canvas */
.scheme-assembly-area {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    padding-top: 0px;
    display: flex;
    flex-direction: column;
}

.scheme-assembly-area h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.assembly-canvas {
    flex: 1;
    min-height: 200px;
    background: #f5f5f5;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
}

.assembly-canvas.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
    border-style: solid;
}

.canvas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    text-align: center;
}

.canvas-empty p {
    margin: 0.5rem 0;
}

.canvas-hint {
    font-size: 0.875rem;
    font-style: italic;
}

.canvas-components {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-height: 200px;
    padding: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

.canvas-component {
    position: relative;
    display: flex;
    align-items: stretch;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    min-width: 120px;
    width: 120px;
    height: 200px;
    max-height: 200px;
    flex-shrink: 0;
    overflow: hidden;
}

.canvas-component:hover {
    z-index: 1;
    opacity: 0.9;
}

.canvas-component.selected {
    z-index: 2;
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.canvas-component.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.canvas-component.drag-over {
    border-color: var(--success);
    transform: scale(1.05);
}


.component-image {
    width: 100%;
    height: 200px;
    max-height: 200px;
    display: block;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
}

.component-image-placeholder {
    width: 100%;
    height: 200px;
    max-height: 200px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    font-size: 3rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.component-number {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid white;
}

.canvas-component .component-label {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-primary);
    font-weight: 500;
    padding: 0.5rem;
    word-wrap: break-word;
    background: white;
    border-top: 1px solid var(--border-color);
}

.component-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    justify-content: center;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-color);
}

.btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-remove:hover {
    background: var(--error);
    border-color: var(--error);
}

.assembly-actions {
    display: flex;
    gap: 1rem;
}

/* Components Parameters Container (внизу) */
.components-params-container {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.components-params-container h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.params-blocks {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.params-block {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.params-block:hover {
    border-color: var(--primary);
}

.params-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-panel);
    cursor: pointer;
    user-select: none;
    transition: var(--transition);
}

.params-block-header:hover {
    background: var(--primary-light);
}

.params-block-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-remove-component {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-remove-component:hover {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.params-block-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.params-block-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.params-block-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-toggle-params {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-toggle-params:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.params-block-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.params-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.component-params-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================
   Compact Form Styles (Step 1)
   ============================================ */

.form-section-compact {
    padding: 1rem;
}

.form-section-compact .section-title {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.form-section-compact .section-subtitle {
    margin: 0.75rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Компактная сетка параметров */
.compact-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.compact-params-grid .form-group.compact {
    gap: 0.25rem;
    margin-bottom: 0;
}

.compact-params-grid .form-group.compact label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.compact-params-grid .form-group.compact .form-input,
.compact-params-grid .form-group.compact .form-select {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    height: 34px;
}

/* Секция климатических параметров */
.climate-params-section {
    margin-top: 0.5rem;
}

.climate-params-section .section-subtitle {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Строка параметров внутри периода */
.period-params-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.period-params-row .param-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.period-params-row .param-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.period-params-row .param-input {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    height: 34px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: white;
}

.period-params-row .param-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

/* Более компактный стиль периодов для Step 1 */
.climate-params-section .params-periods-container {
    gap: 0.75rem;
}

.climate-params-section .params-period {
    border-width: 1px;
}

.climate-params-section .period-header {
    padding: 0.5rem 0.75rem;
}

.climate-params-section .period-title {
    font-size: 0.8rem;
}

.climate-params-section .period-icon {
    font-size: 1rem;
}

.climate-params-section .period-params {
    padding: 0.625rem;
}

/* Адаптивность для компактной сетки */
@media (max-width: 1400px) {
    .compact-params-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .compact-params-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .compact-params-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .climate-params-section .params-periods-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .compact-params-grid {
        grid-template-columns: 1fr;
    }
    
    .period-params-row {
        grid-template-columns: 1fr;
    }
}

/* Scheme Display */
.scheme-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

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

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

.scheme-content {
    min-height: 300px;
}

.scheme-period {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scheme-component {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-panel);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    position: relative;
}

.scheme-component.final-output {
    background: linear-gradient(135deg, var(--success-light) 0%, var(--success) 100%);
    border-left-color: var(--success);
    color: white;
}

.scheme-component.final-output .component-name {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.scheme-component.final-output .detail-line {
    color: rgba(255, 255, 255, 0.95);
}

.component-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.component-info {
    flex: 1;
}

.component-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.component-purpose {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.component-pressure {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Детальная схема */
.detailed-scheme {
    width: 100%;
}

.scheme-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
}

.scheme-header h3 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.scheme-flow {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.component-details {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    color: var(--text-primary);
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 0.5rem;
}

.detail-line {
    padding: 0.25rem 0;
    color: var(--text-secondary);
}

.detail-line:last-child {
    margin-bottom: 0;
}

.component-arrow {
    font-size: 1.5rem;
    color: var(--primary);
    text-align: center;
    margin: 0.5rem 0;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scheme-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.scheme-status {
    text-align: center;
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Responsive для визуального редактора */
@media (max-width: 1400px) {
    .scheme-editor-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 1200px) {
    .scheme-editor-layout {
        grid-template-rows: auto 1fr;
    }
    
    .component-palette {
        max-height: none;
    }
    
    .palette-components-line {
        gap: 0.5rem;
    }
    
    .palette-component {
        min-width: 80px;
        max-width: 80px;
        padding: 0.5rem;
    }
}

/* Улучшения для визуального редактора */
.palette-component img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.canvas-component img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* Transition Period */
.transition-period {
    padding: 2rem;
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
}

.transition-period h3 {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    text-align: center;
}

.transition-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 1rem;
    line-height: 1.8;
}

.transition-item {
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    margin-bottom: 1rem;
}

.transition-item p {
    margin: 0.5rem 0;
    color: var(--text-primary);
}

.transition-item strong {
    color: var(--primary);
    font-weight: 600;
}

.transition-item em {
    color: var(--text-secondary);
    font-style: italic;
}

/* Recuperative Scheme */
.recuperative-scheme {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.scheme-branch {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.scheme-branch h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.supply-branch {
    border: 2px solid #3B82F6;
}

.exhaust-branch {
    border: 2px solid #10B981;
}

.scheme-recuperator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--warning);
    color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-width: 200px;
}

.scheme-recuperator h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.recuperator-info {
    text-align: center;
    font-size: 0.9375rem;
}

/* Technical Parameters */
.technical-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.technical-content {
    min-height: 300px;
}

.technical-period {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.param-group {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.param-group h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.param-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.param-row:last-child {
    border-bottom: none;
}

.param-row.highlight {
    background: var(--primary-light);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 0.5rem;
    font-size: 1.125rem;
}

.recuperative-technical {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.technical-branch {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.technical-branch h3 {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    text-align: center;
}

.technical-params {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.technical-recuperator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-width: 250px;
}

.technical-recuperator h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: white;
}

.recuperator-params {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recuperator-params .param-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.recuperator-params .param-row.highlight {
    background: rgba(255, 255, 255, 0.2);
    font-size: 1.25rem;
    font-weight: 700;
}

.technical-total {
    grid-column: 1 / -1;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    margin-top: 2rem;
}

.technical-total h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.total-power {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Cost Calculation */
.cost-summary {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.cost-section {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

.cost-section h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.cost-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius);
}

.cost-total {
    display: flex;
    justify-content: space-between;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    font-weight: 600;
}

.cost-final {
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.final-row {
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
    font-size: 1.125rem;
}

.final-row.highlight {
    font-size: 1.5rem;
    font-weight: 700;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    margin-top: 1rem;
    padding-top: 1.5rem;
}

/* Reports */
.reports-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.report-option {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
}

.report-option h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.report-option p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.reports-export {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-top: 2rem;
}

.reports-export h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.export-options {
    display: flex;
    gap: 1rem;
}

/* Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.step-nav-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: space-between;
}

.step-nav-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
}

.form-section h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.form-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--bg-hover);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.required {
    color: var(--danger);
}

.tooltip-icon {
    display: inline-block;
    margin-left: 0.5rem;
    cursor: help;
    font-size: 0.875rem;
    opacity: 0.6;
    transition: var(--transition);
}

.tooltip-icon:hover {
    opacity: 1;
}

/* Form hints */
.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Notifications */
.step-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

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

.step-notification-success {
    background: var(--success);
    color: white;
}

.step-notification-error {
    background: var(--danger);
    color: white;
}

.step-notification-warning {
    background: var(--warning);
    color: white;
}

.step-notification-info {
    background: var(--primary);
    color: white;
}

/* Loading */
.step-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: var(--radius);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-message {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .step-indicator-list {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .step-indicator-list::before {
        display: none;
    }

    .installation-type-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .installation-type-cards {
        grid-template-columns: 1fr;
    }

    .recuperative-scheme,
    .recuperative-technical {
        grid-template-columns: 1fr;
    }

    .scheme-recuperator,
    .technical-recuperator {
        min-width: 100%;
    }
}

/* Detailed Scheme (Step 5) */
.detailed-scheme,
.detailed-recuperative-scheme {
    max-width: 100%;
    margin: 0 auto;
}

.scheme-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
}

.scheme-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.scheme-flow {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.scheme-component {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    margin-bottom: 0.5rem;
    position: relative;
}

.component-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    min-width: 2rem;
    text-align: center;
}

.component-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    flex: 1;
}

.component-details {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.4;
}

.detail-line {
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.final-output {
    background: var(--success-bg, #f0f9f0);
    border-left-color: var(--success, #10b981);
}

.final-output .component-name {
    color: var(--success, #10b981);
    font-size: 1.1rem;
}

.component-arrow {
    font-size: 1.2rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Recuperative scheme layout */
.recuperative-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: start;
    margin-bottom: 2rem;
}

.scheme-branch {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scheme-branch h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    padding: 0.5rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
}

.scheme-recuperator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--warning-bg, #fffbeb);
    border: 2px solid var(--warning, #f59e0b);
    border-radius: var(--radius);
    min-height: 200px;
    text-align: center;
}

.scheme-recuperator .component-number {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.scheme-recuperator .component-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--warning, #f59e0b);
    margin-bottom: 1rem;
}

.scheme-footer {
    text-align: center;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    margin-top: 2rem;
}

.scheme-status {
    font-weight: 500;
    color: var(--text-primary);
}

/* Technical Calculations (Step 7) */
.technical-calculations {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.technical-calculations h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary);
}

.calculation-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.calculation-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.calculation-formula {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.calculation-formula > div {
    line-height: 1.4;
    color: var(--text-secondary);
}

.result {
    font-weight: 600;
    color: var(--primary);
    margin-top: 0.5rem;
}

.check-result {
    font-weight: 600;
    color: var(--success, #10b981);
}

.warning {
    font-weight: 600;
    color: var(--warning, #f59e0b);
}

.resistance-table {
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    overflow: hidden;
    margin: 1rem 0;
}

.resistance-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.resistance-row:last-child {
    border-bottom: none;
}

.resistance-total {
    font-weight: 700;
    background: var(--primary-bg, rgba(59, 130, 246, 0.1));
    color: var(--primary);
}

.air-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.point-card {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border-light);
}

.point-card h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.point-card > div {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.heat-flows,
.utilities-consumption {
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin: 1rem 0;
}

.heat-flows > div,
.utilities-consumption > div {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.air-analysis {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.air-analysis > div {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.cooling-process,
.cooling-power,
.duct-calculations,
.duct-pressure-loss {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.cooling-process > div,
.cooling-power > div,
.duct-calculations > div,
.duct-pressure-loss > div {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.acoustic-analysis {
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin: 1rem 0;
}

.acoustic-analysis > div {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.summary-params {
    background: var(--bg-panel);
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    margin: 1rem 0;
}

.summary-params > div {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.technical-navigation {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--text-primary);
}

/* Component Selection (Step 6) */
.components-selection {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.component-section {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.component-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.component-form {
    margin-top: 1rem;
}

.component-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 1rem;
}

.component-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.component-params {
    margin-left: 1.75rem;
    margin-top: 0.75rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.component-params .form-group {
    margin-bottom: 0;
}

.components-summary {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-top: 2rem;
}

.components-summary h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.summary-list {
    margin-top: 1rem;
}

.summary-items {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.summary-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.summary-item-qty {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Cost Calculation (Step 8) */
.cost-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
}

.form-group-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group-inline label {
    font-weight: 500;
    white-space: nowrap;
}

.form-group-inline .form-input,
.form-group-inline .form-select {
    flex: 1;
    min-width: 100px;
}

.cost-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.bom-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.bom-table thead {
    background: var(--primary);
    color: white;
}

.bom-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
}

.bom-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
}

.bom-table tbody tr:hover {
    background: var(--bg-hover);
}

.bom-table tfoot tr.total-row,
.bom-table tbody tr.total-row {
    background: var(--primary-bg, rgba(59, 130, 246, 0.1));
    font-weight: 700;
    color: var(--primary);
}

.bom-table tbody tr.subtotal-row {
    background: var(--bg-panel);
    font-weight: 600;
}

.bom-table tbody tr.highlight {
    background: var(--success-bg, #f0f9f0);
    color: var(--success, #10b981);
    font-weight: 700;
    font-size: 1.1rem;
}

.cost-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* Reports (Step 9) */
.reports-categories {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.report-category {
    background: var(--bg-panel);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.report-category h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.report-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.report-option-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.report-option-item input[type="checkbox"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.report-option-content {
    flex: 1;
}

.report-option-content label {
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    display: block;
    margin-bottom: 0.25rem;
}

.report-option-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.report-option-actions {
    display: flex;
    gap: 0.5rem;
}

.export-options-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.export-options-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.export-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.export-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.export-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ============================================
   Двухлинейная схема (приточно-вытяжная)
   ============================================ */

.dual-line-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
}

.dual-line-layout {
    background: linear-gradient(135deg, #f0fdf4 0%, #fef2f2 100%);
    border-radius: var(--radius-lg);
    padding: 1rem;
}

.dual-line-layout .scheme-assembly-area {
    min-height: 100px;
    background: transparent;
}

/* ============================================
   Professional Scheme Layout - Профессиональная схема
   ============================================ */

.scheme-professional-container {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: white;
    border: 2px solid #1e40af;
    border-radius: var(--radius-lg);
    padding: 0;
    min-height: 280px;
}

/* Колонки со стрелками потока */
.flow-arrows-column {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 1rem 0.5rem;
    min-width: 50px;
}

.flow-arrows-left {
    border-right: 2px solid #e2e8f0;
}

.flow-arrows-right {
    border-left: 2px solid #e2e8f0;
}

.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.flow-arrow .arrow-svg {
    width: 40px;
    height: 20px;
}

.flow-arrow.supply-arrow {
    color: #1e40af;
}

.flow-arrow.exhaust-arrow {
    color: #dc2626;
}

/* Пластинчатый рекуператор - перекрёстный поток */
/* При пластинчатом рекуператоре потоки переходят на другую линию */
/* Справа стрелки МЕНЯЮТСЯ МЕСТАМИ: приток становится красным ←, вытяжка синим → */

/* Справа: приточная линия показывает красную стрелку ← (обработанный воздух, был на вытяжной) */
.scheme-professional-container[data-recuperator-type="plate"] .flow-arrows-right .exhaust-arrow.crossflow-swapped {
    color: #dc2626;
}

/* Справа: вытяжная линия показывает синюю стрелку → (обработанный воздух, был на приточной) */
.scheme-professional-container[data-recuperator-type="plate"] .flow-arrows-right .supply-arrow.crossflow-swapped {
    color: #2563eb;
}

/* Слева: вытяжная стрелка - это уже обработанный воздух (был на приточной линии) */
.scheme-professional-container[data-recuperator-type="plate"] .flow-arrows-left .exhaust-arrow {
    color: #dc2626;
}

/* Индикаторы перекрёстного потока для пластинчатого рекуператора - простые диагональные стрелки */
.crossflow-indicators {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crossflow-svg-simple {
    width: 80%;
    height: 80%;
    opacity: 0.9;
}

/* Стрелки с перекрёстом (swapped) - простые, без лишних эффектов */
.flow-arrow.crossflow-swapped {
    position: relative;
}

/* Визуальное выделение пластинчатого рекуператора */
.recuperator-central-zone.plate-type {
    border-color: #1e40af;
    background: #f8fafc;
}

.recuperator-central-zone.plate-type .recup-symbol .recup-efficiency {
    background: #1e40af;
}

/* Роторный рекуператор - потоки остаются на своих линиях */
.recuperator-central-zone.rotary-type {
    border-color: #1e40af;
    background: #f8fafc;
}

/* Основная область схемы */
.scheme-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Плейсхолдер для рекуператора в линии (занимает место) */
.recuperator-placeholder {
    flex: 0 0 auto;
    min-width: 120px;
    max-width: 120px;
    visibility: hidden;
}

/* Единый рекуператор, растянутый на обе линии (только для пластинчатого) */
.recuperator-unified {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    transform: translateX(-50%);
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    border-left: 2px solid #1e40af;
    border-right: 2px solid #1e40af;
    background: linear-gradient(to bottom, 
        rgba(248, 250, 252, 0.95) 0%, 
        rgba(248, 250, 252, 0.95) 50%, 
        rgba(248, 250, 252, 0.95) 100%);
    box-shadow: inset 0 2px 8px rgba(124, 58, 237, 0.1);
}

.recuperator-unified .recup-block-central {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recuperator-unified .recup-connector-left,
.recuperator-unified .recup-connector-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #1e40af;
    z-index: 1;
}

.recuperator-unified .recup-connector-left {
    left: 0;
}

.recuperator-unified .recup-connector-right {
    right: 0;
}

.recuperator-unified .crossflow-indicators {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recuperator-unified .recup-symbol {
    width: 100%;
    height: 100%;
}

/* Линии схемы */
.scheme-line {
    flex: 1;
    display: flex;
    align-items: center;
    border: 2px solid #1e40af;
    background: white;
    min-height: 80px;
    position: relative;
}

.supply-scheme-line {
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}

.exhaust-scheme-line {
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

.line-cells-container {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0.5rem;
    min-height: 70px;
    gap: 0;
}

.line-empty-placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius);
    margin: 0.25rem;
    padding: 1rem;
}

/* Контейнер с разделёнными частями линии */
.line-split-container {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    position: relative;
    width: 100%;
}

/* Контейнер без рекуператора - центрируем элементы */
.line-split-container.no-recuperator-container {
    justify-content: center;
}

.line-split-container.no-recuperator-container .line-part {
    flex: 0 1 auto;
}

.line-split-container.no-recuperator-container .line-part-before {
    justify-content: center;
}

/* Части линии: до и после рекуператора */
.line-part {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    min-width: 0;
    position: relative;
}

.line-part-before {
    justify-content: flex-end;
    padding-right: 0;
}

.line-part-before .scheme-cells-row {
    justify-content: flex-end;
}

.line-part-after {
    justify-content: flex-start;
    padding-left: 0;
}

.line-part-after .scheme-cells-row {
    justify-content: flex-start;
}

/* Центральная зона рекуператора в разделённой линии */
.line-split-container .recuperator-central-zone {
    flex: 0 0 auto;
    min-width: 120px;
    max-width: 120px;
}

/* Плейсхолдер для пустых частей линии */
.line-part .line-empty-placeholder {
    padding: 10px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ячейки компонентов */
.scheme-cells-row {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    position: relative;
}

/* Центрирование ячеек когда нет рекуператора */
.no-recuperator-container .scheme-cells-row {
    justify-content: center;
}

/* Центрирование для однолинейной схемы (приточная или вытяжная) */
.single-line-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.single-line-container .scheme-cells-row {
    justify-content: center;
}

/* Пустые ячейки для выравнивания */
.scheme-cell-empty {
    min-width: 60px;
    max-width: 80px;
    height: 70px;
    flex-shrink: 0;
    visibility: hidden;
}

.scheme-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    max-width: 80px;
    height: 70px;
    border: 2px solid #1e40af;
    background: white;
    cursor: move;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.scheme-cell:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    z-index: 10;
}

.scheme-cell .cell-symbol {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scheme-cell .cell-symbol svg {
    width: 100%;
    height: 100%;
    color: #1e40af;
}

.scheme-cell .cell-symbol svg.cooler {
    color: #0891b2;
}

.scheme-cell .cell-symbol svg.electric {
    color: #ea580c;
}

.scheme-cell .cell-symbol svg.water {
    color: #dc2626;
}

.scheme-cell .cell-label {
    font-size: 0.65rem;
    color: #475569;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 2px;
}

.scheme-cell .cell-remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scheme-cell:hover .cell-remove-btn {
    opacity: 1;
}

.scheme-cell .cell-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Состояние выбора ячейки */
.scheme-cell.selected {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.3);
    background: #f5f3ff;
}

/* Состояния drag-and-drop для ячеек */
.scheme-cell.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.scheme-cell.insert-before {
    border-left: 4px solid #22c55e;
}

.scheme-cell.insert-after {
    border-right: 4px solid #22c55e;
}

.line-cells-container.drag-over {
    background: rgba(34, 197, 94, 0.1);
}

/* Подсветка блока параметров */
.component-params-block.highlight {
    animation: highlight-pulse 2s ease-out;
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.3) !important;
}

@keyframes highlight-pulse {
    0% { 
        border-color: #7c3aed;
        box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.5);
        background: #f5f3ff;
    }
    100% { 
        border-color: var(--border-color);
        box-shadow: none;
        background: var(--bg-card);
    }
}

/* Курсор для перетаскиваемых элементов */
.scheme-cell[draggable="true"] {
    cursor: grab;
}

.scheme-cell[draggable="true"]:active {
    cursor: grabbing;
}

/* Палитра - состояние перетаскивания */
.palette-component {
    cursor: grab;
    user-select: none;
}

.palette-component:active {
    cursor: grabbing;
}

.palette-component.dragging {
    opacity: 0.4;
    border-style: dashed;
    transform: scale(0.95);
}

/* Drop target для пустой области */
.line-empty-placeholder {
    pointer-events: all;
    transition: all 0.2s ease;
}

.line-cells-container.drag-over .line-empty-placeholder,
.line-cells-container:has(.drag-over) .line-empty-placeholder {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
    border-style: solid;
}

/* Canvas drag-over состояние */
#supplyCanvas.drag-over,
#exhaustCanvas.drag-over,
#assemblyCanvas.drag-over {
    background: rgba(34, 197, 94, 0.08);
}

/* Стили для scheme-cells-row внутри drag-over */
.drag-over .scheme-cells-row {
    background: rgba(34, 197, 94, 0.05);
}

/* Ячейка соединения с рекуператором */
.recup-connection-cell {
    min-width: 30px;
    max-width: 30px;
    border-left: none;
    border-right: none;
    background: transparent;
    border-color: transparent;
    position: relative;
    flex-shrink: 0;
}

.recup-connection-cell .cell-connector-vertical {
    width: 2px;
    height: 100%;
    background: #1e40af;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

/* Выравнивание рекуператоров по вертикали */
.scheme-cells-row[data-line="supply"] .recup-connection-cell,
.scheme-cells-row[data-line="exhaust"] .recup-connection-cell {
    /* Обеспечиваем одинаковую ширину для выравнивания */
    width: 30px;
    flex: 0 0 30px;
}

/* Центральная зона рекуператора */
.recuperator-central-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 50%, #f5f3ff 100%);
    border-left: 2px solid #1e40af;
    border-right: 2px solid #1e40af;
    box-shadow: inset 0 2px 8px rgba(124, 58, 237, 0.1);
}

.recup-connector-left,
.recup-connector-right {
    flex: 1;
    height: 2px;
    background: transparent;
}

.recup-block-central {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.recup-symbol {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.recup-symbol .recup-svg {
    width: 80px;
    height: 80px;
}

.recup-symbol .recup-efficiency {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e40af;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.recup-placeholder {
    font-size: 2rem;
    opacity: 0.3;
}

.no-recuperator-spacer {
    height: 20px;
    border-left: 2px solid #1e40af;
    border-right: 2px solid #1e40af;
    background: #f8fafc;
}

/* Анимация для роторного рекуператора */
.recuperator-central-zone.rotary-type .recup-svg text {
    animation: rotate-symbol 3s linear infinite;
    transform-origin: center;
}

@keyframes rotate-symbol {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Старые стили для обратной совместимости */
.dual-line-canvas-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.supply-line, .exhaust-line {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.line-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: white;
    margin: 0;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.supply-line .line-title {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.exhaust-line .line-title {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.air-direction {
    font-size: 0.875rem;
    font-weight: 400;
    opacity: 0.9;
    white-space: nowrap;
}

/* Однолинейная схема */
.scheme-professional-container.single-line {
    min-height: 100px;
}

.scheme-professional-container.single-line .flow-arrows-column {
    justify-content: center;
}

.scheme-professional-container.single-line .scheme-main-area {
    justify-content: center;
}

.scheme-professional-container.single-line .scheme-line.single {
    border-radius: var(--radius);
    border: 2px solid #1e40af;
}

.scheme-professional-container.single-line .supply-scheme-line.single {
    border-color: #1e40af;
}

.scheme-professional-container.single-line .exhaust-scheme-line.single {
    border-color: #dc2626;
}

/* Адаптивность профессиональной схемы */
@media (max-width: 900px) {
    .scheme-professional-container {
        flex-direction: column;
    }
    
    .flow-arrows-column {
        flex-direction: row;
        justify-content: space-around;
        min-width: auto;
        padding: 0.5rem 1rem;
    }
    
    .flow-arrows-left {
        border-right: none;
        border-bottom: 2px solid #e2e8f0;
    }
    
    .flow-arrows-right {
        border-left: none;
        border-top: 2px solid #e2e8f0;
    }
    
    .flow-arrow .arrow-svg {
        transform: rotate(90deg);
    }
    
    .scheme-cell {
        min-width: 50px;
        max-width: 60px;
        height: 60px;
    }
    
    .scheme-cell .cell-symbol {
        width: 30px;
        height: 30px;
    }
}

/* ============================================
   Air Flow Arrows - Стрелки потока воздуха
   ============================================ */

.line-with-arrows {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.air-flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    min-width: 80px;
    text-align: center;
    border-radius: var(--radius);
    transition: all 0.2s ease;
}

.air-flow-arrow .arrow-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
    white-space: nowrap;
}

.air-flow-arrow .arrow-icon {
    font-size: 1.75rem;
    font-weight: bold;
    line-height: 1;
    animation: pulse-arrow 2s ease-in-out infinite;
}

@keyframes pulse-arrow {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

/* Стрелки для приточной линии - СИНИЕ */
.supply-inlet,
.supply-outlet {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    color: #1d4ed8;
}

.supply-inlet .arrow-icon,
.supply-outlet .arrow-icon {
    color: #2563eb;
    text-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.supply-inlet {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
}

.supply-outlet {
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: none;
}

/* Стрелки для вытяжной линии - КРАСНЫЕ */
.exhaust-inlet,
.exhaust-outlet {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 2px solid #ef4444;
    color: #b91c1c;
}

.exhaust-inlet .arrow-icon,
.exhaust-outlet .arrow-icon {
    color: #dc2626;
    text-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

.exhaust-inlet {
    border-radius: var(--radius) 0 0 var(--radius);
    border-right: none;
}

.exhaust-outlet {
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: none;
}

/* Canvas внутри line-with-arrows */
.line-with-arrows .assembly-canvas {
    flex: 1;
    border-radius: 0;
    border-left: none;
    border-right: none;
}

.line-with-arrows .supply-canvas {
    border-top: 2px solid #3b82f6;
    border-bottom: 2px solid #3b82f6;
}

.line-with-arrows .exhaust-canvas {
    border-top: 2px solid #ef4444;
    border-bottom: 2px solid #ef4444;
}

/* Рекуператор - индикатор потоков */
.recuperator-connection.rotary-type .recuperator-block {
    border: 2px solid #8b5cf6;
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.recuperator-flow-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #c4b5fd;
}

.recuperator-flow-indicator .flow-line {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.recuperator-flow-indicator .supply-flow {
    color: #2563eb;
}

.recuperator-flow-indicator .exhaust-flow {
    color: #dc2626;
}

.recuperator-flow-indicator .flow-arrow {
    font-size: 1rem;
}

.recuperator-flow-indicator .rotor-indicator {
    font-size: 1.5rem;
    color: #7c3aed;
    animation: rotate-rotor 3s linear infinite;
}

@keyframes rotate-rotor {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Адаптивность стрелок */
@media (max-width: 768px) {
    .air-flow-arrow {
        min-width: 60px;
        padding: 0.5rem 0.25rem;
    }
    
    .air-flow-arrow .arrow-label {
        font-size: 0.6rem;
    }
    
    .air-flow-arrow .arrow-icon {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .line-with-arrows {
        flex-direction: column;
    }
    
    .air-flow-arrow {
        flex-direction: row;
        min-width: auto;
        padding: 0.5rem 1rem;
    }
    
    .air-flow-arrow .arrow-label {
        margin-bottom: 0;
        margin-right: 0.5rem;
    }
    
    .supply-inlet, .exhaust-inlet {
        border-radius: var(--radius) var(--radius) 0 0;
        border-right: 2px solid;
        border-bottom: none;
    }
    
    .supply-outlet, .exhaust-outlet {
        border-radius: 0 0 var(--radius) var(--radius);
        border-left: 2px solid;
        border-top: none;
    }
    
    .supply-inlet .arrow-icon,
    .supply-outlet .arrow-icon {
        transform: rotate(90deg);
    }
    
    .exhaust-inlet .arrow-icon,
    .exhaust-outlet .arrow-icon {
        transform: rotate(90deg);
    }
    
    .line-with-arrows .assembly-canvas {
        border-radius: 0;
        border: 2px solid;
        border-top: none;
        border-bottom: none;
    }
}

.canvas-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 2rem;
    text-align: center;
    border: 3px dashed var(--border-color);
    border-radius: var(--radius-lg);
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.02) 10px,
        rgba(0,0,0,0.02) 20px
    );
}

.canvas-empty p {
    margin: 0.5rem 0;
    color: var(--text-secondary);
}

.canvas-empty p:first-child {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.canvas-hint {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Улучшенные кнопки действий */
.assembly-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.assembly-actions .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

#autoGenerateScheme {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

#autoGenerateScheme:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#clearScheme {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
}

#clearScheme:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Информационная панель шага 3 */
.scheme-info-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.scheme-info-banner .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scheme-info-banner .info-label {
    font-size: 0.875rem;
    color: #0369a1;
    font-weight: 500;
}

.scheme-info-banner .info-value {
    font-size: 0.9375rem;
    color: #0c4a6e;
    font-weight: 600;
}

.scheme-info-banner .dual-line-info {
    margin-left: auto;
}

.scheme-tips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scheme-tips .tip {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    background: var(--bg-panel);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
}

/* Заголовок схемы */
.scheme-note-inline {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: normal;
}

/* Индикатор периода */
.period-indicator {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    margin-left: 1rem;
}

.period-indicator.winter {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
}

.period-indicator.summer {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.period-indicator.transition {
    background: linear-gradient(135deg, #fed7aa, #fdba74);
    color: #9a3412;
}

/* Неактивные компоненты в текущем периоде */
.canvas-component.inactive-in-period {
    opacity: 0.5;
    filter: grayscale(50%);
}

.canvas-component.inactive-in-period::after {
    content: '⏸️';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    z-index: 10;
}

.inactive-badge {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Статус-бейджи */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    margin-left: auto;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fef2f2;
    color: #991b1b;
}

/* Блоки параметров неактивных компонентов */
.params-block.inactive {
    opacity: 0.6;
    background: #f9fafb;
}

.params-block.inactive .params-block-header {
    background: #f3f4f6;
}

.inactive-note {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    padding: 0.5rem;
    background: #fef2f2;
    border-radius: var(--radius);
    margin-top: 0.5rem;
}

/* Рекуператор в байпасе */
.recuperator-connection.bypassed {
    opacity: 0.6;
}

.recuperator-connection.bypassed .recuperator-block {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.bypass-badge {
    display: inline-block;
    background: #fef2f2;
    color: #991b1b;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.bypass-note {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}

/* Подсказка для параметров */
.params-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border-left: 3px solid #3b82f6;
    border-radius: var(--radius);
}

/* Секция параметров по периодам */
.period-params-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.period-params {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.period-params.winter-params {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.period-params.summer-params {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.period-label {
    font-weight: 600;
    font-size: 0.875rem;
    min-width: 70px;
}

.period-status {
    font-size: 0.8125rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius);
}

.period-status.active {
    background: #dcfce7;
    color: #166534;
}

.period-status.inactive {
    background: #f3f4f6;
    color: #6b7280;
}

.period-value {
    font-size: 0.8125rem;
    padding: 0.125rem 0.5rem;
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    font-weight: 500;
}

/* Бейдж "работает всегда" */
.always-active-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #dcfce7;
    color: #166534;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 500;
}

/* Улучшенный блок параметров компонента */
.params-block {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.params-block:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.params-block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid var(--border-color);
}

.params-block-header .component-seq {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.params-block-header strong {
    flex: 1;
}

.params-block-content {
    padding: 1rem;
}

.param-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.param-row strong {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Улучшенные вкладки */
.scheme-tabs .tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.scheme-tabs .tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.scheme-tabs .tab-btn:not(.active):hover {
    background: var(--bg-hover);
}

.supply-canvas, .exhaust-canvas {
    min-height: 150px;
    background: white;
    border: 3px solid;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: relative;
    overflow-x: auto;
}

.supply-canvas {
    border-color: #10b981;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.02), rgba(16, 185, 129, 0.05));
}

.exhaust-canvas {
    border-color: #ef4444;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.02), rgba(239, 68, 68, 0.05));
}

.supply-canvas::before {
    content: '→ ПРИТОК';
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #10b981;
    opacity: 0.5;
}

.exhaust-canvas::before {
    content: '← ВЫТЯЖКА';
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    opacity: 0.5;
}

.canvas-components {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.5rem;
}

.supply-component {
    border: 3px solid #10b981 !important;
    background: white !important;
}

.supply-component .component-header {
    background: linear-gradient(135deg, #10b981, #059669);
}

.exhaust-component {
    border: 3px solid #ef4444 !important;
    background: white !important;
}

.exhaust-component .component-header {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.line-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
    color: white;
}

.supply-badge {
    background: #10b981;
}

.exhaust-badge {
    background: #ef4444;
}

.canvas-component {
    position: relative;
    min-width: 140px;
    transition: all 0.2s ease;
}

.canvas-component::after {
    content: '→';
    position: absolute;
    right: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #94a3b8;
    z-index: 1;
}

.canvas-component:last-child::after {
    display: none;
}

/* Индикация места вставки */
.canvas-component.insert-before {
    margin-left: 60px;
}

.canvas-component.insert-before::before {
    content: '+';
    position: absolute;
    left: -50px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    animation: pulse-insert 1s infinite;
}

.canvas-component.insert-after {
    margin-right: 60px;
}

.canvas-component.insert-after::after {
    content: '+' !important;
    right: -50px !important;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-radius: 50%;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    animation: pulse-insert 1s infinite;
}

@keyframes pulse-insert {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.1);
    }
}

/* Стиль при перетаскивании над canvas */
.assembly-canvas.drag-over,
.supply-canvas.drag-over,
.exhaust-canvas.drag-over {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    border-style: solid;
}

/* Компонент, который перетаскивается */
.canvas-component.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Перетаскиваемый элемент из палитры */
.palette-component.dragging {
    opacity: 0.5;
    transform: scale(0.9);
}

/* Рекуператор (связь между линиями) */
.recuperator-connection {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 1rem;
    margin: 1rem 0;
    z-index: 10;
}

.recuperator-connection::before,
.recuperator-connection::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    z-index: 1;
}

.recuperator-connection::before {
    top: 0;
    height: 35%;
    border-radius: 2px 2px 0 0;
}

.recuperator-connection::after {
    bottom: 0;
    height: 35%;
    border-radius: 0 0 2px 2px;
}

.recuperator-block {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 700px;
    position: relative;
    z-index: 2;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.recuperator-block::before {
    content: '⇅';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #667eea;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recuperator-block::after {
    content: '⇅';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: #667eea;
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.recuperator-icon {
    font-size: 4rem;
    line-height: 1;
    animation: rotate-recuperator 10s linear infinite;
}

@keyframes rotate-recuperator {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.recuperator-info {
    flex: 1;
}

.recuperator-info strong {
    display: block;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.recuperator-details {
    font-size: 0.875rem;
    opacity: 0.95;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recuperator-note {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    opacity: 0.9;
    font-style: italic;
}

/* Удалены старые connection-lines, теперь используются ::before и ::after на recuperator-connection */

.scheme-note {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-top: 1rem;
}

/* Параметры компонентов для двухлинейной схемы */
.params-line-group {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

.params-line-group h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.supply-params h4 {
    border-bottom-color: #10b981;
}

.exhaust-params h4 {
    border-bottom-color: #ef4444;
}

.params-block {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.params-block-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.params-block-header .component-seq {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.params-block-header strong {
    flex: 1;
    color: var(--text-primary);
}

.params-block-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.param-row {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.param-row strong {
    color: var(--text-primary);
    font-weight: 500;
    margin-right: 0.5rem;
}

/* ============================================
   Шаг 5: Формы параметров компонентов
   ============================================ */

.component-params-step {
    max-width: 1400px;
    margin: 0 auto;
}

.params-info-banner {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border: 1px solid var(--primary);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

.params-info-banner .info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.params-info-banner .info-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.params-info-banner .info-value {
    font-weight: 600;
    color: var(--primary);
}

/* Контейнер параметров */
.component-params-container {
    margin-bottom: 1.5rem;
}

.dual-line-params,
.single-line-params {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Секция линии */
.line-params-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.line-params-section.supply-params {
    border-left: 4px solid #10b981;
}

.line-params-section.exhaust-params {
    border-left: 4px solid #ef4444;
}

.line-params-section .line-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

/* Блок параметров компонента */
.component-params-block {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.component-params-block:hover {
    border-color: var(--primary);
}

.component-params-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
}

.component-params-header:hover {
    background: var(--bg-hover);
}

.component-params-header .comp-index {
    background: var(--primary);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.component-params-header .comp-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.component-params-header .comp-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-sm);
}

.component-params-header .btn-toggle-params {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem;
}

/* Тело параметров */
.component-params-body {
    padding: 1rem;
    transition: all 0.3s ease;
}

.component-params-body.collapsed {
    display: none;
}

/* Форма параметров */
.params-form {
    display: grid;
   /*  grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));*/
    gap: 0.5rem;
}

/* Поле параметра */
.param-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.param-field.wide {
    grid-column: 1 / -1;
}

.param-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.param-label .required-mark {
    color: #ef4444;
}

/* Инпуты */
.param-input {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    width: 100%;
}

.param-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.param-input:disabled {
    background: var(--bg-panel);
    opacity: 0.6;
    cursor: not-allowed;
}

.param-input.changed {
    border-color: #f59e0b;
}

.param-input.param-checkbox {
    width: auto;
    margin-right: 0.5rem;
}

.param-input.param-textarea {
    min-height: 80px;
    resize: vertical;
}

.param-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M3 4.5L6 7.5 9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
    width: 100%;
}

/* Скрытые расширенные параметры */
.param-advanced {
    opacity: 0.7;
}

/* Секция общих параметров */
.common-params-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-left: 4px solid #6366f1;
    margin-top: 1.5rem;
}

.common-params-section .section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.common-params-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.common-params-form .param-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Кнопки действий */
.params-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.params-actions .btn {
    min-width: 160px;
}

/* Кнопки действий внутри блока параметров (шаг 3) */
.params-actions-inline {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 0;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.params-actions-inline .btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* ============================================
   Параметры по периодам (Зима/Лето)
   ============================================ */

/* Бейджи режима работы */
.work-mode-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    margin-left: auto;
}

.work-mode-badge.winter-only {
    background: #dbeafe;
    color: #1e40af;
}

.work-mode-badge.summer-only {
    background: #fef3c7;
    color: #92400e;
}

.work-mode-badge.both-periods {
    background: linear-gradient(90deg, #dbeafe 50%, #fef3c7 50%);
    color: #374151;
}

.work-mode-badge.always {
    background: #d1fae5;
    color: #065f46;
}

/* Секции параметров */
.params-section {
    margin-bottom: 1.5rem;
}

.params-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    padding: 0.5rem 0;
}

/* Улучшенные стили для общих параметров */
.common-params {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid rgba(99, 102, 241, 0.1);
    margin-bottom: 0.5rem;
}

.common-params .params-grid {
    /* Максимум 6 колонок, элементы растягиваются поровну если их меньше */
    grid-template-columns: repeat(auto-fit, minmax(calc((100% - 5 * 1.25rem) / 6), 1fr));
    gap: 1.25rem;
    max-width: 100%;
}

/* Адаптивность для сетки общих параметров */
@media (max-width: 1600px) {
    .common-params .params-grid {
        grid-template-columns: repeat(auto-fit, minmax(calc((100% - 4 * 1.25rem) / 5), 1fr));
    }
}

@media (max-width: 1400px) {
    .common-params .params-grid {
        grid-template-columns: repeat(auto-fit, minmax(calc((100% - 3 * 1.25rem) / 4), 1fr));
    }
}

@media (max-width: 1200px) {
    .common-params .params-grid {
        grid-template-columns: repeat(auto-fit, minmax(calc((100% - 2 * 1.25rem) / 3), 1fr));
    }
}

@media (max-width: 900px) {
    .common-params .params-grid {
        grid-template-columns: repeat(auto-fit, minmax(calc((100% - 1.25rem) / 2), 1fr));
    }
}

@media (max-width: 600px) {
    .common-params .params-grid {
        grid-template-columns: 1fr;
    }
}

.common-params .param-field {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.common-params .param-field:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.common-params .param-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    width: 100%;
}

.common-params .param-input-wrapper {
    margin-top: 0.25rem;
}

/* Контейнер периодов */
.params-periods-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0.25rem;
}

@media (max-width: 1200px) {
    .params-periods-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .params-periods-container {
        grid-template-columns: 1fr;
    }
}

/* Блок периода */
.params-period {
    position: relative; /* Для правильного позиционирования ::after overlay */
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

.params-period.active {
    border-color: var(--primary);
}

.params-period.inactive {
    opacity: 0.7;
}

.params-period.inactive .period-params {
    pointer-events: none;
}

/* Зимний период */
.winter-period {
    border-color: #93c5fd;
}

.winter-period.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.winter-period .period-header {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-bottom: 1px solid #bfdbfe;
}

/* Летний период */
.summer-period {
    border-color: #fcd34d;
}

.summer-period.active {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.summer-period .period-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-bottom: 1px solid #fde68a;
}

/* Специальный режим */
.special-period {
    border-color: #c4b5fd;
}

.special-period.active {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.special-period .period-header {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    border-bottom: 1px solid #ddd6fe;
}

/* Заголовок периода */
.period-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
}

.period-icon {
    font-size: 1.125rem;
}

.period-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    flex: 1;
}

.period-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-size: 0.8rem;
}

.period-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.period-toggle .toggle-label {
    color: var(--text-secondary);
}

.period-always-on {
    font-size: 0.75rem;
    color: #059669;
    font-weight: 500;
}

/* Параметры периода - для старых компонентов (legacy) */
.period-params-section .period-params {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    flex-wrap: wrap;
}

/* Параметры периода - для новых форм компонентов */
.params-period .period-params {
    padding: 0.875rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    transition: opacity 0.2s ease;
}

.params-period .period-params.disabled {
    opacity: 0.4;
}

.params-period .period-params .param-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.params-period .period-params .param-field.span-2 {
    grid-column: span 2;
}

.period-params .param-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.period-params .param-input {
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    width: 100%;
}

/* Компактные инпуты в периодах */
.period-param .param-input {
    height: 36px;
}

/* Анимация переключения */
.params-period {
    transition: all 0.3s ease;
}

.period-active-toggle:checked ~ .toggle-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Общие параметры секция */
/* Стили для .common-params уже определены выше в секции .params-section */

/* Подсказка для неактивных периодов */
.params-period.inactive::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

/* Сообщения */
.params-info {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 1rem;
}

.no-components {
    color: var(--text-secondary);
    text-align: center;
    padding: 2rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
}

/* Адаптивность */
@media (max-width: 768px) {
    .params-info-banner {
        flex-direction: column;
        gap: 0.5rem;
    }

    .params-form {
        grid-template-columns: 1fr;
    }

    .common-params-form .param-row {
        grid-template-columns: 1fr;
    }

    .params-actions {
        flex-direction: column;
    }

    .params-actions .btn {
        width: 100%;
    }
}

/* ============================================
   Component Selection Wizard Styles
   Внутренний wizard подбора компонентов
   ============================================ */

.component-selection-wizard {
    padding: 1.5rem;
}

.component-selection-wizard .wizard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-primary);
}

.component-selection-wizard .wizard-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.component-selection-wizard .wizard-progress {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
}

/* ===== Заголовок с режимами работы ===== */
.selection-modes-header {
    margin-bottom: 1rem;
}

.modes-header-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.mode-block {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border-primary);
}

.mode-block .mode-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
}

.mode-general .mode-title { color: #6b7280; }
.mode-winter .mode-title { color: #3b82f6; }
.mode-summer .mode-title { color: #f59e0b; }

.mode-block .mode-params {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.mode-block .mode-params div {
    margin-bottom: 0.25rem;
}

.mode-block .mode-params strong {
    color: var(--accent-primary);
}

.mode-block .mode-conditions {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.mode-block .mode-conditions div {
    margin-bottom: 0.125rem;
}

/* ===== Таблица выбора компонентов ===== */
.selection-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-primary);
}

.component-selection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 1200px;
}

.component-selection-table thead {
    background: var(--bg-secondary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.component-selection-table th {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-primary);
    white-space: nowrap;
}

.component-selection-table th sub {
    font-size: 0.65rem;
}

/* Заголовки режимов */
.header-row-main th.mode-header {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.875rem 0.5rem;
}

.mode-general-header { 
    background: rgba(107, 114, 128, 0.1); 
    color: #6b7280;
}

.mode-winter-header { 
    background: rgba(59, 130, 246, 0.1); 
    color: #3b82f6;
}

.mode-summer-header { 
    background: rgba(245, 158, 11, 0.1); 
    color: #f59e0b;
}

.header-row-sub th {
    font-size: 0.7rem;
    padding: 0.5rem 0.375rem;
    background: var(--bg-panel);
}

/* Строки данных */
.component-selection-table tbody tr {
    transition: all 0.15s ease;
    cursor: pointer;
}

.component-selection-table tbody tr:nth-child(even) {
    background: var(--bg-panel);
}

.component-selection-table tbody tr:hover {
    background: rgba(var(--accent-primary-rgb, 0, 212, 255), 0.08);
}

.component-selection-table td {
    padding: 0.625rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-primary);
    color: var(--text-primary);
}

.component-selection-table td.component-id {
    font-weight: 600;
    text-align: left;
    padding-left: 1rem;
    background: var(--bg-secondary);
    position: sticky;
    left: 0;
    z-index: 5;
}

/* Рекомендуемая строка */
.selection-row.recommended-row {
    background: rgba(74, 222, 128, 0.15) !important;
    border-left: 4px solid #4ade80;
}

.selection-row.recommended-row td {
    color: #166534;
    font-weight: 500;
}

.selection-row.recommended-row td.component-id {
    background: rgba(74, 222, 128, 0.2);
    color: #166534;
}

/* Выбранная строка */
.selection-row.selected-row {
    background: rgba(59, 130, 246, 0.2) !important;
    border-left: 4px solid #3b82f6;
}

.selection-row.selected-row td {
    color: #1e40af;
    font-weight: 500;
}

.selection-row.selected-row td.component-id {
    background: rgba(59, 130, 246, 0.25);
    color: #1e40af;
}

/* Варианты вне диапазона ±30% */
.selection-row.out-of-range-row {
    opacity: 0.7;
}

.selection-row.out-of-range-row:hover {
    opacity: 0.9;
}

/* Индикатор отклонения */
.deviation-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
}

.deviation-badge.in-range {
    background: rgba(74, 222, 128, 0.2);
    color: #166534;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.deviation-badge.out-range {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Светлая тема для индикаторов */
[data-theme="light"] .deviation-badge.in-range {
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
}

[data-theme="light"] .deviation-badge.out-range {
    background: rgba(245, 158, 11, 0.15);
    color: #92400e;
}

/* Светлая тема для таблицы */
[data-theme="light"] .selection-row.recommended-row {
    background: rgba(34, 197, 94, 0.12) !important;
}

[data-theme="light"] .selection-row.recommended-row td {
    color: #15803d;
}

[data-theme="light"] .selection-row.selected-row {
    background: rgba(59, 130, 246, 0.15) !important;
}

[data-theme="light"] .selection-row.selected-row td {
    color: #1d4ed8;
}

/* Разделители между режимами */
.component-selection-table td:nth-child(7),
.component-selection-table td:nth-child(13),
.component-selection-table th:nth-child(7),
.component-selection-table th:nth-child(13) {
    border-right: 2px solid var(--border-primary);
}

/* ===== Кнопки действий ===== */
.selection-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.selection-actions .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
}

/* ===== Сводка выбранных компонентов ===== */
.selection-summary {
    text-align: center;
    padding: 2rem;
}

.selection-summary h2 {
    font-size: 1.6rem;
    color: #4ade80;
    margin-bottom: 2rem;
}

.selection-summary .summary-content {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: left;
}

.selection-summary .summary-content h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.selected-components-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.selected-component-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-panel);
    border-radius: var(--radius);
    border-left: 3px solid #4ade80;
}

.selected-component-item .component-name {
    font-weight: 500;
    color: var(--text-primary);
}

.selected-component-item .selected-option {
    font-weight: 600;
    color: #4ade80;
    background: rgba(74, 222, 128, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
}

.summary-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ===== Адаптивность для таблицы выбора ===== */
@media (max-width: 1200px) {
    .modes-header-row {
        grid-template-columns: 1fr;
    }
    
    .mode-block {
        padding: 0.75rem;
    }
    
    .mode-block .mode-conditions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.25rem;
    }
}

@media (max-width: 768px) {
    .component-selection-wizard .wizard-header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
    
    .selection-actions {
        flex-direction: column;
    }
    
    .selection-actions .btn {
        width: 100%;
    }
    
    .summary-actions {
        flex-direction: column;
    }
    
    .summary-actions .btn {
        width: 100%;
    }
}

/* ============================================
   Component Test Tool Modal
   Инструмент тестирования расчётов компонентов
   ============================================ */

/* Специфичные стили ТОЛЬКО для модального окна тестирования компонентов */
#componentTestModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Скрыто по умолчанию, показывается через JS */
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

#componentTestModal.active {
    display: flex;
}

#componentTestModal .modal-container {
    background: var(--bg-panel);
    border-radius: var(--radius-lg);
    max-width: 95vw;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#componentTestModal .component-test-modal {
    width: 1400px;
}

#componentTestModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-primary);
}

#componentTestModal .modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

#componentTestModal .modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    border-radius: var(--radius);
    transition: all 0.15s ease;
}

#componentTestModal .modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Селекторы в одну строку */
#componentTestModal .test-selectors-row {
    display: grid;
    grid-template-columns: 140px 200px 200px 1fr 150px;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-primary);
}

#componentTestModal .selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

#componentTestModal .selector-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#componentTestModal .selector-group select,
#componentTestModal .selector-group input {
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-panel);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
    width: 100%;
    box-sizing: border-box;
}

#componentTestModal .selector-group select:hover:not(:disabled),
#componentTestModal .selector-group input:hover:not(:disabled) {
    border-color: var(--accent-primary);
}

#componentTestModal .selector-group select:focus,
#componentTestModal .selector-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

#componentTestModal .selector-group select:disabled,
#componentTestModal .selector-group input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-tertiary);
}

/* Компонент - растягиваем */
#componentTestModal .selector-component {
    min-width: 0;
}

#componentTestModal .selector-component select {
    width: 100%;
}

/* Фильтр */
#componentTestModal .selector-filter input {
    padding: 0.5rem 0.625rem;
}

#componentTestModal .selector-filter input::placeholder {
    color: var(--text-tertiary);
    font-style: italic;
}

#componentTestModal .modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
}

/* Test Panels */
#componentTestModal .test-panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

#componentTestModal .panel {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-primary);
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

#componentTestModal .panel h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-primary);
    flex-shrink: 0;
}

#componentTestModal .panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Стилизация скроллбара */
#componentTestModal .panel-content::-webkit-scrollbar {
    width: 6px;
}

#componentTestModal .panel-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

#componentTestModal .panel-content::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 3px;
}

#componentTestModal .panel-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

#componentTestModal .placeholder-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
    opacity: 0.7;
}

/* Входные параметры - компактная сетка */
#componentTestModal .param-row {
    display: grid;
    grid-template-columns: 1fr 110px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.4rem;
    padding: 0.2rem 0;
}

#componentTestModal .param-row label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#componentTestModal .param-row input,
#componentTestModal .param-row select {
    width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    box-sizing: border-box;
}

#componentTestModal .param-row input:focus,
#componentTestModal .param-row select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

#componentTestModal .param-row input[type="number"] {
    text-align: right;
}

/* Кнопка расчёта внизу панели */
#componentTestModal .input-params-panel {
    display: flex;
    flex-direction: column;
}

#componentTestModal .input-params-panel .params-form {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}

#componentTestModal .input-params-panel button {
    flex-shrink: 0;
    margin-top: auto;
}

/* Data Table */
#componentTestModal .data-table-container {
    flex: 1;
    overflow: auto;
}

#componentTestModal .data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

#componentTestModal .data-table th,
#componentTestModal .data-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

#componentTestModal .data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

#componentTestModal .data-table td:first-child {
    font-weight: 500;
    color: var(--accent-primary);
    max-width: 150px;
    word-break: break-all;
}

#componentTestModal .data-table .null-value {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.6;
}

/* Input Params Form */
#componentTestModal .params-form {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 0.5rem;
}

#componentTestModal #runCalculation {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

#componentTestModal #runCalculation:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

#componentTestModal #runCalculation:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Results Container */
#componentTestModal .results-container {
    flex: 1;
    overflow: auto;
}

#componentTestModal .calculation-result {
    height: 100%;
}

#componentTestModal .result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
}

#componentTestModal .results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

#componentTestModal .results-table th,
#componentTestModal .results-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

#componentTestModal .results-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
}

#componentTestModal .results-table td:first-child {
    font-weight: 500;
    min-width: 200px;
}

#componentTestModal .results-table td:last-child {
    color: var(--accent-primary);
    font-weight: 600;
}

#componentTestModal .error-result {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 1rem;
}

#componentTestModal .error-result h4 {
    color: #ef4444;
    margin: 0 0 0.5rem 0;
}

#componentTestModal .error-result pre {
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    padding: 0.75rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-top: 0.75rem;
}

/* Test Button Styling */
.nav-btn.test-btn {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
}

.nav-btn.test-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 1400px) {
    #componentTestModal .test-selectors-row {
        grid-template-columns: 130px 180px 180px 1fr 130px;
    }
}

@media (max-width: 1200px) {
    #componentTestModal .component-test-modal {
        width: 95vw;
    }
    
    #componentTestModal .test-panels {
        grid-template-columns: 1fr 1fr;
    }
    
    #componentTestModal .calculation-results-panel {
        grid-column: 1 / -1;
    }
    
    #componentTestModal .test-selectors-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 0.5rem;
    }
    
    #componentTestModal .selector-component,
    #componentTestModal .selector-filter {
        grid-column: span 1;
    }
}

@media (max-width: 900px) {
    #componentTestModal .test-panels {
        grid-template-columns: 1fr;
    }
    
    #componentTestModal .test-selectors-row {
        grid-template-columns: 1fr 1fr;
    }
    
    #componentTestModal .selector-component {
        grid-column: 1 / -1;
    }
    
    #componentTestModal .selector-filter {
        grid-column: 1 / -1;
    }
}

