body {
    font-family: system-ui, -apple-system, sans-serif;
    background: #f0f2f5;
    display: flex;
    justify-content: center;
    padding: 20px;
}
.container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}
.controls {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: left;
}
.controls label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}
.controls select, .controls input[type="number"] {
    padding: 6px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
}
.controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
}
.controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
}
.controls input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: none;
}
.editor-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    align-content: center;
    flex-wrap: nowrap;
}
.crop-area {
    display: flex;
    position: relative;
    line-height: 0;
    border: 1px solid #ccc;
    overflow: hidden;
    user-select: none;
}
#sourceCanvas {
    max-width: 500px;
    height: auto;
    display: block;
}
#cropper {
    position: absolute;
    top: 0;
    left: 0;
    border: 2px dashed #fff;
    box-sizing: border-box;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5);
    cursor: move;
}
#resizer {
    width: 12px;
    height: 12px;
    background: #007bff;
    border: 2px solid #fff;
    position: absolute;
    right: -7px;
    bottom: -7px;
    cursor: nwse-resize;
}
.preview-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#finalCanvas {
    max-width: 1000px;
    max-height: 700px;
    min-width: 64px;
    min-height: 64px;
    image-rendering: pixelated;
    border: 1px solid #333;
    background-image: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%);
    background-size: 10px 10px;
    margin-bottom: 15px;
}
button {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
button:hover { background: #218838; }









/* Вспомогательный класс для скрытия элементов */
.hidden {
    display: none !important;
}

/* Главный контейнер настроек */
.controls {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Первая строка настроек (пресеты, кастомные поля, чекбокс) */
.controls-row {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

/* Поля для ввода кастомного размера */
.custom-size-group {
    display: flex;
    gap: 10px;
}

/* Стилизация коротких инпутов ширины/высоты */
.input-number-short {
    width: 60px;
}

/* Обертка чекбокса инверсии */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

/* Контейнер ползунка порога Ч/Б */
.threshold-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Запрет переноса текста для лейбла */
.no-wrap {
    white-space: nowrap;
}

/* Сам ползунок (input range) */
.threshold-slider {
    flex-grow: 1;
    max-width: 300px;
}
