body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f0f0f0;
}

.dottile-container {
    display: flex;
}

/* 左カラム: エディタ */
.editor-pane {
    width: 50%;
    padding: 20px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Tab System --- */
.tabs {
    display: flex;
    width: 100%;
}
.tab-button {
    padding: 10px 15px;
    border: 1px solid #ccc;
    background-color: #e9e9e9;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    margin-right: 4px;
    margin-bottom: -1px; /* Overlap with panel border */
}
.tab-button.active {
    background-color: #fff;
    border-bottom: 1px solid #fff;
}
.tab-panel {
    display: none; /* Hide inactive panels */
    width: 100%;
    border: 1px solid #ccc;
    padding: 20px;
    background-color: #fff;
    border-radius: 0 4px 4px 4px;
}
.tab-panel.active {
    display: block; /* Show active panel */
}

.editor-controls, .preview-controls, .converter-controls, .processing-controls, .file-operations, .tools {
    width: 100%;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.editor-controls input[type="number"], .preview-controls input[type="number"], .processing-controls input[type="number"] {
    width: 60px;
    padding: 5px;
}

.canvas-container {
    margin-bottom: 20px;
    width: 482px; /* 480px + 2px border */
    height: 482px; /* 480px + 2px border */
    border: 1px solid #999;
    background-color: #f0f0f0;
}

#editor-canvas {
    width: 100%;
    height: 100%;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    background-image:
        linear-gradient(45deg, #eee 25%, transparent 25%),
        linear-gradient(-45deg, #eee 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eee 75%),
        linear-gradient(-45deg, transparent 75%, #eee 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    cursor: crosshair;
}

.tool-group, .color-group {
    gap: 10px;
}

.tool-button, button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
}

.tool-button.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

input[type="color"] {
    height: 36px;
    width: 50px;
    padding: 2px;
    border: 1px solid #ccc;
}

/* 右カラム: プレビュー */
.preview-pane {
    width: 50%;
    padding: 20px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.preview-container {
    width: 482px; /* 480px + 2px border */
    height: 482px; /* 480px + 2px border */
    border: 1px solid #999;
    background-color: #fff;
}

#preview-canvas {
    width: 100%;
    height: 100%;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
}
