.back-link {
    color: var(--accent-light);
    font-size: 14px;
    font-weight: 600;
}

.tool-container {
    width: min(1280px, calc(100% - 24px));
    margin: 20px auto 60px;
    box-sizing: border-box;
}

.tool-header h1 {
    font-size: 26px;
    font-weight: 800;
    margin-top: 4px;
}

.tool-header p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.converter-workspace {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Config Panel */
.config-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
}

.config-panel h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-light);
    margin: 0;
}

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}

/* Upload Zone */
.upload-zone {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: 0.2s;
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
}

.file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 6px;
}

.drop-text {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
}

.drop-text span {
    color: var(--accent-light);
    font-weight: 600;
}

/* Fields */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.dimension-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 10px;
    outline: 0;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}

.field-group input[type="color"] {
    height: 38px;
    padding: 4px;
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text);
}

.toggle-label input {
    width: auto;
}

/* Button */
.download-btn {
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
    margin-top: 6px;
}

.download-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.download-btn:not(:disabled):hover {
    background: var(--accent-light);
}

/* Preview Panel */
.preview-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-light);
    margin: 0;
}

.meta-badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--muted);
    font-family: monospace;
}

.canvas-stage {
    position: relative;
    flex: 1;
    min-height: 420px;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background-image: linear-gradient(45deg, #18181b 25%, transparent 25%), 
                      linear-gradient(-45deg, #18181b 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #18181b 75%), 
                      linear-gradient(-45deg, transparent 75%, #18181b 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.empty-state {
    text-align: center;
    color: var(--muted);
}

.empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

canvas {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    display: none;
}

canvas.active {
    display: block;
}

/* Mobile Breakpoints */
@media (max-width: 900px) {
    .converter-workspace {
        grid-template-columns: 1fr;
    }

    .canvas-stage {
        min-height: 300px;
    }
}
